query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
01d75231c3f024f1a4efdca88ed2f6a5
When used with override = true(ish), will try to locate the binding site for the variable and return it. If override is set to 'sub', will stop before digging into the parent subprocess.
[ { "docid": "7101ccf730a139f535477b47374b59ac", "score": "0.6562937", "text": "def locate_set_var(var, override)\n\n hk = h.variables && h.variables.has_key?(var)\n\n if ( ! override) || var.match(/^\\//)\n false\n elsif override == 'sub' && DefineExpression.is_definition?(tree) && ! hk\n false\n elsif hk\n [ self, var ]\n elsif par = parent\n par.locate_set_var(var, override)\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "c9909fb346f63d62cf03b29db9f3e77a", "score": "0.57759374", "text": "def locate_var(var, prefix=nil)\n\n var, prefix = split_prefix(var, prefix)\n\n if prefix == '//' # engine variable\n nil\n elsif prefix == '/' && par = parent # process variable\n par.locate_var(var, prefix)\n elsif h.variables # it's here\n [ self, var ]\n elsif par = parent # look in the parent expression\n par.locate_var(var, prefix)\n else # uprooted var lookup...\n [ nil, nil ]\n end\n end", "title": "" }, { "docid": "6d07bf707b6cd91d2f7357749fa01985", "score": "0.57614523", "text": "def lookupvar(name)\n puppet_scope.lookupvar name\n end", "title": "" }, { "docid": "0b9fa9beebb8e5c624fc85a970eaed97", "score": "0.57288253", "text": "def lookup_variable(var, prefix=nil)\n\n var, prefix = split_prefix(var, prefix)\n\n if prefix == '//'\n return @context.storage.get_engine_variable(var)\n end\n\n if prefix == '/' && par = parent\n return par.lookup_variable(var, prefix)\n end\n\n if h.variables and Ruote.has_key?(h.variables, var)\n return Ruote.lookup(h.variables, var)\n end\n\n if h.parent_id && h.parent_id['engine_id'] == @context.engine_id\n #\n # do not lookup variables in a remote engine ...\n\n (return parent.lookup_variable(var, prefix)) rescue nil\n # if the lookup fails (parent gone) then rescue and let go\n end\n\n k = var.split('.').first\n vars = { k => @context.storage.get_engine_variable(k) }\n #\n # engine var lookup might be expensive, only lookup the var we need\n\n Ruote.lookup(vars, var)\n end", "title": "" }, { "docid": "70f93c48a7d2a525409ff2a3b7a5201c", "score": "0.5719562", "text": "def get_substitution_variable_value(sub_var, inherited = true)\n sub_var =~ /^&?(.+)$/\n var_name = $1\n log.finer \"Retrieving value for substitution variable #{var_name}\"\n val = nil\n begin\n val = try{ @cube.getSubstitutionVariableValue(var_name) }\n rescue\n raise unless inherited\n begin\n val = @application.get_substitution_variable_value(var_name)\n rescue\n val = @application.server.get_substitution_variable_value(var_name)\n end\n end\n val\n end", "title": "" }, { "docid": "5d545077072365f935d383425825854b", "score": "0.56941867", "text": "def lookupvar(name, options = {})\n dynamic_value = dynamic_lookupvar(name,options)\n twoscope_value = twoscope_lookupvar(name,options)\n if dynamic_value != twoscope_value\n location = (options[:file] && options[:line]) ? \" at #{options[:file]}:#{options[:line]}\" : ''\n Puppet.deprecation_warning(\"Dynamic lookup of $#{name}#{location} is deprecated. For more information, see http://docs.puppetlabs.com/guides/scope_and_puppet.html. To see the change in behavior, use the --debug flag.\")\n Puppet.debug(\"Currently $#{name} is #{dynamic_value.inspect}\")\n Puppet.debug(\"In the future $#{name} will be #{twoscope_value == :undefined ? \"undefined\" : twoscope_value.inspect}\")\n end\n dynamic_value\n end", "title": "" }, { "docid": "ef9d626f2fea34d204d6cdc872209eda", "score": "0.561277", "text": "def extract_variable_and_override(value)\n value = remove_whitespace(value)\n if value.kind_of?(String) && is_variable_override?(value)\n return variable_override_regex.match(value).captures\n end\n\n nil\n end", "title": "" }, { "docid": "0621319ce3724df54f0a1ba963ca37df", "score": "0.55911714", "text": "def dynamic_lookupvar(name, options = {})\n table = ephemeral?(name) ? @ephemeral.last : @symtable\n # If the variable is qualified, then find the specified scope and look the variable up there instead.\n if name =~ /^(.*)::(.+)$/\n begin\n qualified_scope($1).dynamic_lookupvar($2,options)\n rescue RuntimeError => e\n location = (options[:file] && options[:line]) ? \" at #{options[:file]}:#{options[:line]}\" : ''\n warning \"Could not look up qualified variable '#{name}'; #{e.message}#{location}\"\n :undefined\n end\n elsif ephemeral_include?(name) or table.include?(name)\n # We can't use \"if table[name]\" here because the value might be false\n table[name]\n elsif parent\n parent.dynamic_lookupvar(name,options)\n else\n :undefined\n end\n end", "title": "" }, { "docid": "4fbaa237d889b1f4b4613c21c6d76c40", "score": "0.55432254", "text": "def default_lookup\n if str !~ /\\S#\\S/ && target.eval(\"defined? #{str} \") =~ /variable|constant/\n obj = target.eval(str)\n\n if obj.respond_to?(:source_location)\n Pry::Method(obj)\n elsif !obj.is_a?(Module)\n Pry::WrappedModule(obj.class)\n else\n nil\n end\n end\n\n rescue Pry::RescuableException\n nil\n end", "title": "" }, { "docid": "ee0392fd9a08e63a532b2ae7c34a62d8", "score": "0.55401975", "text": "def get_from_var_name(scope, var_string, navigation, default_value = nil, &block)\n catch(:undefined_variable) do\n return call_function_with_scope(scope,'get', scope.lookupvar(var_string), navigation, default_value, &block)\n end\n default_value\n end", "title": "" }, { "docid": "03b30b51c828391381e68af8f2bf3adb", "score": "0.55336785", "text": "def lookup(variable)\n var_def = @variables_to_reorder[variable] || @static_var_def_rules[variable]\n var_def.nil? ? @parent.lookup(variable) : var_def.eval\n end", "title": "" }, { "docid": "f90e18cdab6851b83711d455fc8c76a0", "score": "0.5436736", "text": "def find_script_from_override_path(default_script, override_script_path = nil)\n return unless override_script_path\n script_test = File.join(override_script_path, File.basename(default_script))\n if File.file?(script_test)\n log(:debug, \"Selecting #{script_test} from override script path\")\n script_test\n else\n log(:debug, \"Did not find #{script_test} in override script path\")\n nil\n end\n end", "title": "" }, { "docid": "f932058db1263680072dab7770a192fd", "score": "0.54180384", "text": "def env_lookup_options(meta_invocation, merge_strategy)\n if !instance_variable_defined?(:@env_lookup_options)\n @env_lookup_options = nil\n catch(:no_such_key) do\n @env_lookup_options = merge_strategy.merge_lookup([:lookup_global, :lookup_in_environment]) do |m|\n send(m, LOOKUP_OPTIONS, meta_invocation, merge_strategy)\n end\n end\n end\n @env_lookup_options\n end", "title": "" }, { "docid": "e988ad5fda895e3343afdd7d4cd51d67", "score": "0.54149455", "text": "def resolve_override_file\n file = ENV['OMNIBUS_OVERRIDE_FILE'] || DEFAULT_OVERRIDE_FILE_NAME\n path = File.expand_path(file)\n File.exist?(path) ? path : nil\n end", "title": "" }, { "docid": "cf9f07fc6367f44b3f3ca772bec38800", "score": "0.5370664", "text": "def lookupvar(name, options = EMPTY_HASH)\n unless name.is_a? String\n raise Puppet::ParseError, _(\"Scope variable name %{name} is a %{klass}, not a string\") % { name: name.inspect, klass: name.class }\n end\n\n # If name has '::' in it, it is resolved as a qualified variable\n unless (idx = name.index('::')).nil?\n # Always drop leading '::' if present as that is how the values are keyed.\n return lookup_qualified_variable(idx == 0 ? name[2..-1] : name, options)\n end\n\n # At this point, search is for a non qualified (simple) name\n table = @ephemeral.last\n val = table[name]\n return val unless val.nil? && !table.include?(name)\n\n next_scope = inherited_scope || enclosing_scope\n if next_scope\n next_scope.lookupvar(name, options)\n else\n variable_not_found(name)\n end\n end", "title": "" }, { "docid": "4346e4fe4329e6e7847c77d5077b5aa0", "score": "0.53054404", "text": "def lookup(variable, default_value = '')\n try_to_fetch_unless_found_or_end(variable) || default_value\n end", "title": "" }, { "docid": "b7099360ade41d6045cbc086a5cdb4c3", "score": "0.53044665", "text": "def find_variable_recursive(name)\n if instance_variable_defined?(\"@#{VARIABLE_PREFIX}_#{name}\")\n self\n elsif superclass.ancestors.include?(Init)\n superclass.find_variable_recursive(name)\n else\n false\n end\n end", "title": "" }, { "docid": "977c59baaf4d104dab712023e9784f25", "score": "0.52884763", "text": "def twoscope_lookupvar(name, options = {})\n # Save the originating scope for the request\n options[:origin] = self unless options[:origin]\n table = ephemeral?(name) ? @ephemeral.last : @symtable\n\n if name =~ /^(.*)::(.+)$/\n begin\n qualified_scope($1).twoscope_lookupvar($2, options.merge({:origin => nil}))\n rescue RuntimeError => e\n location = (options[:file] && options[:line]) ? \" at #{options[:file]}:#{options[:line]}\" : ''\n warning \"Could not look up qualified variable '#{name}'; #{e.message}#{location}\"\n :undefined\n end\n # If the value is present and either we are top/node scope or originating scope...\n elsif (ephemeral_include?(name) or table.include?(name)) and (compiler and self == compiler.topscope or (resource and resource.type == \"Node\") or self == options[:origin])\n table[name]\n elsif resource and resource.type == \"Class\" and parent_type = resource.resource_type.parent\n qualified_scope(parent_type).twoscope_lookupvar(name,options.merge({:origin => nil}))\n elsif parent\n parent.twoscope_lookupvar(name, options)\n else\n :undefined\n end\n end", "title": "" }, { "docid": "3d6941a2e25308638c9e6057af87b3c7", "score": "0.5282623", "text": "def method_missing(name, *args)\n value = scope.lookupvar(name.to_s,:file => file,:line => script_line)\n if value != :undefined\n return value\n else\n # Just throw an error immediately, instead of searching for\n # other missingmethod things or whatever.\n raise Puppet::ParseError.new(\"Could not find value for '#{name}'\",@file,script_line)\n end\n end", "title": "" }, { "docid": "94b9540dd8f0464295712b328964d1a4", "score": "0.5241529", "text": "def test_override\n scope = mkscope\n\n ref = nil\n assert_nothing_raised do\n ref = resourceoverride(\"file\", \"/yayness\", \"owner\" => \"blah\", \"group\" => \"boo\")\n end\n\n scope.compiler.expects(:add_override).with { |res| res.is_a?(Puppet::Parser::Resource) }\n ret = nil\n assert_nothing_raised do\n ret = ref.evaluate scope\n end\n\n assert_instance_of(Puppet::Parser::Resource, ret, \"Did not return override\")\n end", "title": "" }, { "docid": "086b8c4f86ba5adc0451f8600ae4469e", "score": "0.52166927", "text": "def package_override(var)\n platform = @project.platform\n platform.package_override(self._project, var)\n end", "title": "" }, { "docid": "48e6ab9e08db704b767dd95bad502375", "score": "0.51853627", "text": "def maybe_resolve_ldflag_variable(input_arg, dest_dir)\n str = input_arg.gsub(/\\$\\((\\w+)\\)/) do |var_name|\n case var_name\n # On windows, it is assumed that mkmf has setup an exports file for the\n # extension, so we have to to create one ourselves.\n when \"DEFFILE\"\n write_deffile(dest_dir)\n else\n RbConfig::CONFIG[var_name]\n end\n end.strip\n\n str == \"\" ? nil : str\n end", "title": "" }, { "docid": "e87ac6b8906fa7c573ce063225b42ffb", "score": "0.51318127", "text": "def is_variable_override?(value)\n if value.kind_of?(String) && variable_override_regex === value\n variables = value.split(/<|>/)\n\n # return if valid variables\n return variables.length == 2 && is_variable?(variables[0]) && is_variable?(variables[1])\n end\n\n # not a string or did not match variable regex\n false\n end", "title": "" }, { "docid": "d2e9aea53b0da72cc9473545f0a78cc6", "score": "0.5131091", "text": "def find_var(name)\r\n find_switch(name, ::Yuki::Var, $game_variables, $data_system.variables, Var_cmd)\r\n end", "title": "" }, { "docid": "6c3f91a749dfdfc99201062ff2bd0f95", "score": "0.51221335", "text": "def find_variable(key)\n scope = @scopes.find { |s| s.has_key?(key) }\n if scope.nil?\n @environments.each do |e|\n if variable = lookup_and_evaluate(e, key)\n scope = e\n break\n end\n end\n end\n scope ||= @environments.last || @scopes.last\n variable ||= lookup_and_evaluate(scope, key)\n \n variable = variable.to_liquor\n \n if variable.class != ActiveRecord::NamedScope::Scope\n variable.context = self if variable.respond_to?(:context=)\n end\n return variable\n end", "title": "" }, { "docid": "1b1938361bb096e6c4e64cc7d6431345", "score": "0.5108047", "text": "def find_var(name, depth = nil)\n # Ignore depth, it has no bearing on namespace lookups.\n NamespaceReference.new(name)\n end", "title": "" }, { "docid": "fc0a0646c4e56bf8c81708cfc86beb85", "score": "0.5090875", "text": "def resolve\n if !@value.nil?\n @value\n elsif !@default.nil?\n if @default == :inherit\n # walk all the way up to root, starting with grandparent\n ancestor = parent\n\n while ancestor = ancestor.parent\n return ancestor[@name].resolve if ancestor.respond_to?(:[]) && ancestor[@name]\n end\n elsif @default.is_a?(Proc)\n @default.call\n else\n @default\n end\n end\n end", "title": "" }, { "docid": "d7814092b8b820dc6cfbba5c19393e28", "score": "0.5077378", "text": "def find_subcommand(base)\n command = File.join @main_lib_bin, \"#{base}.rb\"\n return command if File.exists? command\n return nil\n end", "title": "" }, { "docid": "b969003ec9e86aaa4e54e4c1ec42df5f", "score": "0.5074973", "text": "def lookup(key, scope, order_override, _resolution_type, _context = nil)\n setup_context(scope, order_override)\n value = @connect.lookup_value(key)\n Hiera.debug(\"CONNECT: looked up '#{key}' found '#{value}'\")\n value\n end", "title": "" }, { "docid": "e37de2f0907e47b62df93d6ac55f61c5", "score": "0.506404", "text": "def resolve_internal(variable)\n return nil unless DopCommon.config.use_hiera\n @@mutex_lookup.synchronize do\n begin\n hiera # make sure hiera is initialized\n answer = nil\n Hiera::Backend.datasources(scope) do |source|\n DopCommon.log.debug(\"Hiera internal: Looking for data source #{source}\")\n data = nil\n begin\n data = @parsed_configuration.lookup(source, variable, scope)\n rescue DopCommon::ConfigurationValueNotFound\n next\n else\n break if answer = Hiera::Backend.parse_answer(data, scope)\n end\n end\n rescue StandardError => e\n DopCommon.log.debug(e.message)\n end\n DopCommon.log.debug(\"Hiera internal: answer for variable #{variable} : #{answer}\")\n return answer\n end\n end", "title": "" }, { "docid": "8c6e0ebc8de0390019d635771fcc4366", "score": "0.5056957", "text": "def do_resolve() @@yaml_config[name] || @@yaml_config.dig(*name.split('_')) end", "title": "" }, { "docid": "f2db6d144c3e5efbf776bf80f61a5ec4", "score": "0.50195605", "text": "def env_lookup_options(lookup_invocation, merge_strategy)\n if !instance_variable_defined?(:@env_lookup_options)\n global_options = global_lookup_options(lookup_invocation, merge_strategy)\n @env_only_lookup_options = nil\n catch(:no_such_key) { @env_only_lookup_options = validate_lookup_options(lookup_in_environment(LookupKey::LOOKUP_OPTIONS, lookup_invocation, merge_strategy), nil) }\n if global_options.nil?\n @env_lookup_options = @env_only_lookup_options\n elsif @env_only_lookup_options.nil?\n @env_lookup_options = global_options\n else\n @env_lookup_options = merge_strategy.merge(global_options, @env_only_lookup_options)\n end\n end\n @env_lookup_options\n end", "title": "" }, { "docid": "f04238d8e5e9f4ba01372edcee09ecea", "score": "0.50187755", "text": "def find(name, remote=false)\n found = check(name, remote)\n return found if found || remote\n @variables[name.to_sym] = :var\n found\n end", "title": "" }, { "docid": "c643906fb3a6f7df1568db29f8f7ad85", "score": "0.50152874", "text": "def method_missing(name,*args)\n # variables defined in the current context\n v = context.getVariable(name.to_s)\n return v if v!=nil\n\n super # make it fail\n end", "title": "" }, { "docid": "c2d4471b055fd05929556498fbe615e2", "score": "0.5012105", "text": "def my_env\r\n num=5\r\n return binding\r\n end", "title": "" }, { "docid": "ce56dcb39b532cebd9399e7b0cf39944", "score": "0.49953493", "text": "def lookup_variable_stack (varname, stack=[])\n\n val = self[varname]\n stack << [ self, val ] unless val.nil?\n\n return stack if is_engine_environment?\n return get_parent.lookup_variable_stack(varname, stack) if @parent_id\n\n get_engine_environment.lookup_variable_stack(varname, stack)\n end", "title": "" }, { "docid": "c790037721d952317e04c622e4f9fd48", "score": "0.498958", "text": "def lookup(key, default, scope, order_override=nil, resolution_type=:priority)\n Backend.lookup(key, default, scope, order_override, resolution_type)\n end", "title": "" }, { "docid": "48036d95a155939f84509b5aa93e9f02", "score": "0.4975518", "text": "def method_missing(name, *args)\n # variables defined in the current context\n v = context.getVariableWithDefaultValue(name.to_s,UNDEFINED)\n return v if v!=UNDEFINED\n super # make it fail\n end", "title": "" }, { "docid": "52f9c4416c8e549ada5f6b18b61f2946", "score": "0.49670628", "text": "def fetch_bound_option b, name, default\n begin\n eval(name, b)\n rescue Exception => e\n logger.trace \"Could not find value name #{name} in binding\"\n default\n end\n end", "title": "" }, { "docid": "c2c84f4015807816f078240dc8656138", "score": "0.4964427", "text": "def lookup_in_env(env_variable_name, project_name = nil, default = nil)\n env_variable_name = \"#{env_variable_name.upcase.gsub('-', '_')}\"\n project_specific_name = \"#{project_name.upcase.gsub('-', '_')}_#{env_variable_name}\" if project_name\n project_name && ENV[project_specific_name] || ENV[env_variable_name] || default # rubocop:disable Style/FetchEnvVar\n end", "title": "" }, { "docid": "8fca7bd21912aadc8c55c9213e3d74df", "score": "0.4958908", "text": "def resolve_external(variable)\n return nil unless DopCommon.config.use_hiera\n @@mutex_lookup.synchronize do\n begin hiera.lookup(variable, nil, scope)\n rescue Psych::SyntaxError => e\n DopCommon.log.error(\"YAML parsing error in hiera data. Make sure you hiera yaml files are valid\")\n nil\n end\n end\n end", "title": "" }, { "docid": "abc6dad5c4956c007ae7bd00e43d1c89", "score": "0.49515256", "text": "def bind_ip_address(args)\n return args[:bind_ip_address] if args.has_key? :bind_ip_address\n\n \"127.0.0.1\"\nend", "title": "" }, { "docid": "e5714c99f3c12137572bdf238351cdca", "score": "0.49501985", "text": "def find_self(path_var)\n \"#{path_var} = '/'.join(os.path.realpath(__file__).split('/')[0:-1])\"\n end", "title": "" }, { "docid": "df167cdd86bb0607fe56bd7d836e4841", "score": "0.49482632", "text": "def getBinding(_str)\n binding\nend", "title": "" }, { "docid": "0cc2625a4ad49ce4af1165e2e280f500", "score": "0.49384627", "text": "def findServiceRunner\n # first, try relative to this repo \n srBase = File.join(File.dirname(__FILE__), \"..\", \"..\", \"bpsdk\", \"bin\")\n candidates = [\n File.join(srBase, \"ServiceRunner.exe\"),\n File.join(srBase, \"ServiceRunner\"), \n ]\n \n # now use BPSDK_PATH env var if present\n if ENV.has_key? 'BPSDK_PATH'\n candidates.push File.join(ENV['BPSDK_PATH'], \"bin\", \"ServiceRunner.exe\")\n candidates.push File.join(ENV['BPSDK_PATH'], \"bin\", \"ServiceRunner\")\n end\n\n if ENV.has_key? 'SERVICERUNNER_PATH'\n candidates.push(ENV['SERVICERUNNER_PATH'])\n end\n\n candidates.each { |p|\n return p if File.executable? p\n }\n nil\nend", "title": "" }, { "docid": "0317b35fbced6dd513265b977f04cfa2", "score": "0.49343237", "text": "def get_binding(str)\n return binding\nend", "title": "" }, { "docid": "d0c35f723c03f659871b32dbeb6d41a4", "score": "0.49162197", "text": "def lookup_global_silent(param)\n @context.find_global_scope.to_hash[param]\nend", "title": "" }, { "docid": "e2ce4da5d123395ccb33fc31a440947e", "score": "0.49104878", "text": "def search(override = nil)\n return override if override\n\n # If both default files are present, issue a warning.\n if (File.file? DEFAULT_LOCATION) && (File.file? OLD_DEFAULT_LOCATION)\n logger.warn _(\"Both %{default_path} and %{old_default_path} configuration files exist.\") % {default_path: DEFAULT_LOCATION, old_default_path: OLD_DEFAULT_LOCATION}\n logger.warn _(\"%{default_path} will be used.\") % {default_path: DEFAULT_LOCATION}\n end\n\n path = @loadpath.find {|filename| File.file? filename}\n\n if path == OLD_DEFAULT_LOCATION\n logger.warn _(\"The r10k configuration file at %{old_default_path} is deprecated.\") % {old_default_path: OLD_DEFAULT_LOCATION}\n logger.warn _(\"Please move your r10k configuration to %{default_path}.\") % {default_path: DEFAULT_LOCATION}\n end\n\n path\n end", "title": "" }, { "docid": "21242405d1328adea8b606131013ee65", "score": "0.49043238", "text": "def find_script(default_script, override_script_path = nil)\n script = find_script_from_override_path(default_script, override_script_path) ||\n File.expand_path(\"../../../scripts/#{default_script}\", File.dirname(__FILE__))\n raise Errno::ENOENT, \"Unable to locate script '#{script}'\" unless File.file?(script)\n script\n end", "title": "" }, { "docid": "55b728467de8fd2c7b1bb2dd802009a7", "score": "0.49021617", "text": "def retrieve_lookup_options(module_name, lookup_invocation, merge_strategy)\n meta_invocation = Puppet::Pops::Lookup::Invocation.new(lookup_invocation.scope)\n meta_invocation.top_key = lookup_invocation.top_key\n env_opts = env_lookup_options(meta_invocation, merge_strategy)\n unless module_name.nil? || @env.module(module_name).nil?\n catch(:no_such_key) do\n meta_invocation.module_name = module_name\n options = module_provider(module_name).lookup(LOOKUP_OPTIONS, meta_invocation, merge_strategy)\n options = merge_strategy.merge(env_opts, options) unless env_opts.nil?\n return options\n end\n end\n env_opts\n end", "title": "" }, { "docid": "49db1bbb4311f7d1803b93da183c761e", "score": "0.4885882", "text": "def findServiceRunner\n candidates = []\n\n # first use SERVICERUNNER_PATH if present\n if ENV.has_key? 'SERVICERUNNER_PATH'\n candidates.push(ENV['SERVICERUNNER_PATH'])\n end\n\n # next use BPSDK_PATH env var if present\n if ENV.has_key? 'BPSDK_PATH'\n candidates.push File.join(ENV['BPSDK_PATH'], \"bin\", \"ServiceRunner.exe\")\n candidates.push File.join(ENV['BPSDK_PATH'], \"bin\", \"ServiceRunner\")\n end\n \n # finally, try relative to this repo \n srBase = File.join(File.dirname(__FILE__), \"..\", \"..\", \"bin\")\n candidates.push File.join(srBase, \"ServiceRunner.exe\")\n candidates.push File.join(srBase, \"ServiceRunner\")\n\n candidates.each { |p|\n return p if File.executable? p\n }\n nil\n end", "title": "" }, { "docid": "7a0bff3ec4b383297280e70fbaaea77f", "score": "0.4882215", "text": "def override=(flag)\n @override = flag if enabled?\n end", "title": "" }, { "docid": "9faa4352c061db1360a70163b5680c4c", "score": "0.48769656", "text": "def test_lookup_var_site\n\n pdef = Ruote.process_definition do\n sequence do\n sub0\n echo 'done.'\n end\n define 'sub0' do\n alpha\n end\n end\n\n @dashboard.context.stash[:results] = []\n\n @dashboard.register_participant :alpha do |workitem, fexp|\n\n class << fexp\n public :locate_var\n end\n\n stash[:results] << fexp.locate_var('//a')\n stash[:results] << fexp.locate_var('/a').first.fei.to_storage_id\n stash[:results] << fexp.locate_var('a').first.fei.to_storage_id\n end\n\n assert_trace 'done.', pdef\n\n assert_equal(nil, @dashboard.context.stash[:results][0])\n assert_match(/^0||\\d+_\\d+$/, @dashboard.context.stash[:results][1])\n assert_match(/^0\\_0|\\d+|\\d+_\\d+$/, @dashboard.context.stash[:results][2])\n end", "title": "" }, { "docid": "73f3b7cfd1c2158781bbe3f2f3ecc4cf", "score": "0.48766172", "text": "def get_var(scope, var)\n puts \"-----GET_VAR() OUTSIDE SCOPE-----\" if $debug\n puts \"var: #{var.inspect}\" if $debug\n if var.is_a? NameNode then\n puts \"namenode\" if $debug\n return get_var(scope, scope.get_var(var))\n elsif var.is_a? IdentifierNode then\n puts \"identnode\" if $debug\n return get_var(scope, scope.get_var(var))\n else\n puts \"returning #{var.inspect}\" if $debug\n return var\n end\n\n return nil\nend", "title": "" }, { "docid": "5e9a1062d7da020dbcb6bf79c8d4bd71", "score": "0.4872775", "text": "def default_lookup; end", "title": "" }, { "docid": "5e9a1062d7da020dbcb6bf79c8d4bd71", "score": "0.4872775", "text": "def default_lookup; end", "title": "" }, { "docid": "a572d913b16d629bcd0f7afed7256674", "score": "0.48641518", "text": "def resolve_settings(overrides = {})\n unresolved_setting = /\\$[a-z_]+/\n\n # Returning the key for unknown keys (rather than nil) is required to\n # keep unknown settings in the string for later verification.\n substitutions = Hash.new {|h, k| k }\n settings = {}\n\n confdir = user_specific_conf_dir\n settings[:confdir] = substitutions['$confdir'] = confdir\n\n ssldir = overrides.fetch(:ssldir, '$confdir/ssl')\n settings[:ssldir] = substitutions['$ssldir'] = ssldir.sub('$confdir', confdir)\n\n cadir = overrides.fetch(:cadir, '$ssldir/ca')\n settings[:cadir] = substitutions['$cadir'] = cadir.sub(unresolved_setting, substitutions)\n\n settings[:cacert] = overrides.fetch(:cacert, '$cadir/ca_crt.pem')\n settings[:cakey] = overrides.fetch(:cakey, '$cadir/ca_key.pem')\n settings[:cacrl] = overrides.fetch(:cacrl, '$cadir/ca_crl.pem')\n settings[:serial] = overrides.fetch(:serial, '$cadir/serial')\n settings[:cert_inventory] = overrides.fetch(:cert_inventory, '$cadir/inventory.txt')\n\n settings.each_pair do |key, value|\n settings[key] = value.sub(unresolved_setting, substitutions)\n\n if match = settings[key].match(unresolved_setting)\n @errors << \"Could not parse #{match[0]} in #{value}, \" +\n 'valid settings to be interpolated are ' +\n '$ssldir or $cadir'\n end\n end\n\n return settings\n end", "title": "" }, { "docid": "f174d295c620772c0f1cd73ad18b30e7", "score": "0.48595172", "text": "def find_var(name)\n variables[name.to_s]\n end", "title": "" }, { "docid": "2795a7173c3ad78a4806a6d5773c395c", "score": "0.48389298", "text": "def variable_override_regex\n /^([a-zA-Z_][a-zA-Z_0-9]*)<([a-zA-Z_0-9]*)>/\n end", "title": "" }, { "docid": "2397ba7f900c13aa4782ae81ff450e24", "score": "0.4834454", "text": "def find_gem_wrapper(base)\n wrapper = File.join @gem_bin, base\n return wrapper if File.exists? wrapper\n return nil\n end", "title": "" }, { "docid": "59ce4a9703b8ab58d11b66e771a17cca", "score": "0.48197263", "text": "def find_using(virtual_path)\n self.all.map do |key, overrides_by_name|\n overrides_by_name.values.select do |override|\n [:template, :partial].include?(override.source_argument) && override.args[override.source_argument] == virtual_path\n end\n end.flatten\n end", "title": "" }, { "docid": "b0270c6078b9e76f3555b8ad275008a6", "score": "0.48152438", "text": "def overscript\n @overscript ||= initscript.gsub(/\\.conf$/,\".override\")\n end", "title": "" }, { "docid": "8bcb3c78424399645d42df83a0c5fac6", "score": "0.48054436", "text": "def getBinding(str)\n\treturn binding()\nend", "title": "" }, { "docid": "a5667eeaea32f7bedddc34e6825f724f", "score": "0.48049656", "text": "def nearest_lookup_reference name\n (ancestors - included_modules).each do |klass|\n if klass.respond_to?(:has_lookup?)\n if klass.has_lookup?(name)\n return klass.lookup(name)\n end\n end\n end\n \n raise InheritError, \"no ancestor of #{self.name} has a lookup named '#{name}'\"\n end", "title": "" }, { "docid": "2ac08578da3ddb63c013f608e2661ba4", "score": "0.4804405", "text": "def find_binding_pry\n PTY.spawn( \"git grep binding.pry | grep -v -E vendor/cache | wc -l\" ) do |stdin, stdout, pid|\n results = stdin.read.to_i\n\n unless results.zero?\n puts \"Found #{results} binding.pry in your code\"\n exit 1\n end\n end\nend", "title": "" }, { "docid": "f7c29852d73b25ba04e8e9bc21839721", "score": "0.47983667", "text": "def global_lookup_options(lookup_invocation, merge_strategy)\n if !instance_variable_defined?(:@global_lookup_options)\n @global_lookup_options = nil\n catch(:no_such_key) { @global_lookup_options = validate_lookup_options(lookup_global(LookupKey::LOOKUP_OPTIONS, lookup_invocation, merge_strategy), nil) }\n end\n @global_lookup_options\n end", "title": "" }, { "docid": "805adcead621b030f39d1045096b85b6", "score": "0.47961697", "text": "def lookup (s)\n if s\n @env[s]\n else\n raise Fail.new(\"RubyWrite::lookup: Attempting to lookup nil value\")\n end\n end", "title": "" }, { "docid": "2a8f6c44e3597ab1e77d5e25649288a4", "score": "0.4792607", "text": "def resolve(node)\n begin\n if unix?\n @ip ||= '127.0.0.1'\n @resolved ||= unix\n else\n @ip ||= Socket.getaddrinfo(host, nil, Socket::AF_INET, Socket::SOCK_STREAM).first[3]\n @resolved ||= \"#{ip}:#{port}\"\n end\n rescue SocketError => e\n node.instrument(Node::WARN, prefix: \" MOPED:\", message: \"Could not resolve IP for: #{original}\")\n node.down! and false\n end\n end", "title": "" }, { "docid": "c43ccf65cd3715b496e64c621992712d", "score": "0.47875372", "text": "def get_override\n\t\t\toverrides = @sub_class_overrides + @manual_overrides\n\t\t\twhile !overrides.empty?\n\t\t\t\toverride = overrides.pop\n\t\t\t\treturn override unless @override_disables.include? override or \n\t\t\t\t\t\t\t\t\t\t\t\tFactory.global_override_disables.include? override\n\t\t\tend\n\t\t\treturn @class_name\n\t\tend", "title": "" }, { "docid": "31f1a0525b3585d8a93c86cb73a1280c", "score": "0.47870672", "text": "def binding_elsewhere\n x = 20\n return binding\nend", "title": "" }, { "docid": "377bc9dc83f4bd6a2afe01a7fbb8a02e", "score": "0.4772981", "text": "def sub_env\n @hook.params[\"sub_env\"]\n end", "title": "" }, { "docid": "a6e2c7d09eba520eeffd14cf513599e3", "score": "0.47724295", "text": "def find(var)\n (include? var)? self : outer.find(var)\n end", "title": "" }, { "docid": "413fdaa1fe81269b8b098aa06e6be9f2", "score": "0.4765018", "text": "def select_var_set\n if ARGV[2].nil?\n # default to location sweep only\n var_set = \"generic\"\n else\n var_set = ARGV[2]\n end\n return var_set\nend", "title": "" }, { "docid": "ac31b331287d24af0962b6b0f6f4986c", "score": "0.4746158", "text": "def override_gem(name, *args)\n if dependencies.any?\n raise \"Trying to override unknown gem #{name}\" unless (dependency = dependencies.find { |d| d.name == name })\n dependencies.delete(dependency)\n\n calling_file = caller_locations.detect { |loc| !loc.path.include?(\"lib/bundler\") }.path\n calling_dir = File.dirname(calling_file)\n\n args.last[:path] = File.expand_path(args.last[:path], calling_dir) if args.last.kind_of?(Hash) && args.last[:path]\n gem(name, *args).tap do\n warn \"** override_gem: #{name}, #{args.inspect}, caller: #{calling_file}\" unless ENV[\"RAILS_ENV\"] == \"production\"\n end\n end\nend", "title": "" }, { "docid": "f46a3616340388c25ced4c852abbf8de", "score": "0.47393546", "text": "def get_derived(name)\n return instance_variable_get(name) if instance_variable_defined?(name)\n parents.each do |ancestor|\n next unless ancestor.instance_variable_defined?(name)\n return ancestor.instance_variable_get(name)\n end\n nil\n end", "title": "" }, { "docid": "59689f35e6e62b3e94f0f4bf502c8c3b", "score": "0.47358233", "text": "def resolve_settings(overrides = {}, logger, ca_dir_warn: true)\n unresolved_setting = /\\$[a-z_]+/\n\n # Returning the key for unknown keys (rather than nil) is required to\n # keep unknown settings in the string for later verification.\n substitutions = Hash.new {|h, k| k }\n settings = {}\n\n # Order for base settings here matters!\n # These need to be evaluated before we can construct their dependent\n # defaults below\n base_defaults = [\n [:confdir, user_specific_puppet_confdir],\n [:ssldir,'$confdir/ssl'],\n [:certdir, '$ssldir/certs'],\n [:certname, default_certname],\n [:server, 'puppet'],\n [:serverport, '8140'],\n [:privatekeydir, '$ssldir/private_keys'],\n [:publickeydir, '$ssldir/public_keys'],\n ]\n\n dependent_defaults = {\n :ca_name => 'Puppet CA: $certname',\n :root_ca_name => \"Puppet Root CA: #{SecureRandom.hex(7)}\",\n :keylength => 4096,\n :cacert => '$cadir/ca_crt.pem',\n :cakey => '$cadir/ca_key.pem',\n :capub => '$cadir/ca_pub.pem',\n :csr_attributes => '$confdir/csr_attributes.yaml',\n :rootkey => '$cadir/root_key.pem',\n :cacrl => '$cadir/ca_crl.pem',\n :serial => '$cadir/serial',\n :cert_inventory => '$cadir/inventory.txt',\n :ca_server => '$server',\n :ca_port => '$serverport',\n :localcacert => '$certdir/ca.pem',\n :hostcrl => '$ssldir/crl.pem',\n :hostcert => '$certdir/$certname.pem',\n :hostprivkey => '$privatekeydir/$certname.pem',\n :hostpubkey => '$publickeydir/$certname.pem',\n :ca_ttl => '15y',\n :certificate_revocation => 'true',\n :signeddir => '$cadir/signed',\n :server_list => '',\n }\n\n # This loops through the base defaults and gives each setting a\n # default if the value isn't specified in the config file. Default\n # values given may depend upon the value of a previous base setting,\n # thus the creation of the substitution hash.\n base_defaults.each do |setting_name, default_value|\n substitution_name = '$' + setting_name.to_s\n setting_value = overrides.fetch(setting_name, default_value)\n subbed_value = setting_value.sub(unresolved_setting, substitutions)\n settings[setting_name] = substitutions[substitution_name] = subbed_value\n end\n\n cadir = find_cadir(overrides.fetch(:cadir, false),\n settings[:confdir],\n settings[:ssldir],\n logger,\n ca_dir_warn)\n settings[:cadir] = substitutions['$cadir'] = cadir\n\n\n dependent_defaults.each do |setting_name, default_value|\n setting_value = overrides.fetch(setting_name, default_value)\n settings[setting_name] = setting_value\n end\n\n # If subject-alt-names are provided, we need to add the certname in addition\n overrides[:dns_alt_names] << ',$certname' if overrides[:dns_alt_names]\n\n # rename dns_alt_names to subject_alt_names now that we support IP alt names\n settings[:subject_alt_names] = overrides.fetch(:dns_alt_names, \"\")\n\n # Some special cases where we need to manipulate config settings:\n settings[:ca_ttl] = munge_ttl_setting(settings[:ca_ttl])\n settings[:certificate_revocation] = parse_crl_usage(settings[:certificate_revocation])\n settings[:subject_alt_names] = Puppetserver::Ca::Utils::Config.munge_alt_names(settings[:subject_alt_names])\n settings[:keylength] = settings[:keylength].to_i\n settings[:server_list] = settings[:server_list].\n split(/\\s*,\\s*/).\n map {|entry| entry.split(\":\") }\n\n update_for_server_list!(settings)\n\n settings.each do |key, value|\n next unless value.is_a? String\n settings[key] = value.gsub(unresolved_setting, substitutions)\n if match = settings[key].match(unresolved_setting)\n @errors << \"Could not parse #{match[0]} in #{value}, \" +\n 'valid settings to be interpolated are ' +\n '$ssldir, $certdir, $cadir, $certname, $server, or $masterport'\n end\n end\n\n return settings\n end", "title": "" }, { "docid": "2a8d29309755c91dfbd1c037cc9bfed7", "score": "0.47351587", "text": "def override(val_or_nil)\n @override = check_override_value(val_or_nil)\n end", "title": "" }, { "docid": "d1c7b617fe4d0b5e60b02b6e813aece7", "score": "0.47330362", "text": "def find_variable(key, raise_on_not_found: true)\n # This was changed from find() to find_index() because this is a very hot\n # path and find_index() is optimized in MRI to reduce object allocation\n index = @scopes.find_index { |s| s.key?(key) }\n\n variable = if index\n lookup_and_evaluate(@scopes[index], key, raise_on_not_found: raise_on_not_found)\n else\n try_variable_find_in_environments(key, raise_on_not_found: raise_on_not_found)\n end\n\n variable = variable.to_liquid\n variable.context = self if variable.respond_to?(:context=)\n\n variable\n end", "title": "" }, { "docid": "ccfe6db7f0b840514d8512c5f6682a48", "score": "0.47319365", "text": "def static_variable_get var_name\n var_name = var_name.to_s.to_sym unless var_name.is_a? Symbol\n superclasses.each do |cl|\n sv = cl.static_vars\n return sv[var_name] if sv.key? var_name\n end\n $VERBOSE && warn( \"warning: static variable #{var_name} not initialized\" )\n nil\n end", "title": "" }, { "docid": "10aac1c87d735098120bdff6aaafe6ee", "score": "0.47278175", "text": "def env_or_default(var_name)\n if ENV.has_key?(var_name)\n result = ENV[var_name]\n else\n result = DEFAULTS[var_name]\n end\nend", "title": "" }, { "docid": "0663fdd586860e3aa73211ad3e7e855c", "score": "0.47159362", "text": "def default_python_binary\n if parent_python\n parent_python.python_binary\n else\n which('python')\n end\n end", "title": "" }, { "docid": "69594b6144e8113e9df8a5700a6eb467", "score": "0.47145355", "text": "def locate( symbol )\n binder = @lookup_table[ symbol.object_id ]\n return binder.entry if binder\n\n #puts \"Failed to locate symbol <#{symbol}:#{symbol.class}>:\"\n #puts to_s\n return nil\n end", "title": "" }, { "docid": "a5084c41af2d1805f9d0f41d43093fc3", "score": "0.47112685", "text": "def getBinding(str)\r\n\treturn binding()\r\nend", "title": "" }, { "docid": "28798458472b19f81a166b66e92e55d0", "score": "0.47111097", "text": "def find(name, remote=false)\n found = check(name, remote)\n return found if found || remote\n @variables[name] = true\n found\n end", "title": "" }, { "docid": "ec003fc70509a48b5b44ca9b179f43b3", "score": "0.4706881", "text": "def getVarValue (var)\n res = \"\"\n if (@use_hash || @binding.is_a?(Hash))\n res = @binding[var]\n else\n res = eval( var, @binding ) if (@binding.is_a?( Binding )) \n end\n res = \"\" if res.nil?\n return res\n end", "title": "" }, { "docid": "f7e6ffcfea16f88c3ede92806daddc15", "score": "0.47053477", "text": "def find_bind_ip(scope)\n ip_range = IPAddr.new(scope)\n all_bound_ips.each do |ip|\n return ip if ip_range.include?(IPAddr.new(ip))\n end\n nil\n end", "title": "" }, { "docid": "e665c8ba57b009223e9041e4a27feaeb", "score": "0.4695787", "text": "def lookup(symbol)\n\t\treturn @defs[symbol] if @defs.has_key?(symbol)\n\t\traise \"Sorry mate. Symbol #{symbol} has no value :( If it bothers you just define it a value using define :) \" if @parent.nil?\n\t\treturn @parent.lookup(symbol)\n\tend", "title": "" }, { "docid": "1779ac614c71ce8ffb692180b67d33e5", "score": "0.469408", "text": "def package_override(project, var)\n project.package_overrides << var\n end", "title": "" }, { "docid": "1779ac614c71ce8ffb692180b67d33e5", "score": "0.469408", "text": "def package_override(project, var)\n project.package_overrides << var\n end", "title": "" }, { "docid": "ae02e2735632107f3ee809808c0c4a47", "score": "0.46869746", "text": "def get_keyword_value(p_keyword, p_override_inner = nil)\n\t\t# Initialize result\n\t\tresult = nil\n\t\t\n\t\t# Get possible idx\n\t\tidx = @current_line.index(p_keyword)\n\t\n\t\t# If found, store sanitized handler value\n\t\tunless idx.nil?\n\t\t\tresult = sanitize_key_value_string(@current_line[idx + p_keyword.length..@current_line.length])\n\t\t\tresult = p_override_inner.call(result) unless p_override_inner.nil?\n\t\tend\t\t\t\t\n\t\t\t\t\t\n\t\t# Return result\n\t\tresult\n\tend", "title": "" }, { "docid": "95e2d6a8696fc901315176a267611130", "score": "0.46858078", "text": "def find_command_from_base(command_name,base)\n base.commands.values.select { |command|\n if [command.name,Array(command.aliases)].flatten.map(&:to_s).any? { |_| _ == command_name }\n command\n end\n }.first\n end", "title": "" }, { "docid": "35f1f80d7cead8eae40571258ee46a21", "score": "0.46814495", "text": "def resolve_command_environment\n @default_command_environment['LD_LIBRARY_PATH'] = './.java-buildpack/tibco_bus/lib/lib/linux-i686:./.java-buildpack/tibco_bus/lib/lib/linux-i686/ipm:./.java-buildpack/tibco_bus/lib/lib/linux-x86_64:./.java-buildpack/tibco_bus/lib/lib/linux-x86_64/64:./.java-buildpack/tibco_bus/lib/lib/linux-x86_64/ipm' unless ENV.key? 'LD_LIBRARY_PATH'\n end", "title": "" }, { "docid": "769c3c5886c965af66f5913e9e3ca338", "score": "0.46788394", "text": "def bind(var, typ, force: false)\n raise RuntimeError, \"Can't update variable with fixed type\" if !force && @env[var] && @env[var][:fixed]\n result = Env.new\n result.env = @env.merge(var => {type: typ, fixed: false})\n return result\n end", "title": "" }, { "docid": "95fade20503d2f4d0b471cbee7a6ce06", "score": "0.4669397", "text": "def get_binding\n a = 123\n binding\nend", "title": "" }, { "docid": "dfd93064ccfe773fff1ce3cc62468e9c", "score": "0.46687427", "text": "def find var\n if self.has_key? var\n self\n else\n self.outer.find var unless self.outer.nil?\n end\n end", "title": "" }, { "docid": "b05ea2d13e0571af4f356660417923dd", "score": "0.46679494", "text": "def instance_variable_inherited_get(var_name, method_name = nil)\n method_name ||= var_name\n value = instance_variable_get(\"@#{var_name}\")\n if value.nil? && !@really_translatable_class && self.superclass.respond_to?(method_name)\n self.superclass.send(method_name)\n else\n value\n end\n end", "title": "" }, { "docid": "d93aee6698fcc544944ef6e756dab195", "score": "0.46654212", "text": "def resolve_variable_pointer!(variable_pointer)\n context_index = variable_pointer.context_index\n\n if context_index == -1\n context_index = get_context_index_of_variable_named(variable_pointer.variable_name)\n end\n\n value_of_variable_pointed_to = get_raw_variable_with_name(variable_pointer.variable_name, context_index)\n\n # Extra layer of indirection:\n # When accessing a pointer to a pointer (e.g. when calling nested or\n # recursive functions that take a variable references, ensure we don't create\n # a chain of indirection by just returning the final target.\n if value_of_variable_pointed_to.is_a?(VariablePointerValue)\n return value_of_variable_pointed_to\n # Make a copy of the variable pointer so we're not using the value directly\n # from the runtime. Temporary must bne local to the current scope\n else\n return VariablePointerValue.new(variable_pointer.variable_name, context_index)\n end\n end", "title": "" }, { "docid": "28a1fdd2589d25404842f4e762daba75", "score": "0.46610963", "text": "def fetch_or_default(variable, default, *args)\n if exists?(variable)\n fetch(variable, *args)\n else\n set variable, default\n default\n end \n end", "title": "" }, { "docid": "2a394a1ee4ce14f3a3e5c351fb5d5cc8", "score": "0.46596697", "text": "def safe_lookupvar(key)\n reason = catch :undefined_variable do\n return @real.lookupvar(key)\n end\n\n case Puppet[:strict]\n when :off\n # do nothing\n when :warning\n Puppet.warn_once(Puppet::Parser::Scope::UNDEFINED_VARIABLES_KIND, _(\"Variable: %{name}\") % { name: key },\n _(\"Undefined variable '%{name}'; %{reason}\") % { name: key, reason: reason } )\n when :error\n raise ArgumentError, _(\"Undefined variable '%{name}'; %{reason}\") % { name: key, reason: reason }\n end\n nil\n end", "title": "" }, { "docid": "1f322b570a29ed58af39f221e823a0ef", "score": "0.46577954", "text": "def _find_prefix(sock)\n if (self.respond_to?('stage_prefix') == true)\n self.stage_prefix = _find_tag\n else\n _find_tag\n end\n end", "title": "" }, { "docid": "c711b6094c395cc12b3c0fccd9f69af3", "score": "0.4655015", "text": "def get_oracle_base(homedir)\n oraclehomeprops = homedir + '/inventory/ContentsXML/oraclehomeproperties.xml'\n default_oracle_base = (Facter.value(:kernel) =~ %r{windows}i) ? 'C:\\app\\oracle' : '/u01/app/oracle'\n oraclebase = nil\n if File.readable?(oraclehomeprops)\n p_root = Document.new(File.new(oraclehomeprops)).root\n p_root.each_element('//PROPERTY') { |prop| oraclebase = prop['VAL'] if prop['NAME'] == 'ORACLE_BASE' }\n end\n oraclebase = default_oracle_base if oraclebase.nil? or oraclebase.sub(%r{^(.+)/$}, '\\1') == homedir\n oraclebase\nend", "title": "" } ]
0afbb56fe1eb52562d8c845de0d3da01
Instanciate a class from a hash
[ { "docid": "6b4ba5ffe88965616d51115d3d46696d", "score": "0.75163394", "text": "def from_hash(hash)\n new.from_hash(hash)\n end", "title": "" } ]
[ { "docid": "9b00961a500f5eefe5dd5b24dd55d60f", "score": "0.7942752", "text": "def import(hash, klass)\n klass.new(hash)\n end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.77920777", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.77920777", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.77920777", "text": "def from_hash(hash); end", "title": "" }, { "docid": "6c641c148fb049518c716e2a6b970af6", "score": "0.76912874", "text": "def generate(hash)\n identifier = hash.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end", "title": "" }, { "docid": "ae8dd6ff79c5f35246a045e773ddde16", "score": "0.760927", "text": "def from_hash(hash)\n end", "title": "" }, { "docid": "ae8dd6ff79c5f35246a045e773ddde16", "score": "0.760927", "text": "def from_hash(hash)\n end", "title": "" }, { "docid": "9feff5592775840e8bbab168845026b2", "score": "0.7561582", "text": "def from_hash( hash )\n new.set( hash )\n end", "title": "" }, { "docid": "0edfe66783298694bddba724d0feea94", "score": "0.7464209", "text": "def generate(hash)\n config = hash.dup\n identifier = config.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end", "title": "" }, { "docid": "36d3df4818e3cb26ce3bf3bf3ce12847", "score": "0.74264556", "text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.7390488", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.7390488", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.7390488", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "9d2fbaf59b434ce9a278dceeca93a9e0", "score": "0.7340419", "text": "def create(hash); end", "title": "" }, { "docid": "8a74fcc43166a09d8f5b3f9fa14c3c7a", "score": "0.72950923", "text": "def from_hash(hash)\n hash = CoreExt::HashWithIndifferentAccess.new(hash)\n # Pop off the root key if one is specified and given\n self.class.root_key and hash[self.class.root_key] and hash = hash[self.class.root_key]\n # Then set the attributes on the klass if they're present\n hash.each do |name, value|\n self.send(\"#{name}=\", value) if self.respond_to? name\n end\n self\n end", "title": "" }, { "docid": "2fabc78718e9cb88209fd03cb9a69ba5", "score": "0.7288084", "text": "def initialize(hash) @hash = hash end", "title": "" }, { "docid": "a3da6659112ca8b0bff06444e6dea6f3", "score": "0.72443825", "text": "def initialize(hash)\n\t\t\tset_from_hash(hash)\n\t\tend", "title": "" }, { "docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1", "score": "0.72184104", "text": "def initialize(hash)\n @hash = hash\n end", "title": "" }, { "docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1", "score": "0.72184104", "text": "def initialize(hash)\n @hash = hash\n end", "title": "" }, { "docid": "d9210d7c1788cca764da5f2c01936382", "score": "0.72067237", "text": "def initialize(hash = {})\n load_hash(hash)\n end", "title": "" }, { "docid": "fdb7253d7f93d17f96636af3af8f6b42", "score": "0.714585", "text": "def instantiate(data)\n create_from_hash(data)\n end", "title": "" }, { "docid": "fdb7253d7f93d17f96636af3af8f6b42", "score": "0.714585", "text": "def instantiate(data)\n create_from_hash(data)\n end", "title": "" }, { "docid": "d97c10ac3bead5865b584e1657128340", "score": "0.7054877", "text": "def from_hash(data); end", "title": "" }, { "docid": "c7b36c4cf47254ff691242b0282d62e8", "score": "0.70340604", "text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end", "title": "" }, { "docid": "c7b36c4cf47254ff691242b0282d62e8", "score": "0.70340604", "text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end", "title": "" }, { "docid": "05b92ac4b99e44ab35e46fca58cfa611", "score": "0.69963455", "text": "def initialize(hash = {})\n raise ArgumentError, \"Argument should be a Hash\" unless hash.is_a?(Hash)\n\n @table = {}\n hash.each do |key, value|\n value = self.class.new(value) if value.is_a?(Hash)\n @table[key.to_sym] = value\n end\n end", "title": "" }, { "docid": "77f974efafc21803fa3f54566b8469c7", "score": "0.69889617", "text": "def from_hash(hash, options = {})\n instance = new\n instance.client = extract_client!(options)\n\n hash.inject(instance) do |instance, (key, value)|\n method = :\"#{Util.underscore(key)}=\"\n\n if instance.respond_to?(method)\n instance.send(method, value)\n end\n\n instance\n end\n end", "title": "" }, { "docid": "4ef627cb72c71eb8483bbfb9875bc1bc", "score": "0.69843215", "text": "def load_from_hash!(hash); end", "title": "" }, { "docid": "b548d2a3287cd5b22ee765da94f1468f", "score": "0.69685876", "text": "def initialize(hash)\n @ostruct = hash.to_ostruct\n end", "title": "" }, { "docid": "3d05b5490ae0b97800541421e873993b", "score": "0.69546396", "text": "def initialize(hash={})\n @hash = hash\n end", "title": "" }, { "docid": "65dff1f1d61a989af2d17ec62a30f13d", "score": "0.69111085", "text": "def initialize(key,hash)\n @key = key\n @value = hash\n self.put(key,hash)\n end", "title": "" }, { "docid": "39d42b8eb578c27509760948e8c20ee8", "score": "0.6905166", "text": "def from_hash(hash)\n new(hash[:body], hash[:headers], hash[:status])\n end", "title": "" }, { "docid": "1aeb5b7cb9c689d44ddf49dfbb64719b", "score": "0.68990624", "text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.path, \"#{label}.json\")\n @defer_sync = false\n end", "title": "" }, { "docid": "1b5c27538841a18c18c9251ee353d906", "score": "0.68987614", "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": "e2226d59fc661c90960b7919b761d425", "score": "0.68922645", "text": "def initialize(hash={})\n @hash = hash\n end", "title": "" }, { "docid": "74179537bf975a819e6e44e9e745f3df", "score": "0.687549", "text": "def initialize(hash = {})\n\t\t\tif (hash.kind_of? TypeSafeHash)\n\t\t\t\t@real_hash = hash.to_hash\n\t\t\telsif (hash.kind_of? Hash)\n\t\t\t\t@real_hash = hash\n\t\t\telse\n\t\t\t\traise ArgumentError, \"TypeSafeHash expects a hash object for its initializer\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "91ff02ca3c6955d1736362070d03fe3b", "score": "0.68358874", "text": "def initialize(hash = {})\n end", "title": "" }, { "docid": "24ca93e3e16c6bc87be3ab5c9a1876c4", "score": "0.68180734", "text": "def make_klass(klass_hash)\n response = RestClient.get('http://dnd5eapi.co' + klass_hash['url'])\n json = JSON.parse(response)\n\n if json != nil\n klass = Klass.new(\n api_id: json['_id'],\n name: json['name'],\n hitdie: json['hit_die']\n )\n if klass.valid?\n klass.save\n load_klass_levels(klass.name)\n end\n end\nend", "title": "" }, { "docid": "1f2783a1ca7abc63f1042d114a6980b3", "score": "0.6816546", "text": "def deserialize(hash)\n value = hash.values_at(*VALUE_KEYS).first\n value = deserialize_argument(value) if WORK_REQUIRED.include?(value.class)\n value = yield(value) if block_given?\n value.is_a?(klass) ? value : klass.new(value)\n end", "title": "" }, { "docid": "98658442341994a6f20ff761da379499", "score": "0.6813919", "text": "def new(*args)\n if(args.first.is_a? Hash)\n hash = args.first\n begin\n __new__(*args).from_hash(hash)\n rescue Exception => e\n __new__.from_hash(hash)\n end\n else\n super\n end\n end", "title": "" }, { "docid": "1a19839795db041c37ada01bb2eedd67", "score": "0.6809163", "text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.directory, \"#{label}.json\")\n end", "title": "" }, { "docid": "17c87a6b9a47b7cc618286144127e7c4", "score": "0.680905", "text": "def initialize(hsh)\n @hash = hsh\n end", "title": "" }, { "docid": "17c87a6b9a47b7cc618286144127e7c4", "score": "0.680905", "text": "def initialize(hsh)\n @hash = hsh\n end", "title": "" }, { "docid": "17c87a6b9a47b7cc618286144127e7c4", "score": "0.680905", "text": "def initialize(hsh)\n @hash = hsh\n end", "title": "" }, { "docid": "17c87a6b9a47b7cc618286144127e7c4", "score": "0.680905", "text": "def initialize(hsh)\n @hash = hsh\n end", "title": "" }, { "docid": "d70bddff72d9787a1ac2cb70e41d4f5d", "score": "0.68017834", "text": "def initialize(hash = nil)\n end", "title": "" }, { "docid": "7d1803f33e1a433e0f9f0455d34e9a0c", "score": "0.67969155", "text": "def initialize(hash = {})\n @hash = hash\n end", "title": "" }, { "docid": "7d63a7b603a6caf8cad1ba1f7cb16b84", "score": "0.6781526", "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": "00ba555bdffd1741a118f7ea3a933205", "score": "0.6774336", "text": "def from_hash(data)\n @discovery_method = data.fetch(\"discovery_method\", \"mc\")\n @agents = data.fetch(\"agents\", [\"rpcutil\"])\n @facts = data.fetch(\"facts\", [])\n @classes = data.fetch(\"classes\", [])\n @identity = data.fetch(\"identities\", [])\n @compound = data[\"compound\"]\n\n @_rpc_client = nil\n\n self\n end", "title": "" }, { "docid": "e49438c9ee2794002f96ff60981d8ad3", "score": "0.67576665", "text": "def factory_object(hash)\n hash[\"class_name\"].constantize.find(hash[\"id\"])\n end", "title": "" }, { "docid": "b5ba92945cc28a7371bfd85fbc01e30e", "score": "0.67431307", "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": "f1ecfd21a80dbb3694066379057748c3", "score": "0.67349356", "text": "def initialize(hash)\n # copy over values from hash\n self.merge!(hash)\n end", "title": "" }, { "docid": "0105ad21034c2aa19bd4f63ac2eb6bbd", "score": "0.66909695", "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": "f96176e828255afb968c81d0912c4340", "score": "0.66904896", "text": "def from_hash(hash)\n new(hash[\"source\"],\n hash[\"oid\"],\n q(hash[\"namens\"], hash[\"name\"]),\n hash[\"strict\"] == \"t\",\n hash[\"secdef\"] == \"t\",\n hash[\"setof\"] == \"t\",\n q(hash[\"typens\"], shorten(hash[\"type\"])),\n volatility(hash[\"volatility\"]),\n hash[\"arg_modes\"].to_s.split(\",\").map{|x| mode(x.strip) },\n hash[\"arg_names\"].to_s.split(\",\").map{|x| q(x.strip) },\n hash[\"arg_types\"].to_s.split(\",\").map{|x| q(shorten(x.strip)) })\n end", "title": "" }, { "docid": "aa3ff84d51e13f91d5fc6151300b07e6", "score": "0.66888726", "text": "def initialize(hash = nil)\n if hash\n hash.each_pair do |key, value|\n self.send(\"#{key}=\", value)\n end\n end\n end", "title": "" }, { "docid": "d8f050ddd5239a17fb05396301c990f4", "score": "0.6680964", "text": "def initialize(hash)\n @name = hash[:name]\n @brewery = hash[:brewery]\n @rating = hash[:rating]\n @style = hash[:style]\n @abv = hash[:abv]\n end", "title": "" }, { "docid": "8820271f1dbb47bb95e7ec6e0d798558", "score": "0.6675971", "text": "def from_hash(hsh)\n if hsh.class != Hash\n raise ArgumentError, \"Provided argument must be a hash.\"\n end\n @raw=hsh\n end", "title": "" }, { "docid": "0fd7f9f016e6be18ba8fc7a385b63e04", "score": "0.664127", "text": "def from_hash(hash, opts = {})\n data = hash.dup\n data.delete('chef_type')\n data.delete('json_class')\n\n metadata = Mash.new(data.delete(SecureDataBag::METADATA_KEY) || {})\n metadata = metadata.merge(opts)\n\n item = new(metadata)\n item.data_bag(data.delete('data_bag')) if data.key?('data_bag')\n item.raw_data = data.key?('raw_data') ? data['raw_data'] : data\n item\n end", "title": "" }, { "docid": "4a46555b99775024eaf3e57a4151d675", "score": "0.66340864", "text": "def initialize(hash = {})\n hash.each do |k,v|\n instance_variable_set(\"@#{k}\",v)\n end\n end", "title": "" }, { "docid": "2fea6e5b4080af86ad218509cc291055", "score": "0.66323495", "text": "def init_from_hash(hash)\n byte_arr = Nfc.convert_NdeRecord_hash_to_byte_array(hash)\n init_from_byte_array(byte_arr)\n end", "title": "" }, { "docid": "3e904e5a5dcad69257c523d5fa6cd8ce", "score": "0.66304636", "text": "def new_hash\n HASH_CLASS.new\nend", "title": "" }, { "docid": "336fbe1849d249e64cfacb4d14f467b7", "score": "0.66205597", "text": "def initialize(hash = nil)\n @_hash = hash \n end", "title": "" }, { "docid": "3a74e594d3bde2fdd99d708855c771de", "score": "0.6619406", "text": "def init_hash(num,class_name,hash)\n\t\t(0..num-1).each do |id|\n\t\t\tins=class_name.new(id,self)\n\t\t\thash[id]=ins\n\t\tend\n\n\tend", "title": "" }, { "docid": "e4ce931a3b8315efe360ec5d704c490e", "score": "0.66179454", "text": "def create_from_hash hash\n values = values_from_hash hash\n # $stderr.puts \" ContentModel#create_from_hash #{self} #{hash.inspect} => #{values.inspect}\"\n ModelCache.cache_for self, :create_from_hash, values do\n self.transaction do\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{self} #{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end\n end\n end", "title": "" }, { "docid": "a3b09e4a7c6871c35b9ff2f10a4f830f", "score": "0.6616331", "text": "def initialize(hash={})\n hash.each {|k,v| instance_variable_set(\"@#{k}\".to_sym, v) }\n end", "title": "" }, { "docid": "75b736a0d0e791eb8c39ea530b4564fd", "score": "0.661247", "text": "def from_h hash\n from_json(JSON.generate(hash))\n end", "title": "" }, { "docid": "75b736a0d0e791eb8c39ea530b4564fd", "score": "0.661247", "text": "def from_h hash\n from_json(JSON.generate(hash))\n end", "title": "" }, { "docid": "27be92f6c0d19e8a27b8650206ff8f9b", "score": "0.6608677", "text": "def from_hash(hash)\n super\n @platform_identifier = hash['platformIdentifier'] if hash.has_key? 'platformIdentifier'\n @sdk_identifier = hash['sdkIdentifier'] if hash.has_key? 'sdkIdentifier'\n @sdk_creator = hash['sdkCreator'] if hash.has_key? 'sdkCreator'\n @integrator = hash['integrator'] if hash.has_key? 'integrator'\n @shopping_cart_extension = Domain::Metadata::ShoppingCartExtension.new_from_hash(hash['shoppingCartExtension']) if hash.has_key? 'shoppingCartExtension'\n end", "title": "" }, { "docid": "1037398e94df26512bcc30fc32d66b46", "score": "0.6608063", "text": "def initialize(hash)\n @hash = hash\n @type = identify(hash)\n sort_commons\n end", "title": "" }, { "docid": "87a91a286628d9c02ab76466f53af430", "score": "0.6591686", "text": "def instantiate_from_hash(hash)\n model = new(hash.reject {|k, _| 'model_name' == k})\n model.id = hash['_id']\n model.new_record = false\n if hash['_attachments']\n attachment_names = hash['_attachments'].map {|name, _| name}\n model.attachments = attachment_names.inject({}) {|acc, name| acc[name] = {:content_type => hash['_attachments'][name]['content_type']}; acc}\n end\n model\n end", "title": "" }, { "docid": "869c19da61a375d30bb32b064ca47746", "score": "0.6585914", "text": "def initialize(key,hash)\n super()\n @name = key\n merge! hash\n self\n end", "title": "" }, { "docid": "f6ac21dde4f192eec2183cb3d3067bdd", "score": "0.6568136", "text": "def initialize(hash)\n @id = hash[\"id\"]\n @isbn = hash[\"isbn\"]\n @book_id = hash[\"book_id\"]\n @author = hash[\"author\"]\n @edition_num = hash[\"edition\"]\n @publisher = hash[\"publisher\"]\n @cover = hash[\"cover\"]\n @image = hash[\"image\"]\n @title = hash[\"title\"]\n @for_sale = hash[\"for_sale\"]\n @course_code = hash[\"course_code\"]\n end", "title": "" }, { "docid": "9b68905fd91f6e97be9abfc5c6564bb0", "score": "0.656543", "text": "def from_hash(h)\n h = {} if h.nil? # nasty required check\n h = h.dup\n result = self.new\n result._internal_hash = h\n h.each do |key,value|\n from_hash_parse result, h, key, value\n end\n def result.method_missing(name, *args, &block)\n Hashi.to_object(@_internal_hash).send(name, args[0], block)\n end\n result\n end", "title": "" }, { "docid": "f140e4e41bd6f828ef1848d7f3bedf43", "score": "0.65618706", "text": "def build(hash = {})\n type = hash['type'] || hash[:type]\n\n if type && !type.empty?\n \"#{self.name}::#{type}\".constantize.new(hash)\n else\n new(hash)\n end\n end", "title": "" }, { "docid": "ec8fa27179f3260714133d26abaf814b", "score": "0.6546893", "text": "def initialize(hash)\n hash.each do |k,v|\n case v\n when Hash; self.instance_variable_set(\"@#{k}\", Configuration.new(v))\n else; self.instance_variable_set(\"@#{k}\", v)\n end\n self.class.send(:define_method, k, proc{ self.instance_variable_get(\"@#{k}\") })\n # self.class.send(:define_method, \"#{k}=\", proc{ |v| self.instance_variable_set(\"@#{k}\", v)})\n end\n end", "title": "" }, { "docid": "3a95081a8c1d98e973cfa3bba9b9373b", "score": "0.6532154", "text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @hash = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end", "title": "" }, { "docid": "4f2153529a0aa0b2fabe1bde3fdc5418", "score": "0.6510961", "text": "def from_hash(hash)\n super\n @creator = hash['creator'] if hash.has_key? 'creator'\n @name = hash['name'] if hash.has_key? 'name'\n @version = hash['version'] if hash.has_key? 'version'\n @extension_id = hash['extensionId'] if hash.has_key? 'extensionId'\n end", "title": "" }, { "docid": "7632bb6c747a55d4b13729e8148552e7", "score": "0.650917", "text": "def initialize(hash = {})\n @attributes = {}\n\n # iterate through each key/value pair and set attribute keyed by symbol\n hash.each_pair do |key, value|\n self[key.to_sym] = value\n end\n end", "title": "" }, { "docid": "2d73d781add5a13c65442a8f42447c40", "score": "0.6504878", "text": "def new(hash)\n check_id(hash)\n proxy = @klass.new(hash[:rod_id],@type,@client,@collection_proxy_factory)\n @metadata.fields.each do |field|\n check_field(hash,field)\n proxy.instance_variable_set(\"@#{field.symbolic_name}\",hash[field.symbolic_name])\n end\n @metadata.singular_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(association_variable_name(association),hash[association.symbolic_name])\n end\n @metadata.plural_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(count_variable_name(association),hash[association.symbolic_name][:count])\n end\n proxy\n end", "title": "" }, { "docid": "17d04995dca216a21e24e3a330ef54d9", "score": "0.6494976", "text": "def from_hash hash\n @id= hash['id']\n\n @name= hash['name']\n @user_id= hash['user_id']\n @url= hash['url']\n @cron= hash['cron']\n @timezone= hash['timezone']\n @next_execution= hash.has_key?('next_execution') ? DateTime.parse(hash['next_execution']) : nil\n @enabled= hash['enabled']\n @timeout= hash['timeout']\n\n @mail_when_success = hash['mail_when_success']\n @mail_when_failure = hash['mail_when_failure']\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end", "title": "" }, { "docid": "ccca437f0aaa4fb9095c3a5a3326f6cc", "score": "0.64923346", "text": "def initialize(hash)\n @id = hash[\"personId\"]\n @date_of_birth = hash[\"dateOfBirth\"]\n @gender = hash[\"gender\"]\n @first_name = hash[\"firstName\"]\n @last_name = hash[\"lastName\"]\n @email = hash[\"email\"]\n @publication_status = hash[\"publicationStatus\"]\n @username = hash[\"username\"]\n @employee = hash[\"employee\"]\n @affiliated = hash[\"affiliated\"]\n @student = hash[\"student\"]\n end", "title": "" }, { "docid": "141fef6d86883b4c88a89c2300e30722", "score": "0.6488355", "text": "def init_from_hash(json, conf_dir, profile, assume_role, autoscaling_force_size)\n @@instance = new(conf_dir, profile, assume_role, autoscaling_force_size, json)\n end", "title": "" }, { "docid": "d6f33ca8ec4334eddc3996a0a74814d9", "score": "0.64866304", "text": "def initialize(hash=nil)\n @store = Storage.new( symbol_hash(hash || {}) )\n @inner_hash = @store.octothorpe_store\n end", "title": "" }, { "docid": "16442ab6f8c6615558f8b5ee6930f991", "score": "0.64862406", "text": "def initialize(hash={})\n hash.each_pair do |key,value|\n send(\"#{key}=\".to_sym,value) if DESIRED_FIELDS.include?(key)\n end\n end", "title": "" }, { "docid": "3a93184236acdac9f0009447de05a2c6", "score": "0.64844185", "text": "def init_from_hash(val)\n clear\n val.each do |sym, value|\n raise NoMethodError unless self.members.member?(sym)\n if self[sym].is_a?(FFI::Struct)\n self[sym] = self[sym].class.new\n self[sym].init_from_hash(value)\n else\n self[sym] = value\n end\n end\n end", "title": "" }, { "docid": "aae138d9e7ae9652e43123924b495c61", "score": "0.647016", "text": "def hash_to_model(klass_name, hash)\n model_klass =\n if self.class.const_defined?(\"#{self.class}::#{klass_name}\")\n self.class.const_get(klass_name)\n else\n self.class.const_set(klass_name, Class.new(HashModel))\n end\n model_klass.new(hash)\n end", "title": "" }, { "docid": "dfb2a1a00229e1d0e35475f86353a4ff", "score": "0.6469439", "text": "def initialize(hash)\n %w(id type name video logo).each do |f|\n instance_variable_set \"@#{f}\", hash[f]\n end\n\n @products = Plaid.symbolize_hash(hash['products'])\n @forgotten_password_url = hash['forgottenPassword']\n @account_locked_url = hash['accountLocked']\n @account_setup_url = hash['accountSetup']\n @fields = hash['fields'].map { |fld| Plaid.symbolize_hash(fld) }\n @colors = Plaid.symbolize_hash(hash['colors'])\n @name_break = hash['nameBreak']\n end", "title": "" }, { "docid": "c8c7e50f322c07da5ebef7c446941302", "score": "0.6456137", "text": "def from_h(hash)\n hash.each_pair do |key,value|\n self[key] = value\n end\n end", "title": "" }, { "docid": "2568a1759792d18b131d00e928389595", "score": "0.64436394", "text": "def initialize(hash, configuration)\n @name = hash['name']\n @id = hash['id']\n @level = hash['level']\n @hardcore = hash['hardcore']\n @hero_class = hash['class']\n @gender = hash['gender']\n @last_updated = hash['last_updated']\n @dead = hash['dead']\n\n # Save configuration for on-demand item/skill lookups\n @configuration = configuration\n end", "title": "" }, { "docid": "e87ba9be70c15ecbedf65d16e7a14727", "score": "0.6429388", "text": "def initialize(name)\n @name = name\n @hash = name.hash\n end", "title": "" }, { "docid": "c264d9d57480506c541e7d5018f614b4", "score": "0.64198434", "text": "def initialize\n @class_hash = {}\n end", "title": "" }, { "docid": "4901d7678b50232a3cecab8f5bc35ccd", "score": "0.6417844", "text": "def initialize(hash)\n @code = hash[\"code\"]\n @name = hash[\"name\"]\n @norwegian_name = hash[\"norwegianName\"]\n @english_name = hash[\"english_name\"]\n end", "title": "" }, { "docid": "ba64ab947196c9053bd9b7361a9fecdc", "score": "0.64149386", "text": "def from_hash(hash)\n new(hash[\"source\"],\n hash[\"oid\"],\n QualifiedName.new(hash[\"nschema\"].to_s, hash[\"name\"].to_s),\n hash[\"strict\"] == \"t\",\n hash[\"secdef\"] == \"t\",\n hash[\"setof\"] == \"t\",\n QualifiedType.parse(hash[\"tschema\"].to_s, hash[\"type\"].to_s),\n volatility(hash[\"volatility\"]),\n coalesce(hash[\"arg_modes\"].to_s.split(\",\").map{|x| mode(x.strip) },\n [\"in\"]*hash[\"arg_count\"].to_i),\n hash[\"arg_names\"].to_s.split(\",\").map{|x| QualifiedName.new(nil, x.strip) },\n hash[\"arg_types\"].to_s.split(\",\").map{|x| QualifiedType.parse(x.strip) },\n defaults(hash[\"arg_defaults\"],\n hash[\"arg_defaults_count\"].to_i,\n hash[\"arg_count\"].to_i))\n end", "title": "" }, { "docid": "e10a48008268479ec5bda966d3e89b3e", "score": "0.63996005", "text": "def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end", "title": "" }, { "docid": "631d5266c4f9b3db671a6bd935d27611", "score": "0.63837385", "text": "def initialize (hash = nil)\n @struct = Hash.new\n @struct = hash if hash.is_a? Hash\n end", "title": "" }, { "docid": "44efb9947ee65e8b20979ffadd3a0854", "score": "0.6368214", "text": "def initialize(hash={})\n update_from_json(hash)\n end", "title": "" }, { "docid": "4df420256c8da88b01333fe1bb34915d", "score": "0.6365675", "text": "def from_hash( h)\n\t\t@name = h.keys.first\n\t\th[@name].each { |k,v| self.add_attribute( k, v) }\n\tend", "title": "" }, { "docid": "7edd400a3d068783e8d8333427a4672e", "score": "0.63566566", "text": "def initialize(attrs={})\n from_hash(attrs)\n end", "title": "" }, { "docid": "7edd400a3d068783e8d8333427a4672e", "score": "0.63566566", "text": "def initialize(attrs={})\n from_hash(attrs)\n end", "title": "" }, { "docid": "44d7fca363375fab66a5ee54074f66cb", "score": "0.635544", "text": "def uuid_from_hash(hash_class, namespace, name); end", "title": "" } ]
af449534555579454286a787be4c287f
POST /ssystems POST /ssystems.json
[ { "docid": "30db1e700e277393dccbf53e6761da1e", "score": "0.75975597", "text": "def create\n @ssystem = Ssystem.new(ssystem_params)\n\n respond_to do |format|\n if @ssystem.save\n format.html { redirect_to @ssystem, notice: 'Ssystem was successfully created.' }\n format.json { render :show, status: :created, location: @ssystem }\n else\n format.html { render :new }\n format.json { render json: @ssystem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "65f93539727a577b683d10a486938a31", "score": "0.69371104", "text": "def create\n @system = System.new(params[:system])\n\n respond_to do |format|\n if @system.save\n format.html { redirect_to @system, notice: 'System was successfully created.' }\n format.json { render json: @system, status: :created, location: @system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51a59d946d31071d462abf43e5942328", "score": "0.68504775", "text": "def ssystem_params\n params.require(:ssystem).permit(:nombre, :system_id)\n end", "title": "" }, { "docid": "b1b1a9d829840251069b867da6cd16c6", "score": "0.6614848", "text": "def create\n @sunsystem = Sunsystem.new(sunsystem_params)\n\n respond_to do |format|\n if @sunsystem.save\n format.html { redirect_to @sunsystem, notice: 'Sunsystem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sunsystem }\n else\n format.html { render action: 'new' }\n format.json { render json: @sunsystem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b4b85ad62d8a7277bb653720423ba8c", "score": "0.6519764", "text": "def create\n @system = System.new(params[:system])\n\n respond_to do |format|\n if @system.save\n format.html { redirect_to systems_url, flash[:info]=\"System was successfully created.\" }\n format.js { flash[:info]=\"System was successfully created.\" }\n format.json { render json: @system, status: :created, location: @system }\n end\n end\n end", "title": "" }, { "docid": "000f65efdb23b1c1e57282c98a88548e", "score": "0.65111715", "text": "def create\n begin\n puts\n puts system_create_params\n if SystemMapSystem.create(system_create_params)\n render status: 200, json: { message: \"Success\" }\n else\n render status: 500, json: { message: \"ERROR Occured: New system could not be saved.\"}\n end\n rescue => e\n render status: 500, json: { message: \"ERROR Occured: New system could not be saved: \" + e.message}\n end\n end", "title": "" }, { "docid": "87dab513e78ab51bbc2ecfd70aea256a", "score": "0.6445922", "text": "def create\n @it_system = ItSystem.new(it_system_params)\n\n respond_to do |format|\n if @it_system.save\n format.html { redirect_to @it_system, notice: 'It system was successfully created.' }\n format.json { render :show, status: :created, location: @it_system }\n else\n format.html { render :new }\n format.json { render json: @it_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d99651325676a6ed5b5c250322d0c171", "score": "0.64296895", "text": "def create\n @simba_system = SimbaSystem.new(simba_system_params)\n\n respond_to do |format|\n if @simba_system.save\n format.html { redirect_to @simba_system, notice: 'Simba system was successfully created.' }\n format.json { render :show, status: :created, location: @simba_system }\n else\n format.html { render :new }\n format.json { render json: @simba_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ab68bd8378f186d61edeb153e43e2b6", "score": "0.634649", "text": "def create\n @sysconfig = Sysconfig.new(params[:sysconfig])\n\n respond_to do |format|\n if @sysconfig.save\n format.html { redirect_to @sysconfig, notice: 'Sysconfig was successfully created.' }\n format.json { render json: @sysconfig, status: :created, location: @sysconfig }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sysconfig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bede519cebb944eb49835b5c82ed486a", "score": "0.632464", "text": "def system_params\n params.require(:system).permit(:name, :urn, :os, :reboot_required, :address, :last_seen, :system_group_id)\n end", "title": "" }, { "docid": "9016146acf49e585397249d9c5081965", "score": "0.6314354", "text": "def create\n @systemadmin = Systemadmin.new(params[:systemadmin])\n\n respond_to do |format|\n if @systemadmin.save\n format.html { redirect_to @systemadmin, notice: 'Systemadmin was successfully created.' }\n format.json { render json: @systemadmin, status: :created, location: @systemadmin }\n else\n format.html { render action: \"new\" }\n format.json { render json: @systemadmin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "077ca298df9699ef3a509de64bd8de19", "score": "0.628623", "text": "def create\n @system_config = SystemConfig.new(params[:system_config])\n\n respond_to do |format|\n if @system_config.save\n format.html { redirect_to @system_config, :notice => 'System config was successfully created.' }\n format.json { render :json => @system_config, :status => :created, :location => @system_config }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @system_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "330ed074341f602c2e8333604d7a9d98", "score": "0.62641114", "text": "def create\n @sysconfig = Sysconfig.new(sysconfig_params)\n\n respond_to do |format|\n if @sysconfig.save\n format.html { redirect_to @sysconfig, notice: 'Sysconfig was successfully created.' }\n format.json { render :show, status: :created, location: @sysconfig }\n else\n format.html { render :new }\n format.json { render json: @sysconfig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52957e6923c51335a0cf4889616b090f", "score": "0.6250469", "text": "def create\n @system_model = SystemModel.new(system_model_params)\n\n respond_to do |format|\n if @system_model.save\n format.html { redirect_to @system_model, notice: 'SystemModel was successfully created.' }\n format.json { render :show, status: :created, location: @system_model }\n else\n format.html { render :new }\n format.json { render json: @system_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "753491723dfce85b2f4ce8be088aef58", "score": "0.62446725", "text": "def create_storage_system(request_body)\n response = request(:post, '/devmgr/v2/storage-systems', request_body.to_json)\n status(response, 201, 'Storage Creation Failed')\n end", "title": "" }, { "docid": "753491723dfce85b2f4ce8be088aef58", "score": "0.6243939", "text": "def create_storage_system(request_body)\n response = request(:post, '/devmgr/v2/storage-systems', request_body.to_json)\n status(response, 201, 'Storage Creation Failed')\n end", "title": "" }, { "docid": "1b47cacc3b9bdf39a3b4a4f1eb067500", "score": "0.62219673", "text": "def set_ssystem\n @ssystem = Ssystem.find(params[:id])\n end", "title": "" }, { "docid": "e1a81d6b130d5ca0c610e23d5d74417b", "score": "0.6212187", "text": "def create\n @system_information = SystemInformation.new(system_information_params)\n\n respond_to do |format|\n if @system_information.save\n format.html { redirect_to @system_information, notice: 'System information was successfully created.' }\n format.json { render :show, status: :created, location: @system_information }\n else\n format.html { render :new }\n format.json { render json: @system_information.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea2ce32a9f1076e3f550a4f60bf6e6e4", "score": "0.61943024", "text": "def sunsystem_params\n params.require(:sunsystem).permit(:y, :name)\n end", "title": "" }, { "docid": "f9a953e9d485665825e0342a89b44379", "score": "0.6121469", "text": "def create\n @sys_config = @system.sys_configs.build(params[:sys_config])\n respond_to do |format|\n if @sys_config.save\n flash[:notice] = 'SysConfig was successfully created.'\n format.html { redirect_to user_system_sys_config_url(@user, @system, @sys_config) }\n format.xml { head :created, :location => user_system_sys_config_url(@user, @system, @sys_config) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sys_config.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "de8553d21733680ff6253735c2f45650", "score": "0.6119721", "text": "def create\n @system_config = SystemConfig.new(system_config_params)\n\n respond_to do |format|\n if @system_config.save\n format.html { redirect_to @system_config, notice: 'System config was successfully created.' }\n format.json { render action: 'show', status: :created, location: @system_config }\n else\n format.html { render action: 'new' }\n format.json { render json: @system_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a60a7f42696b29d40013bc59be97dee", "score": "0.61155665", "text": "def nfi_system_params\n params.require(:nfi_system).permit(:system_name, :sysem_description, :data_source_id, :sub_system_exist, :status)\n end", "title": "" }, { "docid": "c962fa8691a08cc8f0c6baab3c95e3d0", "score": "0.6115072", "text": "def create\n @old_system = OldSystem.new(old_system_params)\n\n respond_to do |format|\n if @old_system.save\n format.html { redirect_to @old_system, notice: 'Old system was successfully created.' }\n format.json { render :show, status: :created, location: @old_system }\n else\n format.html { render :new }\n format.json { render json: @old_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f16d514b4bf415ad34e0254abd697142", "score": "0.60736585", "text": "def create\n @system_user = SystemUser.new(system_user_params)\n\n respond_to do |format|\n if @system_user.save\n format.html { redirect_to @system_user, notice: 'System user was successfully created.' }\n format.json { render :show, status: :created, location: @system_user }\n else\n format.html { render :new }\n format.json { render json: @system_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42efc9c4cd4cae2aae82a74f4e34c8d4", "score": "0.6072675", "text": "def create\n @system_overview = SystemOverview.new(system_overview_params)\n\n respond_to do |format|\n if @system_overview.save\n format.html { redirect_to @system_overview, notice: 'System overview was successfully created.' }\n format.json { render :show, status: :created, location: @system_overview }\n else\n format.html { render :new }\n format.json { render json: @system_overview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5eec160125e10f12f51de3cd37626ce", "score": "0.6065694", "text": "def update\n respond_to do |format|\n if @ssystem.update(ssystem_params)\n format.html { redirect_to @ssystem, notice: 'Ssystem was successfully updated.' }\n format.json { render :show, status: :ok, location: @ssystem }\n else\n format.html { render :edit }\n format.json { render json: @ssystem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22a21a71904f2a1195e8b8fddfcdfb1a", "score": "0.6044499", "text": "def create\n system_params\n\n @system = System.new( system_params )\n\n if @system.save\n redirect_to @system\n else \n render :new\n end \n\n end", "title": "" }, { "docid": "7f8068ab150e70c2af4a546ae77c68aa", "score": "0.603266", "text": "def create\n @game_system = GameSystem.new(params[:game_system])\n\n respond_to do |format|\n if @game_system.save\n format.html { redirect_to @game_system, notice: 'Game system was successfully created.' }\n format.json { render json: @game_system, status: :created, location: @game_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "087b22f3ae032d2ccaff8e83e0d47060", "score": "0.6029416", "text": "def create\n @system_configuration = SystemConfiguration.new(params[:system_configuration])\n\n respond_to do |format|\n if @system_configuration.save\n format.html { redirect_to @system_configuration, notice: 'System configuration was successfully created.' }\n format.json { render json: @system_configuration, status: :created, location: @system_configuration }\n else\n format.html { render action: \"new\" }\n format.json { render json: @system_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f5025c41911826fd2578c00c7f9ef86", "score": "0.5995271", "text": "def index\n @ssystems = Ssystem.all\n end", "title": "" }, { "docid": "9255a2d4af2b0823115576bbc963f95b", "score": "0.5953036", "text": "def create\n @system_information = SystemInformation.new(system_information_params)\n\n\n respond_to do |format|\n if @system_information.save \n \n \n format.html { redirect_to @system_information, notice: 'Information was successfully created.' }\n format.json { render json: @system_information, status: :created, location: @system_information }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @system_information.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "320842a8d9d32a6125b491cde433916f", "score": "0.59407234", "text": "def create\n @bs_project = BsProject.find(params[:bs_project_id])\n @bs_system = @bs_project.bs_systems.new(bs_system_params)\n\n respond_to do |format|\n if @bs_system.save\n format.html { redirect_to [@bs_project, @bs_system], notice: 'Bs system was successfully created.' }\n format.json { render :show, status: :created, location: @bs_system }\n else\n format.html { render :new }\n format.json { render json: @bs_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff68719e26e4a67598cadde2183a719d", "score": "0.5936018", "text": "def create\n @system_stat = SystemStat.new(system_stat_params)\n\n respond_to do |format|\n if @system_stat.save\n format.html { redirect_to @system_stat, notice: 'System stat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @system_stat }\n else\n format.html { render action: 'new' }\n format.json { render json: @system_stat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "951b79f87ca252cba3963f7698acd253", "score": "0.5896362", "text": "def create\n @nfi_system = NfiSystem.new(nfi_system_params)\n\n respond_to do |format|\n if @nfi_system.save\n format.html { redirect_to @nfi_system, notice: 'Nfi system was successfully created.' }\n format.json { render :show, status: :created, location: @nfi_system }\n else\n format.html { render :new }\n format.json { render json: @nfi_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c56225c1c7f720b031bc74b2eb7bafba", "score": "0.58435524", "text": "def create\n @sys_op = SysOp.new(params[:sys_op])\n\n respond_to do |format|\n if @sys_op.save\n format.html { redirect_to @sys_op, notice: 'Sys op was successfully created.' }\n format.json { render json: @sys_op, status: :created, location: @sys_op }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sys_op.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8788f07501880b647433fb1a644bedb8", "score": "0.5791612", "text": "def create\n @system_module = SystemModule.new(params[:system_module])\n\n respond_to do |format|\n if @system_module.save\n format.html { redirect_to system_modules_path, notice: 'System module was successfully created.' }\n format.json { render json: @system_module, status: :created, location: @system_module }\n else\n format.html { render action: \"new\" }\n format.json { render json: @system_module.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "07e456b71bf6f6a0292132b9673df2f8", "score": "0.5790982", "text": "def new\n #override new, if we already have a system \n if System.all.empty?\n @system = System.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system }\n end\n else\n respond_to do |format|\n flash[:notice] = \"System has already been created.\"\n format.html { redirect_to systems_path }\n format.json { render json: @systems.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "885ae72274a01ca6b63386db489e4f23", "score": "0.5776209", "text": "def create\n @dis_system = DisSystem.new(dis_system_params)\n\n respond_to do |format|\n if @dis_system.save\n format.html { redirect_to @dis_system, notice: 'Dis system was successfully created.' }\n format.json { render :show, status: :created, location: @dis_system }\n else\n format.html { render :new }\n format.json { render json: @dis_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ec3515b56b3265042cfc5efcb37ae8b", "score": "0.5771629", "text": "def create\n @anwendungs_system = AnwendungsSystem.new(anwendungs_system_params)\n\n respond_to do |format|\n if @anwendungs_system.save\n format.html { redirect_to @anwendungs_system, notice: 'Anwendungs system was successfully created.' }\n format.json { render :show, status: :created, location: @anwendungs_system }\n else\n format.html { render :new }\n format.json { render json: @anwendungs_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33944559a158ad56b59ab47bca4d246d", "score": "0.57336587", "text": "def create\n \t@system_option.system = @system\n respond_to do |format|\n if @system_option.save\n format.html { redirect_to([:admin, @system], notice: 'System Option was successfully created.') }\n format.xml { render xml: @system_option, status: :created, location: @system_option }\n format.js\n website.add_log(user: current_user, action: \"Created system_option: #{@system_option.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @system_option.errors, status: :unprocessable_entity }\n format.js { render template: \"admin/system_options/create_error\" }\n end\n end\n end", "title": "" }, { "docid": "4d939a5cbde38761b8c3923314a3ca5f", "score": "0.5699644", "text": "def destroy\n @ssystem.destroy\n respond_to do |format|\n format.html { redirect_to ssystems_url, notice: 'Ssystem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f38caa9401f0ee53dec2da34d9edd87", "score": "0.5698584", "text": "def create\n @systemuser = Systemuser.new(params[:systemuser])\n @systemuser.name = params[:systemuser][:name]\n \n if params[:systemuser][:group_id] == 4\n @systemuser.ro = 1\n else\n @systemuser.ro = 0\n end\n \n @systemuser.enabled = 1\n\n respond_to do |format|\n if @systemuser.save\n format.html { redirect_to systemusers_path, notice: 'Wizard user was successfully created.' }\n format.json { render json: @systemuser, status: :created, location: @systemuser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @systemuser.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33a95b11f99df15137701d2b78b919be", "score": "0.5661248", "text": "def create\n @roster_system = RosterSystem.new(roster_system_params)\n\n respond_to do |format|\n if @roster_system.save\n format.html { redirect_to @roster_system, notice: 'Roster system was successfully created.' }\n format.json { render :show, status: :created, location: @roster_system }\n else\n format.html { render :new }\n format.json { render json: @roster_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23befb7ca55aae3ad7cabd1c859beb54", "score": "0.5647269", "text": "def create\n @systemlog = Systemlog.new(systemlog_params)\n\n respond_to do |format|\n if @systemlog.save\n format.html { redirect_to @systemlog, notice: 'Systemlog was successfully created.' }\n format.json { render :show, status: :created, location: @systemlog }\n else\n format.html { render :new }\n format.json { render json: @systemlog.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11cd73549dcd9bbd924dd28372f3975e", "score": "0.5640731", "text": "def create\n @subsystem = Subsystem.new(subsystem_params)\n # write subsystem to database\n if @subsystem.save\n redirect_to project_subsystems_path(:project_id => @subsystem.project.id), :notice => 'Teilanlage erfolgreich erstellt.'\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "c1cd5994806fc7bce711b13b19d3c6f7", "score": "0.5628771", "text": "def create\n @sys_check = SysCheck.new(params[:sys_check])\n\n respond_to do |format|\n if @sys_check.save\n format.html { redirect_to @sys_check, notice: 'Sys check was successfully created.' }\n format.json { render json: @sys_check, status: :created, location: @sys_check }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sys_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6302a6731e4661ad4da5295e519fe38d", "score": "0.55951405", "text": "def create\n @category_system = CategorySystem.new(category_system_params)\n\n respond_to do |format|\n if @category_system.save\n format.html { redirect_to @category_system, notice: 'Category system was successfully created.' }\n format.json { render :show, status: :created, location: @category_system }\n else\n format.html { render :new }\n format.json { render json: @category_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "784c2e231075012a109d87506fb0714a", "score": "0.55722517", "text": "def update_system_with_http_info(system, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemsApi.update_system ...'\n end\n # verify the required parameter 'system' is set\n if @api_client.config.client_side_validation && system.nil?\n fail ArgumentError, \"Missing the required parameter 'system' when calling SystemsApi.update_system\"\n end\n # resource path\n local_var_path = '/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 # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\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(system)\n\n # return_type\n return_type = opts[:debug_return_type] || 'System'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['TokenAuth']\n\n new_options = opts.merge(\n :operation => :\"SystemsApi.update_system\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SystemsApi#update_system\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "041e76d6ce27ea8f06187b0bc5b540de", "score": "0.5563523", "text": "def create\n @sys_role = SysRole.new(sys_role_params)\n\n respond_to do |format|\n if @sys_role.save\n format.html { redirect_to @sys_role, notice: 'Sys role was successfully created.' }\n format.json { render :show, status: :created, location: @sys_role }\n else\n format.html { render :new }\n format.json { render json: @sys_role.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cbb020d70cbc83bb1c016fa59d01ad2", "score": "0.555986", "text": "def create\n @syllabus = Syllabus.new(params[:syllabus])\n respond_to do |format|\n if @syllabus.save\n format.html { redirect_to @syllabus, notice: 'syllabus was successfully created.' }\n format.json { render json: @syllabus, status: :created, location: @syllabus }\n else\n format.html { render action: \"new\" }\n format.json { render json: @syllabus.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc472c40a9ae9d8d77f48baacd5b433d", "score": "0.55474323", "text": "def create\n @systemsetting = Systemsetting.new(systemsetting_params)\n\n respond_to do |format|\n if @systemsetting.save\n format.html { redirect_to root_path, notice: 'Se Creó la Configuración Correctamente.' }\n else\n format.html { render :new }\n format.json { render json: @systemsetting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d5e1bc6f48dc1cc33b98966ca3a02fe", "score": "0.55304444", "text": "def dis_system_params\n params.require(:dis_system).permit(:name, :status_id)\n end", "title": "" }, { "docid": "583a8d88ea6c0ec92d1e67f933088106", "score": "0.5514196", "text": "def system_information_params\n params.require(:system_information).permit(:access, :hdd_capacity, :lan, :monitor_type, :os_installed, :ram, :ram_type, :sw_details, :system_name)\n end", "title": "" }, { "docid": "e4e310d2ea3d4c25eb56f7b350783b78", "score": "0.5503416", "text": "def new\n @system_information = SystemInformation.new\n\n \n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_information }\n end\n end", "title": "" }, { "docid": "18a34505e268cc5cd65994b6d4c270fa", "score": "0.5500711", "text": "def init_systems\n response = @conn.get do |req|\n req.url \"/api/v1/systemimages\"\n req.headers = rest_headers\n end\n\n @systems = json(response.body)[:systemimages]\n end", "title": "" }, { "docid": "7ba34dd8fa15761400e1ffddddb08e26", "score": "0.5487259", "text": "def system_params\n params.require(:system).permit(:id, :latitude, :address, :longitude, :city, :country, :consumption, :backup)\n end", "title": "" }, { "docid": "f9bb0950fff62cfc56af310eb7e192a1", "score": "0.5478216", "text": "def post_inventories(name,description, organization=1,variables='')\n dprint \"/api/v1/hosts\"\n resp = @rest['/api/v1/hosts'].post({\n :name => name,\n :description => description,\n :organization => organization,\n :variables => variables\n })\n dprint resp\n\n #[XXX] Theoretical what this is at this point - need to see \n # actual response\n JSON.parse(resp)[\"results\"]\n end", "title": "" }, { "docid": "8244786607da571d7742d34d11560f5c", "score": "0.54772055", "text": "def create\n @planetary_system = PlanetarySystem.new(planetary_system_params)\n\n respond_to do |format|\n if @planetary_system.save\n format.html { redirect_to @planetary_system, notice: 'Planetary system was successfully created.' }\n format.json { render :show, status: :created, location: @planetary_system }\n else\n format.html { render :new }\n format.json { render json: @planetary_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "467455d2749e0589d8e53ccce6f019ae", "score": "0.547444", "text": "def create\n @hydraulic_system = HydraulicSystem.new(params[:hydraulic_system])\n @hydraulic_system.truck_id = @hydraulic_system.driver.truck_id\n respond_to do |format|\n if @hydraulic_system.save\n format.html { redirect_to @hydraulic_system, notice: 'Hydraulic system was successfully created.' }\n format.json { render json: @hydraulic_system, status: :created, location: @hydraulic_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hydraulic_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cf09e688bbb189433d56ca4579d1923", "score": "0.5469718", "text": "def new\n @sysconfig = Sysconfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sysconfig }\n end\n end", "title": "" }, { "docid": "2077c5aad011390db915eba14282735e", "score": "0.5465687", "text": "def create\n @admin_system_admin = Admin::SystemAdmin.new(admin_system_admin_params)\n @admin_system_admin.password = Devise.friendly_token.first(8)\n authorize! :create, @admin_system_admin\n\n respond_to do |format|\n if @admin_system_admin.save\n format.html { redirect_to @admin_system_admin, notice: 'System admin was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_system_admin }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_system_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f9d12b6a96586cd29d1374904b2b167", "score": "0.54608124", "text": "def create\n @nvs_subsystem = NvsSubsystem.new(params[:nvs_subsystem])\n @nvs_subsystem.project_id = session[:project_id]\n\n respond_to do |format|\n if @nvs_subsystem.save\n unless params['depts_project_ids'].nil?\n params['depts_project_ids'].each do |dp|\n dp = NvsDeptProject.find(dp) #get dept_project selected.\n dp.nvs_subsystem = @nvs_subsystem\n dp.nvs_dept_id = 0 if dp.nvs_dept_id.nil?\n dp.project_id = session[:project_id]\n dp.save\n end\n end\n\n format.html { redirect_to @nvs_subsystem, notice: 'Nvs subsystem was successfully created.' }\n format.json { render json: @nvs_subsystem, status: :created, location: @nvs_subsystem }\n else\n prepare_combos\n get_related_projects\n format.html { render action: \"new\" }\n format.json { render json: @nvs_subsystem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eaaa4ad8c613d8cc0e63eb6fffa036f8", "score": "0.5457898", "text": "def new\n @system = System.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js # new.js.erb\n format.json { render json: @system }\n end\n end", "title": "" }, { "docid": "0c9d95cf55021695cc6c1079fb8f92ee", "score": "0.54448456", "text": "def create\n \t@system.brand = website.brand\n respond_to do |format|\n if @system.save\n format.html { redirect_to([:admin, @system], notice: 'System was successfully created.') }\n format.xml { render xml: @system, status: :created, location: @system }\n website.add_log(user: current_user, action: \"Created system: #{@system.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f9dca59bec447b358ddc766aa1a8ce0", "score": "0.54349554", "text": "def update_system(outputs)\n Log.info 'Platform stack has created. CloudConductor will register host to zabbix/DNS.'\n @system.ip_address = outputs['FrontendAddress']\n @system.monitoring_host = @system.domain\n @system.template_parameters = outputs.except('FrontendAddress').to_json\n @system.save!\n end", "title": "" }, { "docid": "663a0d3207b08064928fcf3383eee0eb", "score": "0.5415564", "text": "def simba_system_params\n params.require(:simba_system).permit(:customs_entry_number, :customs_entry_date, :exchange_rate, :total_freight_usd, :total_insurance_Kes, :total_pre_idf, :total_railway_levy, :total_kaa_levy, :total_shipping_line_charges, :total_transport_from_msa, :total_port_handling_charges, :total_offloading_expenses, :total_bank_charges, :total_services_charges, :documents_handling_charges, :total_other_costs)\n end", "title": "" }, { "docid": "217e68967c6d001b0bc3d2a3e366d18d", "score": "0.53968984", "text": "def create\n @system_site_map = SystemSiteMap.new(params[:system_site_map])\n\n respond_to do |format|\n if @system_site_map.save\n format.html { redirect_to @system_site_map, notice: 'System site map was successfully created.' }\n format.json { render json: @system_site_map, status: :created, location: @system_site_map }\n else\n format.html { render action: \"new\" }\n format.json { render json: @system_site_map.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "744a329643768a75faae6698c1dea4a7", "score": "0.53847456", "text": "def set_system\n @system = System.find(params[:id])\n end", "title": "" }, { "docid": "744a329643768a75faae6698c1dea4a7", "score": "0.53847456", "text": "def set_system\n @system = System.find(params[:id])\n end", "title": "" }, { "docid": "d69ee01d4cb12dcf1c685d2e12426c32", "score": "0.538293", "text": "def create\n @system_message = SystemMessage.new(system_message_params)\n\n respond_to do |format|\n if @system_message.save\n format.html { redirect_to system_messages_path, notice: 'System message was successfully created.' }\n format.json { render :show, status: :created, location: @system_message }\n else\n format.html { render :new }\n format.json { render json: @system_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "020aad7c75168f0bc90e457c048a41ce", "score": "0.5377627", "text": "def create\n @last_system_changing = LastSystemChanging.new(last_system_changing_params)\n\n respond_to do |format|\n if @last_system_changing.save\n format.html { redirect_to @last_system_changing, notice: 'Last system changing was successfully created.' }\n format.json { render :show, status: :created, location: @last_system_changing }\n else\n format.html { render :new }\n format.json { render json: @last_system_changing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf8e07baf3eaf6d481265e882174b8d8", "score": "0.5377578", "text": "def create_station\n request = ['Enter station name: ']\n getting(request, :approve_station, :create_station!)\n end", "title": "" }, { "docid": "089b56eb32085681e1f147a8537d3608", "score": "0.5375156", "text": "def create\n @machine_id_standard = MachineIdStandard.new(params[:machine_id_standard])\n\n respond_to do |format|\n if @machine_id_standard.save\n format.html { redirect_to @machine_id_standard, notice: 'Machine ID Standard was successfully created.' }\n format.json { render json: @machine_id_standard, status: :created, location: @machine_id_standard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @machine_id_standard.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f10ba69c92cc0f41734b624b58de1539", "score": "0.5372646", "text": "def create\n @system_parameter = SystemParameter.new(params[:system_parameter])\n\n respond_to do |format|\n if @system_parameter.save\n flash[:notice] = 'SystemParameter was successfully created.'\n format.html { redirect_to(@system_parameter) }\n format.xml { render :xml => @system_parameter, :status => :created, :location => @system_parameter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @system_parameter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3660ea21829a5ad8e60778aac69b165a", "score": "0.53638625", "text": "def new\n @systemadmin = Systemadmin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @systemadmin }\n end\n end", "title": "" }, { "docid": "ecb113077db0864a2f72ee460ff97da9", "score": "0.5362668", "text": "def systems\n @systems ||= []\n end", "title": "" }, { "docid": "a666a45e2c30c263211ac9c8d6d58a0b", "score": "0.5360259", "text": "def subsystems\n @subsystems ||= params[:subsystem].to_s.remove(/\\s/).split(',')\n end", "title": "" }, { "docid": "1ebd140fa412149295811d9a6c8b00f5", "score": "0.535669", "text": "def create\n @sys_user = Sys::User.new(sys_user_params)\n\n respond_to do |format|\n if @sys_user.save\n format.html { redirect_to @sys_user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @sys_user }\n else\n format.html { render :new }\n format.json { render json: @sys_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db8c29f3183b8f778b4850589828adec", "score": "0.53219837", "text": "def new\n @system_configuration = SystemConfiguration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_configuration }\n end\n end", "title": "" }, { "docid": "1f3e17f38266d2d3dba62572198d245a", "score": "0.53136164", "text": "def set_sunsystem\n @sunsystem = Sunsystem.find(params[:id])\n end", "title": "" }, { "docid": "bac4c9ea67c0b00b585d0d5b6d91ce59", "score": "0.5301757", "text": "def new\n @system_config = SystemConfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @system_config }\n end\n end", "title": "" }, { "docid": "8eb3a925826527f176ee269caad37534", "score": "0.5298481", "text": "def index\n @systemadmins = Systemadmin.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @systemadmins }\n end\n end", "title": "" }, { "docid": "2a8603f1adf139a82ba8d50f3068e150", "score": "0.52931434", "text": "def bs_system_params\n params.require(:bs_system).permit(:bs_project_id, :name, :description, :db_connection_id, :delflag)\n end", "title": "" }, { "docid": "3721a21d460d604ff74ab042ed1b0346", "score": "0.5289389", "text": "def update\n respond_to do |format|\n if @simba_system.update(simba_system_params)\n format.html { redirect_to @simba_system, notice: 'Simba system was successfully updated.' }\n format.json { render :show, status: :ok, location: @simba_system }\n else\n format.html { render :edit }\n format.json { render json: @simba_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4dd902f595a5a48368650c0e04ead8e", "score": "0.52874464", "text": "def create\n @space_station = SpaceStation.new(space_station_params)\n\n if @space_station.save\n render json: @space_station, status: :created, location: @space_station\n else\n render json: @space_station.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3187e5bc0e5922a836c4a86aca932dee", "score": "0.52805066", "text": "def roster_system_params\n params.require(:roster_system).permit(:name, :numQuarterBacks, :numRunningBacks, :numWideReceivers, :numTightEnds, :numPlaceKickers, :numSpecialTeams, :numBench)\n end", "title": "" }, { "docid": "06491e46c5b794bb057e3accfbef9c69", "score": "0.5272772", "text": "def it_system_params\n params.require(:it_system).permit(:topic, :learning, :understood, :subject, :repeat)\n end", "title": "" }, { "docid": "d796b316a245961cf06d2db0cbc7b541", "score": "0.52714944", "text": "def create\n @slot_machine = SlotMachine.new(slot_machine_params)\n\n respond_to do |format|\n if @slot_machine.save\n format.html { redirect_to @slot_machine, notice: 'Slot machine was successfully created.' }\n format.json { render :show, status: :created, location: @slot_machine }\n else\n format.html { render :new }\n format.json { render json: @slot_machine.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f32b726c2e0c3eff6d938ce71d549f3", "score": "0.52681273", "text": "def new\n @systemuser = Systemuser.new\n @id = nil\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @systemuser }\n end\n end", "title": "" }, { "docid": "0de482b60dd40d604e7defb6ab9de6db", "score": "0.5236757", "text": "def show\n @system = System.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @system }\n end\n end", "title": "" }, { "docid": "468ab4b6e62d79bec9f3cd22742825fb", "score": "0.52366763", "text": "def create\n @drive_system = DriveSystem.new(params[:drive_system])\n @drive_system.truck_id = @drive_system.driver.truck_id\n respond_to do |format|\n if @drive_system.save\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully created.' }\n format.json { render json: @drive_system, status: :created, location: @drive_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf5b739e26c8459ce51d5c6bf975c969", "score": "0.5225215", "text": "def index\n @system_configs = SystemConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @system_configs }\n end\n end", "title": "" }, { "docid": "2635178f920ad614e8f39a513d221c43", "score": "0.52180535", "text": "def system_put_with_http_info(authorization, system, _opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemApi.system_put ...'\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n raise ArgumentError, \"Missing the required parameter 'authorization' when calling SystemApi.system_put\"\n end\n # verify the required parameter 'system' is set\n if @api_client.config.client_side_validation && system.nil?\n raise ArgumentError, \"Missing the required parameter 'system' when calling SystemApi.system_put\"\n end\n # resource path\n local_var_path = '/system'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:Authorization] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(system)\n auth_names = []\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: SystemApi#system_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n [data, status_code, headers]\n end", "title": "" }, { "docid": "1024a4c88e800b3c3f41239330061cc2", "score": "0.52126557", "text": "def create\n \t@system_rule.system = @system\n respond_to do |format|\n if @system_rule.save\n format.html { redirect_to([:admin, @system], notice: 'System Rule was successfully created.') }\n format.xml { render xml: @system_rule, status: :created, location: @system_rule }\n format.js\n website.add_log(user: current_user, action: \"Created system_rule: #{@system_rule.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @system_rule.errors, status: :unprocessable_entity }\n format.js { render template: \"admin/system_rules/create_error\" }\n end\n end\n end", "title": "" }, { "docid": "80c7519ab52f85492d1c4ab0df4cfac5", "score": "0.52096903", "text": "def system_locale_params\n params.require(:system).permit(:locale)\n end", "title": "" }, { "docid": "af2f142d9099a627d755215237f01d09", "score": "0.52067834", "text": "def create\n @mt_use_machine_subsystem_data = MtUseMachineSubsystemData.new(params[:mt_use_machine_subsystem_data])\n \n respond_to do |format|\n if @mt_use_machine_subsystem_data.save\n format.js { render :action => \"create_mt_use_machine_subsystem_data\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mt_use_machine_subsystem_data.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0ea6ce022176c2b1edb175a1ca58c66", "score": "0.52061313", "text": "def system_information_params\n params.require(:system_information).permit(:ram_available, :checked_at)\n end", "title": "" }, { "docid": "005acd742f09da49a3a763d1660fc1d2", "score": "0.520394", "text": "def get_systems_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_systems ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/systems/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].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 header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_systems\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "332a27ec63ac69ab08294d083ed55e55", "score": "0.5198809", "text": "def index\n @system_configurations = SystemConfiguration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @system_configurations }\n end\n end", "title": "" }, { "docid": "7a8d263580bcd10b8872cb067c35ec14", "score": "0.5195811", "text": "def create\n @piping_system = PipingSystem.new(params[:piping_system])\n\n respond_to do |format|\n if @piping_system.save\n format.html { redirect_to project_path(params[:piping_system][:project_id], notice: 'Piping system was successfully created.') }\n format.json { render json: @piping_system, status: :created, location: @piping_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @piping_system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccf78d08a0f6a51efcb9434acaf2d827", "score": "0.5181819", "text": "def create\n @hardware = Hardware.new(params[:hardware])\n\n respond_to do |format|\n if @hardware.save\n format.html { redirect_to @hardware, :notice => 'Hardware was successfully created.' }\n format.json { render :json => @hardware, :status => :created, :location => @hardware }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @hardware.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
f6f65f8a57666fc0589c6f71767abbdd
Is this user an admin?
[ { "docid": "62c054636755307e59bde7030ddcb809", "score": "0.0", "text": "def admin?\n roles.admin.exists?\n end", "title": "" } ]
[ { "docid": "5f4963a207169ba585fc0099ffb9ca4e", "score": "0.90494174", "text": "def user_admin?\n user_logged_in? && @current_user.type == 'Admin'\n end", "title": "" }, { "docid": "15495e5c6c5dc8bfcde20bac9825e64e", "score": "0.9018155", "text": "def is_admin?(user)\n user.admin > 0\n end", "title": "" }, { "docid": "ff1d7338655721f4c2a0629bb5540802", "score": "0.8990685", "text": "def admin_user?\n (current_user.role == 'admin') if logged_in?\n end", "title": "" }, { "docid": "4b20ca02efa66f3ec5acefd16b5f7d89", "score": "0.8912833", "text": "def is_admin?(user_id)\n\t\treturn admin == user_id\n\tend", "title": "" }, { "docid": "49ea45b9c06f6d5ccb5921706baf7414", "score": "0.89108783", "text": "def admin?\n user = check_user\n user.role == User.role_types['Admin']\n end", "title": "" }, { "docid": "f90912b26d14e5bf6b535d3f0cd51e29", "score": "0.8889145", "text": "def admin?\n return ( self.user_type == User::USER_TYPE_ADMIN )\n end", "title": "" }, { "docid": "c562c058a0d4026eec6e3025c107d4a1", "score": "0.88683397", "text": "def admin_user?\n if current_user != nil\n !!current_user.admin\n end\n end", "title": "" }, { "docid": "c99a780346c7e0c09ad21fb7ede2e3e4", "score": "0.8768015", "text": "def user_is_admin?\n\tbegin\n\t `gpresult /r /scope user`.split.include? \"Admin\"\n\trescue\n\t false\n\tend\n end", "title": "" }, { "docid": "21acfc8ad63bbc12e4aea648aa846d44", "score": "0.8735031", "text": "def admin?\n if(@current_user)\n @current_user.admin?\n end\n end", "title": "" }, { "docid": "d9dec9458d93f916d1565146597e2ff1", "score": "0.8733562", "text": "def is_admin?\n user_type == 'super_admin' || user_type == 'admin'\n end", "title": "" }, { "docid": "b4890b0535f033c51b74a5b29ba397a3", "score": "0.8730506", "text": "def admin?\n current_user.admin?\n end", "title": "" }, { "docid": "db360684c16f4b0e1868d207f453d3df", "score": "0.872982", "text": "def admin_user?\n member_type == MEMBER_TYPE[:admin]\n end", "title": "" }, { "docid": "3e7a16e816fdd7acb3bd8f80a1e6b9cb", "score": "0.8707218", "text": "def admin_user?\n session[:user][:uid] == APP_CONFIG[:admin]\n end", "title": "" }, { "docid": "4766a603f3097231538b39dbecc84219", "score": "0.8692745", "text": "def admin?\n logged_in? && current_user.admin\n end", "title": "" }, { "docid": "c6b00944ce4dd75a0ef018f040fb9642", "score": "0.86921906", "text": "def admin?\n self.user_type == TYPES[:admin]\n end", "title": "" }, { "docid": "53855d403cc2b8a00680fc254e4b5c8b", "score": "0.86814207", "text": "def admin?\n user.admin?\n end", "title": "" }, { "docid": "687c53759140096d3032d57784c8e8d1", "score": "0.8679822", "text": "def is_admin? (user)\n get_admins.any? {|admin|\n user =~ admin\n } && user.authed?\n end", "title": "" }, { "docid": "18251da5d00c47da95283f92f8effc53", "score": "0.8665958", "text": "def is_admin?\n return false unless logged_in?\n user = User.find_by_id(current_user)\n user.userstatus.status == \"admin\" ? true : false\n end", "title": "" }, { "docid": "8ff802af9694f520edcceb15c5af50e2", "score": "0.86627084", "text": "def is_admin?\n if valid_session?\n current_user.admin == true\n end\n end", "title": "" }, { "docid": "a27451a8e872be381bf88c14440ee9b0", "score": "0.86579484", "text": "def admin?\n @user.admin?\n end", "title": "" }, { "docid": "a5eb53ed64611f697fa622007326f14d", "score": "0.8657006", "text": "def admin_user?\n current_user.admin\n end", "title": "" }, { "docid": "1157c53964c99071ef95aab6bec98b48", "score": "0.86556965", "text": "def admin?(user)\n user.role_names.include?('cmsadmin')\n end", "title": "" }, { "docid": "09b3c5945efea8e27f2a4ae16f459ee7", "score": "0.86550826", "text": "def is_admin?\n current_user && current_user.try(:admin?)\n end", "title": "" }, { "docid": "50d8422ab05319c8c74260a17cde2586", "score": "0.8652058", "text": "def is_admin?\n is_admin == 1\n end", "title": "" }, { "docid": "64b54363f28f6f5bb111506478908718", "score": "0.8651631", "text": "def admin?\n if self.login == \"admin\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "a6f1e474659f3b7f3bad1c1b7fc3244b", "score": "0.86482555", "text": "def is_admin?\n current_user and current_user.is_admin?\n end", "title": "" }, { "docid": "f4992d59d5d8154105f66cbdfb281208", "score": "0.86466867", "text": "def current_user_is_admin\n\t\ttrue if current_user.admin == 't'\n\tend", "title": "" }, { "docid": "aa060ae8efc3b6fdac9a08a396d46247", "score": "0.86432344", "text": "def is_admin?\n current_user ? current_user.login == 'admin' : false\n end", "title": "" }, { "docid": "d29b41bbbe547b6e15e3a5e3216fe29a", "score": "0.8641384", "text": "def admin?\n user_role_id == UserRole::ADMIN\n end", "title": "" }, { "docid": "c581c4c7def4e4bb7bfccac89933d00a", "score": "0.8640437", "text": "def admin?\n User.admin_logged_in?\n end", "title": "" }, { "docid": "b536e1ac6cde14a510fb7062ef4d9415", "score": "0.8640078", "text": "def is_admin\n user = UserAdmin.find_by_user_id(current_user.id)\n if user and user.level > 1\n return true || false\n end\n end", "title": "" }, { "docid": "7dd5f585465825b71b0500b5ad762bc3", "score": "0.86382383", "text": "def admin?\n\t\tcurrent_user.try(:admin)\n\tend", "title": "" }, { "docid": "492c2ee75a4a79dfe20492f26d69a6af", "score": "0.8634568", "text": "def admin?\n user_signed_in? && current_user.admin?\n end", "title": "" }, { "docid": "5bc1511dbe4e4400d07470369c179313", "score": "0.8624343", "text": "def admin_user?\n\t\treturn self.user_category == \"admin\"\n\tend", "title": "" }, { "docid": "5cab6fb68f5e3ff9fd892b3ecd2f25c0", "score": "0.86240894", "text": "def user_admin?\n \t@admin_user = Usuario.find(session[:user_id]).admin\n end", "title": "" }, { "docid": "bf5fde8146f79771bb2eb9ff41ab243d", "score": "0.86194336", "text": "def admin?\n\t\tuser_session.admin?\n\tend", "title": "" }, { "docid": "84559a3cd8b84ec2e53a5b699d2e6137", "score": "0.8615503", "text": "def is_admin?\n determine_user_role\n if @admin_user || @superadmin_user\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "3be704de4a4c696c56b2aee6d7f743b7", "score": "0.861347", "text": "def admin?\n @user = current_user.is_admin?\n end", "title": "" }, { "docid": "246e1a3c8261f49bf6d39f8266b595a1", "score": "0.8611995", "text": "def admin_user?\n self.admin ==true\n end", "title": "" }, { "docid": "81520eb0c7c48eb2b8eddcc3c54847ec", "score": "0.8606571", "text": "def admin?\n user.class.name == Admin.name\n end", "title": "" }, { "docid": "d4409236e607f13f6ff31e8e3aec89e4", "score": "0.86026573", "text": "def admin?\n @current_user.admin?\n end", "title": "" }, { "docid": "7b4bd4be02b00bee4e5606886023ca5d", "score": "0.86014265", "text": "def admin?\n if user_signed_in? && current_user.user_level == 1\n return true\n end\n return false\n end", "title": "" }, { "docid": "ca2884f6984712171b60b0b07ca4ddd6", "score": "0.8601039", "text": "def is_admin_user?\n if user_signed_in? == false\n @is_admin = false\n else\n @is_admin = (current_user.email == \"jpwendt@asu.edu\")\n end\n end", "title": "" }, { "docid": "3fe7909a66c7c14b98a5a0f4b28e67c1", "score": "0.8601037", "text": "def admin_user\n @current_user.admin?\n end", "title": "" }, { "docid": "f30b17ba05eed007ff10501d217f6593", "score": "0.85978806", "text": "def is_admin? \n return (user_signed_in? and current_user.role == 1)\n end", "title": "" }, { "docid": "5f5a61fe5891d32b76cf0390384eed3c", "score": "0.85946", "text": "def admin?\n return false\n # return (session[:user_id] && User.find(session[:user_id])[:login] == '') ? true : false\n end", "title": "" }, { "docid": "d481d0b63b2bc6376194426137e90fb9", "score": "0.857536", "text": "def admin_user\n # get current user for session and check if they are an administrator\n check_admin_user = current_user\n return check_admin_user.admin?\n end", "title": "" }, { "docid": "0af174e481aceb2f4847317ddb55b18a", "score": "0.8565475", "text": "def admin_loggedin?\r\n @logged_in_user and @logged_in_user.admin?\r\n end", "title": "" }, { "docid": "fbc6b7f9c1b1be42e2d045a9a415256a", "score": "0.855454", "text": "def is_admin?\n if logged_in?\n current_user.role == \"Admin\"\n end\n end", "title": "" }, { "docid": "ec4ec16fbcef6eba1d9d4b4206386c16", "score": "0.8551735", "text": "def is_admin?\n self.is_admin == \"true\"\n end", "title": "" }, { "docid": "594633ce94e7826937c47e98ff997c92", "score": "0.8547157", "text": "def admin?\n logged_in? and current_user.admin?\n end", "title": "" }, { "docid": "570411aaff7f8052e763d4faf21a4809", "score": "0.8546841", "text": "def admin? \n (logged_in? && current_member.admin?) ? true : false\n end", "title": "" }, { "docid": "c765dcc4ec08b8dff9ee256759120cf4", "score": "0.85447025", "text": "def is_administrator?(user)\n user.admin == 2\n end", "title": "" }, { "docid": "5a9af3def9a5801aef9a98dc460a7ed8", "score": "0.85409707", "text": "def is_admin?\n\t current_account.user.is_a?(Administrator)\n\tend", "title": "" }, { "docid": "3fd0dad3262f6d455aae6c2205067c56", "score": "0.8533758", "text": "def is_admin?\n current_user && current_user.admin\n end", "title": "" }, { "docid": "2bfb78fa2bb734c1e6014621291a2143", "score": "0.8533269", "text": "def admin?\n @current_user && @current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "52d4499a1b717d49f0028da3dfd4d0c6", "score": "0.85297036", "text": "def is_admin?\n usertype == \"admin\" and id == 0\n end", "title": "" }, { "docid": "bcc3a30c367dd72e0cc1f5444956e3bf", "score": "0.85284615", "text": "def is_admin?\n logged_in? && current_user && current_user.admin\n end", "title": "" }, { "docid": "97b2f1f0fdec04644d2e0f97d435aa7d", "score": "0.8527887", "text": "def admin?\n logged_in? && current_user.admin?\n end", "title": "" }, { "docid": "6703bf9be06823d83c44674f9aba1707", "score": "0.85262823", "text": "def is_admin?\n role = self.role\n\n if(role == 'admin')\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "aa2e4b06a3d78c8a3dcbf0acc15ca620", "score": "0.852581", "text": "def admin?\n role == :admin\n end", "title": "" }, { "docid": "a37083d9563a873e90b1a399dfbe39dd", "score": "0.85170805", "text": "def logged_in_as_admin?\n current_admin != :false\n end", "title": "" }, { "docid": "56122e5779b870b3953a7b162e501a0f", "score": "0.8516935", "text": "def is_admin\n return Admin.find_by(email: session[:email]) != nil\n end", "title": "" }, { "docid": "20d85c28dffff901bba048e59115cb96", "score": "0.851264", "text": "def is_admin?(user)\r\n self.admins.one? { |email, admin| email == user.email }\r\n end", "title": "" }, { "docid": "9dac5b483bacc57162ba7e3f3993c7a9", "score": "0.8508547", "text": "def admin_access?\n admin?\n end", "title": "" }, { "docid": "3527779a2d7a6c8ad7233991a908e4a4", "score": "0.85076916", "text": "def admin_authorized?\n\t\tif @user\n\t\t\t@user.level >= ADMIN_USER_LEVEL \n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "title": "" }, { "docid": "84b085a7aa4428048d393ebaa07dab72", "score": "0.849607", "text": "def is_admin?\n current_user && current_user.admin?\n end", "title": "" }, { "docid": "b7ebebf54885308941169dd3a12da008", "score": "0.8494899", "text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "b7ebebf54885308941169dd3a12da008", "score": "0.8494899", "text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "b7ebebf54885308941169dd3a12da008", "score": "0.8494899", "text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "b7ebebf54885308941169dd3a12da008", "score": "0.8494899", "text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "b7ebebf54885308941169dd3a12da008", "score": "0.8494899", "text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end", "title": "" }, { "docid": "9d98ba35623121501233dae5f64e1eee", "score": "0.8489613", "text": "def admin?\n current_user.admin?\n end", "title": "" }, { "docid": "fa627e2912a5cbd68ae580401a690b44", "score": "0.84894687", "text": "def is_admin?\n return false if !current_user\n current_user.admin?\n end", "title": "" }, { "docid": "f35545539093097c84ce92077779753a", "score": "0.84877855", "text": "def isAdmin?\n if session[:perm] == 1\n return true;\n else\n return false;\n end\n end", "title": "" }, { "docid": "a78edae7621354bb9340fadffc6bce37", "score": "0.8478658", "text": "def is_admin?\n !!current_user.admin if !!current_user\n end", "title": "" }, { "docid": "e93dcefb41e8b5958d2f771163a5e5a2", "score": "0.84778893", "text": "def user_is_admin?\n\t`groups`.split.include? \"admin\"\n end", "title": "" }, { "docid": "f61d54b71edc819b8a37c4adc0fae995", "score": "0.8477132", "text": "def is_admin?\n current_user.role.eql?(\"admin\")\n end", "title": "" }, { "docid": "a11358cac73fd526535f8244a015b431", "score": "0.84733117", "text": "def is_admin\n admin?\n end", "title": "" }, { "docid": "823e0aa8636cd002b03f1373488a9a76", "score": "0.8468182", "text": "def is_admin?\n\t\treturn self.usertype == \"admin\"\n\tend", "title": "" }, { "docid": "7b329e8798c4f62b55f57cae2572dab6", "score": "0.8462305", "text": "def admin? ; user.instance_of? User and user.role >= 2 ; end", "title": "" }, { "docid": "f856986bc46d706f017358dce14566a4", "score": "0.84582424", "text": "def isuseradmin?\n if $credentials != nil\n isadminornot = User.where(:username => $credentials[0]).to_a.first\n @adminuser = \"#{isadminornot.username}\"\n if @adminuser == \"Admin\"\n return true\n else \n return false\n end\n end\n end", "title": "" }, { "docid": "9564e8c1f3db7b33126f9c1329bc1a8d", "score": "0.84570885", "text": "def normal_user?\n self.admin ==false\n end", "title": "" }, { "docid": "29680be0f74c395081263f7754a44e99", "score": "0.84569365", "text": "def admin\n is_user_in_role(ADMIN_ROLE_ID)\n end", "title": "" }, { "docid": "9a3c60be373e85918603904b80573fdb", "score": "0.84543014", "text": "def admin?\n if self.role == 'admin'\n true\n else\n false\n end\n end", "title": "" }, { "docid": "ac6a6b8ef5afb13eb0056c6b8a09d20e", "score": "0.8452766", "text": "def has_admin?\n has_auth? && current_person.is_admin\n end", "title": "" }, { "docid": "c88e96cb64c9b0b40918fc8cf94f1f07", "score": "0.84526086", "text": "def is_admin?\n admin?\n end", "title": "" }, { "docid": "25c96eb63d93d2fc0df46651dfb7950f", "score": "0.84517384", "text": "def is_admin\n\t\t\tif @admin == \"TRUE\"\n\t\t\t\treturn true\n\t\t\tend\n\t\t\treturn false\n\t\tend", "title": "" }, { "docid": "d3b9ced04e9982f2dd7ddcd6a2c9b6b6", "score": "0.84498346", "text": "def admin_logged_in?\n User.admin_logged_in?\n end", "title": "" }, { "docid": "d3b9ced04e9982f2dd7ddcd6a2c9b6b6", "score": "0.84498346", "text": "def admin_logged_in?\n User.admin_logged_in?\n end", "title": "" }, { "docid": "f06a9c3e7e1d784d2a314a2b36da69d1", "score": "0.8448815", "text": "def user_is_admin\n unless logged_in? and is_admin?\n respond_with_error(\n \"You must have admin permissions to perform this action.\", \n root_path)\n end\n end", "title": "" }, { "docid": "9ebd8c20568a985889865b7d1b1c9751", "score": "0.84477514", "text": "def admin?\n c_user = current_user\n not c_user.nil? and c_user.group==\"admin\"\n end", "title": "" }, { "docid": "51f77498acb8adba5c94da320b884539", "score": "0.8447068", "text": "def current_admin?(user)\n current_user.admin?\n end", "title": "" }, { "docid": "15c83073e90c60969f4e1d02dfbe99fe", "score": "0.8443101", "text": "def admin?\n current_user && current_user.role?(\"admin\")\n end", "title": "" }, { "docid": "d3e1097924ca877e1f2ba1066e189ef9", "score": "0.8440332", "text": "def is_admin?\n if login == \"ankit\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "721ab5de62404499a58fbfde7087fe77", "score": "0.8437017", "text": "def current_user_is_admin?\n current_user && current_user.is_admin\n end", "title": "" }, { "docid": "46f14b144692128623b38254b9951cc9", "score": "0.84368634", "text": "def adminlogged_in?\n !!current_administrator\n end", "title": "" }, { "docid": "52bee02bb37c3ca5194b89b1dace295d", "score": "0.8435944", "text": "def admin?\n self.role == 53\n end", "title": "" }, { "docid": "ee6eb9b7daaf7b372bdfe6e11bd4974e", "score": "0.8431946", "text": "def isAdmin?\n return current_usuario != nil && current_usuario.admin\n end", "title": "" }, { "docid": "da165449d70fa5cef43793b0cd48bee7", "score": "0.84312296", "text": "def is_admin?\n if user_signed_in?\n return current_user.is_admin\n else\n return false\n end\n end", "title": "" }, { "docid": "3574ee0b531ebb2e6b392f0ddb1011e6", "score": "0.8429492", "text": "def is_admin\n current_user.admin?\n end", "title": "" } ]
c50c25c6a4a1c44df1d232dacce3a864
Queries the InfoStore with the provided statement, returning an Array of InfoObject(s).
[ { "docid": "fb04b59c390acd0dffa5336bfc34417e", "score": "0.75354666", "text": "def query(stmt)\n sql = stmt.match(/^(path|query|cuid):\\/\\//i) ? path_to_sql(stmt) : stmt\n @infostore.query(sql).map{|o| InfoObject.new(o)}\n end", "title": "" } ]
[ { "docid": "cf5074710e7b99a619509cf6559d1e0d", "score": "0.62459695", "text": "def query(statement)\n collection = []\n @repos.each do |repo|\n self.class[repo].query(statement).each do |row| \n collection << row\n end\n end\n collection\n end", "title": "" }, { "docid": "d17ca9e04f56d81b6a83e1c738c6f6cc", "score": "0.6139804", "text": "def execute_as_array(sql)\n return_array = Array.new\n @db.results_as_hash = false\n self.execute(sql).each do |rec|\n return_array << rec[0]\n end\n @db.results_as_hash = true\n return_array\n end", "title": "" }, { "docid": "ebd981ce530bc9a29869d76995172348", "score": "0.5975364", "text": "def query_return_array(sql, *binds)\n connection.fetch(sql, *binds).all\n end", "title": "" }, { "docid": "6ee0c08806add6d5c59590022ee18477", "score": "0.5814476", "text": "def query table, query_array\n # TODO: add support for all potential tables\n items = []\n query_str = \"\"\n # Limiting to the supported tables Incident and Knowledge\n case table\n when Incident.table, Knowledge.table\n new_query = query_array.map { |q| \"number=#{q}\" }\n query_str = new_query.join('^OR')\n end\n\n unless query_str == \"\" # Don't actually query SL if we don't have any parameters\n sl_connection(table).get params: { \n sysparm_query: query_str, \n sysparm_limit: 20,\n sysparm_fields: 'number,sys_id,short_description,description,caller_id,text',\n sysparm_display_value: true,\n sysparm_exclude_reference_link: true\n }{ | response, request, result, &block |\n # p request\n case response.code\n when 200\n if result = JSON.parse(response)['result']\n result.each { |item| items << item }\n end\n end\n }\n end\n # Return either an empty array, or an array of hashes\n return items\n end", "title": "" }, { "docid": "63d6689ffeb43ab41a5acdd36894716a", "score": "0.57863027", "text": "def fetch(sql, *params)\n rs = self.execute(sql, *params)\n return [] if self.interpreter.preview? and not rs\n return rs.fetch_all\n end", "title": "" }, { "docid": "e74d14af993cabc8d807d7e0e9fd1f44", "score": "0.5762124", "text": "def query_single(sql, *params)\n result = run(sql, params)\n result.type_map = type_map\n if result.nfields == 1\n result.column_values(0)\n else\n tuples = result.ntuples\n fields = result.nfields\n\n array = []\n f = 0\n row = 0\n\n while row < tuples\n while f < fields\n array << result.getvalue(row, f)\n f += 1\n end\n f = 0\n row += 1\n end\n array\n end\n ensure\n result.clear if result\n end", "title": "" }, { "docid": "7ae7773761d9f0a2c84f3d21ced8d664", "score": "0.5760278", "text": "def query\n retval = []\n @sth.fetch_hash do |row|\n rowval = []\n row.each{|key,value| rowval.push([key, value])}\n retval.push(rowval)\n end\n @sth.finish\n return retval\n end", "title": "" }, { "docid": "f4a6bff4c7a776a4037fb0b1ce9ffe58", "score": "0.5700561", "text": "def fetch(query)\n exec(query).to_a\n end", "title": "" }, { "docid": "69dac8c31086c589d12cd1ae9736e922", "score": "0.5692701", "text": "def objects_list (query)\n begin\n types = \"('U','P','V','S')\"\n # types = \"('U','P','V','S','TR','R')\"\n sql = \"select name from sysobjects where type in\" + types\n query.sql(sql)\n return [] unless (query.cmd_done?)\n res = query.top_row_result\n return [] unless( res.kind_of?( SybResult) )\n return res.rows.flatten\n rescue\n return []\n end\nend", "title": "" }, { "docid": "a97d6a7deb6fa28e8437f6f13850b112", "score": "0.56482786", "text": "def eval_statement(statement)\n search_terms = results = []\n\n statement.each do |node|\n \n case node.type\n when :SELECT\n search_terms = node.search_terms\n when :FROM\n results = provider_lookup(node, search_terms)\n when :WHERE\n node.constraints.each do\n # results = send :method, results (or something like that)\n end\n end\n end\n\n results\n end", "title": "" }, { "docid": "f5230a9f8b489fb23a5a2e09ddd1ae6b", "score": "0.56132203", "text": "def query(statement='',*args)\n statement = yield if block_given?\n with_composed_sql(statement,*args) do |composed_sql|\n response = client.query(composed_sql)\n if response.respond_to?(:map)\n response.map do |row|\n # @todo Patch Mysql2 to support loading the primitives directly into custom class :as => CustomClass, and remove this map\n # @todo This is defeating Mysql2's lazy loading, but it's good for proof-of-concept\n self.new(row)\n end\n else\n response\n end\n end\n end", "title": "" }, { "docid": "5b245b4f5d04edf17668dfed5f3038af", "score": "0.55996656", "text": "def execute_query(query)\n DB[query].to_a\nend", "title": "" }, { "docid": "a37e8ee09c8b08c40298dc95fd7acc98", "score": "0.5577962", "text": "def fetch_all()\n if @query['type'] == Q_TABLE\n rows = Array.new\n @record_set.each do |row|\n rows << parse_tuple(row)\n end\n @index = Integer(rows.length)\n else\n raise MonetDBDataError, \"There is no record set currently available\"\n end\n\n return rows\n end", "title": "" }, { "docid": "6f886e390e17083a04cf226616922612", "score": "0.5547376", "text": "def query(s)\n res = @my.query(s)\n return nil if !res\n\n # \n out = []\n print(\"nr:\", res.num_rows, \"\\n\")\n fields = res.fetch_fields\n# fields.each do |f| print(\"FF:\", f.type, \"\\n\" )end\n res.each do |row|\n ent = {}\n fields.size.times do |fi|\n rn = fields[fi].name\n rt = fields[fi].type\n rv = conv(rt, row[fi])\n ent[rn] = rv\n# print( \"ent[#{rn}] = #{rv}, #{rv.class} #{rt}\\n\")\n end\n out.push(ent)\n end\n return out\n end", "title": "" }, { "docid": "d472e17fc98d4bd68e5c229a920d9673", "score": "0.5534246", "text": "def query_objects\n queries.values\n end", "title": "" }, { "docid": "24f8bdaa4101b7ffa190a3446e4538db", "score": "0.5525659", "text": "def query(sql, name = nil) #:nodoc:\n log(sql, name) do\n if @async\n res = @connection.async_exec(sql)\n else\n res = @connection.exec(sql)\n end\n return result_as_array(res)\n end\n end", "title": "" }, { "docid": "354c949b35053fa9769138d8ee786078", "score": "0.54740214", "text": "def query(sql)\n results = @connection.query sql\n end", "title": "" }, { "docid": "ca5e7eeb9e2558780c092a61c4e67080", "score": "0.54716784", "text": "def query(q)\n begin\n dbh = connect_to_mysql()\n query = dbh.prepare(q)\n query.execute() \n arr = []\n while row = query.fetch() do\n arr.push(row.to_a)\n end\n dbh.commit\n query.finish\n dbh.disconnect\n end\n\n# example data \n# row = [\"12440\",\"8268\",\"8204\",\"9018\",\"www.itv.com/22862523\",\"2010-06-14 01:20:00\",\"2010-06-14 02:30:00\",\"ITV1\",\"The Zone\"]\n# row1 = [\"12440\",\"4161\",\"4161\",\"9018\",\"fp.bbc.co.uk/5a6s28\",\"2010-06-14 00:05:00\",\"2010-06-14 00:10:00\",\"BBC ONE\",\"Weatherview\"]\n# arr.push(row)\n# arr.push(row1)\n return arr\nend", "title": "" }, { "docid": "ca5e7eeb9e2558780c092a61c4e67080", "score": "0.54716784", "text": "def query(q)\n begin\n dbh = connect_to_mysql()\n query = dbh.prepare(q)\n query.execute() \n arr = []\n while row = query.fetch() do\n arr.push(row.to_a)\n end\n dbh.commit\n query.finish\n dbh.disconnect\n end\n\n# example data \n# row = [\"12440\",\"8268\",\"8204\",\"9018\",\"www.itv.com/22862523\",\"2010-06-14 01:20:00\",\"2010-06-14 02:30:00\",\"ITV1\",\"The Zone\"]\n# row1 = [\"12440\",\"4161\",\"4161\",\"9018\",\"fp.bbc.co.uk/5a6s28\",\"2010-06-14 00:05:00\",\"2010-06-14 00:10:00\",\"BBC ONE\",\"Weatherview\"]\n# arr.push(row)\n# arr.push(row1)\n return arr\nend", "title": "" }, { "docid": "ca5e7eeb9e2558780c092a61c4e67080", "score": "0.54716784", "text": "def query(q)\n begin\n dbh = connect_to_mysql()\n query = dbh.prepare(q)\n query.execute() \n arr = []\n while row = query.fetch() do\n arr.push(row.to_a)\n end\n dbh.commit\n query.finish\n dbh.disconnect\n end\n\n# example data \n# row = [\"12440\",\"8268\",\"8204\",\"9018\",\"www.itv.com/22862523\",\"2010-06-14 01:20:00\",\"2010-06-14 02:30:00\",\"ITV1\",\"The Zone\"]\n# row1 = [\"12440\",\"4161\",\"4161\",\"9018\",\"fp.bbc.co.uk/5a6s28\",\"2010-06-14 00:05:00\",\"2010-06-14 00:10:00\",\"BBC ONE\",\"Weatherview\"]\n# arr.push(row)\n# arr.push(row1)\n return arr\nend", "title": "" }, { "docid": "4ae5387cc96016c1c1775744ca7d4415", "score": "0.5470085", "text": "def query(q)\n begin\n dbh = connect_to_mysql()\n query = dbh.prepare(q)\n query.execute() \n arr = []\n while row = query.fetch() do\n arr.push(row.to_a)\n end\n dbh.commit\n query.finish\n dbh.disconnect\n end\n \n return arr\nend", "title": "" }, { "docid": "c79585a03d4e2f7a216ee6c1cc8547ad", "score": "0.54662406", "text": "def query(soql)\n response = api_get 'query', q: soql\n mashify? ? response.body : response.body['records']\n end", "title": "" }, { "docid": "d63b1ba0ada1947672b537d574c34787", "score": "0.5433132", "text": "def sql_statement\n [\n [ :N, :sql_statement, [ :select_statement ] ],\n ]\n end", "title": "" }, { "docid": "745439d604a316c35b7b8e06fab19d75", "score": "0.5421219", "text": "def query(statement, limit = 30, token = nil)\n response = Hash.new\n response['results'] = Hash.new\n query, token = self.query!(statement, limit, token)\n query.each do |item|\n response['results'][item[:name]] = _parse(item[:attributes]) { |attrs| serializer.new(attrs).deserialize! }\n end\n response['token'] = token unless token.nil?\n return response\n end", "title": "" }, { "docid": "5b9674b967c99ab4f95a2cabdf7e100a", "score": "0.53679955", "text": "def _query(sql)\n \tresults = @client.query(sql, :as => :hash)\n \tresults\n end", "title": "" }, { "docid": "1cce722fc3a7efaf5333ada1fa677c51", "score": "0.5360471", "text": "def query sql \n\n # Create an instance of an ADO Recordset\n recordset = WIN32OLE.new 'ADODB.Recordset' \n\n # Open the recordset, using an SQL statement and the\n # existing ADO connection\n recordset.Open sql, @connection \n\n # Create and populate an array of field names\n @fields = []\n recordset.Fields.each {|f| @fields << f.Name }\n\n begin\n # Move to the first record/row, if any exist\n recordset.MoveFirst\n # Grab all records\n @data = recordset.GetRows\n rescue\n @data = []\n end\n\n # Close the recordset\n recordset.Close\n\n # An ADO Recordset's GetRows method returns an array\n # of columns, so we'll use the transpose method to\n # convert it to an array of rows\n @data = @data.transpose\n end", "title": "" }, { "docid": "2ad3e21e03391488910cf88c341aa7f0", "score": "0.53267574", "text": "def fetch_data(stmt)\n puts_log \"fetch_data\"\n if(stmt)\n begin\n return @servertype.select(stmt)\n rescue StandardError => fetch_error # Handle driver fetch errors\n error_msg = IBM_DB.getErrormsg(stmt, IBM_DB::DB_STMT )\n if error_msg && !error_msg.empty?\n raise StatementInvalid,\"Failed to retrieve data: #{error_msg}\"\n else\n error_msg = error_msg + \": #{fetch_error.message}\" if !fetch_error.message.empty?\n raise error_msg\n end\n ensure\n # Ensures to free the resources associated with the statement\n if stmt\n puts_log \"Free Statement #{stmt}\"\n IBM_DB.free_stmt(stmt)\n end\n end\n end\n end", "title": "" }, { "docid": "29588f0fe690c11ed088cc7bc98f7cc7", "score": "0.5315349", "text": "def query(sql, options={})\n quiet = options.fetch(:quiet, @quiet)\n\n log \"\\n#{sql}\\n\" unless quiet\n result_set = with_error_handling { @statement.execute_query(sql) }\n result_set ? ArrayOfHashesResult.new(result_set).result : nil\n end", "title": "" }, { "docid": "de01160553166d34190f8cc3a6ce312f", "score": "0.5311651", "text": "def exec_query(sql, name = nil, binds = [])\n result = nil\n get_cursor(sql, name, binds) do\n |cursor|\n result = Informix::Result.new(cursor.open.fetch_hash_all)\n end\n ActiveRecord::Result.new(result.fields, result.to_a) if result\n end", "title": "" }, { "docid": "29d3105a2ffa55ba93d4f6e535182db2", "score": "0.5276884", "text": "def select(sql, name = nil)\n log(sql, name) do\n reader = @connection.create_command(sql).execute_reader\n fields = reader.fields\n rows = []\n begin\n while reader.next!\n i = -1\n rows << Hash[*reader.values.map{|v| i+=1; [fields[i], typecast_value(v)]}.flatten]\n end\n ensure\n reader.close\n end\n rows\n end\n end", "title": "" }, { "docid": "a2f216c424b56082c06cdec5071afabf", "score": "0.52728516", "text": "def fetch_records(query)\n key = cache_key(FULL_TABLE)\n # retrieve the current version of the records\n current_version = version_store.current(key)\n # get the records from the cache if there is a current version\n records = current_version ? from_cache(key, current_version) : nil\n # logging (only in debug mode!) and statistics\n log_full_table_cache_hit(key, records)\n statistics.add(1, records ? 1 : 0) if statistics.active?\n # no records found?\n unless records\n # renew the version in case the version was not known\n current_version = version_store.renew(key) unless current_version\n # retrieve all records from the DB\n records = from_db(key, current_version)\n end\n # return the array\n records\n end", "title": "" }, { "docid": "73cc537abc1d66c0d505d931da402fd1", "score": "0.52582306", "text": "def query(sql, name = nil) #:nodoc:\n log(sql, name) do\n result_as_array @connection.async_exec(sql)\n end\n end", "title": "" }, { "docid": "f7879f91564b09eff884050a324f4fb3", "score": "0.52575624", "text": "def find_by_hql(hql)\n hql_result = connection.execute(hql)\n cells_in_native_array_format = hql_result.cells.map do |c| \n connection.cell_native_array(c.row_key, c.column_family, c.column_qualifier, c.value)\n end\n convert_cells_to_instantiated_rows(cells_in_native_array_format)\n end", "title": "" }, { "docid": "c954e3b39eb0b99952f46c35fb86fccb", "score": "0.52482504", "text": "def query(sql)\n\t\trecordset = WIN32OLE.new('ADODB.Recordset')\n\t\trecordset.Open(sql, @connection)\n\t\t@fields = []\n\t\trecordset.Fields.each do |field|\n\t\t\t@fields << field.Name\n\t\tend\n\t\t\n\t\tbegin\n\t\t\t# Transpose to have array of rows\n\t\t\t@data = recordset.GetRows.transpose\n\t\trescue\n\t\t\t@data = []\n\t\tend\n\t\t\n\t\trecordset.Close\n\tend", "title": "" }, { "docid": "0adf3514fbbe81fcb833a0e1a0c4ce8f", "score": "0.52381426", "text": "def all(sql, *args, into: nil, &block)\n pg_result = exec_logged(sql, *args)\n\n # enumerate the rows in pg_result. This returns either an Array of Hashes\n # (if into is set), or an array of row arrays or of singular values.\n #\n # Even if into is set to something different than a Hash, we'll convert\n # each row into a Hash initially, and only later convert it to the final\n # target type (via RowConverter.convert_ary). This is to allow to fill in\n # more entries later on.\n records = enumerate(pg_result, into: into)\n\n # optimization: If we wouldn't clear here the GC would do this later.\n pg_result.clear unless pg_result.autoclear?\n\n # [TODO] - resolve associations. Note that this is only possible if the type\n # is not an Array (i.e. into is nil)\n\n if sql.is_a?(Scope) && sql.paginated?\n records.send(:set_pagination_info, sql)\n end\n\n records.each(&block) if block\n records\n end", "title": "" }, { "docid": "b4fd204b51f9e722295f6268cfa9a2d3", "score": "0.5230949", "text": "def query(sql, name = nil) #:nodoc:\n log(sql, name) do\n result_as_array @connection.async_exec(sql)\n end\n end", "title": "" }, { "docid": "95a9798233f06ff5ce30891abb5befe2", "score": "0.52117044", "text": "def query(sql)\r\n\t\trecordset = WIN32OLE.new('ADODB.Recordset')\r\n\t\trecordset.Open(sql, @connection)\r\n\t\t# Retrieve the names of the fields into an array\r\n\t\t@fields = []\r\n\t\trecordset.Fields.each do |field|\r\n\t\t\t@fields << field.Name\r\n\t\tend\r\n\t\tbegin\r\n\t\t\t# Transpose to get an array of rows\r\n\t\t\t@data = recordset.GetRows.transpose\r\n\t\trescue\r\n\t\t\t@data = []\r\n\t\tend\r\n\t\trecordset.Close\r\n\tend", "title": "" }, { "docid": "5ef9b37b13aec6a781f0406e6f2a05f4", "score": "0.521135", "text": "def query_db(sql_statement)\n puts sql_statement\n # Defines which database is being accessed\n # Unfortunately hardcoded, but can be optimised later\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true\n # Finds the resulting output from the original inputted sql command\n results = db.execute sql_statement\n # Always close it so that it prevents any issues from arising in the future\n db.close\n results \n end", "title": "" }, { "docid": "a8cee1c44d03c1570e2989e6cc81fcc2", "score": "0.5202422", "text": "def all\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n results = CONNECTION.execute(\"SELECT * FROM #{table_name}\")\n\n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n \n return results_as_objects\n end", "title": "" }, { "docid": "9158f9d532a8964389597e93ca190e8d", "score": "0.51980674", "text": "def results\n return @results if defined? @results\n return [] if frozen?\n\n enforce_timezone do\n case query\n when /\\ADELETE/i\n @affected_rows = connection.delete(query, \"#{self.class.name} Delete\")\n\n when /\\AINSERT/i\n @last_insert_id = connection.insert(query, \"#{self.class.name} Insert\")\n\n when /\\AUPDATE/i\n @affected_rows = connection.update(query, \"#{self.class.name} Update\")\n\n when /\\ASELECT/i\n # Why not execute or select_rows? Because select_all hits the query cache.\n ar_results = connection.select_all(query, \"#{self.class.name} Select\")\n @hash_results = ar_results.to_ary\n @results = ar_results.rows\n else\n @results = connection.execute(query, \"#{self.class.name} Execute\").to_a\n end\n\n @results ||= []\n\n retrieve_found_row_count\n freeze\n\n @results\n end\n end", "title": "" }, { "docid": "1c575803121cdf896f2a0777c31d1ddb", "score": "0.51930976", "text": "def query_db(sql_statement)\n puts sql_statement #for command line debugging\n #connect to the database\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true #Don't want arrays!\n #do some SQL\n results = db.execute sql_statement\n #close the db\n db.close\n #return the results\n results #implicit return\nend", "title": "" }, { "docid": "da5832487e9383c79d9968c86d443cb1", "score": "0.51906544", "text": "def query_all(soql)\n version_guard(29.0) do\n response = api_get 'queryAll', q: soql\n mashify? ? response.body : response.body['records']\n end\n end", "title": "" }, { "docid": "2123615fee69b54d15aa4f72d42e58bd", "score": "0.51886964", "text": "def query(qrystring)\n results = Sentinel.client.query(qrystring)\n\n response = []\n results.each do |result|\n response << create_klass_from_result(result)\n end\n\n return response\n end", "title": "" }, { "docid": "8624e5a1110d432c8ceb84aaa743a697", "score": "0.51782745", "text": "def execute_sql\n result = []\n\t\t # Make sure we lock the sync engine's mutex\n\t\t # before we perform a database transaction.\n\t\t # This prevents concurrency issues.\n\t\t begin\n\t\t\tSyncEngine::lock_sync_mutex\n\t\t\tresult = yield\n\t\t\tSyncEngine::unlock_sync_mutex\n\t\t rescue Exception => e\n\t\t\tputs \"exception when running query: #{e}\"\n\t\t\t# make sure we unlock even if there's an error!\n\t\t\tSyncEngine::unlock_sync_mutex\n\t\t end\n puts \"returned #{result.length.to_s} records...\"\n result\n end", "title": "" }, { "docid": "35a40965e7fc94dcd16f547983491397", "score": "0.5170204", "text": "def fetch(options={})\n options = convert_options(options)\n Datastore.convert_exceptions do\n pquery.as_list(options)\n end \n end", "title": "" }, { "docid": "cc8e4d5a89886423f2573b6a0c600640", "score": "0.5166438", "text": "def give_me_all_rows(sql)\n db_row = []\n @sth = @dbh.execute(sql)\n db_row= @sth.map{ |row| row.to_a }\n return db_row\n end", "title": "" }, { "docid": "775e26bed4ab61d7a83f0e7ca6ebaaaf", "score": "0.516517", "text": "def query(statement, *params)\n @logger.info(\"#{statement}: #{params}\")\n @db.exec_params(statement, params)\n end", "title": "" }, { "docid": "a8c629d351956e2c3a7835e15a1059aa", "score": "0.51562625", "text": "def get_sighting_records(db)\n\n sighting_records = db.exec(\"select * from sighting_details order by id\")\n return sighting_records.to_a\n\nend", "title": "" }, { "docid": "16e0a45c928858ef0597fc17c749f2a6", "score": "0.51521343", "text": "def all\n results = DATABASE.execute(\"SELECT * FROM #{table_name}\")\n object_list = results_as_objects(results)\n end", "title": "" }, { "docid": "792e24c050a54cc0316c2f195d95a17e", "score": "0.5151246", "text": "def query(query, params = [])\r\n data = []\r\n q = create_query(query).bind_params(params).execute.fill(data).close\r\n #1.upto(data.first.size) do |i|\r\n # puts q.column_name(i)\r\n #end\r\n data\r\n end", "title": "" }, { "docid": "a684a1098fca457bbe405eadc3dff326", "score": "0.514425", "text": "def call(query)\n @conn.execute(query.to_s).to_a\n end", "title": "" }, { "docid": "8f9787c74795449bd443b5b3def5e21f", "score": "0.5143392", "text": "def select(sql, name = nil, binds = [])\n exec_query(sql, name, binds).to_a\n end", "title": "" }, { "docid": "3d06f13e3f0ef34449d2f332f0feaf88", "score": "0.5125417", "text": "def run_list_query(query)\n items = []\n query.each do |row|\n items << row[0]\n end\n return items\nend", "title": "" }, { "docid": "f7f18b46e40e88ba76dc343b954f2635", "score": "0.5109835", "text": "def all\n# Figure out the table's name from the class we're calling the method on.\n\ttable_name = self.to_s.pluralize.underscore\n\n\tresults = CONNECTION.execute(\"SELECT * FROM #{table_name}\")\n\n\tresults_as_objects = []\n\n\tresults.each do |result_hash|\nresults_as_objects << self.new(result_hash)\n\tend\n\n\treturn results_as_objects\n\tend", "title": "" }, { "docid": "15314457ce0532d148dadb2523d7c12b", "score": "0.5108616", "text": "def select(sql, name = nil, binds = [])\n exec_query(sql, name).to_a\n end", "title": "" }, { "docid": "2aab2fe6bf859265daae62858a1c379c", "score": "0.5106775", "text": "def query_db(sql_statement)\n # connect to database\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true\n # execute some SQL\n results = db.execute sql_statement\n # close the Database\n db.close\n # return the results/render\n results # implicitluy returned\n end", "title": "" }, { "docid": "c1ea778b2d2da68f4b1afc5f72b197f4", "score": "0.5104121", "text": "def read\n records = @connection.query do |statements|\n if @query.conditions.kind_of?(OrOperation)\n fail_native(\"Operation '#{@query.conditions.slug}'.\")\n else\n @query.conditions.each do |condition|\n condition_statement(statements, condition)\n end\n end\n\n if native? && !@query.order.empty?\n sort_statement(statements, @query.order)\n end\n\n statements.limit(@query.limit) if native? && @query.limit\n statements.no_pk\n end\n\n records.each do |record|\n @query.fields.each do |property|\n field = property.field\n record[field] = property.typecast(record[field])\n end\n end\n\n return records if native?\n # TODO: Move log entry out to adapter sublcass and use #name?\n DataMapper.logger.warn(\n \"TokyoAdapter: No native TableQuery support for conditions: #{@native.join(' ')}\"\n )\n @query.filter_records(records)\n end", "title": "" }, { "docid": "e7ded9cae9d62a4a2599c388977cc2ac", "score": "0.5103635", "text": "def query(statement, *params)\n puts \"DB: #{statement} -> #{params}\"\n @db.exec_params(statement, params)\n end", "title": "" }, { "docid": "4a72ff7a81f8ebcb5fdcb108a913bf0e", "score": "0.5096667", "text": "def query(sql)\r\n # Create an instance of an ADO Recordset\r\n recordset = WIN32OLE.new('ADODB.Recordset')\r\n \r\n # Open the recordset, using an SQL statement and the\r\n # existing ADO connection\r\n recordset.Open(sql, @connection)\r\n \r\n # Create and populate an array of field names\r\n fields = []\r\n data = []\r\n recordset.Fields.each do |field|\r\n fields << field.Name\r\n end\r\n \r\n begin\r\n # Move to the first record/row, if any exist\r\n recordset.MoveFirst\r\n \r\n # Grab all records\r\n data = recordset.GetRows\r\n rescue Exception => e\r\n # Do nothing, it's an empty recordset\r\n end\r\n recordset.Close\r\n \r\n # An ADO Recordset's GetRows method returns an array \r\n # of columns, so we'll use the transpose method to \r\n # convert it to an array of rows\r\n data = data.transpose\r\n \r\n result_set = []\r\n data.each { |row| result_set << Hash.create(fields, row) }\r\n \r\n return result_set\r\n end", "title": "" }, { "docid": "7008d55ec93ee52979a1be5338067a69", "score": "0.50814366", "text": "def get_data()\n begin\n conn = open_db() # open database for updating\n query = \"select * from tokens\"\n conn.prepare('q_statement', query)\n rs = conn.exec_prepared('q_statement')\n conn.exec(\"deallocate q_statement\")\n rs.to_a == [] ? (return []) : (return rs.to_a)\n rescue PG::Error => e\n puts 'Exception occurred'\n puts e.message\n ensure\n conn.close if conn\n end\nend", "title": "" }, { "docid": "671848375a630ef2c8218c8ed546fcdf", "score": "0.50641215", "text": "def query_db(sql_statement)\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true\n\n puts sql_statement # Optional but nice for debugging\n\n results = db.execute sql_statement\n db.close\n results # Implicit return\nend", "title": "" }, { "docid": "9bc835bb179943e5573ac600657c8f08", "score": "0.5053696", "text": "def get_records o_class , **args\n query = OrientSupport::OrientQuery.new classname(o_class), args\n\t self.queries << query.compose\n count = 0\n orientdb.get_records(o_class, query: query.compose).each{|c| records << c; count += 1}\n count\n end", "title": "" }, { "docid": "729901f5bf1a4d1b6986c04fc3d5ba40", "score": "0.5049803", "text": "def get_items\r\n DYNAMODB.scan(table_name: TABLE_NAME).items\r\nend", "title": "" }, { "docid": "a6045915ef04b0ca6b2f8e1939b4fe73", "score": "0.5045448", "text": "def query_db(sql_statement)\n puts sql_statement\n # Create a new connection to the 'database.sqlite3' using SQLite3 as our database adaptor, and store this connection in a variable called 'db'\n db = SQLite3::Database.new 'database.sqlite3'\n # We want the results to be returned as hashes >>(the default) arrays.\n db.results_as_hash = true\n results = db.execute sql_statement\n db.close\n results # implicit return you dont have to do it if\nend", "title": "" }, { "docid": "14169aec2171604bfd9e39dbc8773cdf", "score": "0.5044179", "text": "def index\n @statement_items = @statement.statement_items\n end", "title": "" }, { "docid": "3c1cedfc7ea707bdb492eb97a52e0606", "score": "0.50411564", "text": "def find_all\n results = []\n db.do_query(\"SELECT * from #{quoted_table_name}\") {|tup| results << self.new(tup)}\n results\n end", "title": "" }, { "docid": "0de2604cfa49900ec560e4500cbf5ee9", "score": "0.503238", "text": "def all\n results = DATABASE.execute(\"SELECT * FROM #{table_name}\")\n store_results = []\n results.each do |hash|\n store_results << self.new(hash)\n end\n return store_results\n end", "title": "" }, { "docid": "f0178501671b51d393424c9a359091fb", "score": "0.5031688", "text": "def get_results(query, conditions, order)\n domain = query.model.storage_name\n fields_to_request = query.fields.map{|f| f.field}\n fields_to_request << DmAdapterSimpledb::Record::METADATA_KEY\n output_list = fields_to_request.join(', ')\n query_call = \"SELECT #{output_list} FROM #{domain} \"\n query_call << \"WHERE #{conditions.compact.join(' AND ')}\" if conditions.length > 0\n query_call << \" #{order}\"\n if query.limit!=nil\n query_limit = query.limit\n query_call << \" LIMIT #{query.limit}\" \n else\n #on large items force the max limit\n query_limit = 999999999 #TODO hack for query.limit being nil\n #query_call << \" limit 2500\" #this doesn't work with continuation keys as it halts at the limit passed not just a limit per query.\n end\n records = select(query_call, query_limit)\n end", "title": "" }, { "docid": "a534664e4010dd8582309f50500d63f8", "score": "0.502478", "text": "def getArrayOfStudents()\n db = openDatabase\n arr = Array.new\n\n statement = db.prepare(\"select username from Users where role=?\")\n statement.bind_params(\"student\")\n\n # Pushes all student usernames from database into an array\n statement.execute.each do |row|\n arr.push(row[0])\n end\n return arr\nend", "title": "" }, { "docid": "e8bdf515d99f354a2e87ba84c0defe44", "score": "0.5022777", "text": "def query\n query = params[:query].gsub(/(\\n|\\t|\\r)/, ' ').gsub(/>\\s*</, '><').squeeze(' ').split(\"\\;\")\n query.reject!(&:blank?)\n logger.info(\"Parsed query: #{query.each{|t| puts t}}\")\n @results = []\n query.each{|q| @results << @server.sql.query(q)}\n #@results = @server.sql.query(params[:query])\n #logger.debug \"Results: #{@results.size} from connection #{@server.sql}\"\n logger.info @results.to_json\n respond_to do |format|\n format.json{render :json => @results.to_json}\n format.html\n end\n end", "title": "" }, { "docid": "e8bdf515d99f354a2e87ba84c0defe44", "score": "0.5022777", "text": "def query\n query = params[:query].gsub(/(\\n|\\t|\\r)/, ' ').gsub(/>\\s*</, '><').squeeze(' ').split(\"\\;\")\n query.reject!(&:blank?)\n logger.info(\"Parsed query: #{query.each{|t| puts t}}\")\n @results = []\n query.each{|q| @results << @server.sql.query(q)}\n #@results = @server.sql.query(params[:query])\n #logger.debug \"Results: #{@results.size} from connection #{@server.sql}\"\n logger.info @results.to_json\n respond_to do |format|\n format.json{render :json => @results.to_json}\n format.html\n end\n end", "title": "" }, { "docid": "d11a07fa53056610519d942554fe7c77", "score": "0.502201", "text": "def get_database_results(server, database, sql)\n $tracer.trace(\"GameStopDSL: #{__method__}, Line: #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n dbh = dbi_handle(server, database)\n sth = dbh.execute(sql)\n rows = []\n sth.fetch_hash { |h| rows << h }\n sth.finish\n dbh.disconnect if dbh\n return rows\n end", "title": "" }, { "docid": "68ae16af45002135edf82978da2d4f6d", "score": "0.50204176", "text": "def sql_get_arr(tables, fields, wclause, orderclause)\r\n str = \" select \" + fields + \" from \" + tables \r\n if (wclause.length > 0)\r\n str = str + \" where \" + wclause\r\n end\r\n if (orderclause.length > 0)\r\n str = str + \" order by \" + orderclause\r\n end\r\n arr = run(str)\r\n arr\r\nend", "title": "" }, { "docid": "2b80222ef288b9f17efb2ad87effdee3", "score": "0.5008627", "text": "def all(statement = \"SELECT * FROM #{table_name}\")\n sql(statement).each_with_object [] do |attrs, models|\n models << new(attrs)\n end\n end", "title": "" }, { "docid": "b86ed45d0992e4cbf8cf6deedee4432a", "score": "0.5000688", "text": "def query(statement, options = {})\n options = _mysql_query_options.merge(options)\n unless options.delete(:ignore_expiration)\n clear_expired_rows\n end\n logger.debug \"[#{statement}]\"\n res = @client.query statement, options\n {:resultset => res, :affected_rows => @client.affected_rows, :last_id => @client.last_id}\n rescue ::Mysql2::Error\n log_exception($!, statement)\n raise\n rescue\n logger.error %{Unhandled error in query: #{$!.inspect}\\nstatement=[#{statement}]\\n#{$!.backtrace.join(\"\\n\")}}\n raise\n end", "title": "" }, { "docid": "4f2afc73b18f0f605876a1ae9c6f498f", "score": "0.49985307", "text": "def get_info\n\tinfo = Array.new\n\ti = 1\n\twhile i < WS.num_rows\n\t\tinfo[i-1] = WS.rows[i]\n\t\ti += 1\n\tend\n\treturn info\nend", "title": "" }, { "docid": "abe1f724537e17e97bcde9edc566266c", "score": "0.4997375", "text": "def query\n state = Infra::Info.call(exclude_dynamic_info: true)\n end", "title": "" }, { "docid": "619c29ac1755ca1fd4686055cca15ee7", "score": "0.49953958", "text": "def select(sql, name = nil, binds = [])\n hdl = execute(sql, name)\n hdl.result_hashes\n end", "title": "" }, { "docid": "98a4f164c303a502997c2cc19cd62555", "score": "0.49901906", "text": "def find_by_sql(sql)\n connection.select_all(sql, \"#{name} Load\").inject([]) { |objects, record| objects << instantiate(record) }\n end", "title": "" }, { "docid": "0432d00109d0d1f262cbac7271a8d617", "score": "0.49897116", "text": "def index\n @info_queries = InfoQuery.all\n end", "title": "" }, { "docid": "ce289bb931d63b25edaee3fd72dc5921", "score": "0.49843302", "text": "def run(sql, options={})\n log(sql)\n result = []\n if(options[:hash])\n fetch_hashes(sql) do |r|\n result << r\n end\n else\n fetch_arrays(sql) do |r|\n result << r\n end\n end\n result\n end", "title": "" }, { "docid": "4b501f36f531f98245bf1ade37f833ff", "score": "0.498371", "text": "def query_db(sql_statement)\n puts sql_statement # Optional but very nice for debugging\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true\n results = db.execute sql_statement\n db.close\n results # implicit return\nend", "title": "" }, { "docid": "2c56033faf33e39599b9b66465f0f6fd", "score": "0.49737024", "text": "def getFootprints\n query_string = \"SELECT footprints.name\\n\"\n query_string << \"FROM footprints\\n;\"\n result = Array.new\n query(query_string) { |row|\n result.push(row[\"name\"])\n }\n\n end", "title": "" }, { "docid": "1adb38f8ca6247f18d4e743ef19bf05f", "score": "0.49731606", "text": "def results(query); end", "title": "" }, { "docid": "3b8c3ff475f55504d6f22ba4442ee097", "score": "0.4971262", "text": "def values\n statement.object\n end", "title": "" }, { "docid": "7cf305153885f8b196b9437c4f1eecb8", "score": "0.49706966", "text": "def find_by_sql(sql)\n result_set = connection.select_all(\n sanitize_sql(sql),\n \"#{name} Load\",\n )\n message_bus = ActiveSupport::Notifications.instrumenter\n payload = {\n record_count: result_set.length,\n class_name: name,\n }\n message_bus.instrument(\"instantiation.active_record\", payload) do\n result_set.map { |record| new(record) }\n end\n end", "title": "" }, { "docid": "2e6e1c256cea205f017906ced3986eca", "score": "0.49654976", "text": "def select(sql)\n raise(ArgumentError, \"Bad SQL parameter\") unless sql.kind_of?(String)\n\n client = ensure_connection\n Pod4.logger.debug(__FILE__){ \"select: #{sql}\" }\n\n rows = []\n client.exec(sql) do |query|\n oids = make_oid_hash(query)\n\n query.each do |r| \n row = cast_row_fudge(r, oids)\n\n if block_given? \n rows << yield(row)\n else\n rows << row\n end\n\n end\n end\n\n client.cancel \n rows\n\n rescue => e\n handle_error(e)\n end", "title": "" }, { "docid": "b6cbd3506ca2c67fb7d9e4faa7eb1564", "score": "0.4963082", "text": "def query(sql, name = nil) # :nodoc:\n mark_transaction_written_if_write(sql)\n\n log(sql, name) do\n with_raw_connection do |conn|\n conn.async_exec(sql).map_types!(@type_map_for_results).values\n end\n end\n end", "title": "" }, { "docid": "d1838aa728e4bb07c7b46e1d29e2c809", "score": "0.49577323", "text": "def query (&block)\n\n rs = do_query(&block)\n a = rs.to_a\n\n return a\n\n ensure\n rs && rs.free\n end", "title": "" }, { "docid": "8c75411c740aa695438c03db78b742a3", "score": "0.49563098", "text": "def run(str)\r\n arr = Assay.find_by_sql(str)\r\n #sql_msg(str)\r\n arr\r\nend", "title": "" }, { "docid": "cbb61a44a53a39d65f7aaf1ed898bef4", "score": "0.4949644", "text": "def fetch(query)\n exec(query).to_a.map(&:symbolize_keys)\n end", "title": "" }, { "docid": "2710e6fd85166b788c1af83ea89fdc60", "score": "0.4947906", "text": "def find_by_sql(*args)\n DataMapper::database.query(*args)\n end", "title": "" }, { "docid": "472edee21d1bfbe7971d71623b0181b1", "score": "0.4945725", "text": "def query(sql)\n results = ActiveRecord::Base.connection.execute(sql)\n if results.present?\n return results\n else\n return nil\n end\n end", "title": "" }, { "docid": "9d1415adacfe95bd1245df831b5920a0", "score": "0.4945193", "text": "def respond_list(_sQuery)\n begin\n oDb = SQLite3::Database.new(@sDbFile);\n puts(\"@ #{_sQuery}\");\n aObjs = oDb.execute(_sQuery).collect { |aRow|\n @oType.format_row(aRow);\n }\n return success(aObjs);\n rescue SQLite3::Exception => oException\n return error(\"respond_list: #{oException.to_s}\");\n ensure\n oDb.close if oDb;\n end\n end", "title": "" }, { "docid": "c6cda3628083f805ef3a272fbb352266", "score": "0.49451876", "text": "def query_db(sql_statement)\n puts sql_statement # Optional but nice for debugging\n db = SQLite3::Database.new 'database.sqlite3'\n db.results_as_hash = true\n results = db.execute sql_statement\n db.close\n results # Implicit return\nend", "title": "" }, { "docid": "d7e406248a0367c2488a462d78be8ec6", "score": "0.49449393", "text": "def query_all(soql)\n result = call_soap_api(:query_all, {:queryString => soql})\n QueryResult.new(result)\n end", "title": "" }, { "docid": "b0076414efc783ab9e3529d297b00f23", "score": "0.49428874", "text": "def execute(statement, *bind_values)\n Result.new([])\n end", "title": "" }, { "docid": "f446488c6912d78b01d03bc6612cf8c4", "score": "0.494017", "text": "def query(sql_statement, *params)\n # puts \"#{sql_statement} #{params}\"\n @logger.info \"#{sql_statement} #{params}\"\n @db.exec_params(sql_statement, params)\n end", "title": "" }, { "docid": "8597dd9129ad3d612c47ab0f906a632d", "score": "0.4939121", "text": "def fetch_data(query); end", "title": "" }, { "docid": "4c6bd79240bd46898cc8a9ab801e9f99", "score": "0.49388707", "text": "def get_statements()\n end", "title": "" } ]
6ea027035e660e254aba77f4bd9cb6e7
Generate a public/private key pair
[ { "docid": "12d32c4778d8888b03ccecb539bea399", "score": "0.83053005", "text": "def generate_key_pair\n\tg = 2\n\tp = generate_safe_prime(g)\n\td = rand(p)\n\te2 = ModMath.pow(g, d, p)\n\n\tpublic_key = [p, g, e2]\n\tprivate_key = [p, g, d]\n\n\treturn public_key, private_key\nend", "title": "" } ]
[ { "docid": "3aec3a8bfcc314ff374a6ddcc0ae8172", "score": "0.82887447", "text": "def generate_keypair\n key = OpenSSL::PKey::RSA.new 2048\n load_keypair(key.to_pem, key.public_key.to_pem)\n return [@private_key, @public_key]\n end", "title": "" }, { "docid": "5a610f6f7a87076677e0fc30473d07b1", "score": "0.7779332", "text": "def build_key(public_key, private_key)\n group = OpenSSL::PKey::EC::Group.new('prime256v1')\n key = OpenSSL::PKey::EC.new(group)\n\n public_bn = OpenSSL::BN.new(public_key, 16)\n private_bn = OpenSSL::BN.new(private_key, 16)\n public_key = OpenSSL::PKey::EC::Point.new(group, public_bn)\n\n key.tap do\n key.public_key = public_key\n key.private_key = private_bn\n end\n end", "title": "" }, { "docid": "31a2b0b5389f326514169de860c52b23", "score": "0.7738181", "text": "def create_public_private_rsa_key_pair_strings\r\n private_key = OpenSSL::PKey::RSA.new(2048)\r\n public_key = private_key.public_key\r\n private_public_key_strings_pair = {\r\n 'private_key_string' => private_key,\r\n 'public_key_string' => public_key\r\n }\r\n puts 'The randomly generated 2048-bit RSA private key string is:'\r\n puts private_public_key_strings_pair['private_key_string']\r\n puts 'The corresponding 2048-bit public key string is:'\r\n puts private_public_key_strings_pair['public_key_string']\r\n puts 'Keep a record of these key strings. You will not be able to properly ' \\\r\n 'encrypt and decrypt the contents of objects without these keys.'\r\n return private_public_key_strings_pair\r\nend", "title": "" }, { "docid": "3358f0012e0b782b42be1b195b05bf8f", "score": "0.7668881", "text": "def generate_keys\n key = OpenSSL::PKey::RSA.new 2048\n self.pubkey = key.public_key.to_s\n self.privkey = key.to_s\n self.save\n end", "title": "" }, { "docid": "f072f0e5181220a8a2a89b2d6f56d6f8", "score": "0.76259804", "text": "def generate\n key = Bitcoin::Key.generate.priv\n info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end", "title": "" }, { "docid": "fb0f47118d4dc04ce439ceccdfe078b7", "score": "0.75999683", "text": "def generate_key!\n unless priv_key\n tmp = OpenSSL::PKey.generate_key(self)\n set_key(tmp.pub_key, tmp.priv_key)\n end\n self\n end", "title": "" }, { "docid": "bd880c8c311faf788397937262b4018d", "score": "0.7570064", "text": "def generate\n key = Bitcoin::Key.generate.priv\n @log.info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end", "title": "" }, { "docid": "172b154ecbb605ac5878e8ca984503ec", "score": "0.7547779", "text": "def make_keypair\n\t gpg = OpenPGP::Engine::GnuPG.new(:homedir => '~/.gnupg')\n\t key_id = gpg.gen_key({\n\t\t :key_type => 'RSA',\n\t\t :key_length => 4096,\n\t\t :subkey_type => 'RSA',\n\t\t :subkey_length => 4096,\n\t\t :name => @dname,\n\t\t :comment => nil,\n\t\t #:email => '',\n\t\t #:passphrase => '',\n\t\t})\n\tend", "title": "" }, { "docid": "1419e30edbf8074e4f1b7d92307e10d0", "score": "0.7526839", "text": "def create(name, write_private)\n new_key = OpenSSL::PKey::RSA.generate(1024)\n new_public = new_key.public_key.to_pem\n new_private = new_key.to_pem\n File.open(File.join(@keystore, \"#{name}.pub\"), 'w') { |f| f.puts new_public }\n File.open(File.join(@keystore, \"#{name}.key\"), 'w') { |f| f.puts new_key } if write_private\n new_key\n end", "title": "" }, { "docid": "7eb24eb39c66127eefe1c3531462d31f", "score": "0.7428753", "text": "def generate_key_pair(compressed: true)\n private_key = 1 + SecureRandom.random_number(GROUP.order - 1)\n public_key = GROUP.generator.to_jacobian * private_key\n privkey = ECDSA::Format::IntegerOctetString.encode(private_key, 32)\n pubkey = public_key.to_affine.to_hex(compressed)\n [privkey.bth, pubkey]\n end", "title": "" }, { "docid": "a2fd132a334f0efe07c5174c0b23ab6b", "score": "0.7347502", "text": "def create\n @public_key = PublicKey.new\n\n new_key_pair = KeyDistributorHelper::generate_key_pair\n @public_key.key = new_key_pair.public_key\n\n # Get a non-matching public_key for the lulz!\n rand_public_key = begin PublicKey.offset(rand(PublicKey.count)).first.key rescue nil end\n\n # Put em together\n new_private_key = new_key_pair.private_key\n @key_pair = KeyDistributorHelper::KeyPair.new new_private_key, rand_public_key\n \n respond_to do |format|\n if @public_key.save\n format.html { render }\n format.json { render json: key_pair, status: :created }\n else\n format.html { render :new }\n format.json { render json: @public_key.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cba4ec5be210498acd27a1c6399f96ec", "score": "0.7260064", "text": "def make_keypair\n\t gpg = OpenPGP::Engine::GnuPG.new(:homedir => '~/.gnupg')\n\t key_id = gpg.gen_key({\n\t\t :key_type => 'DSA',\n\t\t :key_length => 1024,\n\t\t :subkey_type => 'ELG-E',\n\t\t :subkey_length => 1024,\n\t\t :name => @dname,\n\t\t :comment => nil,\n\t\t #:email => '',\n\t\t #:passphrase => '',\n\t\t})\n\tend", "title": "" }, { "docid": "277deae1a5d17d67aedc9cdf3450230e", "score": "0.7181698", "text": "def get_public_key(private_key)\n PointG1.from_private_key(private_key)\n end", "title": "" }, { "docid": "011f1794f17a60a55ce3db6b169ea795", "score": "0.7129229", "text": "def private_key\n OpenSSL::PKey::RSA.new(_keypair)\n end", "title": "" }, { "docid": "53d2185a7413bd808e331e4edf927b93", "score": "0.70843405", "text": "def generate_key # :nodoc:\n p, g = get_parameters\n\n asn1 = OpenSSL::ASN1::Sequence(\n [\n OpenSSL::ASN1::Integer(p),\n OpenSSL::ASN1::Integer(g)\n ]\n )\n\n dh_params = OpenSSL::PKey::DH.new(asn1.to_der)\n # XXX No private key size check! In theory the latter call should work but fails on OpenSSL 3.0 as\n # dh_paramgen_subprime_len is now reserved for DHX algorithm\n # key = OpenSSL::PKey.generate_key(dh_params, \"dh_paramgen_subprime_len\" => data[:need_bytes]/8)\n if OpenSSL::PKey.respond_to?(:generate_key)\n OpenSSL::PKey.generate_key(dh_params)\n else\n dh_params.generate_key!\n dh_params\n end\n end", "title": "" }, { "docid": "0d2daf9cc91a093f3d4627b08585ff00", "score": "0.7074308", "text": "def gen_key\n # get 2 random primes\n p, q = Prime.each.take_while {|x| x <= KEY_SPACE}.sample(2)\n # special easy case of Euler's totient function\n phi = (p-1)*(q-1)\n # calculate modulus, public key, and private key\n n = p*q\n e = get_public(phi)\n d = get_private(phi, e)\n # print results\n puts \"modulus: #{n}\"\n puts \"public key: #{e}\"\n puts \"private key: #{d}\"\n puts \"(internal information)\"\n puts \"phi: #{phi}\"\n puts \"p,q: #{p},#{q}\"\nend", "title": "" }, { "docid": "c36ba47965e56b95750ff9d7d62a9921", "score": "0.7065002", "text": "def generate_keys\n one = 1.to_bn\n # Gera os 2 numeros primos aleatorios\n p = OpenSSL::BN.generate_prime(512, safe=true)\n q = OpenSSL::BN.generate_prime(512, safe=true)\n # gera n\n n = p * q\n # Computa a função totiente phi(n) = (p -1) (q -1)\n phi_n = (p - one) * (q - one)\n # pega o valor de e (pega um primo aleatorio menor que que phi n e testa se é co-primo com phi(n))\n e = OpenSSL::BN.generate_prime(256, safe=true)\n while(phi_n.gcd(e) > one) do\n e = e + one\n end\n # calcula d, o inverso multiplicativo de e\n d = e.to_bn.mod_inverse(phi_n)\n pub_key = [n, e]\n pvt_key = [n, d]\n return [pub_key, pvt_key]\n end", "title": "" }, { "docid": "4a8d445f7ddd67e5c71bc07c4efb54eb", "score": "0.7025358", "text": "def public_key\n require_key\n\n @private_key.public_key.to_pem\n end", "title": "" }, { "docid": "e33974837a33e0120bfd0751a8de0338", "score": "0.70192474", "text": "def public_key(private_key)\n private_key_int = private_key.to_i(16)\n KeyGen::GROUP.generator.multiply_by_scalar(private_key_int)\n end", "title": "" }, { "docid": "654dc5740f587a63ee1f81c8974a35a3", "score": "0.70152473", "text": "def generate_key_pair(compressed: true)\n with_context do |context|\n ret, tries, max = 0, 0, 20\n while ret != 1\n raise 'secp256k1_ec_seckey_verify in generate_key_pair failed.' if tries >= max\n tries += 1\n priv_key = FFI::MemoryPointer.new(:uchar, 32).put_bytes(0, SecureRandom.random_bytes(32))\n ret = secp256k1_ec_seckey_verify(context, priv_key)\n end\n private_key = priv_key.read_string(32).bth\n [private_key, generate_pubkey_in_context(context, private_key, compressed: compressed)]\n end\n end", "title": "" }, { "docid": "b32f01843436147e9b21c7a0802c4312", "score": "0.70121753", "text": "def createkey(hostname, pupmodule, pubfolder, prvfolder)\n return 'Already there' if\n File.exist?(\"#{pubfolder}/#{pupmodule}/#{hostname}.cert.pem\")\n key = SelfSignedCertificate.new(hostname)\n FileUtils.mkdir_p \"#{pubfolder}/#{pupmodule}/\"\n FileUtils.mkdir_p \"#{prvfolder}/#{hostname}/#{pupmodule}/\"\n open \"#{pubfolder}/#{pupmodule}/#{hostname}.pub.pem\", 'w' do\n |io| io.write key.pub end\n open \"#{pubfolder}/#{pupmodule}/#{hostname}.cert.pem\", 'w' do\n |io| io.write key.crt end\n open \"#{prvfolder}/#{hostname}/#{pupmodule}/#{hostname}.priv.pem\", 'w' do\n |io| io.write key.priv end\n 'OK'\nend", "title": "" }, { "docid": "70262f2196ba327cfef79aa1cca28064", "score": "0.69934773", "text": "def gen_ec_pub_key(priv_key, priv_key_password = nil)\n # if the file exists try to read the content\n # if not assume we were passed the key and set the string to the content\n key_content = ::File.exist?(priv_key) ? File.read(priv_key) : priv_key\n key = ::OpenSSL::PKey::EC.new key_content, priv_key_password\n\n # Get curve type (prime256v1...)\n group = ::OpenSSL::PKey::EC::Group.new(key.group.curve_name)\n # Get Generator point & public point (priv * generator)\n generator = group.generator\n pub_point = generator.mul(key.private_key)\n key.public_key = pub_point\n\n # Public Key in pem\n public_key = ::OpenSSL::PKey::EC.new\n public_key.group = group\n public_key.public_key = pub_point\n public_key.to_pem\n end", "title": "" }, { "docid": "6e228d6bfb4c9f680aedb5fb62538716", "score": "0.69764316", "text": "def generate_pem\n OpenSSL::PKey::RSA.generate(2048)\nend", "title": "" }, { "docid": "ab33aa26222faf8deda211a051d84ad4", "score": "0.69640505", "text": "def public_key\n DH.new(to_der)\n end", "title": "" }, { "docid": "a324fcc641776941701c92315e29e8d7", "score": "0.6938981", "text": "def openssl_generate_key(*args,&block)\n keypair = OpenSSL::PKey::RSA.new CaHelper.ca_config['key_size']\n end", "title": "" }, { "docid": "9de2391910f516de40384e080d548072", "score": "0.6927006", "text": "def gen_ssh_key(sshkey, passphrase)\n if !File.exists?(sshkey + \".pub\") then\n if(passphrase) then\n key = SSHKey.generate(:type => \"RSA\", :bits => 2048, :passphrase => prompt_password())\n \n # Write the private key to the file system\n File.open(sshkey, \"w\") { |f| f.write(key.encrypted_private_key) }\n else\n key = SSHKey.generate(:type => \"RSA\", :bits => 2048)\n \n # Write the private key to the file system\n File.open(sshkey, \"w\") { |f| f.write(key.private_key) }\n end\n\n # Write the public key to the file system\n File.open(sshkey + \".pub\", \"w\") { |f| f.write(key.ssh_public_key) }\n end\n end", "title": "" }, { "docid": "494f7541017421fe9149ffd134b17a56", "score": "0.6906986", "text": "def create(pvt)\n key = Bitcoin::Key.new\n key.priv = pvt\n key.addr\n end", "title": "" }, { "docid": "f2990d6564f2c3708ce68d933fcba532", "score": "0.6896002", "text": "def private_key; end", "title": "" }, { "docid": "f2990d6564f2c3708ce68d933fcba532", "score": "0.6896002", "text": "def private_key; end", "title": "" }, { "docid": "aae0dd62c8a3641ac05f651f6337a177", "score": "0.687457", "text": "def generate_key; end", "title": "" }, { "docid": "c1192bb94938e689a0da357a39e106a8", "score": "0.6825251", "text": "def generate_rsa_keys(p, q)\r\n # Find \"n\", the product of two primes\r\n n = p * q\r\n # Calculate Euler's Totient For The Two Primes\r\n eulers_totient = (p - 1) * (q - 1)\r\n # Find Public Key \"e\" such that 1 < e < totient, e is coprime to totient\r\n key_public = 2\r\n loop do\r\n break if (key_public.gcd(eulers_totient) == 1)\r\n key_public += 1\r\n end\r\n # Find Private Key \"d\" such that e * d * mod(totient) = 1\r\n key_private = 1\r\n loop do\r\n key_private += 1\r\n break if ((key_public * key_private) % eulers_totient == 1)\r\n end\r\n # Public Key = (e,n), Private Key = (d,n)\r\n return [key_public, key_private, n]\r\nend", "title": "" }, { "docid": "730b223c74c5eedf9bd9434aad6f76fb", "score": "0.6823133", "text": "def public_key\n Akero.replate(@cert.to_s, Akero::PLATE_CERT)\n end", "title": "" }, { "docid": "90cd67ae9be999853da6854d7baddde1", "score": "0.6822268", "text": "def public_key\n public_key_object.to_pem\n end", "title": "" }, { "docid": "32f17da2b9ded4b30c3d401628e05680", "score": "0.68031627", "text": "def key\n ECDSA.build_key(public_key, private_key)\n end", "title": "" }, { "docid": "dee5c081bf15ff962e6741e58fce7dad", "score": "0.6798566", "text": "def generate\n Puppet.info \"Creating a new SSL key for #{name}\"\n @content = OpenSSL::PKey::RSA.new(Puppet[:keylength].to_i)\n end", "title": "" }, { "docid": "25c6e1731c84216e1d038be6b8b27ce1", "score": "0.67980504", "text": "def public_key\n @priv.public_key\n end", "title": "" }, { "docid": "3605cb39e3f21f2b0bec4ad67cb50da0", "score": "0.67577124", "text": "def generate_access_key\n access_keys.generate_new\n end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.6748504", "text": "def public_key; end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.6748504", "text": "def public_key; end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.6748504", "text": "def public_key; end", "title": "" }, { "docid": "8dfe795add843fc1f4da7e421ffb9b98", "score": "0.6739635", "text": "def builder_keypair\n if File.exists?(\"#{cluster_data_dir}/builder_key\")\n OpenSSL::PKey::RSA.new(File.read(\"#{cluster_data_dir}/builder_key\"))\n else\n OpenSSL::PKey::RSA.generate(2048)\n end\n end", "title": "" }, { "docid": "d2126abff6b68dd300289585b2ae5445", "score": "0.6733571", "text": "def gen_rsa_pub_key(priv_key, priv_key_password = nil)\n # if the file exists try to read the content\n # if not assume we were passed the key and set the string to the content\n key_content = ::File.exist?(priv_key) ? File.read(priv_key) : priv_key\n key = ::OpenSSL::PKey::RSA.new key_content, priv_key_password\n key.public_key.to_pem\n end", "title": "" }, { "docid": "d2126abff6b68dd300289585b2ae5445", "score": "0.6733571", "text": "def gen_rsa_pub_key(priv_key, priv_key_password = nil)\n # if the file exists try to read the content\n # if not assume we were passed the key and set the string to the content\n key_content = ::File.exist?(priv_key) ? File.read(priv_key) : priv_key\n key = ::OpenSSL::PKey::RSA.new key_content, priv_key_password\n key.public_key.to_pem\n end", "title": "" }, { "docid": "79e4064baefa4b6f3c8506381b850c2b", "score": "0.6712629", "text": "def generate_ssh_key_ruby(type=\"RSA\", bits = 2048, comment = \"OpenShift-Key\")\n key = RHC::Vendor::SSHKey.generate(:type => type,\n :bits => bits,\n :comment => comment)\n ssh_dir = RHC::Config.ssh_dir\n priv_key = RHC::Config.ssh_priv_key_file_path\n pub_key = RHC::Config.ssh_pub_key_file_path\n\n if File.exists?(priv_key)\n say \"SSH key already exists: #{priv_key}. Reusing...\"\n return nil\n else\n unless File.exists?(ssh_dir)\n FileUtils.mkdir_p(ssh_dir)\n File.chmod(0700, ssh_dir)\n end\n File.open(priv_key, 'w') {|f| f.write(key.private_key)}\n File.chmod(0600, priv_key)\n File.open(pub_key, 'w') {|f| f.write(key.ssh_public_key)}\n\n ssh_add\n end\n pub_key\n end", "title": "" }, { "docid": "8c3a12abbece1e6c08ff7b2522140fe4", "score": "0.6703339", "text": "def generate_keypair(rsa_bits = DEFAULT_RSA_BITS, digest = DEFAULT_DIGEST)\n cn = \"Akero #{Akero::VERSION}\"\n rsa = OpenSSL::PKey::RSA.new(rsa_bits)\n\n cert = OpenSSL::X509::Certificate.new\n cert.version = 3\n cert.serial = rand(2**42)\n name = OpenSSL::X509::Name.parse(\"/CN=#{cn}\")\n cert.subject = name\n cert.issuer = name\n cert.not_before = Time.now\n # valid until 2038-01-19 04:14:06 +0100\n cert.not_after = Time.at(2_147_483_646)\n cert.public_key = rsa.public_key\n\n ef = OpenSSL::X509::ExtensionFactory.new(nil, cert)\n ef.issuer_certificate = cert\n cert.extensions = [\n ef.create_extension('basicConstraints', 'CA:FALSE'),\n ef.create_extension('subjectKeyIdentifier', 'hash')\n ]\n aki = ef.create_extension('authorityKeyIdentifier',\n 'keyid:always,issuer:always')\n cert.add_extension(aki)\n cert.sign(rsa, digest.new)\n [rsa, cert]\n end", "title": "" }, { "docid": "30a9ea498575505db33d63562ded4ac5", "score": "0.6681327", "text": "def secret_keygen\n ('k' + Digest.hexencode(rand(9).to_s + self.message[0..2]) + self.id.to_s) \n end", "title": "" }, { "docid": "61b1b8d6a297433bf199030af134d8fc", "score": "0.6663203", "text": "def encrypted_private_key\n return private_key unless passphrase\n key_object.to_pem(OpenSSL::Cipher.new(\"AES-128-CBC\"), passphrase)\n end", "title": "" }, { "docid": "f47a3a8378ae61aedba94bd1c8cea69a", "score": "0.6660118", "text": "def private_key\n encode64(curve.private_key.to_s(2))\n end", "title": "" }, { "docid": "e914bbd2666a4d643412f058558162a7", "score": "0.66589415", "text": "def initialize\n key_pair = ECDSA.generate_key_pair\n self.private_key, self.public_key = key_pair.values_at(:private_key, :public_key)\n end", "title": "" }, { "docid": "d2492432ff753c583b4b5c9cb39855f9", "score": "0.6634708", "text": "def generate_key\n key = RbNaCl::Random.random_bytes(RbNaCl::SecretBox.key_bytes)\n Base64.strict_encode64 key\n end", "title": "" }, { "docid": "a0a45dbf1a61e2c3583605a4506a17df", "score": "0.663042", "text": "def create_keys_files(config_data,external_private_key_path,internal_private_key_path,internal_public_key_path)\n if !File.exist?(external_private_key_path) and !File.exist?(internal_private_key_path)\n File.open(external_private_key_path, \"w\") do |f|\n config_data['keys']['external_private_key'].each { |element| f.puts(element) }\n end\n File.chmod(0600,external_private_key_path)\n File.open(internal_private_key_path, \"w\") do |f|\n config_data['keys']['internal_private_key'].each { |element| f.puts(element) }\n end\n File.chmod(0600,internal_private_key_path)\n end\n if !File.exist?(internal_public_key_path)\n shell_cmd = \"ssh-keygen -y -f #{internal_private_key_path}\"\n generated_key = %x[ #{shell_cmd} ]\n File.open(internal_public_key_path, \"w\") do |f|\n f.puts(generated_key)\n end\n end\nend", "title": "" }, { "docid": "1a72bb2f1680a5c81b92282f5eb33610", "score": "0.6628454", "text": "def private_key\n @priv\n end", "title": "" }, { "docid": "241502c75b60b6d420afa7aac272f2dd", "score": "0.66153675", "text": "def generate_key(compressed: true)\n privkey, pubkey = generate_key_pair(compressed: compressed)\n Tapyrus::Key.new(priv_key: privkey, pubkey: pubkey, compressed: compressed)\n end", "title": "" }, { "docid": "c488f7c936889fa8be23a13bdd58f166", "score": "0.660612", "text": "def private_key\n @private_key.to_der\n end", "title": "" }, { "docid": "05f73d73ba4266a10be5258f5da8e80f", "score": "0.6598985", "text": "def private_key\n # jruby-openssl OpenSSL::PKey::EC support isn't complete\n # https://github.com/jruby/jruby-openssl/issues/189\n jruby_not_implemented(\"OpenSSL::PKey::EC is not fully implemented\") if type == \"ecdsa\"\n\n key_object.to_pem\n end", "title": "" }, { "docid": "7fc5556647eef26ca334847fc81dfd36", "score": "0.6593773", "text": "def public_key\n @public_key.to_der\n end", "title": "" }, { "docid": "62d924b0346411b5ae9c79bb4e98be92", "score": "0.6576572", "text": "def public_key\n @pub\n end", "title": "" }, { "docid": "30891aa73113e3bd90abeb2a8e5b92dd", "score": "0.6573044", "text": "def generate_ecdsa!\n if !File.exists?('public_key.ecdsa.pem')\n puts 'generating new ECDSA key pair'\n\n # First, choose a recommended curve\n ecdsa_key = OpenSSL::PKey::EC.new 'secp384r1'\n\n # Generate private key\n ecdsa_key.generate_key\n\n # Now generate a corresponding public key\n ecdsa_public = OpenSSL::PKey::EC.new ecdsa_key\n ecdsa_public.private_key = nil\n\n # store public key\n open 'public_key.ecdsa.pem', 'w' do |io|\n io.write ecdsa_public.to_pem\n end\n\n # encrypt and store private key\n encypt_and_store(ecdsa_key, 'private.ecdsa.secure.pem')\n\n # return the private key\n key = ecdsa_key\n else\n puts 'loading existing ECDSA key pair'\n key_pem = File.read 'private.ecdsa.secure.pem'\n key = OpenSSL::PKey::EC.new key_pem, DECRYPT_PASSPHRASE\n end\n\n return key\n end", "title": "" }, { "docid": "66c40a4a6914b4e63d4fbc5cdf3c45f7", "score": "0.6564931", "text": "def public_key\n encode64(curve.public_key.to_bn.to_s(2))\n end", "title": "" }, { "docid": "f5d919fba2dca7531fe3bb54e8eb575a", "score": "0.65592074", "text": "def generate_key\n self.key = SecureRandom.hex(KEY_LENGTH / 2)\n end", "title": "" }, { "docid": "e178a7afd7ef8dd29e54af2d1ec16678", "score": "0.6555219", "text": "def public_key\n OpenSSL::PKey.read(public_to_der)\n end", "title": "" }, { "docid": "e178a7afd7ef8dd29e54af2d1ec16678", "score": "0.6555219", "text": "def public_key\n OpenSSL::PKey.read(public_to_der)\n end", "title": "" }, { "docid": "fecef7128cc066ced20eccc9b43b1879", "score": "0.6533988", "text": "def load_keypair(private_key, public_key)\n @private_key = private_key\n @public_key = public_key\n @private_rsa = OpenSSL::PKey::RSA.new @private_key\n @public_rsa = OpenSSL::PKey::RSA.new @public_key\n end", "title": "" }, { "docid": "5ab254444198ece75a789560a137fe3d", "score": "0.6523422", "text": "def generate_key\n puts \"please enter return 3 times\"\n cmd = \"ssh-keygen -t rsa\"\n `#{cmd}`\n end", "title": "" }, { "docid": "77cc57edc7764adbea7840fa9c68ac55", "score": "0.6515481", "text": "def regen_key\n @user = current_user\n @user.regen_private_key\n send_data @user.private_key, :type => \"application/pem-keys\", :disposition => \"attachment\", :filename => \"#{@user.username}.pem\"\n end", "title": "" }, { "docid": "6a8e0c65653aaf06acc98de06874e52e", "score": "0.65061647", "text": "def generate_key(compressed: true)\n privkey, pubkey = generate_key_pair(compressed: compressed)\n Bitcoin::Key.new(priv_key: privkey, pubkey: pubkey, compressed: compressed)\n end", "title": "" }, { "docid": "384ece9d455eb5802bfad3b37a3be9d4", "score": "0.6487693", "text": "def key_generator; end", "title": "" }, { "docid": "384ece9d455eb5802bfad3b37a3be9d4", "score": "0.6487693", "text": "def key_generator; end", "title": "" }, { "docid": "5462c548e48b3120b10bf18732391ae1", "score": "0.6473258", "text": "def createkey(hostname, pupmodule, pubfolder, prvfolder, subject, ca_key_file,\nca_crt_file, passphrase)\n return 'Already there' if\n File.exist?(\"#{pubfolder}/#{pupmodule}/#{hostname}.cert.pem\")\n ca_key = OpenSSL::PKey::RSA.new File.read(ca_key_file), passphrase\n ca_cert = OpenSSL::X509::Certificate.new File.read ca_crt_file\n c=SignedCertificate.new(ca_key, ca_cert, subject)\n FileUtils.mkdir_p \"#{pubfolder}/#{pupmodule}/\"\n FileUtils.mkdir_p \"#{prvfolder}/#{hostname}/#{pupmodule}/\"\n #open \"#{pubfolder}/#{pupmodule}/#{hostname}.pub.pem\", 'w' do\n #|io| io.write c.key.public_key.to_pem end\n #open \"#{pubfolder}/#{pupmodule}/#{hostname}.csr.pem\", 'w' do\n #|io| io.write c.csr.to_pem end\n open \"#{pubfolder}/#{pupmodule}/#{hostname}.cert.pem\", 'w' do\n |io| io.write c.cert.to_pem end\n open \"#{prvfolder}/#{hostname}/#{pupmodule}/#{hostname}.priv.pem\", 'w' do\n |io| io.write c.key.to_pem end\n 'OK'\nend", "title": "" }, { "docid": "22dc935770de7783eedf1b9ce9053e55", "score": "0.6469408", "text": "def get_key(address)\n privkey = get_private_key address\n key = Bitcoin::Key.from_base58(privkey)\n key\nend", "title": "" }, { "docid": "932bf155ac9734f78cefad588b93867c", "score": "0.6459155", "text": "def generate_key( username, password, contract)\n response_xml = self.call( :generate_key, message: {\n arg0: username,\n arg1: password,\n arg2: contract\n })\n response = IssueCentre::Response.parse( response_xml,\n {contract_id: contract})\n end", "title": "" }, { "docid": "f211db1750e78f89b523b2975bf8176b", "score": "0.64568144", "text": "def create_key\n self.key = Digest::MD5.hexdigest(self.official_id.to_s + self.sent_to_email)\n end", "title": "" }, { "docid": "46b4ceae7da7597b4bd51b6f9e0d239b", "score": "0.6452808", "text": "def export_public_key\n public_key = context.crypto.extract_public_key(private_key)\n VirgilBuffer.from_bytes(context.crypto.export_public_key(public_key))\n end", "title": "" }, { "docid": "dabb03ab166a4407b3daad3adb5d3d28", "score": "0.64148724", "text": "def regenerate_private_key! length = private_key_length\n self[:kopal_encoded_private_key] =\n Base64::encode64(OpenSSL::PKey::RSA.new(length).to_pem)\n end", "title": "" }, { "docid": "9716b0917e08d7be5a0c3efd9425d4a8", "score": "0.6410733", "text": "def public_key\n as_public_key(rpc(:account_key, _access: :key))\n end", "title": "" }, { "docid": "fc784fd103a27164b01b87e8e4707b5a", "score": "0.63944966", "text": "def public_key\n encode_tz(:edpk, 32)\n end", "title": "" }, { "docid": "c01066a5bb136282c9d5895288a9f474", "score": "0.6392718", "text": "def get_private_key\n return @private_key\n end", "title": "" }, { "docid": "d67cae0fdff47b0151cca585e270e87e", "score": "0.6389696", "text": "def gen_ec_priv_key(curve)\n raise TypeError, \"curve must be a string\" unless curve.is_a?(String)\n raise ArgumentError, \"Specified curve is not available on this system\" unless %w{prime256v1 secp384r1 secp521r1}.include?(curve)\n\n ::OpenSSL::PKey::EC.new(curve).generate_key\n end", "title": "" }, { "docid": "3188a0905ca55ff8606c85052ae669d2", "score": "0.63896734", "text": "def generate(socket, distinguished_name)\n attributes = {\n :type => :client,\n :subject => distinguished_name\n }\n keypair, certificate = server.depot.generate_keypair_and_certificate(attributes)\n socket.write keypair.private_key.to_s\n socket.write certificate.certificate.to_s\n end", "title": "" }, { "docid": "9ad04e5fce9856670d9d426fb384dc64", "score": "0.6389215", "text": "def gen_key(info = {})\n stdin, stdout, stderr = exec3(:gen_key) do |stdin, stdout, stderr|\n stdin.puts \"Key-Type: #{info[:key_type]}\" if info[:key_type]\n stdin.puts \"Key-Length: #{info[:key_length]}\" if info[:key_length]\n stdin.puts \"Subkey-Type: #{info[:subkey_type]}\" if info[:subkey_type]\n stdin.puts \"Subkey-Length: #{info[:subkey_length]}\" if info[:subkey_length]\n stdin.puts \"Name-Real: #{info[:name]}\" if info[:name]\n stdin.puts \"Name-Comment: #{info[:comment]}\" if info[:comment]\n stdin.puts \"Name-Email: #{info[:email]}\" if info[:email]\n stdin.puts \"Expire-Date: #{info[:expire_date]}\" if info[:expire_date]\n stdin.puts \"Passphrase: #{info[:passphrase]}\" if info[:passphrase]\n stdin.puts \"%commit\"\n end\n stderr.each_line do |line|\n if (line = line.chomp) =~ /^gpg: key ([0-9A-F]+) marked as ultimately trusted/\n return $1.to_i(16) # the key ID\n end\n end\n return nil\n end", "title": "" }, { "docid": "f4b8e734dd6a76fdfaf1ac51f405446e", "score": "0.63872707", "text": "def set_keypair\n # The generated keypair is stored in PEM encoding.\n self._keypair ||= OpenSSL::PKey::RSA.new(2048).to_pem\n self.jwk_kid = public_jwk.kid\n end", "title": "" }, { "docid": "f4b8e734dd6a76fdfaf1ac51f405446e", "score": "0.63872707", "text": "def set_keypair\n # The generated keypair is stored in PEM encoding.\n self._keypair ||= OpenSSL::PKey::RSA.new(2048).to_pem\n self.jwk_kid = public_jwk.kid\n end", "title": "" }, { "docid": "6028d9e0ea955776d5a905deec2262ea", "score": "0.6382725", "text": "def generate_keys(from_wallet_name, master_key)\n ks = { 'master' => master_key }\n %w(recovery money social memo).each do |role|\n private_key = Xgt::Ruby::Auth.generate_wif(from_wallet_name, master_key, 'recovery')\n public_key = Xgt::Ruby::Auth.wif_to_public_key(private_key, @address_prefix)\n ks[\"#{role}_private\"] = private_key\n ks[\"#{role}_public\"] = public_key\n end\n ks['wallet_name'] = Xgt::Ruby::Auth.generate_wallet_name(ks['recovery_public'])\n ks\nend", "title": "" }, { "docid": "500c514ccaee9667c7158465eb17e7a2", "score": "0.6351911", "text": "def private_key!\n if self[:kopal_encoded_private_key].blank?\n regenerate_private_key!\n end\n OpenSSL::PKey::RSA.new Base64::decode64(self[:kopal_encoded_private_key])\n end", "title": "" }, { "docid": "829241ba6ad9b3f1da0e106e3d068aea", "score": "0.63514936", "text": "def private_key\n\t '-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,3D37CD3A313CADA2 7c1TAxzv6Gn2OmZzVNtEnU9lqrEwRL65huGc9ewQQ7senY3rkBgIqBzqVarAfS0I 6OMimI57q7XywAiFn7CZ+L7fbXdNuvmGx5JDNRwylgGWR+hPi9JMKEAP1yjdJPRS 608pDXIliz5bO0GdvufQxQ91MPjE4Bs5AT8TIE3bzuFllBYJD/mLpkK4bOjLHswI 7W7afVctpYaRAwzb64Z+gUQZL0BIcQzG2wYvFU3vAs5sCtEy9o7riY/bBi78EEH6 go01DkgYLt8M7ApTwblJNJR0G/8bwy3oDgdieM42sFLzftxwjeBhIiF1ExH+KuYA ftAcROOfr8rduvNNc6jJcx2lyze+4joPjHDBXZr27bg3o3SwOQCIXUHe0DHG0PHn TbZkL2btHH36mTMq0j6P9R4t1wLhJ8Pq2LjLDwLhXw3Tb8aIX1tpShxyy9Yv8F84 Q6dfBLe4yqmvW1Db2nGmZ++gPua2OGWuNXwjivt2XrZ0fGAGri5j9bsqyvDsHwUS aRs8PaG97rgmyRGHYUoicBdgeFZhBHSLlU5F6RNUTOgK9QAHP4+bdKbMQxvhveh8 +v9o7Xa7BlqEvUYXIfBwEbHZoJx4t90XSndSS3chlfoEb6vcxOBmplUZlWs55aSL U7dW1MaE48Afav6TtM2VsN9RzwU8QSplpm7z9C9xkYVBMN6UcKIbnHH1yXdhTGEG uaEvPrtSh+BroAx1OmMjkmb0s1PjgDqLEtaYifP1OXgSS3uTqPBcpgUZDnuYQZmW Ihv7SvGdyWVQUgpv5LukyZPhXdlsCQ+8TlEYn4MOl87uxqo3KCVzVdmhAx2PWS/q wLcyOq0wJuvgAAtmI4/EnXVaP5P6WQ7rixfxdDfR1nI5TnDQkgs2xquyb0cms0J+ hXkIGvQOMAzq2Js3Ad7qyiklDASR20zZt6JPKTgZpLq682Fx+LJCCryAqjye2nAI 0w5SHEd80J/lAUEYo/HrNDBWS0JzD4lfERwUxgXxvynFI1ak38h0YP9RR2ka0pMI DJ8G6/w3Ir1qgLM/E+bTvp1YE683J/j1+vdYC/eoAbki2wgJAitYFdexLpw/qMvj xonY4iyhVkgzQb0GObesjPhr0CQ1gRC8p/A68Pk4cXejKTO95gUnD682Mu6lgYXQ e3rEnNVUruiPEzMKbkPLIsaWfUKfGRb0okQmuISXEfjyLfjkUgD6bxes+9KuHdvj pZze3dOgB1W6ZGsbrQ8ooXAOewYbhDcEqVsPOItVBoZ14CmCSd1X8RiW1dnfZBLa 5W8L7HaVLgiKUWlu2N6BE3etMK/fzhLh1K8WT6PxqzqVfJZZ9TYwVSYbcJuej0Hf ioHwYgqO22aZrp+ciJplCyOooFOKVVW45iLPtSHX64aE6FKbdPEPcndIOl0J9ah0 Hwicaw0ADP4STb83NysAZdHO2UVNEERkp2P4XmgeeH3gYHhPv3xCbbDejrrRJjeq VRer8i6HxiuJ/SxNKvbiwztF/44nWJ+9m2FoNqumTITdQAx7VU3681uEsO9ZbsJU Lbt0zwxna4X6WEtjdy5ExqLlU+wnzWgG+I11vgXSarye2oTuGPK8wjBkfEqdRTxs -----END RSA PRIVATE KEY----- '\n\tend", "title": "" }, { "docid": "66cc3fdda662c82d45955040a1bb0e60", "score": "0.6340213", "text": "def create\n @private_key = User.where(login: params[:api][:login]).first.generate_private_key!\n end", "title": "" }, { "docid": "923ec2d8b39d94f4f1176d25267423f1", "score": "0.63358516", "text": "def generate_key\n SecureRandom.hex(32)\nend", "title": "" }, { "docid": "f882cb069c99d9389dd7ec3c369a2059", "score": "0.6325906", "text": "def generate_keypair(*args)\n options[:keypair] = \"#{parent && parent.is_a?(PoolParty::Pool::Pool) ? parent.name : \"poolparty\"}_#{name}\" unless has_keypair?\n end", "title": "" }, { "docid": "1a6ace41ac473a69fb3a2f51c9a363bf", "score": "0.63251144", "text": "def priv_key\n key = master_ext_key.derive(PURPOSE_TYPE, true).derive(Tapyrus.chain_params.bip44_coin_type, true)\n\n # Split every 2 bytes\n paths = combined_hash.unpack('S>*')\n paths.inject(key) { |key, p| key.derive(p) }\n end", "title": "" }, { "docid": "5f5dedc514095b65140705fd16739f01", "score": "0.63023317", "text": "def generate_monitor_ssh_keys\n priv_key_file = path(:monitor_priv_key)\n pub_key_file = path(:monitor_pub_key)\n unless file_exists?(priv_key_file, pub_key_file)\n ensure_dir(File.dirname(priv_key_file))\n ensure_dir(File.dirname(pub_key_file))\n cmd = %(ssh-keygen -N '' -C 'monitor' -t rsa -b 4096 -f '%s') % priv_key_file\n assert_run! cmd\n if file_exists?(priv_key_file, pub_key_file)\n log :created, priv_key_file\n log :created, pub_key_file\n else\n log :failed, 'to create monitor ssh keys'\n end\n end\n end", "title": "" }, { "docid": "48df58d2fa6dabaf88e370cd75da82b4", "score": "0.6301986", "text": "def generate_secret_key\n r = Aws::Kms.new('saas', 'saas').decrypt(@client.api_salt)\n return r unless r.success?\n\n api_salt_d = r.data[:plaintext]\n\n client_api_secret_d = SecureRandom.hex\n\n r = LocalCipher.new(api_salt_d).encrypt(client_api_secret_d)\n return r unless r.success?\n\n {e_secret_key: r.data[:ciphertext_blob], d_secret_key: client_api_secret_d}\n end", "title": "" }, { "docid": "9eee3ae92d207ad35543bd4d039b8432", "score": "0.62949264", "text": "def test_generate_pkey_dsa_to_text\n assert_match(\n /Private-Key: \\(512 bit\\)/,\n OpenSSL::PKey::DSA.new(512).to_text\n )\n end", "title": "" }, { "docid": "3636ab70de4facc4dba0d91f8d575136", "score": "0.6294416", "text": "def regenerate_key\n self.private_key = true\n self.save\n end", "title": "" }, { "docid": "c15a24ef7e930142ce67531dcb8602b1", "score": "0.62720424", "text": "def createEc2SSHKey\n\t\t\treturn [@keypairname, @ssh_private_key, @ssh_public_key] if !@keypairname.nil?\n\t\t keyname=\"deploy-#{MU.mu_id}\"\n\t\t\tkeypair = MU.ec2(MU.myRegion).create_key_pair(key_name: keyname)\n\t\t\t@keypairname = keyname\n\t\t @ssh_private_key = keypair.key_material\n\t\t\tMU.log \"SSH Key Pair '#{keyname}' fingerprint is #{keypair.key_fingerprint}\"\n\t\t\n\t\t if !File.directory?(\"#{@myhome}/.ssh\") then\n\t\t\t\tMU.log \"Creating #{@myhome}/.ssh\", MU::DEBUG\n\t\t Dir.mkdir(\"#{@myhome}/.ssh\", 0700)\n\t\t end\n\t\t\n\t\t # Plop this private key into our local SSH key stash\n\t\t\tMU.log \"Depositing key '#{keyname}' into #{@myhome}/.ssh/#{keyname}\", MU::DEBUG\n\t\t ssh_keyfile = File.new(\"#{@myhome}/.ssh/#{keyname}\", File::CREAT|File::TRUNC|File::RDWR, 0600)\n\t\t ssh_keyfile.puts @ssh_private_key\n\t\t ssh_keyfile.close\n\n\t\t\t# Drag out the public key half of this\n\t\t\t@ssh_public_key = %x{/usr/bin/ssh-keygen -y -f #{@myhome}/.ssh/#{keyname}}\n\t\t\t@ssh_public_key.chomp!\n\n\t\t\t# Replicate this key in all regions\n\t\t\tMU::Config.listRegions.each { |region|\n\t\t\t\tnext if region == MU.myRegion\n\t\t\t\tMU.log \"Replicating #{keyname} to #{region}\", MU::DEBUG, details: @ssh_public_key\n\t\t\t\tMU.ec2(region).import_key_pair(\n\t\t\t\t\tkey_name: @keypairname,\n\t\t\t\t\tpublic_key_material: @ssh_public_key\n\t\t\t\t)\n\t\t\t}\n\n# XXX This library code would be nicer... except it can't do PKCS8.\n#\t\t\tfoo = OpenSSL::PKey::RSA.new(@ssh_private_key)\n#\t\t\tbar = foo.public_key\n\n\t\t\tsleep 3\n\t\t return [keyname, keypair.key_material, @ssh_public_key]\n\t\tend", "title": "" }, { "docid": "6713d759280d138e8a2602735dace3ac", "score": "0.62672234", "text": "def keypair; end", "title": "" }, { "docid": "6713d759280d138e8a2602735dace3ac", "score": "0.62672234", "text": "def keypair; end", "title": "" }, { "docid": "6713d759280d138e8a2602735dace3ac", "score": "0.62672234", "text": "def keypair; end", "title": "" }, { "docid": "6713d759280d138e8a2602735dace3ac", "score": "0.62672234", "text": "def keypair; end", "title": "" }, { "docid": "6713d759280d138e8a2602735dace3ac", "score": "0.62672234", "text": "def keypair; end", "title": "" }, { "docid": "7899f7dde767f7fc6315594a49290a59", "score": "0.6264534", "text": "def write_new_key\n File.open(full_key_path, 'w') do |f|\n f.write OpenSSL::PKey::RSA.generate(1024).export()\n end\n end", "title": "" } ]
a544249e10e5236c18da6ee06e66a554
Tries to validate the session from information in the session
[ { "docid": "63a7f29adadf17fd902799265dca19bb", "score": "0.0", "text": "def valid_session?\n if session_credentials\n self.unauthorized_record = search_for_record(\"find_by_#{remember_token_field}\", session_credentials)\n return valid?\n end\n \n false\n end", "title": "" } ]
[ { "docid": "a2907a1f1b1a311111965369e8a5e48f", "score": "0.79082257", "text": "def valid_session\r\n {}\r\n end", "title": "" }, { "docid": "b90d65747b2497683d35976a43793a3c", "score": "0.7905665", "text": "def valid_session?\n return Sessions.is_valid?(session[:session_id]) \nend", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" }, { "docid": "7ccd6e02d7415dd3a603d42c9e4e8195", "score": "0.7901181", "text": "def valid_session\n {}\n end", "title": "" } ]
33813fd6a929f8efa17432f71f2c7841
Main Processing : Spriteset Initialization
[ { "docid": "d30343ede58c32c5b777c70315828887", "score": "0.79839134", "text": "def main_spriteset ; end", "title": "" } ]
[ { "docid": "a783b458a325d65a0eb1755539148436", "score": "0.77455086", "text": "def main_spriteset\r\n super\r\n # Make sprite set\r\n @spriteset = Spriteset_Map.new\r\n end", "title": "" }, { "docid": "303bfd7c692173f9401cc3de72f7104e", "score": "0.7650873", "text": "def main_spriteset\r\n super\r\n # Make sprite set\r\n @spriteset = Spriteset_Battle.new\r\n end", "title": "" }, { "docid": "f0196e9f8c1c70449c9df25e20bf93c5", "score": "0.7283343", "text": "def create_spriteset\n @spriteset = Spriteset_GFishing.new\n end", "title": "" }, { "docid": "1447dc17db11d50be24a625c66c4eb32", "score": "0.7063047", "text": "def initialize()\n @tileset = Gosu::Image.load_tiles(\"media/tileset.png\", TILE_WIDTH, TILE_HEIGHT, tileable: true)\n\n # Load images here so they will only be loaded once per game\n @enemyAnimation = *Gosu::Image.load_tiles(\"media/enemy_char.png\", Enemy::WIDTH, Enemy::HEIGHT)\n @portalAnimation = *Gosu::Image.load_tiles(\"media/portal.png\", Portal::WIDTH, Portal::HEIGHT)\n @diamondImg = Gosu::Image.new(\"media/diamond.png\")\n\n # Load all the stages in to an array\n @stages = Dir.glob('stages/*').select { |e| File.file? e }\n @finalStage = false\n end", "title": "" }, { "docid": "dd201005e358dda0beed07ab664f8153", "score": "0.6674069", "text": "def main_sprite ; end", "title": "" }, { "docid": "cf19c8f6700be284562926bb4f0ee823", "score": "0.66212445", "text": "def setup\n setup_major_pieces\n setup_pawns\n end", "title": "" }, { "docid": "c90bf7ebe5293fc7b615a1b4f3ea8afa", "score": "0.6618396", "text": "def load_sprites\n\n # Sort out the logo that we'll use when it's required\n @logo_sprite = TintedSprite.new(w: 567, h: 135, path: 'vertices/sprites/logo.png')\n @logo_sprite.colourable_cycle(\n [\n [255, 10, 0, 255],\n [205, 10, 50, 255],\n [50, 10, 205, 255],\n [0, 10, 255, 255],\n [50, 10, 205, 255],\n [205, 10, 50, 255]\n ], 15\n )\n @logo_sprite.movable_location_cycle(\n [\n [(@args.grid.w - 547) / 2, 480],\n [(@args.grid.w - 567) / 2, 520],\n [(@args.grid.w - 587) / 2, 500],\n [(@args.grid.w - 567) / 2, 480],\n [(@args.grid.w - 547) / 2, 500],\n [(@args.grid.w - 567) / 2, 520],\n [(@args.grid.w - 587) / 2, 480],\n [(@args.grid.w - 567) / 2, 500]\n ], 60\n )\n\n # And the start button\n @button_sprite = TintedSprite.new(w: 256, h: 64, path: 'vertices/sprites/start.png')\n @button_sprite.movable_location((@args.grid.center_x - 128), 128)\n @button_sprite.colourable_cycle(\n [\n [255, 255, 255, 255],\n [128, 128, 128, 255]\n ], 10\n )\n\n # Lastly, music and audio icons\n @audio_sprite = TintedSprite.new(w: 50, h: 50, path: 'vertices/sprites/audioOn.png')\n @audio_sprite.movable_location((@args.grid.w - 60), 10)\n @audio_sprite.colourable_cycle(\n [\n [255, 200, 200, 128],\n [200, 200, 255, 128]\n ], 60\n )\n @music_sprite = TintedSprite.new(w: 50, h: 50, path: 'vertices/sprites/musicOn.png')\n @music_sprite.movable_location((@args.grid.w - 110), 10)\n @music_sprite.colourable_cycle(\n [\n [255, 200, 200, 128],\n [200, 200, 255, 128]\n ], 60\n )\n\n end", "title": "" }, { "docid": "a5026dfe5dbe8ee2b4b45372c5049226", "score": "0.658024", "text": "def setup_cutin\n return TSBS.error(@acts[0], 3, @used_sequence) if @acts.size < 4\n #-------------------------------------------------------------------------\n file = @acts[1] # Filename\n x = @acts[2] # X Position\n y = @acts[3] # Y Position\n opa = @acts[4] || 255 # Opacity (default: 255)\n zx = @acts[5] || 1.0 # Zoom X (default: 1.0)\n zy = @acts[6] || 1.0 # Zoom Y (default: 1.0)\n #-------------------------------------------------------------------------\n get_spriteset.cutin.start(file,x,y,opa,zx,zy)\n end", "title": "" }, { "docid": "0b65730b0f67da3da4a843dd7e0f74b3", "score": "0.6492529", "text": "def setup\n\t\tsize(1800,900) ; background(20) ; frame_rate 30 #JR\n\t\t# size(1400,850) ; background(20) ; frame_rate 30\n\t\t@w, @h = [width,height].map{|i|i/2.0} ; @i = 0\n \t@m = [235,18,85]\n\n \ttext_font create_font(\"SanSerif\",25) ; stroke(200,200,200)\n \t# @img = loadImage(\"/Users/Jon/Desktop/craigslist_map2.jpg\")\n \t@img = loadImage(\"/Users/Jon/Desktop/full_santa_fe.png\")\n\tend", "title": "" }, { "docid": "8d5b9c835e688be6f5230c6376901d7f", "score": "0.64628994", "text": "def setup\n\t\tsuper\n\t\t@x = 400\n\t\t@y = 300\n\t\t#@image = Gosu::Image[\"Ship.png\"]\n\t\t self.input = {\n\t\t \tholding_left: :left,\n\t\t \tholding_right: :right,\n\t\t \tholding_up: :up,\n\t\t \tholding_down: :down,\n\t\t \tspace: :fire\n\t\t }\n\t\t@speed = 10\n\t\t@angle = 0\n\t\t@animation = Chingu::Animation.new(:file => \"flame_48x48.bmp\")\n\t\t@animation.frame_names = { :still =>0..1, :up =>2..5, :fire =>6..7}\n# :still =>0..1, :fire =>6..7, :up =>2..5\n\t\t@frame_name = :still\n\t\t@last_x, @last_y = @x, @y\n\tend", "title": "" }, { "docid": "31cb098720a5aea5fcefc024bc9a3f1b", "score": "0.6420012", "text": "def initializeSprites\n # initializes player sprite\n @battle.player.each_with_index do |pl, i|\n plfile = GameData::TrainerType.player_back_sprite_filename(pl.trainer_type)\n pbAddSprite(\"player_#{i}\", 0, 0, plfile, @viewport)\n if @sprites[\"player_#{i}\"].bitmap.nil?\n @sprites[\"player_#{i}\"].bitmap = tempMissingBackSprite\n end\n @sprites[\"player_#{i}\"].x = 40 + i*100\n @sprites[\"player_#{i}\"].y = Graphics.height - @sprites[\"player_#{i}\"].bitmap.height\n @sprites[\"player_#{i}\"].z = 50\n @sprites[\"player_#{i}\"].opacity = 0\n @sprites[\"player_#{i}\"].src_rect.width /= 5\n end\n # initializes trainer sprite\n if @battle.opponent\n @battle.opponent.each_with_index do |t, i|\n @sprites[\"trainer_#{i}\"] = DynamicTrainerSprite.new(@battle.doublebattle?, -1, @viewport, @battle.opponent.length > 1, t)\n @sprites[\"trainer_#{i}\"].setTrainerBitmap\n @sprites[\"trainer_#{i}\"].z = (@minorAnimation || @integratedVS) ? 100 : @sprites[\"battlebg\"].battler(i*2 + 1).z\n @sprites[\"trainer_#{i}\"].shadow.z = 98 if @minorAnimation\n @sprites[\"trainer_#{i}\"].tone = Tone.new(-255, -255, -255, -255)\n end\n end\n # initializes Pokemon sprites\n @battlers.each_with_index do |b, i|\n next if !b\n @sprites[\"pokemon_#{i}\"] = DynamicPokemonSprite.new(@battle.doublebattle?, i, @viewport, @battle)\n @sprites[\"pokemon_#{i}\"].z = @sprites[\"battlebg\"].battler(i).z\n @sprites[\"pokemon_#{i}\"].index = i\n end\n # assign bitmaps for wild battlers\n loadWildBitmaps\n end", "title": "" }, { "docid": "8513a2994f6e3be9bd2c12fd8d70e432", "score": "0.6415175", "text": "def initialize(viewport,commands,scene)\n @commands = commands\n @scene = scene\n @index = 0\n offset = 0\n @path = \"Graphics/EBDX/Pictures/UI/\"\n @viewport = viewport\n @sprites = {}\n @visibility = [false,false,false,false]\n baseColor = Color.white\n shadowColor = Color.new(0,0,0,192)\n # apply styling from PBS\n self.applyMetrics\n # generate sprites\n @sprites[\"sel\"] = SpriteSheet.new(@viewport,4)\n @sprites[\"sel\"].setBitmap(pbSelBitmap(@path+@selImg,Rect.new(0,0,92,38)))\n @sprites[\"sel\"].speed = 4\n @sprites[\"sel\"].ox = @sprites[\"sel\"].src_rect.width/2\n @sprites[\"sel\"].oy = @sprites[\"sel\"].src_rect.height/2\n @sprites[\"sel\"].z = 99999\n @sprites[\"sel\"].visible = false\n # fill sprites with text\n bmp = pbBitmap(@path+@btnImg)\n for i in 0...@commands.length\n k = @commands.length - 1 - i\n @sprites[\"choice#{i}\"] = Sprite.new(@viewport)\n @sprites[\"choice#{i}\"].x = Graphics.width - bmp.width - 14 + bmp.width/2\n @sprites[\"choice#{i}\"].y = Graphics.height - 136 - k*(bmp.height+4) + bmp.height/2\n @sprites[\"choice#{i}\"].z = 99998\n @sprites[\"choice#{i}\"].bitmap = Bitmap.new(bmp.width,bmp.height)\n @sprites[\"choice#{i}\"].center!\n @sprites[\"choice#{i}\"].opacity = 0\n choice = @sprites[\"choice#{i}\"].bitmap\n pbSetSystemFont(choice)\n choice.blt(0,0,bmp,bmp.rect)\n pbDrawOutlineText(choice,0,8,bmp.width,bmp.height,@commands[i],baseColor,shadowColor,1)\n end\n bmp.dispose\n end", "title": "" }, { "docid": "b199509323222570b1b7721549ef8fbb", "score": "0.6383701", "text": "def create_spriteset_and_background\n super('GTS')\n end", "title": "" }, { "docid": "77518f118398c7d853969caa8f860f1c", "score": "0.6367045", "text": "def setup\n super\n @background = Image['Bg level1.png']\n viewport.lag = 0\n viewport.game_area = [0, 0, 3000, 1000]\n @gilbert = Gilbert.create(x: 50, y: 900, limited: viewport.game_area.width)\n @level = File.join(ROOT, 'levels', self.filename + '.yml')\n load_game_objects(file: @level)\n\n @plataformas = Plataforma2.all\n @music = Song.new('media/Songs/Music Level1.mp3')\n @loser_song = Song.new('media/Songs/gameover.ogg')\n\n @moneda = Moneda.all.first\n\n @meta_on = false\n\n @marco_name = Image['MarcoName.png']\n @marco_score = Image['MarcoPoint.png']\n\n @score = 0\n @msj_name = Chingu::Text.new(@player_name, x: 85, y: 25, size: 30, color: Gosu::Color::WHITE)\n @msj_score = Chingu::Text.new(@score.to_s, x: $window.width - 130, y: 30, size: 35)\n @mensaje = Chingu::Text.new('Has encontrado todas las monedas', x: 320, y: 20, size: 25, color: Gosu::Color::GREEN)\n @mensaje2 = Chingu::Text.new('Encuentra la Meta', x: @msj_name.x, y: 45, size: 30, color: Gosu::Color::YELLOW)\n\n @music.play(true) if @sonido\n end", "title": "" }, { "docid": "734b213397039843b195a0fa04c04773", "score": "0.63268834", "text": "def initialize(args)\n\n # Keep a handy reference to the args\n @args = args\n\n # On startup we're not running\n @args.state.vertices.running = false\n\n # Set some basic game parameters\n @args.state.vertices.play_ticks ||= 20.seconds\n @args.state.vertices.target_shapes ||= 10\n @args.state.vertices.polygons ||= []\n @polygons = []\n @stars = []\n\n # Need an audio handler\n @audio_handler = Ahnlak::ClassAudio.new\n @audio_handler.play('vertices/sounds/title.ogg')\n\n # Initialise some other bits - again, set some defaults\n @prompt = []\n @prompt << TintedLabel.new(\n visible: true,\n x: @args.grid.center_x, y: 400,\n alignment_enum: 1, size_enum: 15,\n text: 'Click on the shape with the fewest edges',\n font: 'vertices/fonts/Kenney Future Square.ttf'\n )\n @prompt << TintedLabel.new(\n visible: true,\n x: @args.grid.center_x, y: 325,\n alignment_enum: 1, size_enum: 15,\n text: \"Can you clear #{@args.state.vertices.target_shapes} shapes in time?!\",\n font: 'vertices/fonts/Kenney Future Square.ttf'\n )\n @prompt.each do |prompt|\n prompt.colourable_cycle(\n [\n [255, 255, 255, 255],\n [100, 255, 100, 255],\n [255, 100, 255, 255]\n ],\n 30\n )\n end\n @counter = Counter.new(args)\n\n # And load up our sprites\n load_sprites\n\n # The system icons are static\n args.outputs.static_sprites << @audio_sprite\n args.outputs.static_sprites << @music_sprite\n\n end", "title": "" }, { "docid": "ebe91901f51f28cc705292c2d5cc3291", "score": "0.6318276", "text": "def setUp\n # reset of the set-up procedure\n @loaded = false\n @showing = false\n pbDisposeSpriteHash(@sprites)\n @sprites.clear\n # caches the bitmap used for coloring\n @colors = pbBitmap(@path + @colors)\n # initializes all the necessary components\n @sprites[\"base\"] = Sprite.new(@viewport)\n @sprites[\"base\"].bitmap = pbBitmap(@path+@baseBitmap)\n @sprites[\"base\"].mirror = @playerpoke\n\n @sprites[\"status\"] = Sprite.new(@viewport)\n @sprites[\"status\"].bitmap = pbBitmap(@path + \"status\")\n @sprites[\"status\"].z = self.getMetric(\"status\", :z)\n @sprites[\"status\"].src_rect.height /= 5\n @sprites[\"status\"].src_rect.width = 0\n @sprites[\"status\"].ex = self.getMetric(\"status\", :x)\n @sprites[\"status\"].ey = self.getMetric(\"status\", :y)\n\n @sprites[\"mega\"] = Sprite.new(@viewport)\n @sprites[\"mega\"].z = self.getMetric(\"mega\", :z)\n @sprites[\"mega\"].mirror = @playerpoke\n @sprites[\"mega\"].ex = self.getMetric(\"mega\", :x)\n @sprites[\"mega\"].ey = self.getMetric(\"mega\", :y)\n\n @sprites[\"container\"] = Sprite.new(@viewport)\n @sprites[\"container\"].bitmap = pbBitmap(@path + @containerBmp)\n @sprites[\"container\"].z = self.getMetric(\"container\", :z)\n @sprites[\"container\"].src_rect.height = @showexp ? 26 : 14\n @sprites[\"container\"].ex = self.getMetric(\"container\", :x)\n @sprites[\"container\"].ey = self.getMetric(\"container\", :y)\n\n @sprites[\"hp\"] = Sprite.new(@viewport)\n @sprites[\"hp\"].bitmap = Bitmap.new(1, 6)\n @sprites[\"hp\"].z = @sprites[\"container\"].z\n @sprites[\"hp\"].ex = @sprites[\"container\"].ex + @hpBarX\n @sprites[\"hp\"].ey = @sprites[\"container\"].ey + @hpBarY\n\n @sprites[\"exp\"] = Sprite.new(@viewport)\n @sprites[\"exp\"].bitmap = Bitmap.new(1, 4)\n @sprites[\"exp\"].bitmap.blt(0, 0, @colors, Rect.new(0, 6, 2, 4))\n @sprites[\"exp\"].z = @sprites[\"container\"].z\n @sprites[\"exp\"].ex = @sprites[\"container\"].ex + @expBarX\n @sprites[\"exp\"].ey = @sprites[\"container\"].ey + @expBarY\n\n @sprites[\"textName\"] = Sprite.new(@viewport)\n @sprites[\"textName\"].bitmap = Bitmap.new(@sprites[\"container\"].bitmap.width + 32, @sprites[\"base\"].bitmap.height)\n @sprites[\"textName\"].z = self.getMetric(\"name\", :z)\n @sprites[\"textName\"].ex = self.getMetric(\"name\", :x) - 16\n @sprites[\"textName\"].ey = self.getMetric(\"name\", :y)\n pbSetSmallFont(@sprites[\"textName\"].bitmap)\n\n @sprites[\"caught\"] = Sprite.new(@viewport)\n @sprites[\"caught\"].bitmap = pbBitmap(@path + \"battleBoxOwned\") if !@playerpoke && @battler.owned? && !@scene.battle.opponent\n @sprites[\"caught\"].z = @sprites[\"container\"].z\n @sprites[\"caught\"].ex = @sprites[\"container\"].ex - 18\n @sprites[\"caught\"].ey = @sprites[\"container\"].ey - 2\n\n @sprites[\"textHP\"] = Sprite.new(@viewport)\n @sprites[\"textHP\"].bitmap = Bitmap.new(@sprites[\"container\"].bitmap.width, @sprites[\"base\"].bitmap.height + 8)\n @sprites[\"textHP\"].z = self.getMetric(\"hp\", :z)\n @sprites[\"textHP\"].ex = self.getMetric(\"hp\", :x)\n @sprites[\"textHP\"].ey = self.getMetric(\"hp\", :y)\n pbSetSmallFont(@sprites[\"textHP\"].bitmap)\n\n @megaBmp = pbBitmap(@path + \"symMega\")\n @prKyogre = pbBitmap(\"Graphics/Pictures/Battle/icon_primal_Kyogre\")\n @prGroudon = pbBitmap(\"Graphics/Pictures/Battle/icon_primal_Groudon\")\n end", "title": "" }, { "docid": "14c031ac4ae237a8b5b26c30c34b2d09", "score": "0.6308871", "text": "def create_spriteset_and_background\n super(ext_text(8997, 19))\n end", "title": "" }, { "docid": "1a63bbdd37c542b7860a78c96bc735e3", "score": "0.6308208", "text": "def initialize(x, y, img, sprite_cols = nil, sprite_rows = nil, retro = nil)\n @x = x; @y = y\n retro = Res.retro_images if retro.nil?\n @img =\n if sprite_cols.nil?\n [Res.img(img, false, false, '.png', retro)]\n else\n Res.imgs img, sprite_cols, sprite_rows, false, '.png', retro\n end\n @anim_counter = 0\n @img_index = 0\n @index_index = 0\n @animate_once_control = 0\n end", "title": "" }, { "docid": "eab2bbe0900a98ff57bbe5dff4c63312", "score": "0.6283439", "text": "def init_actorsprites\r\n # Make actor sprites\r\n @actor_sprites = []\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n @actor_sprites.push(Sprite_Battler.new(@viewport2))\r\n end", "title": "" }, { "docid": "c4affdd939543eb93e0dcd23833fdd42", "score": "0.6280351", "text": "def initialize window, x, y\n images = Gosu::Image::load_tiles(window, \"media/SlugSlime.png\", WIDTH, HEIGHT, true)\n\n super(window, x, y, WIDTH, HEIGHT, images)\n\n @creation_milliseconds = Gosu.milliseconds\n end", "title": "" }, { "docid": "e694cf7f154a2d672c93e74308d04753", "score": "0.62699074", "text": "def initialize\n @imgs = {}\n @global_imgs = {}\n @tilesets = {}\n @global_tilesets = {}\n @sounds = {}\n @global_sounds = {}\n @songs = {}\n @global_songs = {}\n @fonts = {}\n @global_fonts = {}\n\n @prefix = File.expand_path(File.dirname($0)) + '/data/'\n @img_dir = 'img/'\n @tileset_dir = 'tileset/'\n @sound_dir = 'sound/'\n @song_dir = 'song/'\n @font_dir = 'font/'\n @separator = '_'\n @retro_images = false\n end", "title": "" }, { "docid": "4b2a77ac30ebda28fe2399ffd7ef3ddb", "score": "0.6248261", "text": "def initialize\n @next_scene = nil\n @map_bgm = nil\n @map_bgs = nil\n @common_event_id = 0\n @in_battle = false\n @battle_proc = nil\n @shop_goods = nil\n @shop_purchase_only = false\n @name_actor_id = 0\n @name_max_char = 0\n @menu_beep = false\n @last_file_index = 0\n @debug_top_row = 0\n @debug_index = 0\n @background_bitmap = Bitmap.new(1, 1)\n end", "title": "" }, { "docid": "89c32a2cfa36887dcdcb049461679dbc", "score": "0.62287456", "text": "def setup\n\t\tsize(displayWidth, displayHeight)\n\t\tcolorMode(HSB,360,100,100,60)\n\t\t@w, @h = [width/2.0, 0]\n\t\t@i = 0 ; @t = 0\n frame_rate 20\n\t\tbackground(0)\n\n\t\t@monster = Monster.new 7, width, height\n\t\tstroke_width(160)\n\tend", "title": "" }, { "docid": "a6a39af8a51f988a5a4751afc43d10a8", "score": "0.62266314", "text": "def main_begin\n create_spriteset\n # When comming back from battle we ensure that we don't have a weird transition by warping immediately\n if $game_temp.player_transferring\n transfer_player\n else\n $wild_battle.reset\n $wild_battle.load_groups\n end\n fade_in(@mbf_type || DEFAULT_TRANSITION, @mbf_param || DEFAULT_TRANSITION_PARAMETER)\n $quests.check_up_signal\n end", "title": "" }, { "docid": "71c69ae4207a35059d8bf3ceea366ccb", "score": "0.6220144", "text": "def setup(args)\n position = Engine3D::Vector.new 0.0, 0.0, 0.0, 1.0\n direction = Engine3D::Vector.new 0.0, 0.0,-1.0, 1.0\n args.state.camera = Engine3D::Camera.new position, direction\n args.state.renderer = Engine3D::Render.new 1280, 720, args.state.camera, 1.0, 300.0\n\n #args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/debug.rb'\n #args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/scene1.rb'\n args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/demo.rb'\n\n #args.state.angle = 0.01\n #args.state.camera_angle = 0.001\n\n # DEBUG :\n #args.state.frame_counter = 0\n\n args.state.setup_done = true\n\n puts \"setup finished!!!\"\nend", "title": "" }, { "docid": "3caef5d4ad3e096344f7a9ef5fdb103b", "score": "0.62091964", "text": "def setup\n\t\ttext_font create_font(\"SanSerif\",10);\n\t\tscreen = [1920,1040] #JackRabbit\n\t\t# product[1920,1040] = 1996800\n\n\t\t# screen = [1500,900] #HOME\n\t\t# product[1500,900] = 1350000\n\n\t\t@it = 0\n\n\t\tsize(*screen)\n\t\t@w,@h = screen.map{|d| d/2}\n\t\t@i, @t = [0] * 2 ; background(0)\n\t\t@colors = (0..3).map{|i|rand(255)}\n\t\tframe_rate 2.5 ; colorMode(HSB,360,100,100)\n\t\tno_fill() ; no_stroke ; @xy = [0,0]\n\t\t\t\n\t\tcl = VERTS.map{|c| rand(30) }\n\t\t@cc = VERTS.map{|r| [(20 + rand(@w)) * 1.9,\n\t\t\t\t\t\t\t\t\t\t\t\t (20 + rand(@h)) * 1.9] }.zip(cl)\n\tend", "title": "" }, { "docid": "a1585e980d698831d8bc035486adafa8", "score": "0.6199874", "text": "def start\n @start.call\n @on_start.each(&:call)\n @on_start.clear\n io_initialize\n frame_reset\n @no_mouse = (PSDK_CONFIG.mouse_disabled && !PARGV[:tags])\n init_sprite\n end", "title": "" }, { "docid": "9c60cdbc0a7c61220aac82b4dca72755", "score": "0.6179005", "text": "def game_setup\n end", "title": "" }, { "docid": "d513fe42883d6bddc9cccc8d4f98d037", "score": "0.61427194", "text": "def initialize(scene)\n super(800,600, false)\n self.caption = \"Ruby Ren'ai Game Engine\"\n @hidden = false\n @script = Script.new(self)\n @graphics = Graphics.new(self)\n @clickables = Array.new\n @music = Music.new(self)\n @scriptreader = ScriptReader.new(self, scene || \"mainmenu\")\n @time = Gosu::milliseconds\n advance\n end", "title": "" }, { "docid": "1f5c0f8e30ddf9b317a2195f51012288", "score": "0.610045", "text": "def initialize fps, title\n # The sprite and sound managers.\n @spriteManager = SpriteManager.new\n @soundManager = SoundManager.new 3\n\n # Number of frames per second.\n @framesPerSecond = fps\n\n # Title in the application window.\n @windowTitle = title\n\n # create and set timeline for the game loop\n buildAndSetGameLoop\n end", "title": "" }, { "docid": "5f3a61c513ed56ad51b84ec5333ba1f0", "score": "0.60988724", "text": "def get_spriteset\n SceneManager.scene.instance_variable_get(\"@spriteset\")\nend", "title": "" }, { "docid": "6c7d0b5352939af5ae8aecc60e206682", "score": "0.60946083", "text": "def setup_add_plane\n return TSBS.error(@acts[0], 3, @used_sequence) if @acts.size < 3\n file = @acts[1]\n sox = @acts[2] # Scroll X\n soy = @acts[3] # Scroll Y \n z = (@acts[4] ? Graphics.height + 10 : 4)\n dur = @acts[5] || 2\n opac = @acts[6] || 255\n get_spriteset.battle_plane.set(file,sox,soy,z,dur,opac)\n end", "title": "" }, { "docid": "a49b392479bf182a66289ad31d7feec5", "score": "0.6083928", "text": "def initialize level\n\t\t@tile_size = 32\n\t\t@level = level + 1\n\t\t@num_enemies = 0\n\t\tloadlevel\n\t\tloadgraphics\n\t\tinterpret\n\t\tcreate_tiles\n\t\tfind_player_index\n\t\t@travel = 0\n\tend", "title": "" }, { "docid": "c899129a8e0930270fe8479030b21673", "score": "0.6044309", "text": "def get_spriteset\n get_scene.instance_variable_get(\"@spriteset\")\nend", "title": "" }, { "docid": "5e52557f887f0d5a85af9c101b3cc8be", "score": "0.6033963", "text": "def main_sprite\r\n super\r\n # Make title graphic\r\n @sprite = Sprite.new\r\n @sprite.bitmap = RPG::Cache.title($data_system.title_name)\r\n end", "title": "" }, { "docid": "b7c7ba5b88f14297e76cfcba84214f80", "score": "0.60317504", "text": "def setup( )\n\t\t\t(\"a\"..\"h\").each do |f|\n\t\t\t\t@squares[\"#{f}2\"] = Chess::Pawn.new(self, \"#{f}2\", :white)\n\t\t\t\t@squares[\"#{f}7\"] = Chess::Pawn.new(self, \"#{f}7\", :black)\n\t\t\tend\n\t\t\t[\"a\", \"h\"].each do |f|\n\t\t\t\t@squares[\"#{f}1\"] = Chess::Rook.new(self, \"#{f}1\", :white)\n\t\t\t\t@squares[\"#{f}8\"] = Chess::Rook.new(self, \"#{f}8\", :black)\n\t\t\tend\n\t\t\t[\"b\", \"g\"].each do |f|\n\t\t\t\t@squares[\"#{f}1\"] = Chess::Knight.new(self, \"#{f}1\", :white)\n\t\t\t\t@squares[\"#{f}8\"] = Chess::Knight.new(self, \"#{f}8\", :black)\n\t\t\tend\n\t\t\t[\"c\", \"f\"].each do |f|\n\t\t\t\t@squares[\"#{f}1\"] = Chess::Bishop.new(self, \"#{f}1\", :white)\n\t\t\t\t@squares[\"#{f}8\"] = Chess::Bishop.new(self, \"#{f}8\", :black)\n\t\t\tend\n\t\t\t@squares[\"d1\"] = Chess::Queen.new(self, \"d1\", :white)\n\t\t\t@squares[\"d8\"] = Chess::Queen.new(self, \"d8\", :black)\n\t\t\t@squares[\"e1\"] = Chess::King.new(self, \"e1\", :white)\n\t\t\t@squares[\"e8\"] = Chess::King.new(self, \"e8\", :black)\n\t\tend", "title": "" }, { "docid": "d66a821913baa733243f15dc2bd2c473", "score": "0.6028747", "text": "def create_spriteset_and_background(scene_name = ext_text(8997, 3))\n @sprites = UI::SpriteStack.new(@viewport)\n @background = @sprites.push(0, 0, 'GTS/Background')\n @sprites.add_text(25, 3, 0, 16, scene_name, color: 9)\n @sprites.add_text(300, 3, 0, 16, \"Online ID: #{$pokemon_party.online_id}\", 2, color: 9)\n @sprites_base_index = @sprites.stack.size\n end", "title": "" }, { "docid": "f5a65cc6245134c2fe36e7e231c3cabc", "score": "0.60135895", "text": "def initialize\n super\n init_conditions\n init_indexes\n @index = $game_temp.last_menu_index\n @index = 0 if @index >= @image_indexes.size\n @max_index = @image_indexes.size - 1\n @quiting = false # Flag allowing to really quit\n @entering = true # Flag telling we're entering\n @counter = 0 # Animation counter\n @in_save = false\n @mbf_type = @mef_type = :noen if $scene.is_a?(Scene_Map)\n end", "title": "" }, { "docid": "1b1e71b25bfbaee2dff0cdee36c5cc0e", "score": "0.59896713", "text": "def defaults\n state.tile_size = 64\n state.gravity = -0.2\n state.player_width = 60\n state.player_height = 64\n state.collision_tolerance = 0.0\n state.previous_tile_size ||= state.tile_size\n state.x ||= 0\n state.y ||= 800\n state.dy ||= 0\n state.dx ||= 0\n attempt_load_world_from_file\n state.world_lookup ||= { }\n state.world_collision_rects ||= []\n state.mode ||= :creating # alternates between :creating and :selecting for sprite selection\n state.select_menu ||= [0, 720, 1280, 720]\n #=======================================IMPORTANT=======================================#\n # When adding sprites, please label them \"image1.png\", \"image2.png\", image3\".png\", etc.\n # Once you have done that, adjust \"state.sprite_quantity\" to how many sprites you have.\n #=======================================================================================#\n state.sprite_quantity ||= 20 # IMPORTANT TO ALTER IF SPRITES ADDED IF YOU ADD MORE SPRITES\n state.sprite_coords ||= []\n state.banner_coords ||= [640, 680 + 720]\n state.sprite_selected ||= 1\n state.map_saved_at ||= 0\n\n # Sets all the cordinate values for the sprite selection screen into a grid\n # Displayed when 's' is pressed by player to access sprites\n if state.sprite_coords == [] # if sprite_coords is an empty array\n count = 1\n temp_x = 165 # sets a starting x and y position for display\n temp_y = 500 + 720\n state.sprite_quantity.times do # for the number of sprites you have\n state.sprite_coords += [[temp_x, temp_y, count]] # add element to sprite_coords array\n temp_x += 100 # increment temp_x\n count += 1 # increment count\n if temp_x > 1280 - (165 + 50) # if exceeding specific horizontal width on screen\n temp_x = 165 # a new row of sprites starts\n temp_y -= 75 # new row of sprites starts 75 units lower than the previous row\n end\n end\n end\n end", "title": "" }, { "docid": "550a8b0598a0180801469b98703546bb", "score": "0.5980985", "text": "def setup\n size 200, 200\n @a = load_image 'construct.jpg'\n @b = load_image 'wash.jpg'\n @offset = 0.0\nend", "title": "" }, { "docid": "dbaac84cb2352409af583e100d0fbba5", "score": "0.5954689", "text": "def execute\n if options.version?\n say \"Spriteful #{Spriteful::VERSION}\"\n exit(0)\n end\n\n prepare_options!\n\n if sources.empty?\n self.class.help(shell)\n exit(1)\n end\n\n sources.uniq!\n sources.each do |source|\n create_sprite(source)\n end\n\n save_options\n end", "title": "" }, { "docid": "f5511454ea14c1fb534cbc55d5b51ef8", "score": "0.5953149", "text": "def initialize(x=0, y=0, type=nil)\n @x = 0\n @y = 0\n @z = 0\n @image = nil\n @blending = :default\n @alpha = 1.0\n @angle = 0\n @index = 0\n @radius = 0\n @size = 1.0\n \n @die = false\n \n # Adds this new sprite to its sprite list\n Game.sprite_collection.add(self) \n end", "title": "" }, { "docid": "a8dd0b63319d2be0488c8bc1d4033813", "score": "0.5937062", "text": "def main_sprite\r\n super\r\n # Make game over graphic\r\n @sprite = Sprite.new\r\n @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)\r\n end", "title": "" }, { "docid": "42f2b4a114552a76754b78438bc27917", "score": "0.59346044", "text": "def initialize\n @image = @image3 = Gosu::Image.new(\"ball.bmp\")\n @image2 = Gosu::Image.new(\"ball2.bmp\")\n @beep = @sound = Gosu::Sample.new(\"Beep.wav\")\n @hit = Gosu::Sample.new(\"hit.wav\")\n @x = @y = @vel_x = @vel_y = @angle = 0\n end", "title": "" }, { "docid": "b3dfa70ae12115e16e7def22256a57ec", "score": "0.59305626", "text": "def initialize(configuration = ::Sprites.configuration)\n @sprites = Sprites.new(configuration)\n end", "title": "" }, { "docid": "1b8123a59f6f02ec4f2612fabfca7d74", "score": "0.5912063", "text": "def initialize\n\n #Graphics.freeze\n\n @closing = false\n @savequit = false\n\n $mouse.change_cursor('Default')\n sys('open')\n\n # Vp\n @vp = Viewport.new(0,0,$game.width,$game.height)\n @vp.z = 3500\n\n @snap = Sprite.new(@vp)\n @snap.z = -101\n @snap.bitmap = $game.snapshot\n\n # Background\n @bg = Sprite.new(@vp)\n @bg.z = -100\n #@bg.bitmap = Bitmap.new(640,480)\n #@bg.bitmap.fill(Color.new(0,0,0,180))\n @bg.bitmap = $cache.menu_background(\"sample\")\n #@bg.bitmap = $cache.menu_background(\"witch\")\n @bg.opacity = 0\n \n #@bg.y = 30\n #@bg.do(seq(go(\"y\",-50,150,:qio),go(\"y\",20,150,:qio)))\n\n #self.do(delay(300))\n\n @next_menu = $menu.menu_page\n $menu.menu_page = nil\n\n @menu = nil\n\n #Graphics.transition(20,'Graphics/Transitions/trans') \n\n end", "title": "" }, { "docid": "cf1b759548d09253516425c8f26b89e1", "score": "0.5893648", "text": "def grass_init\n #Herbe du fond\n @layer1 = Sprite.new(@viewport)\n @layer1.bitmap = RPG::Cache.transition(\"ecd_poke03\")\n @layer1.y = 240 - 128\n @layer11 = Sprite.new(@viewport)\n @layer11.bitmap = @layer1.bitmap\n #Herbe de devant\n @layer2 = Sprite.new(@viewport)\n @layer2.bitmap = RPG::Cache.transition(\"ecd_poke01\")\n @layer22 = Sprite.new(@viewport)\n @layer22.bitmap = RPG::Cache.transition(\"ecd_poke02\")\n @layer22.x = @layer11.x = 256\n @layer22.y = @layer2.y = @layer11.y = @layer1.y\n @layer2.ox = @layer22.ox = 512\n @layer11.ox = @layer1.ox = -320\n #>Fond noir qui se déplace\n @black = Sprite.new(@viewport)\n @black.bitmap = Bitmap.new(448, 240)\n @black.bitmap.fill_rect(128,0,320,240, Color.new(0,0,0))\n bmp = RPG::Cache.transition(\"ecd_z01\")\n @black.bitmap.blt(0,0, bmp, bmp.rect)\n @black.ox = 128\n\n @black.z = 99999\n @layer1.z = 101\n @layer11.z = 102\n @layer2.z = 103\n @layer22.z = 104\n @black.visible = @layer2.visible = @layer22.visible = @layer1.visible = \n @layer11.visible = false\n end", "title": "" }, { "docid": "8b025f5826bdbe3faffac915ece469ed", "score": "0.5892528", "text": "def init_picturesprites\r\n # Make picture sprites\r\n @picture_sprites = []\r\n for i in 81..100\r\n @picture_sprites.push(Sprite_Picture.new(@viewport3,\r\n $game_screen.pictures[i]))\r\n end\r\n end", "title": "" }, { "docid": "c247093e9387e7fef74a5cc741333ee9", "score": "0.5884917", "text": "def init primaryStage\n # Sets the window title\n primaryStage.setTitle getWindowTitle\n\n # Create the scene\n setSceneNodes Group.new\n setGameSurface Scene.new getSceneNodes, 640, 580\n primaryStage.setScene getGameSurface\n\n generateManySpheres 150\n\n # Display the number of spheres visible.\n # Create a button to add more spheres.\n # Create a button to freeze the game loop.\n gameLoop = getGameLoop\n stats = VBoxBuilder.create\n .spacing(5)\n .translateX(10)\n .translateY(10)\n .children(HBoxBuilder.create\n .spacing(5)\n .children(\n Label.new(\"Number of Particles: \"),\n @num_sprites_field\n ).build,\n\n # button to build more spheres\n ButtonBuilder.create\n .text(\"Regenerate\")\n .onMousePressed(proc {\n generateManySpheres 150\n }).build,\n\n # button to freeze game loop\n ButtonBuilder.create\n .text(\"Freeze/Resume\")\n .onMousePressed(proc {\n case gameLoop.getStatus\n when Animation::Status::RUNNING\n gameLoop.stop\n when Animation::Status::STOPPED\n gameLoop.play\n end\n }).build\n ).build # (VBox) stats on children\n\n # lay down the controls\n getSceneNodes.getChildren.add stats\n end", "title": "" }, { "docid": "ab35a55c57b89e4ddaca5a264e069d60", "score": "0.588339", "text": "def setup\n\n #Start timer\n every(1000) { @time_limit -= 1 }\n\n #Load the images for the bar\n @image_1 = Image[\"ruby.png\"]\n @image_2 = Image[\"player_life.png\"]\n @image_3 = Image[\"minClock.png\"]\n\n #Create score text\n @score_text = Text.create(\"\", :size => 30, :x => 920, :y => -2, :color => Color::YELLOW)\n\n #Create life text\n @life_text = Text.create(\"\", :size => 30, :x => 28, :y => -2, :color => Color::GREEN)\n\n #Create time text\n @time_text = Text.create(\"\", :size => 30, :x => 488, :y => -2, :color => Color::WHITE)\n\n end", "title": "" }, { "docid": "4b96f9eb01842ecce9683221ad039cc5", "score": "0.5882925", "text": "def initialize(window)\n @terrain = Gosu::Image::load_tiles(window, \"media/Terrain.png\", TILE_WIDTH, TILE_HEIGHT * 2, true)\n @window = window\n\n @level = 0\n\n @start_x = 0\n @start_y = 0\n\n load_level(\"levels/level0.lvl\")\n end", "title": "" }, { "docid": "4b5b802815824b4cad4b8b5cae3cd16f", "score": "0.58700186", "text": "def initialize(window)\n # @lines is an array of strings\n @lines = Array.new\n @current_pos = 0\n @current = true\n @hidden = false\n @cur_start_y = START_Y\n @font = Gosu::Font.new(window, Gosu::default_font_name, FONT_HEIGHT)\n @ctc = Gosu::Image.load_tiles(window, \"resources/sakura.png\", 20, 20, false)\n end", "title": "" }, { "docid": "a4ce904899637c1728393bf5d1a29960", "score": "0.5866781", "text": "def initialize(x, y, args)\n speed_values = args.state.speed_values\n @x_vel = speed_values[rand(speed_values.length)]\n @y_vel = speed_values[rand(speed_values.length)]\n @truex = x - @x_vel\n @truey = y - @y_vel\n @w = 10\n @h = 10\n @x = x - (@w / 2)\n @y = y - (@h / 2)\n @r = 255\n @g = 255\n @b = 255\n @a = 2558\n @path = 'sprites/black.png'\n args.outputs.static_sprites << self\n end", "title": "" }, { "docid": "986fe9144d0f39d38ad3448ba5422788", "score": "0.58650494", "text": "def initialize\n\n $scene = self\n\n # Prep model\n @map = Game_Map.new\n @player = Game_Player.new\n\n # Make viewports - Also in the scene\n @vp_under = Viewport.new(0,0,$game.width,$game.height)\n @vp_under.z = 0\n @vp_main = Viewport.new(0,0,$game.width,$game.height) \n @vp_main.z = 1000\n @vp_weather = Viewport.new(0,0,$game.width,$game.height)\n @vp_weather.z = 1999\n @vp_over = Viewport.new(0,0,$game.width,$game.height)\n @vp_over.z = 2000\n @vp_ui = Viewport.new(0,0,$game.width,$game.height)\n @vp_ui.z = 3000\n \n # Make tilemap\n @panoramas = []\n @tilemap = MapWrap.new(@vp_main)\n \n @characters = [] \n @sparks = []\n @pops = []\n\n # weather in map data\n @weather = nil#Weather.new(@vp_over)\n @fogs = []\n\n # Misc Overlay\n @overlay = Sprite.new(@vp_over)\n @overlay.bitmap = Bitmap.new($game.width,$game.height)\n @overlay.bitmap.fill(Color.new(0,0,0))\n @overlay.opacity = 0\n @overlay.z = 999\n\n # Fadeout\n @black = Sprite.new(@vp_over)\n @black.bitmap = Bitmap.new($game.width,$game.height)\n @black.bitmap.fill(Color.new(0,0,0))\n @black.opacity = 0\n @black.z = 1000\n \n # UI\n @hud = nil # Define in sub\n \n end", "title": "" }, { "docid": "650583b96c70ebe6f789c250b471fc2d", "score": "0.58580214", "text": "def initialize(swf, id, frame_count)\n #initialize/assign defaults\n @swf = swf\n @frame_count = frame_count\n @frame_labels = {}\n @frames = [nil] #frame 0 is empty\n \n #private vars\n @blend_mode = nil\n @cache_as_bitmap = false\n @classname = nil\n @frame = Frame.new\n @name = \"Sprite#{id}\"\n \n end", "title": "" }, { "docid": "04f138aa036f8b6fc3b87675d017b355", "score": "0.58537585", "text": "def setup(args)\n # Camera\n position = Engine3D::Vector.new 0.0, 0.0, 0.0, 1.0\n direction = Engine3D::Vector.new 0.0, 0.0,-1.0, 1.0\n args.state.camera = Engine3D::Camera.new position, direction\n \n # Renderer :\n args.state.renderer = Engine3D::Render.new 1280, 720, # viewport size \n args.state.camera, # camera\n 1.0, 300.0 # near and far planes\n\n # Scene :\n args.state.scene = Engine3D::Scene.load args,\n 'data/scenes/scene1.rb',\n SPRITE_SCALE\n\n # Miscellenaous :\n args.state.angle = 0.01\n\n\n args.state.setup_done = true\nend", "title": "" }, { "docid": "d4b412296cadbb580085f15dcf8c1dbd", "score": "0.5853449", "text": "def initialize\n super(WIDTH, HEIGHT)\n self.caption = 'Sector Five'\n @background_image = Gosu::Image.new('images/start_screen.png')\n @scene = :start\n\n @game = GameService.new(self)\n end", "title": "" }, { "docid": "b6408d052ac7653868a7198e94060ef4", "score": "0.58458245", "text": "def init_units\n for unit in $game_map.units\n # Initialize the unit's sprite\n unit.sprite_id = @unit_sprites.size\n @unit_sprites.push(Unit_Sprite.new(@viewport1, unit))\n end\n end", "title": "" }, { "docid": "88f32eb0e96205a02c6edecc99420a1c", "score": "0.58386326", "text": "def initialize(x, y, width, height)\n @ax, @ay = x, y\n @v = Viewport.new(x,y,width,height)\n @v.z = 99999\n # create the actual sprite\n super(@v)\n # set dimensions\n @width = width\n @height = height\n # create background sprite\n create_background_sprite\n # set position\n self.x, self.y, self.z = 0,0,1000#x, y, 1000\n # store variables\n @active = true\n end", "title": "" }, { "docid": "33e45b8f9444b9cd7aaf2ef14dd4f0c2", "score": "0.58349305", "text": "def init_enemysprites\r\n # Make enemy sprites\r\n @enemy_sprites = []\r\n for enemy in $game_troop.enemies.reverse\r\n @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))\r\n end\r\n end", "title": "" }, { "docid": "42f0384864fcd096310dce7ca7d38ab7", "score": "0.5827838", "text": "def init_sprite\n return if @mouse && !@mouse.disposed?\n init_fps_text\n return if @no_mouse\n @mouse = Sprite.new\n @mouse.z = 200_001\n mouse_skin = PSDK_CONFIG.mouse_skin || (Config.const_defined?(:MouseSkin) && Config::MouseSkin)\n if mouse_skin && RPG::Cache.windowskin_exist?(mouse_skin)\n @mouse.bitmap = RPG::Cache.windowskin(mouse_skin)\n else\n @mouse.bitmap = Bitmap.new(\"\\x89PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x11\\x04\\x03\\x00\\x00\\x00\\x16\\r \\xD6\\x00\\x00\\x00\\x0FPLTENNN\\xA3I\\xA4\\xE5\\xE5\\xE5\\xD3\\xD3\\xD3\\xC3\\xC3\\xC3RUt6\\x00\\x00\\x00\\x02tRNS\\xFF\\x00\\xE5\\xB70J\\x00\\x00\\x00GIDATx\\x015\\xCA\\xC1\\t\\xC40\\fD\\xD1/[\\x05\\xAC:XH\\x03\\x01\\xA7\\x00\\x1F\\xA6\\xFF\\x9A2\\x16D\\x87\\a\\x9F\\x11Q>h\\xC7\\t\\xC6\\xBF\\xBD\\x1C\\xCCu\\xB7+\\xDA}|\\x14LI\\x9B\\x94\\x80D^\\xA9\\xF4\\x1Am\\xD5\\xCF?\\x9F\\xEE\\x17sz\\a\\xBD\\xEBds/\\x00\\x00\\x00\\x00IEND\\xAEB`\\x82\", true)\n end\n\n detect_gl_version\n end", "title": "" }, { "docid": "8890eadeb1c3e928482718f51822c008", "score": "0.5812242", "text": "def initialise(loadfile)\n\n # Initialise steps\n\n phases = Phases.new\n $commands = Commands.new\n \n if $testing == 1\n require_relative 'Testing.rb'\n require_relative '../Extra/Parser.rb'\n end\n \n if $debugplay == 1\n $debug.debugplay\n end\n \n # Initialise graphics if graphics mode is on\n #if $graphics == 1\n #require 'RMagick'\n require_relative '../Graphics/GraphicsHandler.rb'\n #graphicsinit\n #end\n \n #system(\"unzip ../Resources/Images.zip\")\n \n \n # Load game\n if $loadgame == true\n loadgame(loadfile)\n end\n \n # Set command authentication levels\n IO.foreach(\"cards.txt\") { |line| puts line }\n \nend", "title": "" }, { "docid": "b045c309fd3b8a6347f2de483fcf7043", "score": "0.5803773", "text": "def initialize(window)\n @window = window\n @color = Gosu::Color::BLACK\n\n @a = CP::Vec2.new(0,0)\n @b = CP::Vec2.new(SCREEN_WIDTH - (PADDING * 2), 0)\n\n # CHIPMUNK BODY\n @body = CP::Body.new(INFINITY, INFINITY)\n @body.p = CP::Vec2.new(PADDING, SCREEN_HEIGHT - PADDING)\n @body.v = CP::Vec2.new(0, 0)\n\n # CHIPMUNK SHAPE\n @shape = CP::Shape::Segment.new(@body,\n @a,\n @b,\n 1)\n @shape.e = 0\n @shape.u = 1\n\n # STATIC SO THAT THE GRAVITY OF THE SPACE DOESN'T HAVE ITS WAY\n @window.space.add_static_shape(@shape)\n\n end", "title": "" }, { "docid": "2fca81046181400881e5b03652c6608c", "score": "0.5789992", "text": "def create\n @batch = com.badlogic.gdx.graphics.g2d.SpriteBatch.new\n @font = com.badlogic.gdx.graphics.g2d.BitmapFont.new\n @shape = com.badlogic.gdx.graphics.glutils.ShapeRenderer.new\n end", "title": "" }, { "docid": "ebca7f4ab7838c96fd23a26a18c53c0a", "score": "0.57856846", "text": "def tick_initialize\n initialize_tiles\n loading_label = {\n x: 640,\n y: 400,\n text: \"Reticulating Splines...\",\n size_enum: 0,\n alignment_enum: 1,\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }\n @args.outputs.background_color = [0, 0, 0]\n @args.outputs.labels << loading_label\n @args.outputs.solids << { x: 320, y: 300, w: 640 * initialization_percent, h: 50, r: 0, g: 255, b: 0, a: 255 }\n @args.outputs.borders << { x: 320, y: 300, w: 640, h: 50, r: 255, g: 255, b: 255, a: 255 }\n end", "title": "" }, { "docid": "3182d23215d4454f8397dbed0ff1adc6", "score": "0.5784276", "text": "def setup\n @potential_plays = [\"rock\", \"paper\", \"scissors\"]\n @win_counter = Hash[\"P1\",0, \"P2\",0]\n end", "title": "" }, { "docid": "6f53a90962f7dc90dbccbfe5b4f75b28", "score": "0.5778723", "text": "def init_battleback\r\n # Make battleback sprite\r\n @battleback_sprite = Sprite.new(@viewport1)\r\n end", "title": "" }, { "docid": "6913d58f5644dd381b7b22c2d4adc02e", "score": "0.57713896", "text": "def setup_players\n @players = []\n @players << add(Spaceship, 400, 320)\n @players << add(Tank, width/2, height-100)\n end", "title": "" }, { "docid": "01e1f1277587549284881b5b9c4d9171", "score": "0.5765731", "text": "def pbSceneStandby\n Graphics.frame_reset; yield\n $scene.disposeSpritesets if $scene && $scene.is_a?(Scene_Map)\n $scene.createSpritesets if $scene && $scene.is_a?(Scene_Map)\nend", "title": "" }, { "docid": "6feea0669fdc5f73edba2faa427ecc52", "score": "0.576255", "text": "def initialize_game\n setup_boards\n end", "title": "" }, { "docid": "467a668f4401eaee0b5bb0f71f9c078d", "score": "0.57548046", "text": "def setup\n self.parse() # load file\n puts(\"+Constructing a total of (#{@groups.keys.size}) Groups:\") if @verbose\n @groups.each_value do |grp|\n grp.displaylist = glGenLists( 1 )\n glNewList(grp.displaylist, GL_COMPILE )\n puts(\" * \\\"#{grp.name}\\\" : Faces(#{grp.faces.size}) openGL draw list cached.\") if @verbose\n grp.gl_draw_list(self) # create precahced draw operation\n glEndList()\n end\n puts(\"+Total Count of Faces: [ #{self.get_face_count} ]\") if @verbose\n # display materials information\n puts(\"+Material Lib: \\\"#{material_lib}\\\" with (#{@current_materials.size}) Name Refrences.\") if @verbose\n end", "title": "" }, { "docid": "f39008f27a1586bf00439e087221d94b", "score": "0.5730097", "text": "def initialize title, grid\n\t\t@grid = grid\n\t\tsuper @grid.width * 2, @grid.height * 2, false\n\t\tself.caption = title\n\t\t@counter = 0\n\n\t\t@white = Gosu::Image.new(self, \"white.png\", true)\n\t\t@red = Gosu::Image.new(self, \"red.png\", true)\n\n\t\t@time = Time.now\n\tend", "title": "" }, { "docid": "92b0852732133ffb0cd7fc4b09acf23b", "score": "0.57278275", "text": "def setup_skos\n\n #skosfile = File.dirname(__FILE__) + ::File::SEPARATOR + \"skos.rdf\"\n skosfile = File.expand_path(\"skos.rdf\", File.dirname(__FILE__))\n @log.info(\"Load SKOS itself to be able to render labels etc later. File: \" + skosfile)\n\n RDF::Reader.open(skosfile) do |reader|\n reader.each_statement do |statement|\n if statement.predicate == \"http://www.w3.org/2000/01/rdf-schema#label\" then\n @skos_objs << {:obj => statement.subject.to_s.sub(\"http://www.w3.org/2004/02/skos/core#\",\"\"), :label => statement.object.to_s.downcase.strip}\n\n @log.info(\"Adding #{statement.object.to_s.downcase.strip}, #{statement.subject.to_s}\")\n end\n end\n end\n\n end", "title": "" }, { "docid": "9fef5d6da6c9b95e40fbbc42e14a5e1d", "score": "0.5724792", "text": "def main_begin\n create_graphics\n sort_sprites\n fade_in(@mbf_type || DEFAULT_TRANSITION, @mbf_param || DEFAULT_TRANSITION_PARAMETER)\n end", "title": "" }, { "docid": "33788399f0e4f6e66f1d32f1c98efbd1", "score": "0.5723907", "text": "def initialize \n super(ScreenWidth, ScreenHeight, false)\n self.caption = \"Mad Pokemon\"\n $window = self\n\n @@images = Hash.new\n @@fonts = Hash.new \n load_images\n load_fonts\n\n @@fading_off = false\n @@fading_on = false\n @@end_fade = 0\n @@start_fade = 0\n\n @@change_game_state = nil\n\n @@game_state = MenuState.new\n end", "title": "" }, { "docid": "a06288026020d343afb31c3ef1f5130e", "score": "0.5722967", "text": "def setup\n\t\tbackground(0)\n\t\tzahlen = (2*3*5*7)-1# <-- change integer here. # what is biggest array?\n\t\t@table = color_it(rsa_group(zahlen))\n\t\tsquare = [1000] * 2 ; size(*square)\n\t\tframe_rate 1 ; colorMode(HSB,360,100,100)\n\tend", "title": "" }, { "docid": "e54d09d536660daf57b186ff99cc8947", "score": "0.57213414", "text": "def my_initialize\n\t\t@classes = 1\n\t\t@toys = 0\n\t\t@books = 0\t\t\n\t\tsrand seed.to_i\n\t\t@location = nil\n\t\tnext_spot()\n\t\t@random_number = 0\n\t\ttrue\n\tend", "title": "" }, { "docid": "3d9d541b99d0d1e28a0378fdc8e61bd9", "score": "0.57208335", "text": "def initialize\n @game_settings = GameSettings.new\n super 920, 480\n self.caption = GAME_TITLE\n @settings_hovered = Options::START_SCREEN[0]\n @title_font, @subtitle_font = Gosu::Font.new(50), Gosu::Font.new(20)\n @background_image = Gosu::Image.new(\"media/background1.jpg\", :tileable => true)\n @blank_card = Gosu::Image.new(\"media/card.png\", :tileable => true)\n @button_option = Gosu::Image.new(\"media/button.png\", :tileable => true)\n @deck = Deck.new\n @playing_cards = Array.new\n @computer_signal = ComputerTimer.new\n @players_created, @mes, @false_mes, @true_mes, @trying_mes = false, false, false, false, false\n @hint = []\n #players\n @pressed, @p1, @p2 = nil, nil, nil\n @game_timer = Timers.new\n end", "title": "" }, { "docid": "77ab4a8d7ed1447815a1993594bd9493", "score": "0.5720621", "text": "def initialize\n @screen = Game_Screen.new\n @interpreter = Game_Interpreter.new(0, true)\n @map_id = 0\n @display_x = 0\n @display_y = 0\n create_vehicles\n end", "title": "" }, { "docid": "92f485341a7d757a82a2091f9a460fb6", "score": "0.57181376", "text": "def initialize (window, x, y)\n # Establishes a sprite for the palyer\n @image = Gosu::Image.new(window, \"media/Starfighter.bmp\", false)\n # Initializes the x,y and last position\n @x, @y = x, y\n @lastPosX = @lastPosY = @lastShot = 0\n # Initializes x-y-velocity\n @vel_x = @vel_y = 0\n # Stores instance of window\n @window = window\n # Establishes constant velocity for x and y directions\n @VELOCITY = 3\n # Boolean which measures if the ship is dead or not\n @isKill = false\n end", "title": "" }, { "docid": "1e1fdeaf33040cc06126d1823dabea59", "score": "0.5716117", "text": "def start\n\t\tinit\n\t end", "title": "" }, { "docid": "520cb325c97e41766065ac839ad7660f", "score": "0.5712904", "text": "def didMoveToView _\n # Set the aspect ratio.\n self.scaleMode = SKSceneScaleModeAspectFit\n\n # Set the background color to white.\n self.backgroundColor = UIColor.whiteColor\n\n # Add instructions for this scene.\n add_label <<-HERE\n This is scene two. This scene shows a spinning sprite.\n\n The sprite code is located in the add_sprite method in scene_two.rb file. Take a look at it. Be sure to read all the comments in the file.\n\n Once you're done reading the code. Tap anywhere to go to the next scene.\n HERE\n\n # Add sprite (which will be updated in the render loop).\n # Assets are located inside of the resources folder.\n @square = add_sprite device_screen_width.fdiv(2),\n device_screen_height.fdiv(2),\n 'square.png'\n end", "title": "" }, { "docid": "2d6c0fe6174392dc9e860a6a871b65a6", "score": "0.5700764", "text": "def setup\n\t\ttext_font create_font(\"SanSerif\",10);\n\t\t# size(1920,1080) #JackRabbit\n\t\tsquare = [1080] * 2 + [P3D] # 800\n\t\t@w,@h = [square[0]/2] * 2\n\t\tsize(*square) ; @bs = [height,width].min\n\t\t@i, @t = [0] * 2 ; background(0)\n\t\t@colors = (0..3).map{|i|rand(255)}\n\t\tframe_rate 50 ; colorMode(HSB,360,100,100)\n\t\tno_fill() ; lights() ; no_stroke\n\n\t\tfile = \"#{FILES_PATH}/processed_history.csv\"\n\n\t\tloc_type_pair = DATA\n\t\t@with_type = CSV.read(file).map do |line|\n\t\t\ttype = loc_type_pair.detect{|loc,type| loc == line[1]}[1]\n\t\t\tline[4] = type ; line\n\t\tend\n\tend", "title": "" }, { "docid": "a54a15380ab55c1f52bdca82bf675fc5", "score": "0.56983835", "text": "def initialize(save_file=nil)\n super()\n\n @tiles = Gosu::Image.load_tiles(\n RES_DIR.join(\"tiled-icons-16x16.png\").to_s, \n 16, 16,\n retro: true)\n\n @letters = Gosu::Image.load_tiles(\n RES_DIR.join(\"tiled-font-8x16.png\").to_s,\n 8, 16,\n retro: true)\n\n @tile_scale = Size[2,2]\n @grid_size = Size[32,32]\n @map_size = Size[25,19]\n @window = Window.new(size: Size[800,608])\n @window.on_input= self.method(:on_input)\n @window.on_update= self.method(:on_update)\n @window.on_draw= self.method(:on_draw)\n\n @prng = Random.new\n\n sword = {\n tile_index: 5,\n card_type: :weapon,\n description: \"sword\",\n cooldown: 3,\n cooldown_timer: -1\n }\n\n magic_missile = {\n tile_index: 6,\n card_type: :spell,\n description: \"magic missile\",\n contamination: 3,\n }\n\n meat = {\n tile_index: 4,\n card_type: :item,\n description: \"hunk of meat\",\n }\n\n @player = { \n name: \"Player\",\n tile_index: 0,\n action: nil,\n position: Point[1,1],\n movement: nil,\n card_state: {\n contaminated: true,\n weapon: sword,\n spell: magic_missile,\n item: meat,\n deck: [],\n }\n }\n\n goblin = {\n name: \"Goblin\",\n tile_index: 1,\n action: nil,\n position: Point[3,3],\n movement: nil,\n ai_method: :goblin_ai,\n }\n\n walls = Bitmap.new(MAP_SIZE).from_s(WALLS).active_coords.map do |pt|\n {\n tile_index: 2,\n position: pt,\n obstructing: true\n }\n end\n\n @movement = [@player, goblin]\n @with_cards = [@player]\n @ai_method = [goblin]\n @action = [@player, goblin]\n @visible = [@player, goblin, *walls]\n\n @map = {\n size: Size[20,20],\n index: {\n @player[:position] => [@player],\n goblin[:position] => [ goblin],\n },\n }\n\n @map[:index].default_proc = Proc.new do |hash, key|\n hash[key]= []\n end\n\n walls.each do |entity|\n pos = entity[:position]\n @map[:index][pos] << entity\n end\n end", "title": "" }, { "docid": "1964991b573bba54eb2d18205d60950c", "score": "0.56965387", "text": "def initialize\n \t\ttmax = TERRAIN_TRIANGLE_MAX_HEIGHT\n \t\ttmin = TERRAIN_TRIANGLE_MIN_HEIGHT\n \tsuper(50,100, tmin, tmax-tmin, BROWN)\n\t @depth = 20\n \t@groups = [:all, :terrain, :can_kill]\n \tend", "title": "" }, { "docid": "bdad317124dcb5dc881045dfe336629d", "score": "0.56928015", "text": "def initialize(frames = 1024)\n $frames = Frame.new(1024)\n $bm = Bitmap.new(1024)\n\n init_segment_table\n end", "title": "" }, { "docid": "a323e4e76f48c3b1337e8fbc450c5625", "score": "0.56872153", "text": "def initialize(image, x, y, oy)\n @sprite = ::Sprite.new(Particles.viewport, true)\n @sprite.bitmap = ::RPG::Cache.autotile(image)\n @sprite.oy = @sprite.bitmap.height - oy - 16\n @x = (x + MapLinker.get_OffsetX) * 16\n @y = (y + MapLinker.get_OffsetY) * 16\n @real_y = (y + MapLinker.get_OffsetY) * 128\n @map_id = $game_map.map_id\n update\n end", "title": "" }, { "docid": "f616abbc97cc03034dd975b2bcf12101", "score": "0.5685818", "text": "def setup_anim\n if $game_temp.one_animation_flag || (@acts[1].nil? && item_in_use &&\n item_in_use.one_animation)\n handler = get_spriteset.one_anim\n size = target_array.size\n xpos = target_array.inject(0) {|r,battler| r + battler.x}/size\n ypos = target_array.inject(0) {|r,battler| r + battler.y}/size\n zpos = target_array.inject(0) {|r,battler| r + battler.screen_z}/size\n handler.set_position(xpos, ypos, zpos)\n sprites = target_array.collect {|t| t.sprite}\n handler.target_sprites = sprites\n anim_id = (@acts[1].nil? ? item_in_use.animation_id : @acts[1])\n anim_id = atk_animation_id1 if anim_id == -1 && actor?\n mirror = flip || @acts[2]\n $game_temp.one_animation_id = anim_id\n $game_temp.one_animation_flip = mirror\n $game_temp.one_animation_flag = false\n elsif area_flag\n target_array.uniq.each do |target|\n setup_target_anim(target, @acts)\n end\n else\n setup_target_anim(target, @acts)\n end\n end", "title": "" }, { "docid": "272387e05c6abf627d8694f96e15a748", "score": "0.5669527", "text": "def initialize(testmode)\n super(FRAME_WIDTH, FRAME_HEIGHT, false)\n self.caption = \"Shoota\"\n @state = :in_game\n \n #@gl_background = GLBackground.new(self)\n #@background_image = Gosu::Image.new(self, \"media/Space.png\", true)\n \n # Lists of sprites elements\n @bullets = []\n @e_bullets = []\n @ennemies = []\n @bonuses = []\n @particles = []\n \n # Launch player\n @player = Player.new(self, FRAME_WIDTH/2, 4.0/5.0*FRAME_HEIGHT)\n \n # Create Waves generator\n if testmode\n @w_generator = Wave_Generator_Test.new self\n else\n @w_generator = Wave_Generator.new self\n end\n\n @finished = false\n \n # Fonts for textual elements\n @font = Gosu::Font.new(self, Gosu::default_font_name, 20)\n @big_font = Gosu::Font.new(self, Gosu::default_font_name, 52)\n \n # other constants\n # TODO use Image.from_text() instead\n @GAME_OVER_X = (FRAME_WIDTH - @big_font.text_width(\"GAME OVER\"))/2.0\n @GAME_OVER_Y = (FRAME_HEIGHT - @big_font.text_width(\"GAME OVER\")/9.0)/2.0\n @THE_END_X = (FRAME_WIDTH - @big_font.text_width(\"THE END\"))/2.0\n @THE_END_Y = (FRAME_HEIGHT - @big_font.text_width(\"THE END\")/9.0)/2.0\n \n end", "title": "" }, { "docid": "27dfcb880db8e9b26b6306ae0e46877e", "score": "0.56538534", "text": "def initialize settings={:x => 0, :y => 0, :width => 0, :height => 0, :life => 1, :depth => 0}\n\t\t\ts = {:x => 0, :y => 0, :width => 0, :height => 0, :life => 1, :depth => 0}.merge! settings\n\t\t\tUtil.hash_to_var(s, [:x, :y, :width, :height, :life, :depth], self)\n\t\t\t@@game.add self\n\t\tend", "title": "" }, { "docid": "eb491a5f2365797490246ed9adf7fe42", "score": "0.564104", "text": "def setup\n size 200, 200\n frame_rate 30\n @a = 0\n \n # The background image must be the same size as the parameters\n # into the size method. In this program, the size of \"milan_rubbish.jpg\"\n # is 200 x 200 pixels.\n @background_image = load_image \"milan_rubbish.jpg\"\nend", "title": "" }, { "docid": "823b66308265a4cc7a5f4dff9fd7fc4c", "score": "0.56399107", "text": "def preload!\n end", "title": "" }, { "docid": "e6cd06ff5d727b0cd1dcab9f53702ae4", "score": "0.5636299", "text": "def initialize\n @shapes = Set.new\n @lights = Set.new\n end", "title": "" }, { "docid": "aae260fa4dbf9b558a3923d3e2dd7eee", "score": "0.5634603", "text": "def init_variables\n\t\t@canvas = Magick::ImageList.new \n\t\t@canvas_width = 2880\n\t\t@canvas_height = 1800\n\t\t@quote = self.quote\n\t\t@citation = self.citation\n\t\t@highlight = self.colour_scheme.highlight\n\t\t@quote_marks = self.layout_scheme.quote_marks \n\t\t@font_size = self.layout_scheme.font_size.to_i\n\t\t@col = self.layout_scheme.col.to_i\n\t\t@position = self.layout_scheme.position\n\t\t@underline = self.layout_scheme.underline\n\tend", "title": "" }, { "docid": "8449c9d23ae91922c2f813149a9a6d6f", "score": "0.5633595", "text": "def initialize(base)\n self.count = 0\n self.boards = []\n self.maxvalue = 0\n # base directory/path where images are stored\n self.base = base\n %x{mkdir -p #{base}}\n %x{mkdir -p #{File.join(base, \"data\")}}\n end", "title": "" }, { "docid": "e577fb1aea0d602f305533a23f23609c", "score": "0.56323564", "text": "def initialize(game_player)\n @game_player = game_player\n @sprite = Sprite.new($visuals.viewport)\n @sprite.set_bitmap(\"gfx/characters/\" + game_player.graphic_name)\n @sprite.src_rect.width = @sprite.bitmap.width / 4\n @sprite.src_rect.height = @sprite.bitmap.height / 4\n @sprite.src_rect.y = @sprite.src_rect.height * (@game_player.direction / 2 - 1)\n @sprite.ox = @sprite.src_rect.width / 2\n @sprite.oy = @sprite.src_rect.height\n @sprite.x = Graphics.width / 2\n @sprite.y = Graphics.height / 2 + 16\n @sprite.z = @sprite.y + 31\n @oldx = @game_player.global_x\n @oldy = @game_player.global_y\n @xdist = []\n @xtrav = []\n @xstart = []\n @xloc = []\n @ydist = []\n @ytrav = []\n @ystart = []\n @yloc = []\n @anim = []\n @fake_anim = nil\n @stop_fake_anim = false\n end", "title": "" }, { "docid": "1902ef14835a4b5b639ac127e417cde0", "score": "0.56305736", "text": "def load_tsbs\n @sprite_name = \"\"\n @collapsound = $data_system.sounds[11]\n super\n end", "title": "" }, { "docid": "d2a3d453bd2d4f8b6a948f5abff453ae", "score": "0.5627802", "text": "def start_scene; end", "title": "" }, { "docid": "05fa317d45346fda7be0aa7901f5ae68", "score": "0.562381", "text": "def initialize(setup)\n @grid = Array.new(8) { Array.new(8, nil)}\n\n if setup\n setup_pieces\n end\n end", "title": "" }, { "docid": "fa04026d73b5bba9b8dec85a328117bd", "score": "0.5621069", "text": "def init\r\n @tasks = {\r\n on_update: {},\r\n on_scene_switch: {},\r\n on_dispose: {},\r\n on_init: {},\r\n on_warp_start: {},\r\n on_warp_process: {},\r\n on_warp_end: {},\r\n on_hour_update: {},\r\n on_getting_tileset_name: {},\r\n on_transition: {}\r\n }\r\n @storage = {}\r\n end", "title": "" } ]
7721f8f0ac4f275f39ac69e547584b4a
find the id of the next item so (current..next).size == chunk_size
[ { "docid": "c98a2e45dd089963833344be2ecbc65e", "score": "0.63491136", "text": "def get_next_offset(current)\n context.select_value(sanitize([\n %Q{\n SELECT MAX(id)\n FROM (\n SELECT id FROM #{source}\n WHERE id > ?\n ORDER BY id\n LIMIT ?\n ) AS t\n },\n current,\n chunk_size\n ])).tap do |next_offset|\n logger.debug(\"-> Next offset is: #{next_offset}\")\n end\n end", "title": "" } ]
[ { "docid": "08c93322228a7978523ac71e6bf262a6", "score": "0.7127212", "text": "def get_next\n r = nil\n iterator_lock do\n if @iterator <= @last_id\n r = get(@iterator)\n @iterator += 1\n @iterator_file.write(\"#{@iterator.to_s(36)}\\n\")\n r\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "75363db14abda6d8ccf71258745a1842", "score": "0.69644934", "text": "def next_id\n @next_id = ((start...(start + size)).to_a - leases.map { |l| l.id }).first\n end", "title": "" }, { "docid": "6ce96fbee52370f9aaef2f73d3f6219a", "score": "0.6888967", "text": "def next_item\n @current += 1 if @current < last\n\n items\n end", "title": "" }, { "docid": "f2f11ac20eae5de39bc5a2f5fb6c278a", "score": "0.6869496", "text": "def read_next_id\n id = nil\n list = current_list\n\n if @co_index <= list.size\n id = list[@co_index - 1][:id]\n end\n\n @co_index += 1\n\n id\n end", "title": "" }, { "docid": "1667733dc8337a9714f251457fcd5e1e", "score": "0.6807286", "text": "def next_id\n @imutex.synchronize do\n @mid += 1\n end\n end", "title": "" }, { "docid": "8f637b7fc77d6433e4d40ac872bc8c22", "score": "0.6758881", "text": "def next_chunk_number\n\t\t\treturn -1\n\t\tend", "title": "" }, { "docid": "76a266e6f00ecd2bfbb6e5e12eb8599d", "score": "0.6522448", "text": "def next_free_id\n # Index 0 is not valid, so start at 1.\n found = (1...@items.length).find do |i|\n @items[i].nil?\n end\n if found\n # There's an empty slot.\n found\n else\n # No empty slots, next ID is at the end.\n @items.length\n end\n end", "title": "" }, { "docid": "8b2252861cdcafd864ef4f4bddfef2a4", "score": "0.6511649", "text": "def next\n\t\t# Use up all of the extras\n\t\treturn @extras.pop if !@extras.empty?\n\t\t# Then track the last freeid used (which should always be the max)\n\t\treturn (@last+=1)-1\n\tend", "title": "" }, { "docid": "62200e1fa4ce4de98ffcb329a07c5ca8", "score": "0.63280755", "text": "def next_offset\n [all_contents.size + 1, offset + limit].min\n end", "title": "" }, { "docid": "c9edfd4e4e61fa5a36277e1e39655f79", "score": "0.63200915", "text": "def next_id(items)\n max_id = items.map { |item| item[:id] }.max || 0\n max_id + 1\nend", "title": "" }, { "docid": "4d97e3e5af29d70cab5cc79624d767d9", "score": "0.623989", "text": "def next\n Photo.find_by_id(next_id) if next?\n end", "title": "" }, { "docid": "4d861acb6a3151188522d2c4f11dccf6", "score": "0.6136826", "text": "def item_at_head\n\t\t\t@head.next\n\t\tend", "title": "" }, { "docid": "9d19d5986425dbb6253b8a26eedb263c", "score": "0.6069068", "text": "def next\n next? ? @current + 1 : nil\n end", "title": "" }, { "docid": "244581346e9b235b5496c6971b1b5b7c", "score": "0.60583264", "text": "def get_next_id\n id = 0\n contacts = read_contacts\n contacts.each do |contact|\n if id < contact[:id]\n id = contact[:id]\n end\n end\n id + 1\nend", "title": "" }, { "docid": "35d6c0b9e0a2ca9712b160f507323e70", "score": "0.6028435", "text": "def next_offset\n next_offset = offset + limit\n return nil if next_offset >= total\n\n next_offset\n end", "title": "" }, { "docid": "23f87abf03f11bd29d8e8c2daf374973", "score": "0.6010095", "text": "def next\n complete_chunk_size = 4 + @size_length + @header_size + self.size\n remaining_size = @max_size - complete_chunk_size\n raise \"#{self} - Remaining size for next chunk: #{remaining_size}\" if remaining_size < 0\n remaining_size > 0 ? Chunk.new(@file_name,\n offset: @offset + complete_chunk_size,\n chunks_format: @chunks_format,\n max_size: remaining_size,\n parent_chunk: @parent_chunk,\n warnings: @warnings,\n debug: @debug\n ) : nil\n end", "title": "" }, { "docid": "c47d6d0d455f43a4d8b0adc2b8c6969a", "score": "0.60049355", "text": "def next\n last? ? nil : locate + 1\n end", "title": "" }, { "docid": "d9b41a51cc0b9df7991b753a6b5d1603", "score": "0.59309846", "text": "def index(key, size)\n i = IndexNext.new\n sum = 0\n i.next = 0\n # generate index with ascii code\n key.each_byte do |c|\n sum += c\n end\n i.index = sum % size\n if self.list[i.index] != nil\n #loop through the next available slot\n i.index = i.index + 1\n #index and number_searched is returned to i\n i = next_open_index(i.index)\n else\n #when empty just return sum % size\n i\n end\n end", "title": "" }, { "docid": "321ef41a7c1159e9784d87fd9d1dde1d", "score": "0.58933574", "text": "def get_next_entry; end", "title": "" }, { "docid": "ca0fdffabc74d75c9a5062c7063ad108", "score": "0.5892393", "text": "def next_available_index\n for index in 0..32 do\n break index unless self[index].exists?\n end\n end", "title": "" }, { "docid": "4be06d92af620ca89bd7db32eb9f4ea1", "score": "0.5887218", "text": "def next\n\t\tself.class.where(\"id > ?\", id).first\n\tend", "title": "" }, { "docid": "7d802b7cc7d536db5667e5cd79fc225b", "score": "0.5875641", "text": "def next_chunk\n mwc = (new_z << 16) + new_w\n [mwc].pack('L>')\n end", "title": "" }, { "docid": "d2677519106727fd8f6915985a94526f", "score": "0.5866504", "text": "def test_next\n\t\tassert_equal(6, @freeid.next, \"Extras not working\")\n\t\tassert_equal(1, @freeid.next, \"Last not working\")\n\t\tassert_equal(2, @freeid.next, \"Last not incrementing\")\n\tend", "title": "" }, { "docid": "8c9f3004668d6b5ffb973354eac609d5", "score": "0.58641815", "text": "def next_key\n @next && @next.key\n end", "title": "" }, { "docid": "ff4d7b6f8e3b0671bdd424cd2cf8bb54", "score": "0.58621705", "text": "def next\n @pointer += 1\n end", "title": "" }, { "docid": "61cad9de7fed4f026cd33945b475048d", "score": "0.5856406", "text": "def next_id\n @id ||= 0\n @id += 1\n end", "title": "" }, { "docid": "b9c3059c2c22ab11876cca89e6c949cc", "score": "0.5848767", "text": "def next_item\n storage.rotate!\n\n update\n end", "title": "" }, { "docid": "b9c3059c2c22ab11876cca89e6c949cc", "score": "0.5848767", "text": "def next_item\n storage.rotate!\n\n update\n end", "title": "" }, { "docid": "b022b3f85e6106606f1ecbbbaefdedda", "score": "0.58429676", "text": "def next\n \tself.class.where(\"id > ?\", id).first\n \tend", "title": "" }, { "docid": "8e148868ab3c6766729ee6553b3db580", "score": "0.58374965", "text": "def next_object_id\n\t\t\t@@object_count += 1\n\t\tend", "title": "" }, { "docid": "24c37d03489e67bd74c2fb3c9d354e23", "score": "0.58341414", "text": "def next\n\t\t@curItem.where(\"id > ?\", id).order(\"id ASC\").first || @curItem.first\n\t\t@curItem.show\n\tend", "title": "" }, { "docid": "b335346849328d95e6663443d48210f5", "score": "0.58117145", "text": "def next_serial_number\n size + 1\n end", "title": "" }, { "docid": "e1c6d53570de08ca73fbf9e9d02b8320", "score": "0.58031017", "text": "def next(pointer); end", "title": "" }, { "docid": "e1c6d53570de08ca73fbf9e9d02b8320", "score": "0.58031017", "text": "def next(pointer); end", "title": "" }, { "docid": "2f66596d23ed4eaaadd53de8673b66a9", "score": "0.5799905", "text": "def next_group_id\n if @groups.empty?\n # Start each time from 1 to make sure groups get the same id's for the\n # same input data\n 1\n else\n id = @groups.last.id\n loop do\n id += 1\n break id if @groups.find { |g| g.id == id }.nil?\n end\n end\n end", "title": "" }, { "docid": "668c6060a4f12b0d75a6e21ce8663935", "score": "0.5785054", "text": "def next_item\n storage.rotate!\n\n update\n end", "title": "" }, { "docid": "1139aebfc32d67ebaa0aa94060e81f59", "score": "0.57841015", "text": "def next\n @counter += 1\n @counter = 0 if @counter >= @buffers.size\n @buffers[@counter]\n end", "title": "" }, { "docid": "d859f16060b9b748c9445b6f9f249856", "score": "0.57827556", "text": "def next_id\n self[:next_id]\n end", "title": "" }, { "docid": "d760911284b8ed99b484b3163900b852", "score": "0.5782014", "text": "def next_stream_id\n\t\t\t\tid = @local_stream_id\n\t\t\t\t\n\t\t\t\t@local_stream_id += 2\n\t\t\t\t\n\t\t\t\treturn id\n\t\t\tend", "title": "" }, { "docid": "079c1f21562a9c3867d2bc1d0355ddde", "score": "0.57766604", "text": "def seek\n while @next < @n && @ptns[@next].size == @nums[@next]\n @next += 1\n end\n @next < @n # return true/false\n end", "title": "" }, { "docid": "d10fa4d3a46e23a76778077c1fa1ad3d", "score": "0.5772465", "text": "def next_number\n self.to_a.size + 1\n end", "title": "" }, { "docid": "55e8225ed5048f2ee2e3413aa5e98624", "score": "0.5763291", "text": "def get_next_object\n unless( @next_object )\n @next_object = reserve\n get_more\n end\n get_head\n end", "title": "" }, { "docid": "5765b752115f50c298405331b4cfe3e9", "score": "0.57517546", "text": "def row_id n\n n % @size\n end", "title": "" }, { "docid": "c129811837f5ee764625f4365851de12", "score": "0.574607", "text": "def next\n\t\t@ibuf = (@ibuf+1).modulo(@nbuf)\n\t\t@buffers[@ibuf]\n\tend", "title": "" }, { "docid": "3ab522b5e221980866b9d123974308d0", "score": "0.57444215", "text": "def next_element\n validates_possibility_of :next\n self.index += 1\n self.current\n end", "title": "" }, { "docid": "dcbdb86942f7d8c4f290c78d2361e6cf", "score": "0.5729847", "text": "def next\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) < master_files_sorted.length\n return master_files_sorted[master_files_sorted.find_index(self)+1]\n else\n return nil\n end\n end", "title": "" }, { "docid": "efd7bd46bb16fe1e76acd011ed03fa8c", "score": "0.5728123", "text": "def next_available_id\n last_id = all_ids.map do |key|\n key.sub(\"#{self.name}_\", \"\").to_i\n end.max.to_i\n\n last_id + 1\n end", "title": "" }, { "docid": "c303d4cdb779d01a93a5893913af1ff7", "score": "0.57241166", "text": "def get_index(i)\n\t\tif (!@head || @size < i+1)then return false end\n\t\tcurrent = this.head\n\t\tcount = 0\n\t\twhile (count < i) #go to the index\n\t\t\tcurrent = current.get_next()\n\t\t\tcount+=1\n\t\tend\n\t\treturn current.get_item()\n\tend", "title": "" }, { "docid": "c2108736c56f0c96fd1dd85d9dbfefe6", "score": "0.5713131", "text": "def _next_id\n @@id -= 1\n @@id\n end", "title": "" }, { "docid": "fe0dd0e0214459d82e5f6a87fd3acd46", "score": "0.5712707", "text": "def next!\r\n @cur = @cache[@idx+=1]\r\n end", "title": "" }, { "docid": "9aa3e16be678d4430af53a2474f9cc9f", "score": "0.57098365", "text": "def get_next_by_group group\n r = nil\n group_iterator_lock(group) do\n @group_iterators[group] = 1 unless @group_iterators.key?(group)\n if @group_iterators[group] <= @last_id\n r = get(@group_iterators[group])\n @group_iterators[group] += 1\n group_iterators_file(group) do |f|\n f.write(\"#{@group_iterators[group].to_s(36)}\\n\")\n end\n else\n nil\n end\n end\n r\n end", "title": "" }, { "docid": "28599289797605c8698851c7652ebe31", "score": "0.5700494", "text": "def next_messages_id\n messages.max{|a,b| a[:id] <=> b[:id]}[:id] + 1\nend", "title": "" }, { "docid": "d316c8ac9233ed333674b76450350b77", "score": "0.56913435", "text": "def next_list_id(lists)\n max = lists.map { |list| list[:id] }.max || 0\n max + 1\nend", "title": "" }, { "docid": "0ca8ab48f27b1b92b2c89e6a03571136", "score": "0.5679857", "text": "def find_next\n PcpItem.where( pcp_subject_id: pcp_subject_id ).where( 'id > ?', id ).first\n end", "title": "" }, { "docid": "9502cabe22d2e3ec9f938b2e6cad7dd6", "score": "0.56755793", "text": "def next_identifier\n if @identifier >= @max_identifier\n @identifier = 1\n else\n @identifier += 1\n end\n end", "title": "" }, { "docid": "54e5bb8455be4a728d71b2d655073854", "score": "0.56729233", "text": "def next\n self.class.where('id > ?', id).first\n end", "title": "" }, { "docid": "824daaa2c4b4504e352f58393f82bba8", "score": "0.5667695", "text": "def next\n last? ? nil : @collection[index + 1]\n end", "title": "" }, { "docid": "a5d748b442fe39dd181e55dbbecdd2e0", "score": "0.5651621", "text": "def next()\n result = current\n @index += 1\n @got_next_element = false\n @next_element = nil\n result\n end", "title": "" }, { "docid": "b3368486ee3740cfb3171bfdf2453cc4", "score": "0.5648537", "text": "def next\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) < master_files_sorted.length\n return master_files_sorted[master_files_sorted.find_index(self)+1]\n else\n return nil\n end\n end", "title": "" }, { "docid": "a43d8e53797c07aea93cf56702ee4270", "score": "0.5640298", "text": "def next_id\n (all.map(&:id).max || 0) + 1\n end", "title": "" }, { "docid": "84f81c59121255ed0e4d97d5938c7ba9", "score": "0.56388426", "text": "def next_id\n self.latest_id += 1\n end", "title": "" }, { "docid": "d1df69c08f5ab092db7482cf0c52aa0c", "score": "0.5634458", "text": "def next_read(meta)\n offset = meta.tail_page_offset\n index = meta.tail_page_index\n return EOQ if index >= meta.head_page_index && offset >= meta.head_page_offset\n\n buffer = mmap_buffer(index)\n buffer.position = offset\n\n if (size = buffer.get_int) == 0\n # we hit the trailing zero that indicates the end of data on this page\n # this tail page is now unsused and we will move to the next one\n offset = meta.tail_page_offset = 0\n purge_unused_page_index(meta.tail_page_index)\n index = meta.tail_page_index += 1\n return EOQ if index >= meta.head_page_index && offset >= meta.head_page_offset\n\n buffer = mmap_buffer(index)\n buffer.position = offset\n size = buffer.get_int\n end\n\n meta.tail_page_offset = offset + size + INT_BYTES\n meta.size -= 1\n\n [buffer, size]\n end", "title": "" }, { "docid": "027f89981796083e18c06cdb4216122a", "score": "0.5630241", "text": "def chunk_by_size(list, max_chunk_size)\n chunk_agg = 0\n list.slice_before do |elem|\n size = elem.size\n chunk_agg += size\n if chunk_agg > max_chunk_size\n # Can't fit element in current chunk, start a new one.\n chunk_agg = size\n true\n else\n # Add to current chunk\n false\n end\n end\n end", "title": "" }, { "docid": "9660e7ae0fd13d8c39b2bf5b6909464e", "score": "0.56251144", "text": "def next\n peek.tap { @position += 1 }\n end", "title": "" }, { "docid": "b383ed491bb6660a9f32ce09bca532fa", "score": "0.560181", "text": "def next\n at(position + 1)\n end", "title": "" }, { "docid": "4e2370b7d6d03fc548df20de3e25dc10", "score": "0.5601148", "text": "def next_temp_id\n @id ||= ASSET_GROUP_TEMPORARY_ID.to_i\n @id -= 1\nend", "title": "" }, { "docid": "d10b1cdae0933f51e621d496094e97e3", "score": "0.55998516", "text": "def choose_next_chunk\n token_ids_where = []\n\n # grab all but the first token in the chunk\n token_ids[1..].map.with_index do |token_id, index|\n # and build a where clause so that all the tokens in the array match.\n # Note: PostgreSQL arrays are 1-indexed and not 0-indexed\n token_ids_where << \"token_ids[#{index + 1}] = #{token_id}\"\n end\n token_ids_where = token_ids_where.join(' AND ')\n\n candidates = SentenceChunk\n .where(\"text_sample_id = :text_sample_id AND size = :sentence_chunk_size AND #{token_ids_where}\",\n text_sample_id: text_sample.id, sentence_chunk_size: size)\n .limit(nil)\n\n SentenceChunk.choose_chunk_from_candidates(candidates)\n end", "title": "" }, { "docid": "28dc86cbd6c148b80dce2d008adef288", "score": "0.5596603", "text": "def next\n\t\tself + 1\n\tend", "title": "" }, { "docid": "751461755396cf4eb3a4de66e95344b5", "score": "0.55932665", "text": "def next\n if next_listing = self.class.where(\"id > ?\", id).first\n next_listing\n else\n Listing.first\n end\n end", "title": "" }, { "docid": "ba5219c899ae57436f7df413ec874757", "score": "0.55630463", "text": "def index_of(item)\n hash_value = 0\n item.each_byte { |byte| hash_value += byte }\n hash_value % @table.size\n end", "title": "" }, { "docid": "e07b9e19df0335b298c30a00700947d3", "score": "0.55580765", "text": "def next\n update_current(list_index_of(@current))\n end", "title": "" }, { "docid": "d0573d32bd6f26d1b0b4e344dc5d71bc", "score": "0.55518275", "text": "def next\n Section.where(\"id > ?\", id).order(id: :asc).limit(1).first\n end", "title": "" }, { "docid": "d5b2dc5aa500971cdf1b55fbb5960b5a", "score": "0.5534882", "text": "def insert_next_id!(arr, step = 1, start = 0, max = Float::INFINITY)\n sorted_array = arr.sort\n arr_length = arr.length\n i = 0\n insertable = start\n\n while i < arr_length\n return insert_id!(arr, insertable) if insertable < sorted_array[i]\n\n insertable += step if insertable == sorted_array[i]\n return nil if insertable > max\n\n i += 1 if insertable > sorted_array[i]\n end\n\n insert_id!(arr, insertable)\nend", "title": "" }, { "docid": "8728a4e3340c0c5b8acd8094cac28ada", "score": "0.55263937", "text": "def next\n if @bucket and entry = @bucket[1]\n @bucket = nil\n return entry\n end\n\n while (@index += 1) < @maximum\n if @bucket = @entries[@index]\n return @bucket[0]\n end\n entry = @entries[@index]\n return entry if entry\n end\n end", "title": "" }, { "docid": "828e127a1110d85a1260958898a0a9b2", "score": "0.5521635", "text": "def next_id\n next_id = \"sdc:\" + (current_id.to_i + 1).to_s\n next_id\n end", "title": "" }, { "docid": "1c8613d57f94beb68b781c7482fd14d3", "score": "0.55110735", "text": "def find_next_in(parent, index)\n loop do\n while (c = parent.blocks[index])\n return c if c.context == :section && c.level <= @chunk_level\n\n index += 1\n end\n return unless parent.parent\n return unless (index = parent.parent.blocks&.find_index parent)\n\n parent = parent.parent\n index += 1\n end\n end", "title": "" }, { "docid": "e242f94be310771951ce395b740517d0", "score": "0.5508357", "text": "def next_asset_pid \n id_array = self.file_assets.map{ |asset| asset.id }.sort\n logger.debug(\"existing siblings - #{id_array}\")\n if id_array.empty?\n return \"#{self.id}a\"\n else\n if id_array[-1].match /[a-zA-Z]$/\n return \"#{self.id}#{id_array[-1].split('')[-1].succ}\"\n else\n return nil\n end\n end\n end", "title": "" }, { "docid": "f3f288c74e1283a061a7b7d83ed7f85b", "score": "0.5502243", "text": "def next_id\n COUNTER_LOCK.synchronize do\n @@id_counter += 1\n end\n end", "title": "" }, { "docid": "229707042f60420cd97e62247087ff05", "score": "0.5498239", "text": "def next_open_index(index)\n (index...(index + @size)).each do |i|\n if i >= @size\n i = i % @size\n end\n\n if @nodes[i] == nil\n return i\n end\n end\n\n return -1\n end", "title": "" }, { "docid": "2ae2478c120b7c9b413e075e56c45924", "score": "0.5486946", "text": "def see_next\n if @index >= @normalized_numbers.length\n return -1\n else\n return @normalized_numbers[@index]\n end\n end", "title": "" }, { "docid": "d0e1a08aefb6cd2fb2a875c8e5a8f6a1", "score": "0.5483388", "text": "def next\n\t self.class.where(\"deck_id == ?\", deck_id).where(\"id > ?\", id).first\n\tend", "title": "" }, { "docid": "daf69a8a5badd9fe4c609aa726219000", "score": "0.54802215", "text": "def next?\n next_id != '0'\n end", "title": "" }, { "docid": "1e9c859a05afac700cfa1fe4567b6da5", "score": "0.5473829", "text": "def next_index(idx)\n idx = idx + 1\n idx = 0 if idx >= @connections.length\n idx\n end", "title": "" }, { "docid": "03abbcf28b9121a5c1240e1ea1879485", "score": "0.54705757", "text": "def next()\n if @limit != nil && @offset >= @limit\n return nil\n end\n\n if @data == nil || (@pos >= @data.length && @truncated)\n load_next_page()\n end\n\n if @pos < @data.length\n item_data = @data[@pos]\n @pos += 1\n @offset += 1\n cls = @item_cls\n if cls\n return cls.new(@api, item_data, true)\n else\n return item_data\n end\n else\n return nil\n end\n end", "title": "" }, { "docid": "22d078e7d5686f38b77d6036b5f3b78a", "score": "0.5460911", "text": "def next\n if self.last?\n first_in_section\n else lower_item\n end\n end", "title": "" }, { "docid": "643a4754dcdf5919f240e9017c4a4b05", "score": "0.54471564", "text": "def next\n \t\tNote.where([\"id > ?\", self.id]).first\n\tend", "title": "" }, { "docid": "93f04b639df58b12e781c0245cb10f2a", "score": "0.5443267", "text": "def next\n @next ||= Changeset.where([\"id > ? AND repository_id = ?\", id, repository_id]).order('id ASC').first\n end", "title": "" }, { "docid": "bef0d433645ca86c02beb11881ca57c9", "score": "0.54381627", "text": "def next!\n id = @counter.next!\n id = @counter.next! while @map[id]\n register id\n end", "title": "" }, { "docid": "4b2a568d978ce1a0f1a7308e8c4dc153", "score": "0.54336333", "text": "def idIndex(a, id, offset = 0)\n p \"--------- idIndex called ------------\"\n a.each_with_index do |node, index|\n if node.id == id\n p \"------- index ---------\"\n p index\n return index + offset\n end\n end\n nil\nend", "title": "" }, { "docid": "a0023bfb9b7761c4ae88757258220fd1", "score": "0.5424231", "text": "def set_first\n return 0 if @first_item.nil?\n first = 0\n (0..item_max - 1).each { |i|\n first = i if @data[i].id == @first_item\n }\n @index = first\n end", "title": "" }, { "docid": "1387cda00593a9c0e134b84818785d11", "score": "0.5423366", "text": "def intend_next\n intend_with :first, :next\n end", "title": "" }, { "docid": "1387cda00593a9c0e134b84818785d11", "score": "0.5423366", "text": "def intend_next\n intend_with :first, :next\n end", "title": "" }, { "docid": "a469a845295f50df2787f07c19199e91", "score": "0.54191506", "text": "def next(entry)\n if entry and entry = entry.next\n return entry\n end\n\n while (@index += 1) < @capacity\n if entry = @entries[@index]\n return entry\n end\n end\n end", "title": "" }, { "docid": "89a1039916faff4c19d1dbb05ae48bb1", "score": "0.54166216", "text": "def next_item\n return nil if @link == nil\n link.kernel.select {|item| item.rule == @rule}.first\n end", "title": "" }, { "docid": "ca6c3553af88369b8f92130d53d17d23", "score": "0.5406218", "text": "def next_id\n id = nil\n MinterState.transaction do\n state = read\n minter = ::Noid::Minter.new(state)\n id = minter.mint\n write!(minter)\n end # transaction\n id\n end", "title": "" }, { "docid": "b669ecd49069ba538292f0469f0224c7", "score": "0.5404482", "text": "def next\n self.offset(1)\n end", "title": "" }, { "docid": "e3573c8311c3825e373825f6037d2135", "score": "0.54007965", "text": "def next_id\n (@curr_id +=1).to_s\n end", "title": "" }, { "docid": "f22ef8786c795074e07ad5a0bbba5c1f", "score": "0.54001844", "text": "def find_k_to_last_size_known linked_list, k\n k_to_last = linked_list.length - k\n current = linked_list.head\n k_to_last.times do\n current = current.next\n end\n current.data\nend", "title": "" }, { "docid": "543c94baa47dc0235fd748cb01987fda", "score": "0.53860706", "text": "def next_free\n #need to increment before returning value, because returning exits function\n sizeup if @next_free >= @max\n @next_free+=1\n # puts \"item #{arr[@next_free-1].pool_id} allocated\" \n return @arr[@next_free-1]\n end", "title": "" }, { "docid": "2aa5bb39ed2e49117e68b9f8092f9bd8", "score": "0.5384502", "text": "def next\n\t\tTask.order(:position).where(\"position > ?\", position).first\n\tend", "title": "" } ]
5947010b79f853492dfdbbd4f2758250
GET /admin/geonodes/new GET /admin/geonodes/new.json
[ { "docid": "ba356ccd95d65a6d53dd717cb60c2ec2", "score": "0.7842644", "text": "def new\n @admin_geonode = Admin::Geonode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_geonode }\n end\n end", "title": "" } ]
[ { "docid": "c1bbbefae18288fc0d3d51e435d77707", "score": "0.7549366", "text": "def create\n @admin_geonode = Admin::Geonode.new(params[:admin_geonode])\n\n respond_to do |format|\n if @admin_geonode.save\n format.html { redirect_to @admin_geonode, notice: 'Geonode was successfully created.' }\n format.json { render json: @admin_geonode, status: :created, location: @admin_geonode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_geonode.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "954e9f5ea15a937fc5a2c89f00b3398b", "score": "0.6754762", "text": "def new\n @geoname = Geoname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geoname }\n end\n end", "title": "" }, { "docid": "397c177b70074abb74f113b297c5ae8f", "score": "0.6731536", "text": "def new\n @map_node = Map::Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @map_node }\n end\n end", "title": "" }, { "docid": "b895ecfac3fa4f8dd70dcf00135a6af6", "score": "0.6669955", "text": "def new\n @map = Map.find(params[:map_id])\n\n #@node = Node.new\n @node = @map.nodes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "7d15005e271cfc72b4d68f7e22b7f062", "score": "0.65695447", "text": "def new\n @node = Node.new\n @node.addresses.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "a6353495bee83c1340b8eb5f8813693f", "score": "0.6528158", "text": "def new\n @node_template = NodeTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node_template }\n end\n end", "title": "" }, { "docid": "c1eab3a44f2e0f6d091452bd5487bdf8", "score": "0.64611864", "text": "def new\n @origin = OriginAddr.new\n \n drop_breadcrumb('新增')\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @origin }\n end\n end", "title": "" }, { "docid": "44976fbdbcc4a9e6e8e587829b789652", "score": "0.64575243", "text": "def new\n @admin_route = Admin::Route.new\n\t\t@admin_route.route_markers.build\n\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_route }\n end\n end", "title": "" }, { "docid": "2d4a8ae2040656711fe4f6b1b5dc0a33", "score": "0.64373124", "text": "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood }\n end\n end", "title": "" }, { "docid": "2d4a8ae2040656711fe4f6b1b5dc0a33", "score": "0.64373124", "text": "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood }\n end\n end", "title": "" }, { "docid": "3cffe1ce5610e81a773d17de7ce3a6fe", "score": "0.64251554", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "3cffe1ce5610e81a773d17de7ce3a6fe", "score": "0.64251554", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "3cffe1ce5610e81a773d17de7ce3a6fe", "score": "0.64251554", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "3cffe1ce5610e81a773d17de7ce3a6fe", "score": "0.64251554", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "98058b9f84f359cc43f9940ba952318c", "score": "0.64172953", "text": "def new\n @server_node = ServerNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_node }\n end\n end", "title": "" }, { "docid": "3a9914fde816347ddb2903f5c31300bf", "score": "0.6415352", "text": "def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end", "title": "" }, { "docid": "ae3572c2b4bd0b8f29cf6b4f4080bb23", "score": "0.63833797", "text": "def new\n @compute_node = ComputeNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compute_node }\n end\n end", "title": "" }, { "docid": "3c4db91b1ab8c3ad785f89f9a3ac5386", "score": "0.63560784", "text": "def new\n @admin_zones = Admin::Zone.all\n @admin_zone = Admin::Zone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_zone }\n end\n end", "title": "" }, { "docid": "bc84dc05a5664333c0b45ddbaaf84020", "score": "0.63428485", "text": "def new\n @obj = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @obj }\n end\n end", "title": "" }, { "docid": "6eb44a95270cba73681af3526ecb33b4", "score": "0.62632084", "text": "def new\n @torneo = Torneo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @torneo }\n end\n end", "title": "" }, { "docid": "23d55652df62c5bff8f105014c9b7675", "score": "0.62527686", "text": "def new\n @zone_updater = ZoneUpdater.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @zone_updater }\n end\n end", "title": "" }, { "docid": "8b96dad74888a599d3ba13525a2def8a", "score": "0.6247075", "text": "def new\n @node = Node.new\n authorize! :create, @node\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "title": "" }, { "docid": "d05f4bdb9f0165a88cf9839c4e01bf5e", "score": "0.62354434", "text": "def new\n @curpg = :admintools\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "a31d32d9a258e2d5bdbca497dd373068", "score": "0.6229255", "text": "def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end", "title": "" }, { "docid": "e046a4f440b40f3ac98ba963e3ec3e27", "score": "0.61746585", "text": "def new\n @hotel = Hotel.new\n authorize! :create, @hotel\n unless current_user.present?\n redirect_to new_user_registration_url(proceed: 'new_hotel'), notice: 'Register first'\n return\n end\n\n @hotel.node = Node.new\n @hotel.user_id = current_user.id\n @hotel.type = Type.find_by_slug('hotels')\n @hotel.location = Location.new\n @hotel.address = Address.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hotel }\n end\n end", "title": "" }, { "docid": "22395fb0fcdf430c8265e506dab8cdb6", "score": "0.6158354", "text": "def new\n @postcode = Postcode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: admin_postcode_url }\n end\n end", "title": "" }, { "docid": "1c2de6828c579c047c05869c7ab9590a", "score": "0.61567837", "text": "def new\n @node = @job.nodes.build \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => @node } \n end\n end", "title": "" }, { "docid": "52a3764fc3cea5169c5f1e6278564d36", "score": "0.61562014", "text": "def new\n @breadcrumb = 'create'\n @street_directory = StreetDirectory.new\n @towns = towns_dropdown\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @street_directory }\n end\n end", "title": "" }, { "docid": "1a0fea3589a6290e52387925b3d6f03e", "score": "0.612638", "text": "def new\n @mini_map_road = MiniMapRoad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mini_map_road }\n end\n end", "title": "" }, { "docid": "0cb829fe4de7d9f4782f04708ae15cf8", "score": "0.61110866", "text": "def new\n @tree = Tree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tree }\n end\n end", "title": "" }, { "docid": "0e82167f07c1524a3d472b5f7b531f09", "score": "0.60923153", "text": "def create\n @geoname = Geoname.new(params[:geoname])\n\n respond_to do |format|\n if @geoname.save\n flash[:notice] = 'Geoname was successfully created.'\n format.html { redirect_to(@geoname) }\n format.xml { render :xml => @geoname, :status => :created, :location => @geoname }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @geoname.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f0eca1c59bc98e52f3cf6bd6ce0955b", "score": "0.60885835", "text": "def new\n @loc = current_user.locs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loc }\n end\n end", "title": "" }, { "docid": "525a961ac4e9819706d8d97b32a10f8e", "score": "0.6088098", "text": "def new\n @pinglun = Pinglun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pinglun }\n end\n end", "title": "" }, { "docid": "b1b41dc14dd070f69fccfc76acb0be9b", "score": "0.6087337", "text": "def new\n @registration = NodeRegistration.new\n node_id = params[:node]\n \n if(mac = params[:node_mac])\n mac.gsub!(/[^A-Fa-f0-9]/,'')\n node_id = mac.to_i(16)\n logger.info \"Got node-id: #{node_id}\"\n end\n\n node = Node.find_by_id(node_id) || Node.new(id: node_id)\n \n if(node && node.node_registration.present?)\n flash[:error] = \"Fehler: Der Node #{node.mac} ist bereits registriert.\"\n redirect_to app_index_path\n return\n end\n\n @registration.node = node\n @registration.owner = current_user\n @registration.osm_loc = \"Suchbegriff\"\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration }\n end\n end", "title": "" }, { "docid": "1bd203e648e7dc98d7eca17b39ac608d", "score": "0.6074958", "text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n # initialize lat/lng to Brisbane-ish\n @site.longitude = 152\n @site.latitude = -27\n respond_to do |format|\n format.html\n format.json { respond_new }\n end\n end", "title": "" }, { "docid": "4df9b70f452cdcbcba296456bb7a3676", "score": "0.6071719", "text": "def new\n @clonet = Clonet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clonet }\n end\n end", "title": "" }, { "docid": "7f1dad64e729eab923579f66c37190ac", "score": "0.60652137", "text": "def new\n @admin_hotspot = Admin::Hotspot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_hotspot }\n end\n end", "title": "" }, { "docid": "e13b8b8efb012db20ce79f314f3cbfd9", "score": "0.60567546", "text": "def new\n @ovode = Ovode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ovode }\n end\n end", "title": "" }, { "docid": "182c1130aee1267c921c088a05a03690", "score": "0.6045455", "text": "def new\n @comment_node = CommentNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @comment_node }\n end\n end", "title": "" }, { "docid": "618f0df37a74853a39ac89e16865134e", "score": "0.6031747", "text": "def new\n @cad_neighborhood = CadNeighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cad_neighborhood }\n end\n end", "title": "" }, { "docid": "77c0f2c2eb83fe061d3961df051368e3", "score": "0.6031733", "text": "def create\n @newnode = Newnode.new(newnode_params)\n\n respond_to do |format|\n if @newnode.save\n format.html { redirect_to @newnode, notice: 'Newnode was successfully created.' }\n format.json { render :show, status: :created, location: @newnode }\n else\n format.html { render :new }\n format.json { render json: @newnode.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c0b23d765b8eff05288cd0d4fb83b62", "score": "0.60304177", "text": "def new\n @fornecedore = Fornecedore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fornecedore }\n end\n end", "title": "" }, { "docid": "10b167a3e8a2206ecec381908b452ffc", "score": "0.6022392", "text": "def new\n @zona = Zona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @zona }\n end\n end", "title": "" }, { "docid": "9afcc2f7c5aaa85425b13772e6980526", "score": "0.6020277", "text": "def new\n @locationmap = Locationmap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @locationmap }\n end\n end", "title": "" }, { "docid": "103fd5403dfe0bc55e9170b0e106c32d", "score": "0.601933", "text": "def new\n @ip = Ip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ip }\n end\n end", "title": "" }, { "docid": "cef7406bab3b285cd8ab7726b71f3b9a", "score": "0.60170907", "text": "def new\n @zone = Zone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @zone }\n end\n end", "title": "" }, { "docid": "a0dbf626d0370bb8e470ddb485422ced", "score": "0.60111403", "text": "def new\n @network = Network.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @network }\n end\n end", "title": "" }, { "docid": "c32eab6a88b1a797f2fef91be32fc4be", "score": "0.6009565", "text": "def new\n @erogenous_zone = ErogenousZone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @erogenous_zone }\n end\n end", "title": "" }, { "docid": "d2ec5661f6e6f4961a8bd15d730988a7", "score": "0.59918433", "text": "def new\n @node_index = NodeIndex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node_index }\n end\n end", "title": "" }, { "docid": "6c4dd4eb28e3265bed6dce290f0b4890", "score": "0.5990563", "text": "def new\n @post_geo = current_user.post_geos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_geo }\n end\n end", "title": "" }, { "docid": "606ff664abb2b3a2ebc44605bdbe9965", "score": "0.59611243", "text": "def new\n @record = Location.new\n @networks = current_user.entity.networks\n @location_types = Location.location_types\n\n respond_to do |format|\n format.html {render :layout => 'popup'} \n format.json { \n response = {}\n render json: response \n }\n end\n end", "title": "" }, { "docid": "a3982337ca99d53235044161afbae891", "score": "0.5957816", "text": "def create\n @admin_neighbourhood = Admin::Neighbourhood.new(admin_neighbourhood_params)\n\n respond_to do |format|\n if @admin_neighbourhood.save\n format.html { redirect_to @admin_neighbourhood, notice: 'Neighbourhood was successfully created.' }\n format.json { render :show, status: :created, location: @admin_neighbourhood }\n else\n format.html { render :new }\n format.json { render json: @admin_neighbourhood.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d077e7506417116bc5a6491b80cdcfd", "score": "0.59567827", "text": "def new\n @administrative_division = AdministrativeDivision.new\n @countries = Country.find :all\n @geo_positions = GeoPosition.find :all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administrative_division }\n end\n end", "title": "" }, { "docid": "282b3242126511c6176d1c6e05f6cd61", "score": "0.5954114", "text": "def new\n @ip = @customer.ips.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ip }\n end\n end", "title": "" }, { "docid": "a5fbd08791e53e3c0e101bd473027c94", "score": "0.5950267", "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": "" }, { "docid": "d4c8111c8cca4a7d75d50263183878c3", "score": "0.59443694", "text": "def new\n @location_url_map = LocationUrlMap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location_url_map }\n end\n end", "title": "" }, { "docid": "32d23e457194194ed523de156ee89693", "score": "0.59359133", "text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "d6e6ce8aa94c8d4bc7ba256dae1c2c61", "score": "0.5922301", "text": "def new\n @corp_location = CorpLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corp_location }\n end\n end", "title": "" }, { "docid": "98b39f6ec8dbe89850665dfa21559a2c", "score": "0.59211385", "text": "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end", "title": "" }, { "docid": "4e7ec6cd0bbb1e4269cbf1c29498668a", "score": "0.59195966", "text": "def create\n @admin_neighbour = Admin::Neighbour.new(admin_neighbour_params)\n\n respond_to do |format|\n if @admin_neighbour.save\n format.html { redirect_to @admin_neighbour, notice: 'Neighbour was successfully created.' }\n format.json { render :show, status: :created, location: @admin_neighbour }\n else\n format.html { render :new }\n format.json { render json: @admin_neighbour.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "227f1e9e73e4826df0e8990da4c85dba", "score": "0.5911002", "text": "def new\n @jugadore = Jugadore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jugadore }\n end\n end", "title": "" }, { "docid": "463f26c89359eb0ffdb7c521dbdda2b4", "score": "0.59102017", "text": "def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "48f3121ace381a94558fa8b18b7862dd", "score": "0.5909285", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "48f3121ace381a94558fa8b18b7862dd", "score": "0.5909285", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "48f3121ace381a94558fa8b18b7862dd", "score": "0.5909285", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "48f3121ace381a94558fa8b18b7862dd", "score": "0.5909285", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "48f3121ace381a94558fa8b18b7862dd", "score": "0.5909285", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "title": "" }, { "docid": "4ba0efa6df301eeb0d3d9e03efdbe9af", "score": "0.59057975", "text": "def new\n puts 'NEW METHOD'\n @pessoa = Pessoa.new\n @pessoa.enderecos.build\n 2.times { @pessoa.telefones.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pessoa }\n end\n end", "title": "" }, { "docid": "b244dd0f43606477898a3acd4ab92e8c", "score": "0.58987474", "text": "def new\n @tinymap = Tinymap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tinymap }\n end\n end", "title": "" }, { "docid": "09d9f63143f3f7b19ff30d622452b203", "score": "0.5889759", "text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lore }\n end\n end", "title": "" }, { "docid": "1fd2f1c6948ab2770169b6e0ab5c6abb", "score": "0.5887008", "text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "1fd2f1c6948ab2770169b6e0ab5c6abb", "score": "0.5887008", "text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "3abc193281033ca19ffe3f6be20cdcb2", "score": "0.5886895", "text": "def new\n @spawner = Spawner.new\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spawner }\n end\n end", "title": "" }, { "docid": "1612eaa5a47ee0534d42721a83a01aa8", "score": "0.5886765", "text": "def new\n @core_nota = Core::Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_nota }\n end\n end", "title": "" }, { "docid": "5f74caec13e5671976c9c790332dc8e0", "score": "0.58727294", "text": "def new\n @road = Road.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @road }\n end\n end", "title": "" }, { "docid": "49d710192ea9cfe41152cecaa6ac9c85", "score": "0.58713365", "text": "def new\r\n @location = Location.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @location }\r\n end\r\n end", "title": "" }, { "docid": "49d710192ea9cfe41152cecaa6ac9c85", "score": "0.58713365", "text": "def new\r\n @location = Location.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @location }\r\n end\r\n end", "title": "" }, { "docid": "92b0f218a8246bb0890a86a4c6cf8ee2", "score": "0.586637", "text": "def create\n @loner = Loner.new(loner_params)\n puts \"loner params: #{loner_params}\"\n\n respond_to do |format|\n if @loner.save\n format.html { redirect_to admin_loner_path(@loner), notice: 'Loner was successfully created.' }\n puts \"loner successfully saved\"\n format.json { render :show, status: :created, location: @loner }\n else\n format.html { render :new }\n format.json { render json: @loner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2995febc154b326993c7ef8d968bddea", "score": "0.5862643", "text": "def new\n @admin_village = Admin::Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_village }\n end\n end", "title": "" }, { "docid": "a090ddaf839578568ed168d021c93cf0", "score": "0.5859971", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "a090ddaf839578568ed168d021c93cf0", "score": "0.5859971", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "a049ab3b5671e525f8c76d14dc51b59f", "score": "0.58588976", "text": "def new\n @ordinario = Ordinario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ordinario }\n end\n end", "title": "" }, { "docid": "922eefbb3ab06385c06b9c148346f1cf", "score": "0.5858336", "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": "be03e7a4e13c4be16425eb4b7e6bb5ab", "score": "0.5856936", "text": "def new\n\n if params[:journey_id]\n @journey = Journey.find(params[:journey_id])\n render_403 and return if @journey.user_id != current_user.id\n\n @journey_leg = JourneyLeg.new\n @url = \"/journeys/#{@journey.id}/legs\"\n elsif params[:journey_leg]\n @journey_leg = JourneyLeg.new(journey_leg_params)\n @url = \"/journeys\"\n else\n @journey_leg = JourneyLeg.new\n @url = \"/journeys\"\n end\n\n @method = :POST\n\n @stations = Station.order(:name)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @journey_leg, callback: params[:callback] }\n format.xml { render xml: @journey_leg }\n end\n end", "title": "" }, { "docid": "efb8ed038faf2947a393451c65b8ae09", "score": "0.5855812", "text": "def new\n #Ajax after delete\n zone_id = params[:zone_id]\n zone_id = zone_id.to_i unless zone_id.match(/[^[:digit:]]+/)\n if zone_id.is_a?(Integer)\n @zone = Zone.find(params[:zone_id])\n else\n @zone = Zone.find_by_zone_name(url2domain(params[:zone_id]))\n end\n\n @name_server = ZoneNameServer.new\n #@name_server.ns_ttl = Dnscell::Utils.default_ttl\n @name_server.ns_ttl = ZoneNameServer.where(:zone_id => @zone.id, :primary => true).first.ns_ttl\n end", "title": "" }, { "docid": "9177a46e297c4ff7e34922f77dcce20e", "score": "0.58518696", "text": "def new\n @neuron = Neuron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neuron }\n end\n end", "title": "" }, { "docid": "83c8cdd5e9d9a9baa8e4980474e68133", "score": "0.58509785", "text": "def new\n @quest_tree = QuestTree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest_tree }\n end\n end", "title": "" }, { "docid": "2710cb42e1536d4133b130b7542579e5", "score": "0.584698", "text": "def new\n\t @location = Location.new\n\t @months = Month.all\n\t @countries = Location.all.map(&:country).uniq\n\n\t respond_to do |format|\n\t format.html # new.html.erb\n\t format.json { render json: @location }\n\t end\n\t end", "title": "" }, { "docid": "c0b2010ee69f84353051124f92a0bc06", "score": "0.584145", "text": "def create\n @map_node = Map::Node.new(params[:map_node])\n\n respond_to do |format|\n if @map_node.save\n format.html { redirect_to @map_node, notice: 'Node was successfully created.' }\n format.json { render json: @map_node, status: :created, location: @map_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @map_node.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "833fb054e37377186cc01d109259c763", "score": "0.58331573", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @location }\n end\n end", "title": "" }, { "docid": "05b72d3cd9bbf321372a114fd558befe", "score": "0.58303535", "text": "def new\n @neighborhood_topic = NeighborhoodTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood_topic }\n end\n end", "title": "" }, { "docid": "e07b4e4dd9cc4b42aed448b0b742c215", "score": "0.5817897", "text": "def new\n \t@internship_position = InternshipPosition.new\n\n \trespond_to do |format|\n \t\tformat.html #new.html.erb\n \t\tformat.json { render json: @internship_position }\n \tend\n end", "title": "" }, { "docid": "5c617e5bf7b80b1301f2f7b83efd4906", "score": "0.5814663", "text": "def new\n geoname = Geoname.find(rand(Geoname.count))\n\n respond_to do |format|\n format.html { redirect_to travel_path(geoname.name)}\n end\n end", "title": "" }, { "docid": "333e05dfa1abdb03ed2a8aeb8ead3848", "score": "0.5809949", "text": "def new\n @area = Area.new\n @other_areas = Area.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "e2dc9cbe6462ea34efce1af4591c4f8f", "score": "0.5807305", "text": "def new\n @oma_relation_type = OmaRelationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @oma_relation_type }\n end\n end", "title": "" }, { "docid": "c2675be8fd48407fbfecaf0a275f7be3", "score": "0.5807251", "text": "def new\n @location = Location.new \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @location }\n end\n end", "title": "" }, { "docid": "2f25c677ce5d96a6a8b506423e98c103", "score": "0.58067334", "text": "def new\n @place = @site.places.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @place }\n end\n end", "title": "" }, { "docid": "97bdfc66fec408babbf82f8bfd9030df", "score": "0.58024883", "text": "def new\n @admin = Admin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin }\n end\n end", "title": "" }, { "docid": "eee1067965b9ace8ce4826e61cccbe2a", "score": "0.5797181", "text": "def new\n @coordinador = Coordinador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @coordinador }\n end\n end", "title": "" }, { "docid": "315b0642d50e20714d6b7336d8b3465d", "score": "0.57937235", "text": "def new\n @taxon = Taxon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxon }\n end\n end", "title": "" } ]
1f2365c0fd67fa8ca8003ca75d7254e2
constructor with dn_ldap initialisation _dn and _passdn are required, _rootdn, _host and _port are optionals return a boolean
[ { "docid": "e88753bb06f0b104057c8d54adb4d2a8", "score": "0.6409158", "text": "def initialize(_dn, _rootdn='', _passdn='', _host = 'localhost', _port = 389)\n _scope = LDAP::LDAP_SCOPE_SUBTREE\n _filter = '(objectClass=*)'\n super( _host, _port, _rootdn, _passdn, _filter, _scope )\n @dn_ldap = _dn\n @list_objectclass = Array::new\n @list_attributs_type = Hash::new\n @list_attributs = Hash::new\n add_objectclass!\n @list_attributs_rollback = @list_attributs\n end", "title": "" } ]
[ { "docid": "e8b25c858e669965c7961569710a1063", "score": "0.810314", "text": "def initialize(_host='localhost', _port=389, _rootdn='', _passdn='', _filter='(objectClass=*)', _scope=LDAP::LDAP_SCOPE_SUBTREE ) \n @host_ldap = _host # default localhost\n @port_ldap = _port # default 389\n @scope_ldap = _scope # default to SUBTREE\n @filter_ldap = _filter # default (objectClass=*)\n @basedn_ldap = get_basedn(_host,_port,_rootdn,_passdn)\n @passdn_ldap = _passdn # default empty\n @rootdn_ldap = _rootdn # default empty\n return true\n end", "title": "" }, { "docid": "be734aef0eb6bdec08d96154d1c6898a", "score": "0.71871936", "text": "def authenticate_dn(dn, password)\n if dn.present? && password.present?\n initialize_ldap_con(dn, password).bind\n end\n end", "title": "" }, { "docid": "2d405b61ce752a979960144cf2d2aec3", "score": "0.7085736", "text": "def authenticate_dn(dn, password)\n if dn.present? && password.present?\n initialize_ldap_con(dn, password).bind\n end\n end", "title": "" }, { "docid": "1cf1fb2cdb7f4405c0f84dd604f6f65a", "score": "0.68457556", "text": "def init_ldap(hostname, basedn, admindn, adminpw)\n require 'net-ldap'\n ldap = Net::LDAP.new :host => hostname,\n :port => 636,\n :encryption => {\n :method => :simple_tls,\n :tls_options => {\n :ca_file => '/etc/ssl/certs/tsldap.pem'\n }\n },\n :base => basedn,\n :auth => {\n :method => :simple,\n :username => admindn,\n :password => adminpw\n }\n return ldap\nend", "title": "" }, { "docid": "7b50945d83da55c735cd8ef52985662a", "score": "0.67988163", "text": "def initialize(options = {})\n @options = {\n ssl: true,\n email_attribute: 'mail'\n }.merge(options || {})\n\n @options[:port] = @options[:port].to_s.to_i unless @options[:port].is_a?(::Integer)\n\n if @options[:port] == 0\n @options[:port] = (@options[:ssl] ? 636 : 389)\n end\n\n raise InvalidConfiguration, \"Missing value for 'host' parameter.\" if @options[:host].blank?\n raise InvalidConfiguration, \"The value for 'port' must be between 1 and 65535.\" unless (1..65535).include?(@options[:port])\n raise InvalidConfiguration, \"Missing value for 'base_dn' parameter.\" if @options[:base_dn].blank?\n raise InvalidConfiguration, \"Missing value for 'email_attribute' parameter.\" if @options[:email_attribute].blank?\n raise InvalidConfiguration, \"Missing value for 'browse_user' parameter.\" if @options[:browse_user].blank?\n\n ldap_opt = {\n host: @options[:host],\n port: @options[:port],\n base: @options[:base_dn],\n auth: {\n method: :simple,\n username: @options[:browse_user],\n password: @options[:browse_password]\n }\n }\n\n if @options[:ssl]\n @options[:ssl] = @options[:ssl].to_sym if @options[:ssl].is_a?(::String)\n\n unless [:simple_tls, :start_tls].include?(@options[:ssl])\n @options[:ssl] =\n if @options[:port] == 389\n :start_tls\n else\n :simple_tls\n end\n end\n\n ldap_opt[:encryption] = { method: @options[:ssl] }\n end\n \n ::Incline::Log::debug \"Creating new LDAP connection to #{@options[:host]}:#{@options[:port]}...\"\n @ldap = Net::LDAP.new(ldap_opt)\n \n ::Incline::Log::debug 'Binding to LDAP server...'\n raise BindError, \"Failed to connect to #{@options[:host]}:#{@options[:port]}.\" unless @ldap.bind\n\n ::Incline::Log::info \"Connected to LDAP host #{@options[:host]}:#{@options[:port]}.\"\n end", "title": "" }, { "docid": "7b2904553edb8b51bf129a1b9b76e74b", "score": "0.6747673", "text": "def ldap\n Net::LDAP.new :host => SETTING[ENV['RACK_ENV']]['ldapserver'],\n :port => 389,\n :auth => {\n :method => :simple,\n :username => [SETTING[ENV['RACK_ENV']]['admin_cn'], SETTING[ENV['RACK_ENV']]['ldap_dn']].join(','),\n :password => SETTING[ENV['RACK_ENV']]['passwd']\n }\n end", "title": "" }, { "docid": "8cca72ce30b2db993d585151af9c0cdd", "score": "0.6735134", "text": "def connector(_host='localhost', _port=389, _rootdn='', _passdn='')\n begin \n if not $connection then\n output \"connecting to #{_host} on port : #{_port}\" if $verbose\n $connection = LDAP::Conn.new(_host,_port)\n $connection.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)\n end\n if _rootdn.empty? and not $bind then\n output 'Anonymous binding' if $verbose \n $connection = $connection.bind\n $bind = true\n elsif not _rootdn.empty? and not $authenticated then\n output 'Authenticated binding' if $verbose\n $connection.unbind if $connection.bound?\n $connection = $connection.bind(\"#{_rootdn}\", \"#{_passdn}\")\n $authenticated = true\n end\n return $connection\n rescue Exception\n raise LdapmapperConnectionError\n end\n end", "title": "" }, { "docid": "ea10eea692d1a936fd3130da081a65fd", "score": "0.669685", "text": "def new_net_ldap()\n params = {\n :host => host,\n :auth => authentication_information,\n :port => 636, \n :encryption => {:method =>:simple_tls}\n }\n @net_ldap = Net::LDAP.new(params)\n @net_ldap.bind || raise(BindFailedException)\n @net_ldap\n rescue Net::LDAP::LdapError => e\n raise(BindFailedException)\n end", "title": "" }, { "docid": "c6fd3985b1eceab8f42ea253c138605d", "score": "0.66931814", "text": "def init_ldap\n @log.debug \"#{__method__} called by #{caller_locations(1, 1)[0].label}\"\n if @config[:tls_noverify]\n tls_options = { :verify_mode => OpenSSL::SSL::VERIFY_NONE }\n else\n tls_options = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS\n end\n\n encryption = {\n :method => (@config[:start_tls] ? :start_tls : :simple_tls),\n :tls_options => tls_options,\n }\n\n ldap = Net::LDAP.new(:hosts => @config[:ldap_hosts].map { |h| [ h, @config[:ldap_port] ] },\n :auth => {\n :method => :simple,\n :username => @config[:ldap_user],\n :password => @config[:ldap_pass],\n },\n :encryption => encryption)\n\n if !ldap.bind\n @log.error \"LDAP authentication failed, #{ldap.get_operation_result.message}\"\n exit 1\n end\n\n ldap\n end", "title": "" }, { "docid": "02bea0e2fb9ec2f26d980956c066d25b", "score": "0.66733575", "text": "def valid_user?\n @ldap = Net::LDAP.new(:base => @base,\n :host => @ldaphost,\n :auth => {:username => @dn,\n :password => @password,\n :method => :simple})\n #return a boolean indicating whether authentication was successful or not\n return @ldap.bind\n end", "title": "" }, { "docid": "50cb61ac6345ede8cbd4c5b30e5cf842", "score": "0.66495293", "text": "def connect_to_ldap?\n ldap.host = ENV['SERVER']\n ldap.port = ENV['LDAP_PORT']\n ldap.auth \"#{associate_id}@#{ENV['DOMAIN']}\", password\n fail LDAPAuthenticationFailure unless ldap.bind\n\n true\n end", "title": "" }, { "docid": "e4e01b88128a78b3818d5260af759e0e", "score": "0.663401", "text": "def validate_iplanet(dn, password)\n raise ArgumentError, \"dn is nil\", caller if dn == nil\n raise ArgumentError, \"password is nil\", caller if password == nil\n @ldapconn = LDAP::Conn.new(\"ldap1.nyit.edu\", 389)\n @ldapconn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )\n @ldapconn.set_option( LDAP::LDAP_OPT_SIZELIMIT, 999 )\n @ldapconn.set_option( LDAP::LDAP_OPT_TIMELIMIT, 60 )\n @ldapconn.bind(dn, password)\n end", "title": "" }, { "docid": "bc33bd40520d87e1fd73e7a0fcb86bc8", "score": "0.6606128", "text": "def net_ldap()\n @net_ldap ||= new_net_ldap\n end", "title": "" }, { "docid": "54b2ad29df1bf6d8ab1a1598029e6e4c", "score": "0.65641576", "text": "def initialize(host, options={})\n \n # All initialized LDAPDispatcher objects will have test_uids to ensure\n # no collisions when creating entries in the directory services.\n @test_uid = Scooter::Utilities::RandomString.generate(4)\n if host.is_a? Windows::Host\n @ds_type = :ad\n elsif host.is_a? Unix::Host\n @ds_type = :openldap\n else\n raise \"host must be Unix::Host or Windows::Host, not #{host.class}\"\n end\n\n generated_args = {}\n generated_args[:host] = host.reachable_name\n generated_args[:port] = DEFAULT_DS_PORT\n generated_args[:encryption] = {:method => :simple_tls}\n generated_args[:base] = return_default_base\n\n generated_args.merge!(options)\n super(generated_args)\n\n # If we didn't pass in an :auth hash, generate the default settings\n # using the auth method of Net::LDAP\n if !options[:auth]\n self.auth admin_dn, return_default_password\n end\n\n if !bind\n warn \"Problem binding to #{host}, #{get_operation_result}\\n\n username: #{admin_dn}, pw: #{return_default_password}\"\n end\n end", "title": "" }, { "docid": "5eec7cc1a826baa6e718faa091c7e695", "score": "0.65085983", "text": "def connect\n self.settings.symbolize_keys!\n if @conn.nil?\n self.port = DEFAULT_PORT if self.port.nil?\n @conn = LDAP::Conn.new(self.host, self.port)\n @conn.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)\n end #if\n @conn.bind(self.username, self.password) unless @conn.bound?\n return @conn.bound?\n end", "title": "" }, { "docid": "786b64f388f7225838a8273fd9711378", "score": "0.65038735", "text": "def initialize(username, password, ou, ldaphost, domain, tld)\n @username = username\n @password = password\n @ou = ou\n @ldaphost = ldaphost\n @domain = domain\n @tld = tld\n @base = \"dc=#{@domain},dc=#{@tld}\"\n @dn = \"uid=#{@username},ou=#{@ou},dc=#{@domain},dc=#{@tld}\"\n end", "title": "" }, { "docid": "ecd5a63239dc95f905d2634c37e16365", "score": "0.6493222", "text": "def authenticate(dn, password)\n conn = Net::LDAP.new(\n :host => @options[:host],\n :port => @options[:port],\n :encryption => @options[:encryption],\n :auth => {:method => :simple, :username => dn, :password => password}\n )\n conn.bind\n end", "title": "" }, { "docid": "022605703dbce3bdcbcfdf2e35274467", "score": "0.64288753", "text": "def connection(which_ldap)\n Net::LDAP.new(:host => host(which_ldap), :port => port(which_ldap), :encryption => (:simple_tls if ssl?(which_ldap)))\n end", "title": "" }, { "docid": "246d8da7b7f950a112f39455873fa39d", "score": "0.63618016", "text": "def hasLDAP?\n !attrs['dn'].nil?\n end", "title": "" }, { "docid": "8f29140ce62557dac1e2f2159148acb4", "score": "0.6346181", "text": "def ldap_connect(host)\n auth = {\n method: :simple,\n username: @rootdn,\n password: @ldap_password\n }\n\n Net::LDAP.new(host: host, port: @port, base: @basedn, auth: auth)\n end", "title": "" }, { "docid": "38e4621589d2e0492eaed3155d216663", "score": "0.6331845", "text": "def valid? login, password\n @directories.each do |ldap|\n ldap = ldap.to_sym\n unless @LDAP[env][ldap].nil?\n conn = connection(ldap)\n conn.authenticate(\"#{attribute(ldap)}=#{login.to_s},#{base(ldap)}\", password.to_s)\n begin\n # if bind => OK\n if conn.bind\n logger.info(\"Authenticated #{login.to_s} by #{host(ldap)}\") if logger\n @user_attributes = conn.search(:base => base(ldap),:filter => Net::LDAP::Filter.eq(attribute(ldap),login.to_s)).first.each do |k,v|\n class_eval \"attr_reader :#{k}\"\n self.instance_variable_set \"@#{k}\".to_sym, v\n end\n @user_location = ldap\n return true\n else\n logger.info(\"Error attempting to authenticate #{login.to_s} by #{host(ldap)}: #{conn.get_operation_result.code} #{conn.get_operation_result.message}\") if logger\n end\n rescue Net::LDAP::LdapError => error\n logger.info(\"Error attempting to authenticate #{login.to_s} by #{host(ldap)}: #{error.message}\") if logger\n return false\n end\n else\n logger.info \"ERROR ! \\\"#{ldap}\\\" directory data are missing in ldap.yml\" if logger\n raise Net::LDAP::LdapError, \"\\\"#{ldap}\\\" directory data are missing in ldap.yml\"\n end\n end\n false\n end", "title": "" }, { "docid": "b9ebef8b6b2720b21a09b20d4e6488f7", "score": "0.6271687", "text": "def initialize(ldap_options)\n @connection = Net::LDAP.new(ldap_options)\n end", "title": "" }, { "docid": "47eb450016aebac089897734ac3d5e75", "score": "0.623798", "text": "def connect\n ldap = nil\n\n auth = {\n :method => :simple,\n :username => @username,\n :password => @password }\n ldap = Net::LDAP.new :host => @host, :port => @port, :auth => auth\n\n if @secure\n ldap.encryption :simple_tls\n end\n\n Timeout::timeout(@timeout) do\n result = ldap.bind\n\n if result.nil? || ldap.get_operation_result.code > 0\n ldap = nil\n end\n end\n\n ldap\n end", "title": "" }, { "docid": "9519e5619673c41d8865028e0759ee72", "score": "0.61804837", "text": "def connect\n # Connect to LDAP\n @conn = LDAP::SSLConn.new( 'ldap.ucdavis.edu', 636 )\n @conn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )\n @conn.bind(dn = LDAP_SETTINGS['base_dn'], password = LDAP_SETTINGS['base_pw'] )\n end", "title": "" }, { "docid": "3ba917e2bc15d3eb02f2ccf400959c67", "score": "0.6176046", "text": "def initialize(ldap_entry)\n @ldap_entry = ldap_entry\n end", "title": "" }, { "docid": "66d3e436fba5ddb69c7248c58ba025cc", "score": "0.61495537", "text": "def valid_credentials?(dn, password)\n bind(dn, password)\n end", "title": "" }, { "docid": "69c4d1a6e23e31ee7ab75331b940f1bd", "score": "0.61181104", "text": "def using_ldap?\n @options[:enable_ldap_auth]\n end", "title": "" }, { "docid": "8991444470ed7242c8839330d6b1ca9d", "score": "0.60825276", "text": "def valid_password?(password)\n LDAPAdmin.instance.net_ldap.bind(:username => @dn, :password => password, :method => :simple)\n end", "title": "" }, { "docid": "5e725f248b7e61924e6ff7c7706216d2", "score": "0.60624695", "text": "def connect\n logger.debug \"LDAP connect\"\n if ! @connected\n logger.debug \"Binding to ldap...\"\n @ldap = Net::LDAP.new(ldap_params)\n if @ldap.bind\n logger.debug \"Connection succeed\"\n @connected = true\n else\n @connected = false\n @ldap = nil\n logger.debug \"Connection failed\"\n end\n @ldap\n else\n @logger.debug \"LDAP already connected\"\n nil\n end\n end", "title": "" }, { "docid": "ab0fe06422d4e9bcc64c2c3f6f146abe", "score": "0.60403657", "text": "def test_ut_t1_la_ldap_019\n ldap_setting = LdapSetting.create(:name => NAME,\n :host => HOST,\n :port => 0,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"mail\")\n assert_equal ldap_setting.port, 389\n end", "title": "" }, { "docid": "def13618813f5ecf5c06cfda5cc9902e", "score": "0.6020298", "text": "def add_object(_dn, _record, _host='localhost',_port=389, _rootdn='', _passdn='')\n _record.delete('dn') \n _data = _record\n _data.each{|_key,_value|\n _data[_key] = _value.to_a \n }\n begin\n connector(_host,_port,_rootdn,_passdn).add(\"#{_dn}\", _data)\n return true\n rescue LDAP::ResultError\n raise LdapmapperAddRecordError \n return false\n end\n end", "title": "" }, { "docid": "6e03f7eab01d4e46fd8032dbc2e97a33", "score": "0.60047686", "text": "def net_ldap #:nodoc:\n UCB::LDAP.net_ldap\n end", "title": "" }, { "docid": "db316e81e6b0185d24b4623ba15816d9", "score": "0.59874225", "text": "def open(host, user = nil, password = nil)\n @ldap = Net::LDAP.new\n @ldap.host = host\n @ldap.port = 389\n @ldap.auth(user, password)\n @ldap.bind\n end", "title": "" }, { "docid": "ebb41311771397c900906c7f611846a0", "score": "0.5958937", "text": "def ldap_login( email, password )\n ldap = Net::LDAP.new(:host => HOST, :port => PORT)\n ldap.bind(:method => :simple, :username => \"cn=\"+email+\",\"+BASE,\n :password => password)\n end", "title": "" }, { "docid": "ed616a9c69a75a8fbb0a9059ae8db17f", "score": "0.5954263", "text": "def authenticate(username, password)\n return false if username.blank? || password.blank?\n ldap_connection = Net::LDAP.new(connect_timeout: CONNECTION_TIMEOUT)\n ldap_connection.host = self.host\n ldap_connection.port = self.port\n configure_encryption(ldap_connection)\n\n ldap_connection.auth self.connection_user, self.connection_password\n\n valid_ldap_entry = nil\n domain_bases_list.find do |domain|\n valid_ldap_entry = ldap_connection.bind_as(\n base: domain,\n filter: search_filter(username),\n password: password\n )\n end\n @last_authentication_result = ldap_connection.get_operation_result\n return false unless valid_ldap_entry\n\n Carto::Ldap::Entry.new(valid_ldap_entry.first, self)\n rescue Net::LDAP::Error => e\n log_error(exception: e, message: 'Error authenticating against LDAP', current_user: username)\n nil\n end", "title": "" }, { "docid": "9e4358546ff62798750c6846fa21da08", "score": "0.59479976", "text": "def initialize(config = {})\n raise(ArgumentError, \"the following attributes are required for an ldap connection #{REQUIRED_KEYS}\") unless config.is_a?(Hash) && !config.blank?\n\n map_variables(validate_keys(cleanup_hash(defaults(config))))\n end", "title": "" }, { "docid": "b5a2d0bc664bae95cc1ef54b2fcdcdf3", "score": "0.59462905", "text": "def authenticate_user_in_ldap (user_name, pwd)\r\n\r\n log \"\\n\\n Entering task :authenticate_user_in_ldap.\\n\\n\"\r\n\r\n initialize_variables\r\n\r\n #username = \"xldapProxy\"\r\n #password = \"\"\r\n username = user_name\r\n password = pwd\r\n\r\n ldap = Net::LDAP.new\r\n ldap.host = \"10.1.1.2\"\r\n ldap.port = \"389\"\r\n\r\n ldap.authenticate \"uid=#{username},ou=Users,o=MTC\", password\r\n\r\n is_authenticated = ldap.bind\r\n\r\n unless is_authenticated == true\r\n log \"Error: Authentication fails with username '#{username}'.\"\r\n exit\r\n end\r\n\r\n log \"\\n\\n Exiting task :authenticate_user_in_ldap.\\n\\n\"\r\n\r\n return ldap\r\nend", "title": "" }, { "docid": "299b27a42a60c7bbe8ef062baca03732", "score": "0.5908925", "text": "def ldap_client\n @ldap_client ||= \n begin\n rootdn = build_rootdn\n tls_enable = tls_enable?(node['ca_openldap']['tls']['enable'])\n Chef::Recipe::LDAPUtils.new(node['ca_openldap']['ldap_server'], \n node['ca_openldap']['ldap_port'], \n rootdn, \n node['ca_openldap']['rootpassword'], \n tls_enable\n )\n end\n end", "title": "" }, { "docid": "16144e22e49b5aed5e16475a0756a2ed", "score": "0.58958274", "text": "def test_ut_t1_la_ldap_017\n ldap_setting = LdapSetting.create(:name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => false,\n :attr_mail => \"mail\")\n assert ldap_setting.authenticate(LOGIN,PASS)\n end", "title": "" }, { "docid": "b17a9f4d36d601e3f9a5ed327e486d0e", "score": "0.58672696", "text": "def setup_ldap!(name, password)\n # Spin up the LDAP server.\n opts = {\n \"Env\" => [\n \"LDAP_READONLY_USER=true\",\n \"LDAP_READONLY_USER_USERNAME=#{name}\",\n \"LDAP_READONLY_USER_PASSWORD=#{password}\"\n ]\n }\n cname = \"integration_ldap\"\n start_container!(\"osixia/openldap:1.1.2\", cname, opts)\n\n # And re-start the Portus container with the new LDAP config.\n hostname = `docker inspect -f {{.NetworkSettings.IPAddress}} #{cname}`.strip\n portus = `docker inspect -f {{.NetworkSettings.IPAddress}} integration_portus`.strip\n setup_portus!(false, [\n \"PORTUS_LDAP_ENABLED=true\",\n \"PORTUS_LDAP_HOSTNAME=#{hostname}\",\n \"PORTUS_LDAP_UID=cn\",\n \"PORTUS_LDAP_BASE=dc=example,dc=org\",\n \"PORTUS_LDAP_AUTHENTICATION_ENABLED=true\",\n \"PORTUS_LDAP_AUTHENTICATION_BIND_DN=cn=admin,dc=example,dc=org\",\n \"PORTUS_LDAP_AUTHENTICATION_PASSWORD=admin\"\n ], portus)\nend", "title": "" }, { "docid": "ab4965aaace0215794e0f30b9b51cb7d", "score": "0.5861932", "text": "def test_ut_t1_la_ldap_015\n ldap_setting = create_ldap\n assert ldap_setting.authenticate(\"wrong login\",\"wrong pass\").blank?\n end", "title": "" }, { "docid": "c78101a262d5699dc5e6a99d9dc31283", "score": "0.5831278", "text": "def test_ut_t1_la_ldap_013\n ldap_setting = create_ldap\n assert !ldap_setting.authenticate(\"\",\"\")\n end", "title": "" }, { "docid": "66eb0c099a02b9a8923c7bc6e5cdcccb", "score": "0.5828164", "text": "def create_ldap\n ldap_setting = LdapSetting.create(:name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"mail\",\n :in_use => true)\n return ldap_setting \n end", "title": "" }, { "docid": "dd57faaba25bd8af71bf3ec0c8f62e34", "score": "0.58010405", "text": "def test_ut_t1_la_ldap_005\n ldap_setting = LdapSetting.new( :name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"\"\n )\n assert !ldap_setting.save\n end", "title": "" }, { "docid": "e82b47975585418b2f77a29e241cdb76", "score": "0.5800599", "text": "def ldap\n\t\tif !@ldap\n\t\t\tif self.options.config && (uri = self.options.config.ldapuri)\n\t\t\t\t@ldap = Treequel.directory( uri )\n\t\t\telse\n\t\t\t\t@ldap = Treequel.directory_from_config\n\t\t\tend\n\n\t\t\tself.log.info \"Authentication will use: %s\" % [ @ldap.uri ]\n\t\tend\n\n\t\treturn @ldap\n\tend", "title": "" }, { "docid": "45ec9f6876c6e568d611ca6d3de3731a", "score": "0.5798973", "text": "def get_connection\n Net::LDAP.new({ :host => LDAP_CONFIG['server'], :port => LDAP_CONFIG['port'] })\n end", "title": "" }, { "docid": "2bacd27be943360d59a271c0cf2a91aa", "score": "0.5798546", "text": "def mod_object(_dn, _mod, _host='localhost',_port=389, _rootdn='', _passdn='')\n# begin\n _mod.delete('dn')\n _data = _mod\n _data.each{|_key,_value|\n _data[_key] = _value.to_a\n }\n connector(_host,_port,_rootdn,_passdn).modify(\"#{_dn}\", _data)\n return true\n# rescue LDAP::ResultError\n# raise LdapmapperModRecordError\n# return false\n# end\n end", "title": "" }, { "docid": "fbe04019b2d6aac2cef37065a30ff9ab", "score": "0.57950926", "text": "def ldap\n @ldap ||= Origen::Users::LDAP.new\n end", "title": "" }, { "docid": "9c47d2d47fb1ca3086cfd4dc3122608b", "score": "0.5789311", "text": "def setup\n unless @@conn && @@conn.bound?\n File.open( '/etc/ldap.conf' ) do |f|\n while line = f.gets\n if line =~ /^host\\s+(\\S+)$/\n @@host = $1\n break\n elsif line =~ /^base\\s+(\\S+)$/\n @@base = $1\n break\n end\n end\n end\n\n @@conn = LDAP::Conn.new( @@host )\n @@conn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )\n @@conn.bind\n @@root_dse = @@conn.root_dse[0]\n @@naming_context = @@root_dse['namingContexts'][0]\n end\n end", "title": "" }, { "docid": "9864f8665ec0aa88ca153dcafdee9936", "score": "0.5781214", "text": "def test_ut_t1_la_ldap_025\n ldap_setting = create_ldap\n assert !ldap_setting.test_connection\n end", "title": "" }, { "docid": "738a7bd954f9e708b8ac947d1a87c067", "score": "0.5772501", "text": "def authenticate (password, challenge=\"\")\n return authenticate_with_challenge(password, challenge) unless challenge.empty?\n return false if password.blank?\n self.class.ldap_connection.bind :method => :simple,\n :username => ldap_dn,\n :password => password\n end", "title": "" }, { "docid": "17822a44280d417347f11ac43b911969", "score": "0.5772019", "text": "def ldap()\n\n\t\tldap = Net::LDAP.new :host => $k.get('server_ldap'),\n\t\t :port => $k.get('port_ldap'),\n\t\t :auth => {\n\t\t\t :method => :simple,\n\t\t\t :username => $k.get('user_ldap'),\n\t\t\t :password => $k.get('password_ldap')\n\t\t \t\t}\n\n\t\tfilter = Net::LDAP::Filter.eq( \"objectClass\", \"*\" )\n\t\ttreebase = \"subdata=services,uid=f4994c2a-783a-4962-bf3a-5003d7b8,ds=SUBSCRIBER,o=DEFAULT,DC=C-NTDB\"\n\n\t\tldap.search( :base => treebase, :filter => filter ) do |entry|\n\t\t puts \"\"\n\t\t logger.debug \"##{entry.dn}\"\n\t\t entry.each do |attribute, values|\n\t\t values.each do |value|\n\t\t puts \"#{attribute}: #{value}\"\n\t\t end\n\t\t end\n\t\tend\n\n\t\t# p ldap.get_operation_result\n\tend", "title": "" }, { "docid": "2d8a6a1ff83efbebbf9c2bf1ead23467", "score": "0.57704663", "text": "def ldap?\n ENV[\"INTEGRATION_LDAP\"] == \"t\" || ENV[\"INTEGRATION_LDAP\"] == \"true\"\nend", "title": "" }, { "docid": "997d693d81aa88b58b412bb1538131ea", "score": "0.57586795", "text": "def test_ut_t1_la_ldap_016\n ldap_setting = create_ldap\n assert ldap_setting.authenticate(LOGIN,PASS)\n end", "title": "" }, { "docid": "bfe449de0e2b6046e44db7e34e93ff76", "score": "0.57439554", "text": "def initialize_ldap(keytab, ldap_host)\n self.class.const_set(:FIND_ROLE_ACCOUNT_CMD, \"kinit -kt #{keytab} && \" \\\n \"ldapsearch -LLL -Y GSSAPI -o ldif-wrap=no -h #{ldap_host} -D %{basedn} -b '%{basedn}' \" \\\n \"'(&(objectClass=user)(!(objectClass=computer))(!(employeeID=*))(|(memberOf=%{group})))' %{attr}\")\n self.class.const_set(:FIND_HUMAN_USER_CMD, \"kinit -kt #{keytab} && \" \\\n \"ldapsearch -LLL -Y GSSAPI -o ldif-wrap=no -h #{ldap_host} -D %{basedn} -b 'OU=Enabled Accounts,%{basedn}' \" \\\n \"'(&(objectClass=user)(!(objectClass=computer))(&(employeeID=*)(|(memberOf=%{group}))))' %{attr}\")\n self.class.const_set(:FIND_GROUP_CMD, \"kinit -kt #{keytab} && \" \\\n \"ldapsearch -LLL -Y GSSAPI -o ldif-wrap=no -h #{ldap_host} -D %{basedn} -b '%{basedn}' \" \\\n \"'(&(objectClass=group)(memberOf=%{group}))' %{attr}\")\n end", "title": "" }, { "docid": "77ab71351221ab065327297e3bda2b90", "score": "0.5724421", "text": "def ldap_storage\n LDAPStorage.new(\n Property[:ldap_hostname], Property[:ldap_port],\n Property[:ldap_base], Property[:ldap_admin_user],\n Property[:ldap_admin_pass], Property[:ldap_use_ssl]\n )\nend", "title": "" }, { "docid": "ef7d3c1c755654a1a2be41a7c15ae682", "score": "0.5711578", "text": "def find(params = {})\n unless params.include?(:dn)\n LdapAdmin::Logger.send('Error in find. No dn parameter provided')\n return false\n end\n\n @ldap.search(:base => params[:dn])\n\n end", "title": "" }, { "docid": "ca0ab47a2de22f68b3cd232a3f4188d2", "score": "0.56959903", "text": "def test_ut_t1_la_ldap_018\n ldap_setting = create_ldap\n ldap_setting.host = \"wrong host\"\n ldap_setting.save\n assert !ldap_setting.authenticate(LOGIN,PASS)\n end", "title": "" }, { "docid": "648c7a248b8e0dd71552485336551ec0", "score": "0.56914765", "text": "def notest_ut_t1_la_ldap_003\n ldap_setting = LdapSetting.new( :name => SSL_NAME,\n :host => SSL_HOST,\n :port => SSL_PORT,\n :base_dn => SSL_BASE_DN,\n :attr_login => SSL_ATTR_LOGIN,\n :tls => true,\n :account => \"account\",\n :account_password => \"\"\n )\n assert !ldap_setting.save\n end", "title": "" }, { "docid": "baa3335050eedcd0d78c6489bdeff460", "score": "0.5684313", "text": "def notest_ut_t1_la_ldap_002\n ldap_setting = LdapSetting.new( :name => SSL_NAME,\n :host => SSL_HOST,\n :port => SSL_PORT,\n :base_dn => SSL_BASE_DN,\n :attr_login => SSL_ATTR_LOGIN,\n :tls => true,\n :account => \"\",\n :account_password => \"secret\"\n )\n assert !ldap_setting.save\n end", "title": "" }, { "docid": "b7c07f07b968b6e5c9ea70ea9cf199bc", "score": "0.5674273", "text": "def ldap_exists?\n self.class.ldap_connection.search(\n :base => ldap_dn,\n :scope => Net::LDAP::SearchScope_BaseObject,\n :filter => 'objectClass=*'\n ) ? true : false\n end", "title": "" }, { "docid": "53a841422e522d6a66fd3a36b77a57f5", "score": "0.5673082", "text": "def validate_ldap_login(value = nil)\n rw_config(:validate_ldap_login, value, true)\n end", "title": "" }, { "docid": "514ade6d2d404fdfaa10bbb25c49866f", "score": "0.5670044", "text": "def set_ldap_enabled\n PrivateChef['ldap']['enabled'] = !PrivateChef['ldap'].empty?\n end", "title": "" }, { "docid": "2df3739630f3e1a35fc1e4841935922f", "score": "0.5664247", "text": "def initialize(args = {})\n if File.exist?(AvdtLdap.configuration.ldap_config_file)\n @LDAP = YAML.load_file(AvdtLdap.configuration.ldap_config_file).symbolize_keys!\n else\n raise \"AvdtLdap: File #{AvdtLdap.configuration.ldap_config_file} not found, maybe you forgot to define it ?\"\n end\n @directories = args[:directories] || @LDAP[env].keys\n end", "title": "" }, { "docid": "9213802dc109ec9c37d4293fa4e359fd", "score": "0.56495357", "text": "def bind_as(username, password, search_root = Chef::Config[:ldap_base_root],\n user_attribute = Chef::Config[:ldap_user_attribute],\n user_preprocess = Chef::Config[:ldap_user_preprocess])\n if bind\n search_root = LDAPConnection.call_if_proc(search_root, username)\n actual_username = LDAPConnection.call_if_proc(user_preprocess, username, username)\n search_filter = LDAPConnection.call_if_proc(user_attribute, actual_username, \"(#{user_attribute}=#{LDAPConnection.ldap_escape(actual_username)})\")\n Chef::WebUIUser::LDAPUser.load(@conn.bind_as(:base => search_root, :password => password, :filter => search_filter))\n else\n raise ArgumentError, \"Unable to bind to any LDAP server\" \n end\n end", "title": "" }, { "docid": "4edfdfd42049802a2fc6c36c9c147a5e", "score": "0.56487966", "text": "def ldap_create\n return unless UpdatesToLDAP.enabled\n return unless ldap_apply_conditions\n # We delete nil values or empty arrays because that is how we indicate that something is not present\n attributes = to_ldap_hash.delete_if {|key, value| value.nil? || value == [] || value == [nil]}\n self.class.ldap_connection.nested_open do |ldap|\n ldap.add :dn => ldap_dn, :attributes => attributes\n return ldap_update if ldap.get_operation_result.code == 68 # record already exists, so update\n raise ldap unless ldap.get_operation_result.code == 0\n end\n end", "title": "" }, { "docid": "44acbf174756e970e2637ffa8c9e6f3e", "score": "0.5647839", "text": "def build_from_conf(config)\n unless (config.key? 'ldap_uri') then\n raise 'required ldap_uri parameter at LDAP pass-source configuration.'\n end\n ldap_params = parse_uri(config['ldap_uri'])\n ldap_args = []\n\n for name in [ :host, :port ]\n value = ldap_params.delete(name) or raise \"internal error: #{name}\"\n ldap_args << value\n end\n\n for name in [ :base_dn, :attribute ]\n value = ldap_params.delete(name)\n if (config.key? name.to_s) then\n value = config[name.to_s]\n end\n unless (value) then\n raise \"required #{name} parameter at LDAP pass-source configuration.\"\n end\n ldap_args << value\n end\n\n for name in [ :scope, :filter, :search_bind_verification_skip ]\n if (config.key? name.to_s) then\n ldap_params[name] = config[name.to_s]\n end\n end\n\n if (config.key? 'search_bind_auth') then\n case (config['search_bind_auth']['method'])\n when 'anonymous'\n auth = { method: :anonymous }\n when 'simple'\n auth = { method: :simple }\n auth[:username] = config['search_bind_auth']['username'] or raise 'required serach bind username at LDAP pass-source configuration.'\n auth[:password] = config['search_bind_auth']['password'] or raise 'required search bind password at LDAP pass-source configuration.'\n else\n raise \"unknown or unsupported bind method type: #{config['search_bind_auth'].inspect}\"\n end\n ldap_params[:search_bind_auth] = auth\n end\n\n self.new(*ldap_args, **ldap_params)\n end", "title": "" }, { "docid": "730a751c83c8e88ad651d01b5c572590", "score": "0.56415623", "text": "def ldap_authenticate\n # logger.debug(\"ldap_authenticate\")\n # ldap_time = Benchmark.realtime { ActiveLdap::Base.setup_connection }\n # logger.debug(\"LDAP: took #{ldap_time} to establish the connection\")\n authenticate_or_request_with_http_basic \"Bluepages Authentication\" do |user_name, password|\n # logger.info(\"attempt to ldap authenticate: user_name #{user_name}\")\n next nil unless LdapUser.authenticate_from_email(user_name, password)\n # logger.info(\"successful ldap_authenticate as #{user_name}\")\n common_authenticate(user_name)\n return true\n end\n return false\n end", "title": "" }, { "docid": "64af508d6ab50de4ff38b9d32d4d7ada", "score": "0.56252867", "text": "def ping(host = nil)\n decode_uri(host) if host\n super(@host)\n \n bool = false\n\n start_time = Time.now\n\n begin\n Timeout.timeout(@timeout) do\n Net::LDAP.new( config ).bind\n end\n rescue Net::LDAP::LdapError => e\n @exception = e.message\n rescue Exception => e\n @exception = e.message\n else\n bool = true\n end\n\n # There is no duration if the ping failed\n @duration = Time.now - start_time if bool\n\n bool\n end", "title": "" }, { "docid": "c6f6b8d34186b131c7234bf23e44a5bb", "score": "0.5620365", "text": "def test_ut_t1_la_ldap_014\n ldap_setting = create_ldap\n assert !ldap_setting.authenticate(LOGIN,\"wrong pass\")\n end", "title": "" }, { "docid": "175ca4941823c99f4e533c05e9ef4bbc", "score": "0.5599665", "text": "def ldap_authentication_enabled?\n running_config['private_chef']['ldap'] && !running_config['private_chef']['ldap'].empty?\nend", "title": "" }, { "docid": "6bfcffd23d0d9de9cfcbce6317c98bcf", "score": "0.5591575", "text": "def ldap_uri( uri=nil )\n\t\t\t@ldap_uri = uri if uri\n\t\t\treturn @ldap_uri\n\t\tend", "title": "" }, { "docid": "ec9a4f77bbb4ad4d17b8e3751439150b", "score": "0.55887944", "text": "def connection(user = nil, pass = nil)\n require 'net/ldap' unless defined?(Net::LDAP)\n\n # Generate arguments for ldap connection\n args = {\n host: host,\n port: port,\n base: base,\n encryption: encryption,\n connection_timeout: connection_timeout,\n force_no_page: force_no_page?,\n instrumentation_service: instrumentation_service,\n auth: auth_method == :anonymous ? { method: :anonymous } : { method: auth_method, username: user || username, password: pass || password }\n }.reject { |_k, v| v.nil? }\n\n # Build LDAP connection\n Net::LDAP.new(args)\n rescue => e\n BlockStack.logger.warn(\"Failed to build LDAP connection using provider #{name}. Error follows.\")\n BlockStack.logger.error(e)\n end", "title": "" }, { "docid": "64cfa211137560f06dec00dcb4d83e33", "score": "0.5584796", "text": "def autenticacion\n ldap_configs = Rails.application.secrets.ldap\n ldap_configs = ldap_configs.is_a?(Hash) ? [ldap_configs] : ldap_configs\n\n ldap_configs.each do |ldap_config|\n options = {\n host: ldap_config['host'],\n port: ldap_config['port']\n }\n ldap_config[\"ssl\"] = :simple_tls if ldap_config[\"ssl\"] === true\n options[:encryption] = ldap_config[\"ssl\"].to_sym if ldap_config[\"ssl\"]\n\n options.merge! auth: {\n method: :simple,\n username: generar_username(ldap_config),\n password: @contrasena\n }\n\n ldap = Net::LDAP.new options\n\n return ldap, ldap_config if ldap.bind\n end\n\n return nil, nil # No hay coincidencia, no hay autenticación\n end", "title": "" }, { "docid": "b2848a3525c35f57fb1564ab30c2e6d4", "score": "0.5563477", "text": "def create\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net', :port=>636, :auth=>auth, :encryption=>:simple_tls)\n \n #can we connect to the ldap server\n if ldap.bind\n treebase=\"ou=People,dc=cws,dc=net\"\n attrs=[\"uidNumber\"]\n filter = Net::LDAP::Filter.eq( \"uid\", \"*\" )\n \n #find next available uidNumber\n uidNumber='1'\n ldap.search(:base=>treebase, :attributes=>attrs,:filter=>filter) do |entry|\n if entry[:uidnumber][0].to_i > uidNumber.to_i\n uidNumber=entry[:uidnumber][0]\n end\n end\n\n #prepare our data for entry to ldap\n dn=\"uid=#{username},ou=People,dc=cws,dc=net\"\n attrs={ :uid=>username,\n :cn=>username,\n :objectClass=> ['account','posixAccount','top','shadowAccount'],\n :shadowMax => '99999',\n :shadowWarning => '7',\n :loginShell => '/bin/bash',\n :userPassword => password,\n :uidNumber => uidNumber,\n :gidNumber=> uidNumber,\n :homeDirectory=>homedir }\n\n #try to add new entry\n if ldap.add(:dn=>dn,:attributes=>attrs)\n true\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add user #{ldaperror}\",'ldap.add errors'\n errors.add attrs.to_s,'user_attributes'\n false\n end\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add user #{ldaperror}','ldap.add errors\"\n false\n end\n end", "title": "" }, { "docid": "1851b1dcb51dfa7b032d4314b8e42d41", "score": "0.5561972", "text": "def test_ut_t1_la_ldap_001\n ldap_setting = LdapSetting.new( :name => SSL_NAME,\n :host => SSL_HOST,\n :port => SSL_PORT,\n :base_dn => SSL_BASE_DN,\n :attr_login => SSL_ATTR_LOGIN,\n :tls => true,\n :account => \"\",\n :account_password => \"\"\n )\n assert ldap_setting.save\n end", "title": "" }, { "docid": "8f57ca97763cf56a31a1ff3bed81c03d", "score": "0.5557353", "text": "def bind_options_test(admin:)\n cfg = ::Portus::LDAP::Configuration.new(@params)\n bind_options(cfg, admin: admin)\n end", "title": "" }, { "docid": "8b2628edaa86d63fa74062331928bba1", "score": "0.5553242", "text": "def is_authorized_by_ldap?(ldap_class, login, password)\n return false if password.nil? || password == ''\n options = ldap_options_for(login, password)\n ldap = ldap_class.new(options)\n is_authorized = ldap.bind\n\n if !is_authorized\n ldap_error = ldap.get_operation_result\n logger.error \"LdapAuthenticatableTiny, ldap_error: #{ldap_error}\"\n end\n\n is_authorized\n end", "title": "" }, { "docid": "bd9a47cecdfadf1d2a76cbbf4504bf9c", "score": "0.55525464", "text": "def get_basedn(_host='localhost',_port=389,_rootdn='',_passdn='')\n _my_basedn = String::new('')\n begin\n _my_basedn = connector(_host,_port,_rootdn,_passdn).root_dse[0][\"namingContexts\"].to_s\n rescue\n raise LdapmapperGetBaseDnError\n ensure\n return _my_basedn\n end\n end", "title": "" }, { "docid": "0e63d17baa9105dd4bbcee42eff9fb07", "score": "0.55510175", "text": "def notest_ut_t1_la_ldap_004\n ldap_setting = LdapSetting.new( :name => SSL_NAME,\n :host => SSL_HOST,\n :port => SSL_PORT,\n :base_dn => SSL_BASE_DN,\n :attr_login => SSL_ATTR_LOGIN,\n :tls => true,\n :account => SSL_ACCOUNT,\n :account_password => SSL_PASS\n )\n assert ldap_setting.save\n end", "title": "" }, { "docid": "cbd773129051fd691dc378f05b0cdb23", "score": "0.5544804", "text": "def initialize(ldap, options = {})\n super\n @attrs = Array(options[:attrs]).concat DEFAULT_ATTRS\n end", "title": "" }, { "docid": "77383d737ad4c9cff4a794f26269efdf", "score": "0.55436337", "text": "def test_ut_t1_la_ldap_006\n ldap_setting = LdapSetting.new( :name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"mail\"\n )\n assert ldap_setting.save\n end", "title": "" }, { "docid": "ca4031c526449e6e9ad3f0d73031275b", "score": "0.5541493", "text": "def ldap_connection(reset = false)\n @conn = nil if reset\n @conn ||= connect\n end", "title": "" }, { "docid": "8be57949c74d7c3b4ead4216ac1a03d6", "score": "0.55409396", "text": "def initialize(ldap, options = {})\n super\n @depth = options[:depth] || DEFAULT_MAX_DEPTH\n @attrs = Array(options[:attrs]).concat DEFAULT_ATTRS\n end", "title": "" }, { "docid": "f7c7378b9271cfe6090f111b026df069", "score": "0.5536643", "text": "def ldap_authenticate\n # logger.debug(\"ldap_authenticate\")\n # ldap_time = Benchmark.realtime { ActiveLdap::Base.setup_connection }\n # logger.debug(\"LDAP: took #{ldap_time} to establish the connection\")\n authenticate_or_request_with_http_basic \"Bluepages Authentication\" do |user_name, password|\n logger.info(\"attempt to ldap authenticate: user_name #{user_name}\")\n next nil unless LdapUser.authenticate_from_email(user_name, password)\n logger.info(\"successful ldap_authenticate as #{user_name}\")\n common_authenticate(user_name)\n return true\n end\n return false\n end", "title": "" }, { "docid": "95c7f4592e0ea678ff7dc67c94035076", "score": "0.5526858", "text": "def ldapsearch\n ldap_settings = {\n :port => 389,\n :auth => { :method => :anonymous }\n \n }\n if params[:host].blank? or params[:filter].blank? or params[:base].blank?\n render :status=>400, :json=>{:message=>\"Missing parameter\"}\n return\n end\n ldap_settings[:host] = params[:host].to_s\n ldap_settings[:port] = params[:port].to_s unless params[:port].blank?\n unless params[:username].blank?\n ldap_settings[:auth] = {\n :method => :simple,\n :username => params[:username].to_s,\n :password => params[:password].to_s\n }\n end\n ldap_settings[:encryption] = :simple_tls if params[:encryption].to_s == 'simple_tls'\n\n begin\n ldap = Net::LDAP.new ldap_settings\n query_filter = Net::LDAP::Filter.construct params[:filter].to_s\n basedn = params[:base].to_s\n\n results = []\n ldap.search(:base => basedn, :filter => query_filter) do |entry|\n results << entry\n# puts \"DN: #{entry.dn}\"\n entry.each do |attribute, values|\n# puts \" #{attribute}:\"\n values.each do |value|\n# puts \" --->#{value}\"\n end\n end\n end\n rescue Exception => e\n render :status=>400, :json => { message: e.message }\n return\n end\n\n# puts ldap.get_operation_result\n\n render :status=>200, :json => results\n end", "title": "" }, { "docid": "c91523228aa96b8bf38d89478b33c532", "score": "0.552186", "text": "def is_base?\n if self.dn_ldap == self.basedn_ldap then\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "5b6533df55210509451395a60e83d13f", "score": "0.55205667", "text": "def ldap_authentication(zone, url, requires = {})\n authentication_basics(zone, requires)\n auth_basic_provider :ldap\n authz_ldap_authoritative :on\n auth_ldap_url url\n end", "title": "" }, { "docid": "e21fc47a15e4cf6b666d87dbc3293445", "score": "0.5519296", "text": "def find_valid_host\n @hosts.each do |host|\n @ldap = ldap_connect(host)\n begin\n if @ldap.bind\n return @ldap\n else\n next\n end\n rescue Net::LDAP::LdapError\n next\n end\n end\n abort('Could not connect to any LDAP servers')\n end", "title": "" }, { "docid": "7ea5388f83c56645f0141daa70cd4700", "score": "0.5499289", "text": "def tests(_dn,_rootdn,_passdn)\n output \"Running tests on #{_dn}\"\n _dn = \"ou=toto,#{_dn}\"\n output \"test on ou=toto in node : #{_dn}\"\n record = LdapMapper.new(_dn,_rootdn,_passdn)\n output \"- Could create it ? : #{record.can_create?}\"\n output \"- Already exist ? : #{record.exist?}\"\n output \"- Is it a node ? : #{record.is_node?}\"\n output \"- Is it the base ? : #{record.is_base?}\"\n if record.can_create?\n output \"- Create ou=toto in node : #{_dn}\"\n record.add_objectclass!('organizationalUnit')\n record.ou = 'toto'\n record.description = \"Test\"\n output \"- Is it valid ? : #{record.valid?}\"\n record.commit!\n end\n if record.exist? then\n output \"- ObjectClasses list :\"\n record.list_objectclass.each{|objectclass|\n output \" * #{objectclass}\"\n }\n output \"- Attributes list : \"\n record.list_attributs.each{|attribute,value|\n if value.size > 1 then\n output \"* #{attribute} =\"\n value.each{|val| puts \" - #{val}\"\n }\n else\n output \"* #{attribute} = #{value}\"\n end\n }\n record.description = `date`\n record.commit!\n# output \"deleting ou=toto...\"\n# record.delete! \n output \">> test done.\"\n end\n end", "title": "" }, { "docid": "ba86568111c5ac8ac57aaad0c10eb86a", "score": "0.5496243", "text": "def populateLDAP\n\n #quit if no email or netid to work with\n self.email ||= ''\n return if !self.email.include?('@yale.edu') && !self.netid\n\n begin\n ldap = Net::LDAP.new( :host =>\"directory.yale.edu\" , :port =>\"389\" )\n\n #set e filter\n if !self.email.blank?\n f = Net::LDAP::Filter.eq('mail', self.email)\n else #netid\n f = Net::LDAP::Filter.eq('uid', self.netid)\n end\n\n b = 'ou=People,o=yale.edu'\n p = ldap.search(:base => b, :filter => f, :return_result => true).first\n\n rescue Exception => e\n logger.debug :text => e\n logger.debug :text => \"*** ERROR with LDAP\"\n guessFromEmail\n end\n\n self.netid = ( p['uid'] ? p['uid'][0] : '' )\n self.fname = ( p['knownAs'] ? p['knownAs'][0] : '' )\n if self.fname.blank?\n self.fname = ( p['givenname'] ? p['givenname'][0] : '' )\n end\n self.lname = ( p['sn'] ? p['sn'][0] : '' )\n self.email = ( p['mail'] ? p['mail'][0] : '' )\n self.year = ( p['class'] ? p['class'][0].to_i : 0 )\n self.college = ( p['college'] ? p['college'][0] : '' )\n self.save!\n\n end", "title": "" }, { "docid": "9be8afe59933c79af6c69a5b08b8560c", "score": "0.5478574", "text": "def ldap_dn_search( filter=nil, options={} )\n\t\t\tif filter\n\t\t\t\t@ldap_dn_search ||= {}\n\t\t\t\t@ldap_dn_search[:filter] = filter\n\t\t\t\t@ldap_dn_search[:base] = options[:base] if options[:base]\n\t\t\t\t@ldap_dn_search[:scope] = options[:scope] if options[:scope]\n\t\t\tend\n\n\t\t\treturn @ldap_dn_search\n\t\tend", "title": "" }, { "docid": "7f52240df4128e4092af8cbece6f62d8", "score": "0.5473729", "text": "def initialize(options = {})\n options.symbolize_keys!\n keys = options.keys\n if keys.include?(:entry) && (keys & [:ldap, :filter, :ldap_options]).any?\n raise ArgumentError, \":entry and one of (:ldap, :filter, :ldap_options) are mutually exclusive!\"\n end\n reset_errors\n get_ldap_entry(options)\n unless entry.nil?\n self.class.class_eval do\n generate_single_value_readers\n generate_multi_value_readers\n end\n end\n end", "title": "" }, { "docid": "747ef47d25c98bedd7adb6162e0c211f", "score": "0.5472003", "text": "def mit_ldap\n #return nil if true\n return nil if Rails.env.test?\n return @ldap if @ldap\n return nil unless @ldap.nil?\n begin\n @ldap = User::MitLdap.find(uname)\n return @ldap\n rescue\n @ldap = false\n return nil\n end\n end", "title": "" }, { "docid": "7f1715bbad91aaaa04e529c008d9cf82", "score": "0.54710823", "text": "def ldap_dn( pattern=nil )\n\t\t\t@ldap_dn = pattern if pattern\n\t\t\treturn @ldap_dn\n\t\tend", "title": "" }, { "docid": "7fc7dd242bb73e0f3d6db05abd13724f", "score": "0.54648775", "text": "def populateLDAP\n #quit if no email or netid to work with\n self.email ||= ''\n return if !self.email.include?('@yale.edu') && !self.netid\n \n begin\n ldap = Net::LDAP.new( :host =>\"directory.yale.edu\" , :port =>\"389\" )\n \n #set e filter\n if !self.email.blank?\n f = Net::LDAP::Filter.eq('mail', self.email)\n else #netid\n f = Net::LDAP::Filter.eq('uid', self.netid)\n end\n \n b = 'ou=People,o=yale.edu'\n p = ldap.search(:base => b, :filter => f, :return_result => true).first\n \n rescue Exception => e\n logger.debug :text => e\n logger.debug :text => \"*** ERROR with LDAP\"\n guessFromEmail\n end\n \n self.netid = ( p['uid'] ? p['uid'][0] : '' )\n self.fname = ( p['knownAs'] ? p['knownAs'][0] : '' )\n if self.fname.blank?\n self.fname = ( p['givenname'] ? p['givenname'][0] : '' )\n end\n self.lname = ( p['sn'] ? p['sn'][0] : '' )\n self.email = ( p['mail'] ? p['mail'][0] : '' )\n self.year = ( p['class'] ? p['class'][0].to_i : 0 )\n self.college = ( p['college'] ? p['college'][0] : '' )\n self.save!\n p self\n end", "title": "" }, { "docid": "e22c5a3e0d714177f689459b7a8838ad", "score": "0.5463254", "text": "def i_need_ldap\n return if @ldap_running\n\n @ldap_server = Ladle::Server.new(\n quiet: false,\n ldif: Rails.root.join('spec', 'fixtures', 'tufts_ldap.ldif')\n ).start\n\n @ldap_running = true\n end", "title": "" }, { "docid": "cd9ddd12eee65a7b7c250515e12b5cd5", "score": "0.5453324", "text": "def test_ldap_no_valid_connection\n assert_raise Net::LDAP::LdapError do\n ldap = AuthenticateLdap.new('someuser','somepw','someou', 'some_host', 'dc', 'tld')\n puts ldap.valid_user?\n end\n end", "title": "" }, { "docid": "dd99de1e65c9c085873a2d005013c498", "score": "0.545257", "text": "def auth_options\n cfg = APP_CONFIG[\"ldap\"]\n {\n auth: {\n username: cfg[\"authentication\"][\"bind_dn\"],\n password: cfg[\"authentication\"][\"password\"],\n method: :simple\n }\n }\n end", "title": "" }, { "docid": "dd99de1e65c9c085873a2d005013c498", "score": "0.545257", "text": "def auth_options\n cfg = APP_CONFIG[\"ldap\"]\n {\n auth: {\n username: cfg[\"authentication\"][\"bind_dn\"],\n password: cfg[\"authentication\"][\"password\"],\n method: :simple\n }\n }\n end", "title": "" } ]
1aa912250349b9947327406015c2f0e1
GitHub user owning this repo. Returns the user name as a String.
[ { "docid": "087c83dff736c8a7880602518d7da055", "score": "0.0", "text": "def github_owner\n uri[/.*[\\/:]([a-zA-Z0-9\\-_]+)\\//] && $1\n end", "title": "" } ]
[ { "docid": "11cb23f82e7d57b50917eaa3ae0685ed", "score": "0.7521199", "text": "def github_user\n @user ||= `git config --get github.user`.strip\n @user ||= ENV[:GITHUB_USER].strip\n end", "title": "" }, { "docid": "6a514576f3aebf7de798a2111084a713", "score": "0.7489457", "text": "def get_username\n @github.user.login\n end", "title": "" }, { "docid": "a81ca4b4264e91cb052937fbc18f148a", "score": "0.7437934", "text": "def user\n @user ||= `git config user.name`.strip\n end", "title": "" }, { "docid": "8bfdbbd4938e7fc2fbd7a938e929b8b9", "score": "0.73737735", "text": "def user\n #@user ||= grit_repo.config['user.name']\n @user ||= `git config user.name`.strip\n end", "title": "" }, { "docid": "3de7ab7ed0a507465dda4789a05c7a0f", "score": "0.72632307", "text": "def github_user\n if USER.empty?\n abort \"** No GitHub user set. See #{LGHCONF}\"\n else\n USER\n end\n end", "title": "" }, { "docid": "cba207c9a4957bbc3de342366fa87358", "score": "0.7248396", "text": "def github_name\n self.name if self.github_user_name\n end", "title": "" }, { "docid": "6f91f0a57919ee3f44d6011c7aa0dc1c", "score": "0.7228696", "text": "def git_author_name\n git_author_name = `git config user.name`.chomp rescue ''\n git_author_name.empty? ? \"TODO: Write your name\" : git_author_name\n end", "title": "" }, { "docid": "b11ed47097aeb1a0a89487a65fef2fa5", "score": "0.7209738", "text": "def user_name\n\t\t\tJeweler::JewelerGit.configuration[\"user\"][\"name\"]\n\t\tend", "title": "" }, { "docid": "6ea458361bb0ccaab47758f3d81e816d", "score": "0.715952", "text": "def git_name\n %x(git config --get user.name).split(\"\\n\")[0]\n end", "title": "" }, { "docid": "a4ae717c95d780b2d1d7a06b18eb86c4", "score": "0.7131608", "text": "def github_user(fatal = true)\n if user = ENV['GITHUB_USER'] || GIT_CONFIG['config github.user']\n user\n elsif fatal\n abort(\"** No GitHub user set. See #{LGHCONF}\")\n end\n end", "title": "" }, { "docid": "a4ae717c95d780b2d1d7a06b18eb86c4", "score": "0.7131608", "text": "def github_user(fatal = true)\n if user = ENV['GITHUB_USER'] || GIT_CONFIG['config github.user']\n user\n elsif fatal\n abort(\"** No GitHub user set. See #{LGHCONF}\")\n end\n end", "title": "" }, { "docid": "ea98ccf2a2ed446d1ca66eb43ebd26f4", "score": "0.7115927", "text": "def get_git_user()\n\tuser = `git config user.name`\n\treturn user\nend", "title": "" }, { "docid": "be04c434bc6fbb9769a0600355add129", "score": "0.71062756", "text": "def github_user(fatal = true)\n if user = GIT_CONFIG['config github.user']\n user\n elsif fatal\n abort(\"** No GitHub user set. See #{LGHCONF}\")\n end\n end", "title": "" }, { "docid": "430ca48288e38ced72c56a63f63d2ef2", "score": "0.70815504", "text": "def gitconfig_user\n `git config --get user.name`.chomp\n end", "title": "" }, { "docid": "94614d52896ae3df2360c0f2717a79f2", "score": "0.70782655", "text": "def github_name\n options[:github_name] || git_config('github.user')\n end", "title": "" }, { "docid": "f2ba6d62da1826b38adda453a0f47298", "score": "0.7077734", "text": "def github_user\n configuration.github_user\n end", "title": "" }, { "docid": "d7ea8032598f951643e5d9e792e2c68d", "score": "0.6946443", "text": "def git_author_name\n `git log #{git_sha} -n 1 --pretty=%an`.chomp\n end", "title": "" }, { "docid": "d7042d5178a85fda28f5f8de9cbbf775", "score": "0.6854014", "text": "def repo_user\n local_user = `git config --local user.name`\n global_user = `git config --global user.name`\n if local_user == \"\"\n @repo_user = global_user\n @repo_user = \"unset\" if global_user == \"\"\n else\n @repo_user = local_user\n end\n end", "title": "" }, { "docid": "9d7a84269944d22105eb517977362eb8", "score": "0.6847723", "text": "def get_username\n @user_name ||= user.username\n end", "title": "" }, { "docid": "926ae7ca858c87976c9da5228618ce23", "score": "0.6830625", "text": "def get_username()\n username_gitconfig = %x(git config user.name).strip\n username_passwd = Etc.getpwnam(Etc.getlogin).gecos.gsub(/ - SBP.*/,'')\n\n username = username_gitconfig unless username_gitconfig.nil?\n username = username_passwd if username.empty?\n username\n end", "title": "" }, { "docid": "cd7038bad4e8392b180d96226aed3318", "score": "0.6807988", "text": "def deployer\n name = `git config github.user`.strip\n name = nil if name.empty?\n name ||= Etc.getpwnam(ENV['USER']).gecos || ENV['USER'] || ENV['USERNAME']\n \"@#{name}\"\n end", "title": "" }, { "docid": "409d4ddece81951b07f97acf65557bc7", "score": "0.6800075", "text": "def get_user_from_global\n\t\t\t\t%x(git config --global user.name).strip\n\t\t\tend", "title": "" }, { "docid": "2ce9eb3df222c1b20fdf595bfafa52de", "score": "0.6793528", "text": "def user_base user = github_user\n \"users/#{CGI::escape(user)}\"\n end", "title": "" }, { "docid": "b1d5a9f5fe579a42f7c436d8bdc23b1f", "score": "0.67777294", "text": "def github_user_account\n endpoint = \"/users/#{username}\"\n url = \"#{BASE_URI}#{endpoint}\"\n response = HTTParty.get url, options\n\n handle! response\n end", "title": "" }, { "docid": "337ae9cb65b7f2a615868df9082afa0c", "score": "0.6776735", "text": "def current_user\n name = `git config --global --get user.name`\n email = `git config --global --get user.email`\n\n return nil if name.nil? && email.nil?\n\n User.new name.delete(\"\\n\"), email.delete(\"\\n\"), @@nickname # git cli returns the name and email with \\n at the end\n end", "title": "" }, { "docid": "c2c2b6c9cd78a8766b57bec72dbace0f", "score": "0.67594236", "text": "def github_user\n @github_user || raise(MissingGitHubAuth)\n end", "title": "" }, { "docid": "ec4501e24088937f2f4c89d01764c102", "score": "0.6746589", "text": "def github_user\n git_user = git_payload['user']\n user_id = git_user['id']\n User.find_by(id: user_id)\n end", "title": "" }, { "docid": "735073372dfc55851a683c1b6607a456", "score": "0.67041147", "text": "def get_user_name\n return User.find(self.user_id).name\n end", "title": "" }, { "docid": "cbd984d8bb59948e9b9997730b611c24", "score": "0.6701115", "text": "def deployer\n name = `git config user.name`.strip\n name = nil if name.empty?\n name ||= Etc.getpwnam(ENV['USER']).gecos || ENV['USER'] || ENV['USERNAME']\n name\n end", "title": "" }, { "docid": "9850ab3938701b187d52bae52c55114c", "score": "0.6693041", "text": "def deployer\n name = `git config user.name`.strip\n name = nil if name.empty?\n name ||= Etc.getpwnam(ENV['USER']).gecos || ENV['USER'] || ENV['USERNAME']\n name\n end", "title": "" }, { "docid": "00f51aa3f23ebcd523bfba0ecf01c016", "score": "0.6683863", "text": "def username\n _user.username || ''\n end", "title": "" }, { "docid": "1ea0353eafee32a39e82e5337281ffcb", "score": "0.6678632", "text": "def hubssolib_get_user_name\n user = self.hubssolib_current_user\n user ? user.user_real_name : nil\n end", "title": "" }, { "docid": "bdfdaa1e337a4c759bd448afa2b83e15", "score": "0.66569954", "text": "def repo_name\n \"s-#{@registration.github_username}\"\n end", "title": "" }, { "docid": "7772c847b270c892d44f3b03d516893e", "score": "0.66202885", "text": "def user_name\n user.try!(:name) || I18n.t('models.issue.unknown_user')\n end", "title": "" }, { "docid": "944ca32d8d3bfeb2ae7be1d607b36e88", "score": "0.6585582", "text": "def user_repo\n \"#{user}/#{repo}\"\n end", "title": "" }, { "docid": "0c0923f97a88502322ad33b73b4ef940", "score": "0.6541499", "text": "def title\n return \"\" if users.empty?\n\n github_client = users.sample.github_client\n github_org = GitHubOrganization.new(github_client, github_id)\n github_org.name.present? ? github_org.name : github_org.login\n end", "title": "" }, { "docid": "05ee56b67763f51cd2ffb92c63ad9f86", "score": "0.6528667", "text": "def git_author_email\n git_author_email = `git config user.email`.chomp rescue ''\n git_author_email.empty? ? \"TODO: Write your email address\" : git_author_email\n end", "title": "" }, { "docid": "1a61702c5d330c76df93d33eb5c0236e", "score": "0.6511708", "text": "def user_name\n user_account.org_name\n end", "title": "" }, { "docid": "189792ca7e41af2cb90452222aa599ff", "score": "0.6509977", "text": "def nwo\n \"#{github_owner}/#{github_name}\"\n end", "title": "" }, { "docid": "f6e5bc244273411c65043124b718a9de", "score": "0.6472336", "text": "def github_user(scope=Rails.default_scope)\n request.env['warden'].user(scope)\n end", "title": "" }, { "docid": "0fb31e781028983dfca360049e556da1", "score": "0.646301", "text": "def owner_username\n self.owner.username\n end", "title": "" }, { "docid": "35c506ad672a826b2dcdfa0895572e7f", "score": "0.6462945", "text": "def repo_user\n @repo_user ||= UserByRepo.new(repo).call\n end", "title": "" }, { "docid": "664f58bb4466971083d3d89980158918", "score": "0.6459754", "text": "def get username\n open(\"https://github.com/#{username}.json\").read\n end", "title": "" }, { "docid": "e6c00eaf3cabd701995000720ad6f0c2", "score": "0.64449984", "text": "def get_username\n @gitlab.user.username\n end", "title": "" }, { "docid": "49a42876af81da48c244c5c9f259d8b2", "score": "0.6441676", "text": "def author\n GitHub::User.new(commit_data.author.login)\n rescue NoMethodError\n GitHub::User.new(GitHub::UNKNOWN_USER)\n end", "title": "" }, { "docid": "e1e9ce3de41ba9255f20078f8194ea10", "score": "0.64130306", "text": "def git_author_email\n `git log #{git_sha} -n 1 --pretty=%ae`.chomp\n end", "title": "" }, { "docid": "8d95b5ead81b09cd97d2c1b836ae7e74", "score": "0.64082325", "text": "def author\n @author ||= run 'git config --get user.name'\n end", "title": "" }, { "docid": "46bc6ae0a2d8d11499242f9253a43a9d", "score": "0.64078325", "text": "def user_repo\n \"#{repo}\"\n end", "title": "" }, { "docid": "dafa156fbf9b18dc0d39c6f6e3d107bc", "score": "0.6406875", "text": "def repo_full_name(repo)\n \"#{repo[:owner]}/#{repo[:slug]}\"\n end", "title": "" }, { "docid": "73feb545bb28befad949f39da86fef53", "score": "0.64041275", "text": "def user_with_name\n user_without_name || user_name\n end", "title": "" }, { "docid": "0cd6c8683cc2b99c2a462d162feb3676", "score": "0.64034325", "text": "def author\n owner_name.empty? ? owner_username : owner_name\n end", "title": "" }, { "docid": "46243ca01bd6547198ffbabe3f0df65e", "score": "0.6394025", "text": "def deployer\n name = `git config user.name`.strip\n name = nil if name.empty?\n name ||= ENV['USER'] || ENV['USERNAME'] || 'Deployer'\n name\n end", "title": "" }, { "docid": "a2ce45572ac0d18073db1d90a86d507c", "score": "0.6388866", "text": "def user_name\n return @user_name\n end", "title": "" }, { "docid": "a2ce45572ac0d18073db1d90a86d507c", "score": "0.6388866", "text": "def user_name\n return @user_name\n end", "title": "" }, { "docid": "a2ce45572ac0d18073db1d90a86d507c", "score": "0.6388866", "text": "def user_name\n return @user_name\n end", "title": "" }, { "docid": "a2ce45572ac0d18073db1d90a86d507c", "score": "0.6388866", "text": "def user_name\n return @user_name\n end", "title": "" }, { "docid": "a2ce45572ac0d18073db1d90a86d507c", "score": "0.6388866", "text": "def user_name\n return @user_name\n end", "title": "" }, { "docid": "ade2eeae6d433ecc324b11f87922ae40", "score": "0.63796526", "text": "def user_name\n \tif self.member_id.nil?\n \t\tself.username\n \telse\n \t\tself.user.name\n \tend\n end", "title": "" }, { "docid": "8e7c7640ef0b01a9a3da317f59ecb773", "score": "0.63666517", "text": "def git_user\n to_s false\n end", "title": "" }, { "docid": "8e7c7640ef0b01a9a3da317f59ecb773", "score": "0.63666517", "text": "def git_user\n to_s false\n end", "title": "" }, { "docid": "31f6a91fc90980ee1480aba0216a02ec", "score": "0.63545233", "text": "def username\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "dc540d92462ad1a315132acaa7a91518", "score": "0.6351647", "text": "def repo\n \"#{creator.username}/#{name}\"\n end", "title": "" }, { "docid": "dc540d92462ad1a315132acaa7a91518", "score": "0.6351647", "text": "def repo\n \"#{creator.username}/#{name}\"\n end", "title": "" }, { "docid": "f4dbcd766ed9fb4ab502ed32d0e1feca", "score": "0.63479894", "text": "def get_user_name\n user = Etc.getpwnam(Etc.getlogin)['gecos'].split(',').first\n user = Etc.getlogin if user.nil?\n\n return user\n end", "title": "" }, { "docid": "d335bd2a89b3273186aaf8069749d2a2", "score": "0.6325446", "text": "def user_name\n spec[USER_NAME]\n end", "title": "" }, { "docid": "44de77a4720f0933dd8929ec4c76c021", "score": "0.6317409", "text": "def get_owner_name\n\n\t\t@owner = User.find(self.user_id)\n\t\t@owner_name = \"No last name\"\n\t\tif @owner.last_name\n\t\t\t@owner_name = @owner.name + \" \" + @owner.last_name\n\t\tend\n\n\t\treturn @owner_name\n\tend", "title": "" }, { "docid": "433b8ee6288798cb29a9bc60068372bc", "score": "0.63155746", "text": "def getAuthorName\n\t\treturn User.find(self.user_id).username\n\tend", "title": "" }, { "docid": "62488f1329518e372f30ebcf44797c73", "score": "0.63057226", "text": "def user_name\n if self.user\n self.user.user_name\n end\n end", "title": "" }, { "docid": "4ab6776c94d6225c4f2dd54407f6fded", "score": "0.6301784", "text": "def user_name\n return @config['os']['user']['name']\n end", "title": "" }, { "docid": "2d85d7a4811f446ee02ca4feebef238b", "score": "0.6283808", "text": "def user_name\n \t\tUser.find(self.user_id).full_name\n \tend", "title": "" }, { "docid": "a7a6aacaf75a86f86205324313a8c191", "score": "0.627724", "text": "def display_username(user)\n full_name = Etc.getpwnam(user).gecos.strip\n full_name = full_name.empty? ? user : full_name\n\n \"#{full_name} - #{user}\"\n end", "title": "" }, { "docid": "6eb00738127e6386a69566de70a894fa", "score": "0.62720186", "text": "def user_name\n @user_name\n end", "title": "" }, { "docid": "6eb00738127e6386a69566de70a894fa", "score": "0.6271347", "text": "def user_name\n @user_name\n end", "title": "" }, { "docid": "7939127f72f86d916dfe1fc710f801fc", "score": "0.6264173", "text": "def get_owner_name\r\n\r\n\t\t@owner = User.find(self.user_id)\r\n\t\t@owner_name = \"No last name\"\r\n\t\tif @owner.last_name\r\n\t\t\t@owner_name = @owner.name + \" \" + @owner.last_name\r\n\t\tend\r\n\r\n\t\treturn @owner_name\r\n\tend", "title": "" }, { "docid": "986072689b2eb5621723497313faa02f", "score": "0.6256415", "text": "def to_s\n username || 'User'\n end", "title": "" }, { "docid": "986072689b2eb5621723497313faa02f", "score": "0.6256415", "text": "def to_s\n username || 'User'\n end", "title": "" }, { "docid": "383e6539bd1a0208a79b23c172e57fea", "score": "0.62420434", "text": "def to_s\n username || full_name\n end", "title": "" }, { "docid": "3b4eb5366b0ab69b09a1efa551236317", "score": "0.62361383", "text": "def github_user_from_gitconfig\n results = `git config github.user`.chomp\n return nil if results.empty?\n results\nend", "title": "" }, { "docid": "d358d4aa3ea1e30cf7b365dafe264647", "score": "0.62287766", "text": "def username(user = nil)\n user ||= @logged_in_user\n \"#{t.site.name_prefix}#{user.username}#{t.site.name_suffix}\"\n end", "title": "" }, { "docid": "d25bbe54863f8a81513f4a9d08f986d9", "score": "0.62184864", "text": "def get_user(username)\n return nil if username.to_s.strip.empty?\n username = user_login(username)\n begin\n github_client.user(username)\n rescue Octokit::Unauthorized\n logger.warn(\"Error calling GitHub API! Bad credentials: TOKEN is invalid\")\n nil\n rescue Octokit::NotFound\n nil\n end\n end", "title": "" }, { "docid": "82c3faade9ebbeed19fa2c1f25828c50", "score": "0.6217444", "text": "def get_user_name(user)\n return Slack.users_info({:user => user})[\"user\"][\"name\"]\n end", "title": "" }, { "docid": "cac20a9706da5e31db5d3504d8492050", "score": "0.62142736", "text": "def owner\n if author\n author.display_username\n elsif username.blank?\n \"someone\"\n else\n username\n end\n end", "title": "" }, { "docid": "64700c8dd7429512ae569396b7c67bc5", "score": "0.62084407", "text": "def user_name\n\n #grabs user info with helper method\n user = user_info\n\n #returns the user's name\n if user != nil\n return user.my_name\n end\n return \" \"\n end", "title": "" }, { "docid": "72880392b26995aa1b3478ad66a61711", "score": "0.6207482", "text": "def get_useremail()\n email = nil\n git_user_email = %x(git config user.email).strip\n email = git_user_email if git_user_email\n email\n end", "title": "" }, { "docid": "4091c20efdffae635a8bfe8c7f71360b", "score": "0.62057316", "text": "def username\n self.user_info.username\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "6a989f9e2ebb333ae8d010579c463072", "score": "0.62017256", "text": "def user_name\n user ? user.name : ''\n end", "title": "" }, { "docid": "0d25f589ce3d8b58845137368413b152", "score": "0.6196407", "text": "def name\n @user.name\n end", "title": "" }, { "docid": "ea50b97a0e1d39d0f4fe8f8771a99d7b", "score": "0.61935145", "text": "def user_name\n (self.user_profile_full_name || self.name).to_s\n end", "title": "" }, { "docid": "53cc309f2a54d6c0edca817976d2d950", "score": "0.61862355", "text": "def get_user_name\n user ? user.name : ''\n end", "title": "" } ]
311bec02e92cef4b488207e8e037b388
informacion de un usuario
[ { "docid": "98c57ad27b551ae12b8f2610d2b4db2b", "score": "0.0", "text": "def usern\n user = User.username(params[:usern])\n render json: user, status: 200\n end", "title": "" } ]
[ { "docid": "5e343c82dac552260d3fefd4af825071", "score": "0.72564495", "text": "def info()\n super(USER_METHODS[:info], 'USER')\n end", "title": "" }, { "docid": "b57ebb820c72bdd8201c02e2ca045f74", "score": "0.7189962", "text": "def user_info\n @connection.post('/user/info').response\n end", "title": "" }, { "docid": "98f336ed93eb9dff0cb1b63a3beee5f9", "score": "0.7152693", "text": "def info()\n super(USER_METHODS[:info], 'USER')\n end", "title": "" }, { "docid": "c9e17860ec2dd5587ec4bf32e75f80b8", "score": "0.7103176", "text": "def info(session, id)\n read_task('rvpe.user.info', session) do\n session_uname = get_user_from_session(session)\n session_user = User.find_by_name(session_uname).last\n\n user = User.find_by_id(id).last\n raise \"User[#{id}] is not found.\" unless user\n\n if session_user.id != 0 && session_user.id != id\n raise \"You don't have permission to see info. of User[#{user.name}].\"\n end\n\n doc = REXML::Document.new\n doc.add(user.to_xml_element(session))\n [true, doc.to_s]\n end\n end", "title": "" }, { "docid": "9f1001916b2385631887d614101eee8f", "score": "0.7096392", "text": "def info(decrypt = false)\n super(USER_METHODS[:info], 'USER', decrypt)\n end", "title": "" }, { "docid": "d1699e785e4b8dcac9f001071d930e05", "score": "0.7035216", "text": "def user_info\n\n end", "title": "" }, { "docid": "0c698a87c17c7be4b4acb43a7d31c2f8", "score": "0.6879184", "text": "def userinfo; end", "title": "" }, { "docid": "0c698a87c17c7be4b4acb43a7d31c2f8", "score": "0.6879184", "text": "def userinfo; end", "title": "" }, { "docid": "eb3ab627f11b91a80b81ea855e4b58d6", "score": "0.6756507", "text": "def info()\n _params = {}\n return @master.call 'users/info', _params\n end", "title": "" }, { "docid": "23ae77a8e0f1e27ca36fb0e8576c5e02", "score": "0.6712348", "text": "def info\n @user = current_user\n end", "title": "" }, { "docid": "4aac6d8c5a0b445522def88c2389626e", "score": "0.6680019", "text": "def info\n hash = {:username => @username}\n @api.request(\"users/info/?#{build_query_string(hash)}\")\n end", "title": "" }, { "docid": "e3bc0d1ff120019769381f9bf80eca71", "score": "0.667379", "text": "def get_user_info\n\t\t\tdo_api :get, 'user/get_info', { :session => @session }\n\t\tend", "title": "" }, { "docid": "4e3ae377be1dfb79af74564908a61589", "score": "0.66700864", "text": "def utilisateur\n\n end", "title": "" }, { "docid": "1694375332c4177ccf25e504dad6112f", "score": "0.6612177", "text": "def info(params)\n user_id = (params.split(\"-\"))[0]\n @info = @client.keystone(\"users/#{user_id}\", 'GET')\n @info[\"response\"]\n end", "title": "" }, { "docid": "3b33f049bd85be795b853c7769584e8d", "score": "0.6600647", "text": "def request_user_information\n user_id = ask((@lang_handler.get_str :login_id_request), Integer) do |q| \n q.in = 0..999999\n end\n \n user_pin = ask((@lang_handler.get_str :login_pin_request), Integer) do |q| \n q.echo = false\n q.in = 0..9999\n end\n \n return user_id, user_pin\n end", "title": "" }, { "docid": "f6e67efc03f41d9aa4dbe59e6a11e145", "score": "0.6583253", "text": "def user_info\n puts '------Enter User Info------'\n puts 'Enter name'\n name = name_valid\n puts 'Enter Contact No.'\n contact_no = contact_number_valid\n puts 'Enter Age'\n age = age_valid\n User.new(name, contact_no, age)\n end", "title": "" }, { "docid": "194a9a2b1bcafc15eadea9a869742e3c", "score": "0.65774876", "text": "def user_info\n parse_user_info(@success_body)\n end", "title": "" }, { "docid": "194a9a2b1bcafc15eadea9a869742e3c", "score": "0.65774876", "text": "def user_info\n parse_user_info(@success_body)\n end", "title": "" }, { "docid": "481985fce93c345545e01c710a7d2950", "score": "0.65490925", "text": "def get_user_info\n request :get_user_info\n end", "title": "" }, { "docid": "5cabd37136c34dcd6459416aa5ef9eb8", "score": "0.65432936", "text": "def user_info\n { \n 'nickname' => user_hash['name'],\n 'name' => user_hash['nickname']\n }\n end", "title": "" }, { "docid": "446f0b8703008bc7252e6761c174a0ad", "score": "0.6495248", "text": "def show\n #o usuario só pode ver a si mesmo\n @usuario = current_user\n end", "title": "" }, { "docid": "c36a093c896f0d121580b2cd52ac5208", "score": "0.6494106", "text": "def show params \n # Solo se puede mostrar al propio usuario\n @user\n end", "title": "" }, { "docid": "c4ad761bb22532fdc400a8f9be1c6650", "score": "0.6469527", "text": "def set_usuario\n\t end", "title": "" }, { "docid": "a14af600e0d282a871ddb8bf91ad2f2a", "score": "0.6457701", "text": "def user_info\n get('/userinfo')\n end", "title": "" }, { "docid": "a14af600e0d282a871ddb8bf91ad2f2a", "score": "0.6457701", "text": "def user_info\n get('/userinfo')\n end", "title": "" }, { "docid": "42670b61a160d1e10223e342cca6e3ab", "score": "0.6445466", "text": "def info username, password\n\t\t\t@pack_data[:account] = username\n\t\t\t@pack_data[:password] = password\n\n\t\t\tresult = do_req CMD[:CHECK]\n\t\t\tputs \"Your Account Info:\\n #{result[:res_info]}\" \n\t\tend", "title": "" }, { "docid": "4d3b192786131c70c9ee860e2e47d23b", "score": "0.6403952", "text": "def user_name; det.form(:name, 'configUser').text_field(:id, 'usernameUser'); end", "title": "" }, { "docid": "aea3cba8f5b675eb94b7c213bcc1ce08", "score": "0.639411", "text": "def user_info\n {\n :id => self.id,\n :username => self.username,\n :location => self.location,\n :display_name => self.display_name,\n :profile_image => self.profile_image\n }\n end", "title": "" }, { "docid": "636824c0082a2d29de357f805996fc52", "score": "0.6386074", "text": "def show\n @user_name = current_user.email # 获取当前登录用户的Emai\n end", "title": "" }, { "docid": "730f8a07abd4f4f4d668f01fa716d2e6", "score": "0.6377874", "text": "def verifica_usuario(user_id)\n if self.user_id == 0 or self.user_id == nil\n r = 'SOLICITANTE'\n else\n r= self.user.name\n end\n end", "title": "" }, { "docid": "8b6de593028bb7bb616456ae87d28a67", "score": "0.6371907", "text": "def identificacion_usuario\n \"#{user.customer.people.type_identification}-#{user.customer.people.identification_document}\"\n end", "title": "" }, { "docid": "f8e291b1ed1c10a3d063541f876185df", "score": "0.63637865", "text": "def set_info\n @info = User.find(params[:id])\n end", "title": "" }, { "docid": "76f4e46137d220987276efc4658cc6b2", "score": "0.6363442", "text": "def identificacion_usuario\n \"#{people.type_identification}-#{people.identification_document}\"\n end", "title": "" }, { "docid": "ba8bad61dde11dbd2f666bd66213a6da", "score": "0.6349451", "text": "def accionIdentify(comando,usuariosLista,socketUsuario)\n orden=comando.split(\" \")\n username=orden[1]\n if(username==nil)\n socketUsuario.puts \"Necesitas ingresar un nombre\"\n elsif (nombreExiste?(username,usuariosLista))\n socketUsuario.puts \"Este usuario ya esta ocupado\"\n else\n status=\"ACTIVE\"\n usuario=Usuario.new(username,socketUsuario,status)\n usuariosLista.push(usuario)\n socketUsuario.puts \"Ahora esta identificado como #{username}\"\n s=\"_ Se a conectado\"\n accionPublicMessage(s,usuariosLista,socketUsuario)\n end\n end", "title": "" }, { "docid": "8d2c9e05cbd8b30a2b222de9a16c7d95", "score": "0.63425094", "text": "def show\n\t\t@user = buscarUsuario(params[:id])\n\tend", "title": "" }, { "docid": "5b4e2db74fe1f82e7dc407e2a42cef16", "score": "0.634138", "text": "def user_info\n {\n 'uid' => user_hash['id'],\n 'nickname' => user_hash['username'],\n 'first_name' => user_hash['firstname'],\n 'last_name' => user_hash['lastname'],\n 'name' => [user_hash['firstname'],user_hash['lastname']].reject{ |n| n.nil? || n.empty? }.join(' '),\n 'email' => user_hash['email'],\n 'language' => user_hash['language']\n }\n end", "title": "" }, { "docid": "22cd8fb55a0332795ea365c39d49f2c7", "score": "0.6340604", "text": "def user!\n u = user\n u.info!\n u\n end", "title": "" }, { "docid": "d5932b812d39230ae65eab4f97965071", "score": "0.6329392", "text": "def account_information(user, password)\n @title = 'INFORMAZIONE DELL\\'ACCOUNT'\n set_language_if_valid user.language\n recipients user.mail\n subject l(:mail_subject_register_info, Setting.app_title)\n body :user => user,\n :password => password,\n :login_url => url_for(:controller => 'editorial', :action => 'home')\n #:login_url => url_for(:controller => 'account', :action => 'login')\n render_multipart('account_information', body)\n end", "title": "" }, { "docid": "9ee95b2e8b69b963554ff24d4f2f326d", "score": "0.63221085", "text": "def name\n @data['aozoraUsername'][0..20]\n end", "title": "" }, { "docid": "2968a7531a51b478615b069ea8ccf077", "score": "0.63149774", "text": "def name\r\n @usr_name\r\n end", "title": "" }, { "docid": "a22094d6403eb2ba9e1aba9ec1753109", "score": "0.63149154", "text": "def retornar_texto_usuario\n texto_usuario.greenify\n texto_usuario.text\n end", "title": "" }, { "docid": "3c1fe44e78ebde983e73b06c8f7363bb", "score": "0.6306453", "text": "def user_name\n @data[:user_name]\n end", "title": "" }, { "docid": "94499c2c0a126bb1713d0d356e36e685", "score": "0.62993574", "text": "def showUserInfo\n FBRequest.requestForMe.startWithCompletionHandler(lambda do |connection, user, error|\n if error.nil?\n NSLog(\"#{user.inspect}\")\n textLabel.textColor = UIColor.charcoal\n textLabel.text = \"Welcome #{user[:name]}\"\n end\n end)\n end", "title": "" }, { "docid": "0dfaa655c603152248e835ca31c5ab87", "score": "0.6294476", "text": "def print_user_info first_name, last_name, phone, age\nend", "title": "" }, { "docid": "1e947e850598cca105ccd03727eed0ee", "score": "0.6291671", "text": "def info() $USER.inspect end", "title": "" }, { "docid": "f8e2f55a7fffc5f1609bdeb3042c45b3", "score": "0.62772834", "text": "def vista_user_name\nprint \"\\nUser name: \"\nend", "title": "" }, { "docid": "4497ee542e6facd90820958785371a76", "score": "0.62758076", "text": "def users_info(options = {})\n raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?\n options = options.merge(user: users_id(options)['user']['id']) if options[:user]\n post('users.info', options)\n end", "title": "" }, { "docid": "8a64744e0f33a1a24d1f35ec6d2d15e8", "score": "0.62699103", "text": "def user_info \n @user_info ||= raw_info.nil? ? {} : raw_info[\"user\"]\n end", "title": "" }, { "docid": "4d5cde07edc094dca2b56bb7e8918dc2", "score": "0.62689424", "text": "def descadastrar\n @user = current_user\n end", "title": "" }, { "docid": "38def7d073ddb5003a0e5029d7ea7a94", "score": "0.6254828", "text": "def display_user_name\n @username = name\n puts name\n end", "title": "" }, { "docid": "433aa7f6a6ed82c82ae366c0bf354513", "score": "0.6251948", "text": "def show\n verifica_se_usuario_logado_e_admin\n end", "title": "" }, { "docid": "ba46c33eaa6033eeddbbdddd3ad3411f", "score": "0.6247462", "text": "def user_info\n get(api_get.body.identity).body\n end", "title": "" }, { "docid": "d1b4592564fb7a1f2201075ad3a3fcf7", "score": "0.623964", "text": "def show_username(str_name)\n self.title = \"#{APP_CUPERATIVA_NAME} - Utente: #{str_name}\" \n #@lbl_username.text = \"#{@comment_init} - Utente: #{str_name}\" \n end", "title": "" }, { "docid": "2b46853d8d61d7a9f2e923f94befdeb8", "score": "0.6233581", "text": "def users_info(params = {})\n fail ArgumentError, \"Required arguments 'user' missing\" if params['user'].nil?\n response = @session.do_post \"#{SCOPE}.info\", params\n Slack.parse_response(response)\n end", "title": "" }, { "docid": "d6ffbf276dc8999232d659c747d0473f", "score": "0.62303203", "text": "def user_name\n data[:user_name]\n end", "title": "" }, { "docid": "80ba79584a54d7eb596bc2a0e594a404", "score": "0.6230057", "text": "def accionUsers(usuariosLista,socketUsuario)\n s=\"Usuarios Identificados: \\n\"\n for i in usuariosLista\n s=s+\"[#{i.status}]\"+i.name+\"\\n\"\n end\n socketUsuario.puts s\n end", "title": "" }, { "docid": "ce05995bc66e2c23b99041ef490a09dc", "score": "0.62206614", "text": "def user\r\n end", "title": "" }, { "docid": "e0c0791bab1d5359a1350043a8a1f999", "score": "0.6220393", "text": "def showuser\n # Find a user by their username\n @user = User.find_by_name(params[:name])\n # Get all the users chat messages\n @chat_messages = @user.chat_messages\n # Get the user's lock record, if there is one\n @lock = @user.lock\n # Get a list of the users active infractions\n @infractions = @user.active_infractions\n # Get a list of the users expired infractions\n @expired_infractions = @user.expired_infractions\n end", "title": "" }, { "docid": "0f40b720d84d241a5fd578f5b856fe2d", "score": "0.6217422", "text": "def user_info\n {}\n end", "title": "" }, { "docid": "d6ac498415b09987c979443d12fdfddb", "score": "0.6210464", "text": "def get_user_info username\n get(\"/user/#{username}/about.json\")\n end", "title": "" }, { "docid": "c76c24c7a0166d9693c40d0e065d2fcc", "score": "0.6202818", "text": "def username\n info['username']\n end", "title": "" }, { "docid": "efd611927ca5f130385191da09eee43a", "score": "0.62016976", "text": "def account_information(user, password)\n set_language_if_valid user.language\n @user = user\n @password = password\n @login_url = url_for(:controller => 'account', :action => 'login')\n mail :to => user.mail,\n :subject => l(:mail_subject_register, Setting.app_title)\n end", "title": "" }, { "docid": "c00bc736b251202066e293f307704a4a", "score": "0.62011784", "text": "def load_info\n unless @info_loaded\n xml = Base.request 'user.getinfo', :user => @name\n if xml.root['status'] == 'ok' and xml.root.children.first.name == 'user'\n load_from_xml xml.root.children.first\n @info_loaded = true\n end\n end\n end", "title": "" }, { "docid": "b61058452601b9881a0338e6073c8d4e", "score": "0.6187435", "text": "def user_extra_information login\n self.user = parse_response(send_my_own_request(\"/api/users/#{login['title']}/\").body)['user']\n end", "title": "" }, { "docid": "d357ef74b314319d54b1c54143220402", "score": "0.6184474", "text": "def personal_information\n\t\t@account = current_user\n\t\t@usertype = current_usertype\n\n\t\trender \"users/edit\"\n\tend", "title": "" }, { "docid": "237a6af97a2b213b31eaf5f92b143e67", "score": "0.61805", "text": "def get_info(user_id)\n if user_id.integer?\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/users/#{user_id}.json\"\n end\n end", "title": "" }, { "docid": "0d42fc68bf5019f7e6df8a6cfaf8b995", "score": "0.6175638", "text": "def userInfo\n\t\tname = gets\n\t\tgpa = gets\n\t\tsat = gets\n\t\tact = gets\n\t\tlocation = gets\n\t\tpopulation = gets\n\t\tsocial_life = gets\n\t\tathletics = gets\n\tend", "title": "" }, { "docid": "6eb8c1d80395624bf13929d4fa0800c7", "score": "0.6172703", "text": "def show\n # puts(\"bbbbbbbbllllllaaaaaa!!!!!!!!\")\n @user = User.find(params[:id])\n @infos = @user.infos\n end", "title": "" }, { "docid": "2c7823036206b29437e89f49042e0220", "score": "0.61561835", "text": "def show_users\n begin\n users = @dbClient.query(\"select username,id from users where id != '#{current_user_id}'\")\n if users.count > 0\n user_choices = {}\n for user in users do\n user_choices[user[\"username\"]] = user[\"id\"]\n end\n transfer_money user_choices\n else\n @prompt.say(\"No accounts found.\")\n end\n rescue => exception\n puts exception\n end\n \n end", "title": "" }, { "docid": "a45133011568b78edad3b3d54b397ee9", "score": "0.6141141", "text": "def about\n\t\t@user = Account.find(params[:id])\n\t\t@user_details = Npo.find_by_account_id(@user.id)\n\tend", "title": "" }, { "docid": "11af01411b008d7b304199a5972a35c8", "score": "0.6139418", "text": "def account_info\n \"#{ user_name } (#{ name_with_id })\"\n end", "title": "" }, { "docid": "eefb836dd0c77c2eea33f6901aa3a84e", "score": "0.6138542", "text": "def user_name\n data.user_name\n end", "title": "" }, { "docid": "1a07a508a2bc4b58fc7e1d06168cc448", "score": "0.613094", "text": "def discover_user_information\n system(\"clear\")\n puts \"What is your first name?\"\n @first_name = gets.chomp.capitalize\n puts \"Hi #{@first_name}. What would you like to select for your username?\"\n @username = gets.chomp.downcase\n username_exist?\n sleep(2)\n system(\"clear\")\n puts \"#{@username}, an excellent choice! \"\n puts \"#{@first_name}, the last thing we need from you is a password. Make sure its unique, but something you'll remember.\"\n @password = gets.chomp\n puts \"Alrighty. Your account has been created, and you are ready to go!\"\n user = User.new(@first_name, @username, @password)\n end", "title": "" }, { "docid": "30d161983681947bf3d754c067bdf574", "score": "0.6130706", "text": "def onUserInfo(user, infoType, info)\n end", "title": "" }, { "docid": "8ff5370943b1033404c2610641bdeddb", "score": "0.61299783", "text": "def account_info\n user = User.last\n UserMailer.account_info(user)\n end", "title": "" }, { "docid": "e4a5f01ec8bf17e0f44f0ac886ca55fc", "score": "0.6129116", "text": "def get_info( params )\n LastFM.get( \"user.getInfo\", params )\n end", "title": "" }, { "docid": "5cc7cb6b90cccd432131e957257c52aa", "score": "0.6125097", "text": "def get_user_info\n return User.find_by_id(self.user_id)\n end", "title": "" }, { "docid": "6e8373ddd7cf9d3f4084394699a1acdb", "score": "0.6113914", "text": "def info\n puts @user.inspect\n render json: current_user.sanitized, status: :ok\n end", "title": "" }, { "docid": "ce7b3bf7f09c7b3c7d3a23720e96ee21", "score": "0.6104271", "text": "def username; end", "title": "" }, { "docid": "ce7b3bf7f09c7b3c7d3a23720e96ee21", "score": "0.6104271", "text": "def username; end", "title": "" }, { "docid": "ce7b3bf7f09c7b3c7d3a23720e96ee21", "score": "0.6104271", "text": "def username; end", "title": "" }, { "docid": "ce7b3bf7f09c7b3c7d3a23720e96ee21", "score": "0.6104271", "text": "def username; end", "title": "" }, { "docid": "ce7b3bf7f09c7b3c7d3a23720e96ee21", "score": "0.6104271", "text": "def username; end", "title": "" }, { "docid": "4091c20efdffae635a8bfe8c7f71360b", "score": "0.6102994", "text": "def username\n self.user_info.username\n end", "title": "" }, { "docid": "1e9c46ba236e1903eaeabadf4762e292", "score": "0.610075", "text": "def user_info(user_id)\n return db.execute(\"SELECT * FROM users WHERE id=?\", user_id)\n end", "title": "" }, { "docid": "430fab781b401e545c8f579796decfb5", "score": "0.6092859", "text": "def show\n\t#確認自己的權限\n\tif session['user']==0\n\t\tredirect_to({:controller => 'sessions', :action => 'new' }, notice:\"請登入!\")\n\tend\n\t@prm = User.find_by(\"name='#{session['user']}'\")\n end", "title": "" }, { "docid": "db649ea06331747c7787f0490c21675d", "score": "0.6091122", "text": "def set_userinfo\n # @userinfo = Userinfo.find(params[:id])\n @userinfo = Userinfo.find(current_user.id)\n end", "title": "" }, { "docid": "fd037c340f4d8faced721bc8a9856983", "score": "0.60842186", "text": "def info\n {\n domain: @domain,\n username: @username\n }\n end", "title": "" }, { "docid": "7b9dac5d9db8f35b96508a199f4c24d6", "score": "0.60811305", "text": "def show\n user_info = self.info.show\n adm = Administrator.find(self.administrator_id)\n info_adm = adm.info\n user_info[:administrator] = info_adm.name + ' ' + info_adm.last_name\n user_info[:organisation] = adm.organisation\n user_info\n end", "title": "" }, { "docid": "116f1bd642b822e10fedd018d4da715d", "score": "0.60690415", "text": "def call\n info = Vc::Login.get_user @username, @password\n\n update_person_info info\n end", "title": "" }, { "docid": "3e25ab96c02ffbc97786b6cd2d23bc1f", "score": "0.6068704", "text": "def user\n Delphix.get(Delphix.user_url).body.result\n end", "title": "" }, { "docid": "90aa1a681bbccdd92addeb3d1d28e3f4", "score": "0.60653853", "text": "def show\n if @peran.users.length == 0\n @user_terhubung = \"Tidak ada yang terhubung\"\n else\n @user_terhubung = @peran.users.map(&:nama_lengkap).join(\", \")\n end\n end", "title": "" }, { "docid": "22b3b33d99044fa7a286a5c43ec48300", "score": "0.606065", "text": "def show\n @info = User.find(params[:id])\n #@info = current_user.infos.where(id: params[:id])\n end", "title": "" }, { "docid": "d5690fd6fbb83cce9aef9f17a1b2ef7e", "score": "0.6056929", "text": "def account_info\n get(\"/users/self\")\n end", "title": "" }, { "docid": "81304994e45ddb98e8243808af9fabcd", "score": "0.60566854", "text": "def print_user\n \"#{sender}(#{identification})\"\n end", "title": "" }, { "docid": "37de1860d0a4ffc3be44f55ae4281acb", "score": "0.6051437", "text": "def show\n @user = User.find(params[:id])\n @user_info = Information.gets_current_information(params[:id])\n end", "title": "" }, { "docid": "63895646644cf9ec2d50911f607e7a04", "score": "0.60464257", "text": "def account_information (usu, pass, email, msg)\n\t\tMail.deliver do\n\t\t to email\n\t\t from 'usu0100@gmail.com'\n\t content_type 'text/plain; charset=UTF-8'\n\t\t subject msg\n\t\t body \"Your account, \\n \\tUsername: #{usu}\\n \\tPassword: \"+\"#{pass}\\n \\tEmail: #{email}\"\n\t \tend\n\tend", "title": "" }, { "docid": "ddf02d4c7a328c7c9b968c4d73b1c8b1", "score": "0.60441595", "text": "def registrar_usuario\n customer_user = User.new\n customer_user.email = self.people.email\n customer_user.password = customer_user.generar_password\n customer_user.client_type = 'persona'\n customer_user.save\n update(user_id: customer_user.id, user_created_id: customer_user.id)\n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_customer = HistoryPassword.new\n password_customer.password = customer_user.password\n password_customer.user_id = customer_user.id\n password_customer.save\n end", "title": "" }, { "docid": "e18a73c2c827c09038692d3b66227a66", "score": "0.6033053", "text": "def get_user_info\n self.class.get(\"#{@url}/rest/user-management/logged-in-user?pretty\", basic_auth: @auth)\n end", "title": "" }, { "docid": "4754166a831ea48bb703894f620bd299", "score": "0.60322887", "text": "def info(options = {})\n params = options.merge(access_token: @access_token, uid: @uid) { |_, important, _| important }\n make_request resource_path('users/show', params), {}\n end", "title": "" }, { "docid": "637defa59733b8b5b100ab973d5005e9", "score": "0.60316163", "text": "def verifica_usuario(user_id)\n if self.user_id == 0\n @request_support_requests = Requests::SupportRequest.find(self.support_request_id)\n unless @request_support_requests == nil\n r = @request_support_requests.name\n else\n r = 'SOLICITANTE'\n end\n\n \n else\n r= self.user.name\n end\n r\n end", "title": "" } ]
f61ad6cb02299aee0223e10fd1b9be16
DELETE /bookings/1 DELETE /bookings/1.json
[ { "docid": "7d2b12e7180889b3b75ae81a67e77701", "score": "0.6953511", "text": "def destroy\n booking = @booking\n @booking.destroy\n respond_to do |format|\n flash[:success] = \"Your Booking was Cancelled Successfully\"\n format.html { redirect_to bookings_url}\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "899ffdf005df064f4dbab155002fe202", "score": "0.7660707", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899ffdf005df064f4dbab155002fe202", "score": "0.7660707", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899ffdf005df064f4dbab155002fe202", "score": "0.7660707", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899ffdf005df064f4dbab155002fe202", "score": "0.7660707", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f6f4adb3b4fd8697fa1b7c73600ad6e", "score": "0.7657568", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "22b6f1478dd3479a261b76c7797d4f1e", "score": "0.7565737", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to '/bookings' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "886c634f86f48c3f4337fef89ea40267", "score": "0.75498253", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "886c634f86f48c3f4337fef89ea40267", "score": "0.75498253", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22414be6020252d8feb10a7805160aec", "score": "0.739592", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2a9797482112c0687c701898b728add3", "score": "0.7359668", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2a9797482112c0687c701898b728add3", "score": "0.7359668", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f4dea1c7b94d1862f8fe2ba863c5b06c", "score": "0.729106", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_index_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3cb21286346bca328b1bb85b46333f51", "score": "0.72711414", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to admin_bookings_url, notice: 'Bookingen er nu slettet.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724865", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.724861", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8891e59697b3c553108e5838cba27c0f", "score": "0.72474027", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e008cf33ee280b89e50576daf0589766", "score": "0.7243795", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: \"Booking was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e008cf33ee280b89e50576daf0589766", "score": "0.7243795", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: \"Booking was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14ca636450d9910f82beecebd71768f6", "score": "0.7240045", "text": "def destroy\n book = Book.find(params[:id])\n book.destroy\n \n render json: {}, status: 204\n end", "title": "" }, { "docid": "0425062f5637fabb6aa3d8e9f2c9ae39", "score": "0.72398716", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n \n format.json { render json: @book, status: :created, location: @book }\n end\n end", "title": "" }, { "docid": "7087cb25617f7a2536dd801fbbd6280a", "score": "0.72395927", "text": "def destroy\n @api_book.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "1ce3ff253ca42c90d26fc969e0b108db", "score": "0.72278243", "text": "def destroy\n @booking = @room.bookings.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to property_room_bookings_url(@property, @room) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "522edca48866f6ccd1b91a159ff8ef9a", "score": "0.72186166", "text": "def destroy\n sql = \"DELETE FROM Booking WHERE bookingId = #{params[:id]}\"\n ActiveRecord::Base.connection.execute(sql)\n\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "758614dba6f014a4beaab3441ba33d97", "score": "0.7204612", "text": "def destroy\n @booking.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "37601b4cbb1006651d37e9f815a82fcc", "score": "0.71994567", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n \n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ead5d9ab31b6353d5a2c6b3954e860b0", "score": "0.71873736", "text": "def destroy\n @bidding = Bidding.find(params[:id])\n @bidding.destroy\n\n respond_to do |format|\n format.html { redirect_to biddings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2bd5f4c5b5d342488e17b99f6de31003", "score": "0.7173599", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to profile_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "edac190a8b4acf3350d1d329c4eb983d", "score": "0.7169725", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n end\n end", "title": "" }, { "docid": "a0327edbf8fdb77d6e8871b182b1be23", "score": "0.7169493", "text": "def destroy\n @book_shelf = BookShelf.find(params[:id])\n @book_shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to book_shelves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b241146335fb167465464d38492a92b", "score": "0.7155298", "text": "def destroy\n @bookable.destroy\n respond_to do |format|\n format.html { redirect_to bookables_url, notice: 'Bookable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f62dbf5da982b93f3619cb9c5471fc77", "score": "0.7153458", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html do\n redirect_to bookings_url,\n notice: 'Booking was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2307680262c24eb29d58b049dcd8771d", "score": "0.7148876", "text": "def destroy\n @bookalawn.destroy\n respond_to do |format|\n format.html { redirect_to bookalawns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8dd2c81df43c7d35efe43722ab2976ba", "score": "0.7145432", "text": "def delete_bookings()\n sql = \"DELETE FROM bookings\n WHERE bookings.member_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "ea71501d1e2f341405c264140122f1e7", "score": "0.71424234", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to static_pages_new_booking_enquiry_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2df45145f4f30968f748e22b015adb96", "score": "0.7140181", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8c676ea72f709b9f4708796778f6559", "score": "0.71385974", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e8c676ea72f709b9f4708796778f6559", "score": "0.71385974", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "5d068192cde9a25c7f04c0fe9932ad3c", "score": "0.713271", "text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n respond_with(@booking)\n end", "title": "" }, { "docid": "14b49806556be21502688c30e0638572", "score": "0.71215683", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to options_path, notice: 'Booking was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "36e05f7cae4c7d492c587d2f4f6ead65", "score": "0.7104804", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to hairdresser_bookings_path(@hairdresser), notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "13afa09076d275360d547741db6b12e7", "score": "0.70873666", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end \n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b379b54d38c9d4445b6f52770d858611", "score": "0.7085463", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1754553339929866613b7ae69cce22ad", "score": "0.70769304", "text": "def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "c1186a97a809322b8eda7016317ad317", "score": "0.7074334", "text": "def destroy\n @guestbook = Guestbook.find(params[:id])\n @guestbook.destroy\n\n respond_to do |format|\n format.html { redirect_to guestbooks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09c4ec74a15f7c8b6da0d455f1cdbc09", "score": "0.706808", "text": "def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "759c4df672012a541f81e06049cc6d35", "score": "0.70601404", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to portal_bookings_url, notice: 'booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11c4fd2ce16a8c48181d00076751aafe", "score": "0.7051713", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to user_bookings_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cf3101b20b9ddd6a6b2db08529d62a1", "score": "0.70437735", "text": "def destroy\n @businessbook = Businessbook.find(params[:id])\n @businessbook.destroy\n\n respond_to do |format|\n format.html { redirect_to businessbooks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ec7bb8165ccc197abe930e52b7559a0c", "score": "0.70330614", "text": "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to home_path, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7841e24c19127d3dd0576e874a9ba3be", "score": "0.70199597", "text": "def destroy\n @fg_booking.destroy\n respond_to do |format|\n format.html { redirect_to fg_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a94d2ebb9a1586d21a8708d00a9b3d36", "score": "0.7010398", "text": "def destroy\n @title = \"Destroy Book\"\n\n # @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a620a59d1ac365af0b2a73da44c6287e", "score": "0.7006443", "text": "def delete\n api_delete(\"/listings/#{@listing_id}\")\n end", "title": "" }, { "docid": "1815d0941255cff8738d2fac778c90bf", "score": "0.7005126", "text": "def destroy\n booking = Booking.find(params[:id])\n\n # Check if user is the owner of the booking\n if current_user[:id] == booking[:user_id]\n if booking.destroy\n render json: { status: 'SUCCESS', message: 'Deleted booking', data: booking }, status: :ok\n else\n render json: { status: 'FAILURE', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end\n end", "title": "" }, { "docid": "15cd614930ce3295611c8cccccbfdd86", "score": "0.6986635", "text": "def destroy\n @tblbooking.destroy\n respond_to do |format|\n format.html { redirect_to tbl_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c5704479f5ce35a2f2eb7d8c8f119bea", "score": "0.69730276", "text": "def destroy\n @test_booking = TestBooking.find(params[:id])\n @test_booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_bookings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "325b31a8ef47f80b03d4a93e4e354617", "score": "0.69596344", "text": "def destroy\n @tablebooking.destroy\n respond_to do |format|\n format.html { redirect_to tablebookings_url, notice: 'Tablebooking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1132e66be2150f9e89070d3341440612", "score": "0.6955844", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.xml { head :ok }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "61d028f4425499fab01326b13ab31876", "score": "0.6954383", "text": "def destroy\n @book_progress.destroy\n respond_to do |format|\n format.html { redirect_to book_progresses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "900ee9f86f13550dcb46d5216b575087", "score": "0.69530857", "text": "def destroy\n @booking_status.destroy\n respond_to do |format|\n format.html { redirect_to booking_statuses_url, notice: 'Booking status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69058c8afc314038fb2797cbd113fbf0", "score": "0.6951499", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69058c8afc314038fb2797cbd113fbf0", "score": "0.6951499", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dccbd4f359dbd0e596d5d16dd9418001", "score": "0.69402784", "text": "def destroy\n @book_step = BookStep.find(params[:id])\n @book_step.destroy\n\n respond_to do |format|\n format.html { redirect_to book_steps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c3a770c55c040a7e1615c6e995a4f4c1", "score": "0.6934259", "text": "def destroy\n @bidding.destroy\n respond_to do |format|\n format.html { redirect_to biddings_url, notice: 'Bidding was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df5159b1034aed207d6c836a1aa07dfc", "score": "0.6922136", "text": "def destroy\n if @booking.destroy\n respond_to do |format|\n format.html { redirect_to grounds_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "f9ccc0bf19619d042b0587b2cf25e6b8", "score": "0.69216913", "text": "def destroy\n @bookkeeping.destroy\n\n head :no_content\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "04baa93cfe18ffef780b0ab8332f9a32", "score": "0.0", "text": "def set_csv_import\n @csv_import = CsvImport.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.5920606", "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.5912896", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5912896", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.5898134", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5887081", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.5876557", "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.5860066", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5807812", "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.57404715", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57310694", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5715928", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5701527", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.569245", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.5669733", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.56503016", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648064", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5636733", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5623887", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56089544", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.559635", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5595486", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.55868655", "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.55584484", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55584484", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5507632", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.55033326", "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": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5466339", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54640555", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54472816", "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.54455507", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54398936", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5415934", "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.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.54", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394463", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394463", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5391065", "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.5388469", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5376582", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5355932", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5348422", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53466004", "text": "def setup_phase; end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53451854", "text": "def register_action(action); end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5343858", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5339292", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.532725", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53038853", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.52850133", "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.52815986", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.5257178", "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": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.5257024", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5248709", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244428", "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": "7b3954deb2995cf68646c7333c15087b", "score": "0.5239302", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.5230717", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52270764", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5222752", "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.5222485", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52205867", "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.52127427", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.52127236", "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.520801", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.5204501", "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": "2aba2d3187e01346918a6557230603c7", "score": "0.5204178", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52039874", "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": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.52032334", "text": "def create_setup\n \n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5198697", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51944995", "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.51944995", "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.51913106", "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.5178707", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51781213", "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.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5163576", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5152934", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5142308", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51392764", "text": "def setup(params)\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51391184", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51387095", "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": "111fd47abd953b35a427ff0b098a800a", "score": "0.51351416", "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.5115222", "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.51131564", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.51114494", "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": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.51055247", "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.5102995", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.50979155", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50949734", "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.5091706", "text": "def add_callbacks(base); end", "title": "" } ]
48c12bd7cec602931905b2924b7fd4cf
DELETE /letters/1 DELETE /letters/1.json
[ { "docid": "6e2b501b2652947ac1f3cc43818f10bb", "score": "0.7528059", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "46e14a7ccd23f3409079e015a359397f", "score": "0.75452733", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d151efa13f594ba83afb9f6217663f8e", "score": "0.7504963", "text": "def destroy\n @letter = Letter.find(params[:id])\n @letter.destroy\n\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "82f414bbc9a50899b62de333c0561187", "score": "0.74328744", "text": "def destroy\n @subletter.destroy\n respond_to do |format|\n format.html { redirect_to subletters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "068b186395daa5032d584370f9870344", "score": "0.74227417", "text": "def destroy\n @letter = current_user.letters.find(params[:id])\n @letter.destroy\n\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c0f811171ee500a0bba4b07e6287169", "score": "0.72730947", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c0f811171ee500a0bba4b07e6287169", "score": "0.72730947", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c0f811171ee500a0bba4b07e6287169", "score": "0.72730947", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1cb9a400a049a13a1cc0da3d5c20c8bb", "score": "0.719483", "text": "def destroy\n @admin_letter.destroy\n respond_to do |format|\n format.html { redirect_to admin_letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "704198957a1d2e6e7f664b8e523db683", "score": "0.71357363", "text": "def destroy\n @first_letter = FirstLetter.find(params[:id])\n @first_letter.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/clients/#{@first_letter.client_id}/first_letters\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ec82ec167aeb9def9f79a034e648a6d5", "score": "0.70856166", "text": "def destroy\n \n @letterhead.destroy\n \n respond_to do |format|\n format.html { redirect_to cases_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70701444", "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": "c8038aa73e6a770368ddc72d550f133f", "score": "0.7045313", "text": "def test_delete\n delete :delete, params: { alpha2: 'za' }, **{ format: 'json' }\n\n assert_response 200\n assert_equal(countries.first.name, 'South Africa', 'Not working.')\n assert_equal(countries.first.active, false, 'Not working.')\n end", "title": "" }, { "docid": "d734d3f7fa5e2b6985a0297439e0a1d6", "score": "0.70097375", "text": "def destroy\n @esod_internal_letter.destroy\n respond_to do |format|\n format.html { redirect_to esod_internal_letters_url, notice: 'Internal letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.69547856", "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": "7ffa1ec8e2e3639257b10595aa7ad319", "score": "0.6949196", "text": "def destroy\n @letter_order = LetterOrder.find_by_uuid(params[:id])\n authorize! :destroy, @letter_order\n\n @letter_order.destroy\n\n respond_to do |format|\n format.html { redirect_to letter_orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.6922563", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "8af2f929695a25a79c775ec833dbf6e7", "score": "0.6875901", "text": "def create_letter_delete(lettersid)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/letter/delete.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'lettersid' => lettersid\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "2e75a5a35b98aaa0f9d2c64839587114", "score": "0.6845478", "text": "def delete\n render json: Text.delete(params[\"id\"])\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6830752", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.6830194", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "fdfa5f023a5b91de7150a7231284ceb6", "score": "0.6745508", "text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end", "title": "" }, { "docid": "88a6126ca6ca4ab7ba417a142b0a5fab", "score": "0.67137814", "text": "def destroy\n @invite_letter.destroy\n respond_to do |format|\n format.html { redirect_to invite_letters_url, notice: 'Invite letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "da9dea2b7f2f1515416748e3b33bc995", "score": "0.6659708", "text": "def destroy\n p \"Character destroy route accessed\"\n set_character\n render json: @character.destroy()\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.66573066", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "82879ea49ab4fdf087edbca44de8fea6", "score": "0.66173375", "text": "def destroy\n delword = Word.find_by_word(params[:id])\n delword.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8f314271b6ddc87eeeea2ba210ec49d1", "score": "0.66155905", "text": "def delete\n render json: Person.delete(params[\"id\"])\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.66091794", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.66077363", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "feb05fa712cede2232b7a79bf0cdeb56", "score": "0.66073513", "text": "def delete\n render json: Entry.delete(params[\"id\"])\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.65825063", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "171d5204ba2b07b5bfbbee3421df28d0", "score": "0.658138", "text": "def destroy\n @letter_grade.destroy\n respond_to do |format|\n format.html { redirect_to letter_grades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48e61125123243683b8f9c9cf56866f5", "score": "0.65791714", "text": "def destroy\n @admin_name_exercise.destroy\n respond_to do |format|\n format.html { redirect_to admin_name_exercises_url, notice: 'Name exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.6562014", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "51b8fa7103ecf9672d76a31c77e7adb4", "score": "0.654395", "text": "def destroy\n @edict.destroy\n respond_to do |format|\n format.html { redirect_to edicts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.65433455", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.65433455", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.65433455", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.6538226", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "99fc56aa8cee463fdf35d82288233bea", "score": "0.6532765", "text": "def destroy\n @alpha = Alpha.find(params[:id])\n @alpha.destroy\n\n respond_to do |format|\n format.html { redirect_to alphas_url }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "17de2676c104a91cf5a2382d9105ff5e", "score": "0.6520664", "text": "def destroy\n @alpha.destroy\n respond_to do |format|\n format.html { redirect_to alphas_url, notice: 'Alpha was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "05edc7078e37dcb6428455a858bd77de", "score": "0.65087956", "text": "def destroy\n @legs1.destroy\n respond_to do |format|\n format.html { redirect_to legs1s_url, notice: 'Legs1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.6498588", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.6493346", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.6489575", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "eb17bb60f85d952738360f55504fbf9e", "score": "0.64851373", "text": "def delete(path, opts = {})\n request(:delete, path, opts)\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.64801383", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "c5fd29d27354c11e4cf31bb6a256403b", "score": "0.64685476", "text": "def destroy\n @spring_letter.destroy\n respond_to do |format|\n format.html { redirect_to admin_spring_letters_url, notice: 'Spring letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2138bd525796933873e0b477e258379", "score": "0.6463845", "text": "def delete(name)\n response = Hashie::Mash.new(self.class.delete(\"/#{username}/#{name}.json\", :basic_auth => @auth))\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.6463736", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "35aa89b649455365a39a7cbd6f3a23c9", "score": "0.6463426", "text": "def destroy\n @clientes1.destroy\n respond_to do |format|\n format.html { redirect_to clientes1s_url, notice: 'Clientes1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6aaa89c687dadb86ba2f39cfcac421de", "score": "0.6462155", "text": "def destroy\n @enonce = Enonce.find(params[:id])\n @enonce.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7292895b8a48e07466b377315d5c5ea5", "score": "0.64583856", "text": "def delete(e)\n url = \"https://#{@username}:#{@password}@#{@host}#{@docroot}#{e}\"\n return RestClient.delete(url)\n end", "title": "" }, { "docid": "3f19c73fda8970036f75c30c857f0839", "score": "0.64509654", "text": "def destroy\n @jsonbeepdatum.destroy\n respond_to do |format|\n format.html { redirect_to jsonbeepdata_url, notice: 'Jsonbeepdatum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22b4c24965b9b6b9b962155dcd68ccab", "score": "0.64428794", "text": "def destroy\n @exercise = Exercise.find(params[:id])\n File.unlink(@exercise.path)\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9dac66c12c427ffcc7d31907a34adf4", "score": "0.6442533", "text": "def delete(opts = {})\n http_request(opts, :delete)\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.64393336", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "9497f8d4e7559d238ba41fcb78693ea6", "score": "0.64326346", "text": "def destroy\n @kebab.destroy\n respond_to do |format|\n format.html { redirect_to kebabs_url, notice: 'Kebab was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df57275425b1dd9036ae9145e8f19330", "score": "0.64242893", "text": "def destroy\n @exercise.destroy\n render json: @exercise\n end", "title": "" }, { "docid": "ea8d670ed7a7b073e956fee8671266ab", "score": "0.64241076", "text": "def destroy\n @greet = Greet.find(params[:id])\n @greet.destroy\n\n respond_to do |format|\n format.html { redirect_to greets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.64013463", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "dc8069c58110a97b29e9f10f89666c2e", "score": "0.6398824", "text": "def destroy\n @try1.destroy\n respond_to do |format|\n format.html { redirect_to try1s_url, notice: 'Try1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df80d0b9f4654217136d9dcc94607222", "score": "0.63897645", "text": "def destroy\n @client_name = ClientName.find(params[:id])\n @client_name.destroy\n\n respond_to do |format|\n format.html { redirect_to client_names_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "59c47e64fd78418cdb35270b22cf8416", "score": "0.63876474", "text": "def destroy\n Character.find(params[:id]).delete\n\n respond_to do |format|\n format.html { redirect_to character_list_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.6382863", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "266ff91b0c70838c2f07be7dce57dce5", "score": "0.6382636", "text": "def destroy\n @key = Keys.find(params[:id])\n @key.destroy\n\n respond_to do |format|\n format.html { redirect_to keys_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.6381514", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_name incorrecta'\n assert_equal '1094673845', data['document'], 'propiedad document incorrecta'\n end", "title": "" }, { "docid": "9c1aaa40ddc5ea48205b40e716fa4b2a", "score": "0.63755524", "text": "def delete(arg0, arg1, *rest)\n end", "title": "" }, { "docid": "6602dec34d43961163673137e27a2f92", "score": "0.63700664", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6602dec34d43961163673137e27a2f92", "score": "0.63700664", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6602dec34d43961163673137e27a2f92", "score": "0.63700664", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.636725", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "20c97a81d0efb0e6df28dd6a6855f2db", "score": "0.63650686", "text": "def delete(*a) route 'DELETE', *a end", "title": "" }, { "docid": "f10ec797a3271c529c643f1ddc60c092", "score": "0.63645405", "text": "def destroy\r\n @client1.destroy\r\n respond_to do |format|\r\n format.html { redirect_to client1s_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "eca623012ecc5a2b668b2f8957715020", "score": "0.63642114", "text": "def destroy\n @text_replica.destroy\n respond_to do |format|\n format.html { redirect_to replicas_url, notice: 'TextReplica was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5309e606deb5fdb2a690d8d3d7eda9b0", "score": "0.63633096", "text": "def destroy\n @agnieszka1 = Agnieszka1.find(params[:id])\n @agnieszka1.destroy\n\n respond_to do |format|\n format.html { redirect_to agnieszka1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b844c69e110f8d3e36fed312328a7127", "score": "0.63624233", "text": "def destroy\n @key_word.destroy\n respond_to do |format|\n format.html { redirect_to key_words_url, notice: 'Key word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b844c69e110f8d3e36fed312328a7127", "score": "0.63624233", "text": "def destroy\n @key_word.destroy\n respond_to do |format|\n format.html { redirect_to key_words_url, notice: 'Key word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.636233", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "e4d577130f2ab81066fe39b95180b96d", "score": "0.6360426", "text": "def delete(args)\n url = build_url(args[:endpoint], args[:subs], args[:parameters])\n HTTParty.delete(url, headers: args[:headers], query: args[:query])\n end", "title": "" }, { "docid": "c0731d76e83dd3ba80093bacd75ba24b", "score": "0.6358285", "text": "def destroy\n @exercise_text = ExerciseText.find(params[:id])\n @exercise_text.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_texts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.6355403", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.6355403", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "58304a4987caf6d8d918944890fdf6b4", "score": "0.63552225", "text": "def destroy\n @client_bed.destroy\n respond_to do |format|\n format.html { redirect_to client_beds_url, notice: 'Client bed was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.6353834", "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": "c0e04e7b24575da23f7965e8dad6e32c", "score": "0.6342268", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "308c171f9099f537d67a780aca8ffdec", "score": "0.63414806", "text": "def destroy\n @keg.destroy\n respond_to do |format|\n format.html { redirect_to kegs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "29c5346324687e5f4b8b7c741962badc", "score": "0.63398236", "text": "def a_delete(path)\n a_request(:delete, Twitter::REST::Client::ENDPOINT + path)\nend", "title": "" }, { "docid": "a8bcb16cba5aea1dba4b6062b1950cc2", "score": "0.6338742", "text": "def destroy\n @ng_word = NgWord.find(params[:id])\n @ng_word.destroy\n\n respond_to do |format|\n format.html { redirect_to @current_account }\n format.json { render json: @ng_word }\n end\n end", "title": "" }, { "docid": "7a0e69d4b1958684e5ebe80d49ead9e9", "score": "0.6337713", "text": "def destroy\n http_api.delete(\"clients/#{@name}\")\n end", "title": "" }, { "docid": "d5aa9fc7dc0504dab5685583fe8b88b8", "score": "0.63372594", "text": "def destroy\n @monkey.destroy\n respond_to do |format|\n format.html { redirect_to monkeys_url, notice: 'Monkey was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "54834df46afc825506d70afbc10bfc4b", "score": "0.6336399", "text": "def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "54834df46afc825506d70afbc10bfc4b", "score": "0.6336399", "text": "def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77c742322d16bbccac07ab52cc2f42db", "score": "0.6335131", "text": "def delete\n # TODO\n end", "title": "" }, { "docid": "fbf04affeb974724fc8155ed17ee9f28", "score": "0.6330735", "text": "def destroy\n @answer = Letter.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "769304fbb4730ef96173d3c20bedde80", "score": "0.63286495", "text": "def delete(name); end", "title": "" } ]
85d6b718bb33997ea84262e8a826084e
Return the date for the given month number
[ { "docid": "aeaea184df29d5eaa516405d06daa4d2", "score": "0.8226094", "text": "def date_for_month(month)\n months[month - 1]\n end", "title": "" } ]
[ { "docid": "0bd6bd7cade30acdd557221706efde32", "score": "0.797533", "text": "def jump_to_month(month_number)\n # find difference in months\n if month_number >= self.month\n ZDate.new(year_str + (month_number).to_s2 + \"01\")\n else\n ZDate.new((year + 1).to_s + (month_number).to_s2 + \"01\")\n end\n end", "title": "" }, { "docid": "82215ebba9204f08091f70858b01917b", "score": "0.7968085", "text": "def get_month(month_number)\n return Date::MONTHNAMES[month_number]\nend", "title": "" }, { "docid": "eb758a3cd7e3bd9d5a796fbb17ec5e83", "score": "0.7497121", "text": "def month() @date.strftime(\"%b\") end", "title": "" }, { "docid": "aa7cd9ee3c930320c5ea0664a0a34916", "score": "0.7373322", "text": "def month(input) = (day_of_year(input) - 1) / 30 + 1", "title": "" }, { "docid": "0eb34b84455592cf69565ec2dc6d6fb4", "score": "0.7300047", "text": "def month= num\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "b48208e608dcf2a277c02b51b45c7c27", "score": "0.7288511", "text": "def month(code)\n # We use the helper method from 'date' to give us the month name as a string\n return Date::MONTHNAMES[code.to_i]\nend", "title": "" }, { "docid": "6422dfde386756f3fdac54cdf29df524", "score": "0.725702", "text": "def get_next_month(number)\n month = number.to_i < @start.day ? (@start.month == 12 ? 1 : @start.month + 1) : @start.month\n end", "title": "" }, { "docid": "10dbda5b072e8d99af01d38ad991efeb", "score": "0.7242515", "text": "def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[4])\n end", "title": "" }, { "docid": "aeb3f5750eab271e4ca05e81846a7fd6", "score": "0.72321475", "text": "def what_month(number)\n number = number.to_s\n months = {\n \"1\" => \"January\", \n \"2\" => \"February\",\n \"3\" => \"March\", \n \"4\" => \"April\", \n \"5\" => \"May\", \n \"6\" => \"June\", \n \"7\" => \"July\", \n \"8\" => \"August\", \n \"9\" => \"September\", \n \"10\" => \"October\", \n \"11\" => \"November\", \n \"12\" => \"December\"\n }\n return months[number] \n end", "title": "" }, { "docid": "9c989dae25d553c436343d57ca0ebf69", "score": "0.71931773", "text": "def get_month(year, month)\n self.monthly # Ensure we've converted all months.\n @months.detect do |parsed_month|\n parsed_month.year == year && parsed_month.month == month\n end\n end", "title": "" }, { "docid": "0665bfff8c19344095cb786a4c02d0fa", "score": "0.71918505", "text": "def month_index(month)\n ParseDate.parsedate(month)[1]\n end", "title": "" }, { "docid": "7b62177d4ffa22c210e8b17892212b9d", "score": "0.71845925", "text": "def number_to_full_month_name(month_num)\n return Date::MONTHNAMES[month_num]\nend", "title": "" }, { "docid": "5d4868b78b68554e3b3ce4d4af046926", "score": "0.71727705", "text": "def get_month(month)\n if month == 1\n return \"Jan\"\n elsif month == 2\n return \"Feb\"\n elsif month == 3\n return \"Mar\"\n elsif month == 4\n return \"Apr\"\n elsif month == 5\n return \"May\"\n elsif month == 6\n return \"Jun\"\n elsif month == 7\n return \"Jul\"\n elsif month == 8\n return \"Aug\"\n elsif month == 9\n return \"Sep\"\n elsif month == 10\n return \"Oct\"\n elsif month == 11\n return \"Nov\"\n else\n return \"Dec\"\n end\n end", "title": "" }, { "docid": "594ea9e5c827cfa3baa10b35c91c030a", "score": "0.7161632", "text": "def start_of_month\n Date.parse(\"#{month} #{year}\")\n end", "title": "" }, { "docid": "751f1c9905834ffd7dbb8946c6799b3f", "score": "0.7135503", "text": "def choose_month_for(parcel_number)\n months = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n index = @beginning_month - 1 + parcel_number\n if index >= 12\n months[index - 12]\n else\n months[index]\n end\n end", "title": "" }, { "docid": "0545d18b211e7109ec59d938929e46c2", "score": "0.71153027", "text": "def month\n\t\t\t\t@month ||= month_and_day_of_month[0]\n\t\t\tend", "title": "" }, { "docid": "de06da116ff433cd550559368c75486b", "score": "0.7100237", "text": "def month_from_name(month)\n f = lambda {|months| months.compact.map {|x| x.downcase }.index(month) }\n\n month = f[Date::MONTHNAMES] || f[Date::ABBR_MONTHNAMES]\n month ? month + 1 : nil\n end", "title": "" }, { "docid": "de06da116ff433cd550559368c75486b", "score": "0.7100237", "text": "def month_from_name(month)\n f = lambda {|months| months.compact.map {|x| x.downcase }.index(month) }\n\n month = f[Date::MONTHNAMES] || f[Date::ABBR_MONTHNAMES]\n month ? month + 1 : nil\n end", "title": "" }, { "docid": "4d3dd90547d7eb507c41d956f1a498a8", "score": "0.7098676", "text": "def month_name; Date::MONTHNAMES[month]; end", "title": "" }, { "docid": "3a7ac9f1c799c2ca6ec56e160e104b47", "score": "0.7086813", "text": "def calendar_month\n\t\t#\tDate.parse() returns => Mon, 01 Jan -4712 which we don't want\n\t\tDate.parse(params[:month]||'').beginning_of_month\n\trescue\n\t\tDate.current.beginning_of_month\n\tend", "title": "" }, { "docid": "4cda1e7ed42c01505cee836cc602be3c", "score": "0.7080472", "text": "def month\n date.month\n end", "title": "" }, { "docid": "4cda1e7ed42c01505cee836cc602be3c", "score": "0.7080472", "text": "def month\n date.month\n end", "title": "" }, { "docid": "a6640524f58b1bfa491091ca2858e057", "score": "0.70678335", "text": "def get_month(date)\n month = ''\n # if its a year range dont proceed further\n return month if /[\\d]{4}[\\s\\-\\.\\/\\\\\\\\][\\d]{4}/.match(date.strip)\n # year is at start so month will be first pair of digits if present\n if /^[0-9]{4}[\\s\\-\\.\\/\\\\\\\\]([\\d]{1,2})/.match(date.strip)\n month = $1\n # year is at end so month will immediately precede the year\n elsif /([\\d]{1,2})[\\s\\-\\.\\/\\\\\\\\][0-9]{4}\\Z/.match(date.strip)\n month = $1\n end\n # month = '0' + normalised_month if month.length == 1\n month = '0' + month if month.length == 1\n month\n end", "title": "" }, { "docid": "4998bafb1845e3a8ac057d939c0f2bef", "score": "0.70631725", "text": "def month(*month)\n TExp::Month.new(normalize_months(month))\n end", "title": "" }, { "docid": "6b8ee498fde760154642b6a8718e6eeb", "score": "0.70619357", "text": "def month\n format('%02d', rand_in_range(1, 12))\n end", "title": "" }, { "docid": "609ad2e4fa60fbd066373d4996e77e32", "score": "0.7060443", "text": "def get_month_from(key)\n key = key.to_s.split(',')\n Date::MONTHNAMES[key[1].to_i]\n end", "title": "" }, { "docid": "021af49533814babcb71278fe5ce9490", "score": "0.7058408", "text": "def merch_month\n # TODO: This is very inefficient, but less complex than strategic guessing\n # maybe switch to a binary search or something\n merch_year = calendar.merch_year_from_date(date)\n @merch_month ||= (1..12).detect do |num|\n calendar.end_of_month(merch_year, num) >= date && date >= calendar.start_of_month(merch_year, num)\n end\n end", "title": "" }, { "docid": "b128af899ee62d9ff23e7bffedde5a32", "score": "0.7055667", "text": "def month\n date.month\n end", "title": "" }, { "docid": "5e88dc36e3e8d1039db552939d213730", "score": "0.70463127", "text": "def get_month date\n month_two_digits = date.split('-')[1]\n return month_two_digits[1].to_s if month_two_digits[0] == '0'\n month_two_digits\nend", "title": "" }, { "docid": "95f91a5211d30eccd3c697b49da2a9a0", "score": "0.7046152", "text": "def mayan_haab_month(date)\n date[0]\n end", "title": "" }, { "docid": "9878d1ccfedc51823c0184a842de2157", "score": "0.7021881", "text": "def month\n return if release.size < 5\n Date.strptime(release, '%Y-%m').month\n end", "title": "" }, { "docid": "23db0d53d3a18167aa691112eb762a77", "score": "0.7014759", "text": "def month(*month)\n TExp::Month.new(Util.normalize_months(month))\n end", "title": "" }, { "docid": "67c1d97d1e7a60f08d4f5ea4614b9505", "score": "0.7013773", "text": "def strMonthOf monthNumber\n monthArr = ['January', 'February', 'March', 'April',\n 'May', 'June', 'July', 'August',\n 'September', 'October', 'November', 'December']\n return monthArr[monthNumber - 1]\nend", "title": "" }, { "docid": "f0f9c35c796341c1a246871029418bb9", "score": "0.6993545", "text": "def month_name(num)\n l('date.month_names')[num]\n end", "title": "" }, { "docid": "d1baa1439b1b38a7e8ba0ec0c1d767b6", "score": "0.69815016", "text": "def month\n date.month\n end", "title": "" }, { "docid": "31862563cc54f3ed7ff889baf6b7a3ca", "score": "0.697817", "text": "def month(*args)\n raise ::ArgumentError, 'not an integer' unless args.all? { |arg| arg.is_a?(::Integer) }\n\n matching(*args, &:month)\n end", "title": "" }, { "docid": "364129ce1975860c8ebb04ead6e63196", "score": "0.6944794", "text": "def month\n date_time.month\n end", "title": "" }, { "docid": "ec7fd7e2fd12fd3585c7fdfebf502386", "score": "0.69305533", "text": "def month\n @mode = :months\n return @time.month\n end", "title": "" }, { "docid": "d8cea5d40963bb1cca81e846c4bc455d", "score": "0.69264615", "text": "def month()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6f512cf46c451f1d515695d4b9750c4b", "score": "0.69215", "text": "def month; end", "title": "" }, { "docid": "6f512cf46c451f1d515695d4b9750c4b", "score": "0.69215", "text": "def month; end", "title": "" }, { "docid": "6f512cf46c451f1d515695d4b9750c4b", "score": "0.69215", "text": "def month; end", "title": "" }, { "docid": "2a3ec70a39cab177d3f55a4c59b4641d", "score": "0.6915395", "text": "def month(month, as: :array)\n month_as_date(month, as: as)\n end", "title": "" }, { "docid": "a5bf53a95e2b6363647d49a167be7fc4", "score": "0.69149286", "text": "def month\n get(month_path)\n end", "title": "" }, { "docid": "8a3df745edbef7780009c38e745579ed", "score": "0.69146955", "text": "def number_to_full_month_name(month)\n\nif(month ==1)\n month = \"January\"\nelsif (month == 3)\n month =\"March\"\nelsif(month == 9)\n month = \"September\"\n end\nreturn month\nend", "title": "" }, { "docid": "a51a476ea8e1f71b062ce4c10bf6d41a", "score": "0.6886398", "text": "def to_month(date)\n d = to_date_obj(date)\n return d.strftime('%Y-%m')\n end", "title": "" }, { "docid": "928768734e13696ec8cb6a7c3fc7fc44", "score": "0.6881467", "text": "def get_month(start_date)\n if start_date.blank?\n Date.today.strftime(\"%B\")\n else\n start_date.strftime(\"%B\")\n end\n end", "title": "" }, { "docid": "c0e72f400f9a5227013b0b1509997c69", "score": "0.6860128", "text": "def convert_month(m)\n m = m.downcase.capitalize\n Date::MONTHNAMES.index(m) || Date::ABBR_MONTHNAMES.index(m)\nend", "title": "" }, { "docid": "d88944ecd5672857638ad78771f0f7b3", "score": "0.68596584", "text": "def name_of_month\n self.class.new(year, month, day).strftime('%B')\n end", "title": "" }, { "docid": "c02178ea45593b9114cd08f06d9328a8", "score": "0.68591094", "text": "def zmonth; '%02d' % month; end", "title": "" }, { "docid": "56bbec377edbf99873cbcdd2c9b6522d", "score": "0.68507385", "text": "def month\n @date.month\n end", "title": "" }, { "docid": "273097f011edf18d783c2625b5c2d2b9", "score": "0.684701", "text": "def get_start_month_date\n Date.civil(get_current_year, date.strftime(\"%m\").to_i, 1)\n end", "title": "" }, { "docid": "3ff2f6992d4d824567b9dc844976faaf", "score": "0.6834109", "text": "def formatted_month\n Date::MONTHNAMES[month] \n end", "title": "" }, { "docid": "8e4e8653b0aabbfe86eca273638a3690", "score": "0.6832972", "text": "def number_to_full_month_name(month_num)\nmonth = month_num\ncase month\n when 1\n return \"January\"\n when 3\n return \"March\"\n when 9\n return \"September\"\n end\nend", "title": "" }, { "docid": "3d5057df102bec83103c38e154f9b5a1", "score": "0.6832884", "text": "def number_to_full_month_name(month)\n\n case(month)\n when 1\n return \"January\"\n when 2\n return \"February\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 5\n return \"May\"\n when 6\n return \"June\"\n when 7\n return \"July\"\n when 8\n return \"August\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n when 11\n return \"November\"\n when 12\n return \"December\"\n end\nend", "title": "" }, { "docid": "2934f8131f83d389d38b6eed2acfcf02", "score": "0.6828445", "text": "def month(year_value, month_value)\n m = @month_factory.new(year(year_value), month_value)\n m.day_factory = @day_factory\n m\n end", "title": "" }, { "docid": "9f68d606ac67ee20e6199be1e2f3a054", "score": "0.68155015", "text": "def month\n @month ||= calendar.merch_to_julian(merch_month)\n end", "title": "" }, { "docid": "e1c1deeb5c2e4b78526dc0cff227342a", "score": "0.68141437", "text": "def day_of_year_for_first_day_of_month(month_number)\n result = 1\n result = days_in_month[0..month_number-1].inject(:+) if month_number > 1\n result\n end", "title": "" }, { "docid": "995bb1ecd69e063f0ecbe2e052c05e7e", "score": "0.6812484", "text": "def month_param(params=nil)\n params ||= @params\n if params[\"month\"]\n month = params[\"month\"].strip\n if %r{(?<month>^(0[1-9]|[1-9]|1[0-2])$)}x === month\n return month.to_i.to_s\n end\n end\n nil\n end", "title": "" }, { "docid": "b66b577ca57d51d9c47c3ece940f329a", "score": "0.67801917", "text": "def month_cardinal(month)\n validate_month(month)\n\n digit = @@months.index(month) + 1\n if (digit < 10)\n digit = \"0#{digit}\"\n end\n\n \"#{digit}\"\n end", "title": "" }, { "docid": "a3e6aca26dd1b007d45e202832850df4", "score": "0.6773509", "text": "def number_to_full_month_name(month_num)\n case month_num\n when 1\n return \"January\"\n when 2\n return \"February\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 5\n return \"May\"\n when 6\n return \"June\"\n when 7\n return \"July\"\n when 8\n return \"August\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n when 11\n return \"November\"\n when 12\n return \"December\"\n end\nend", "title": "" }, { "docid": "04d682c83e640696115bfd91dddba0aa", "score": "0.6766039", "text": "def with_month(month)\n ym = YearMonth.new(@year, month)\n if ym.last_day_of_month < @day\n LocalDate.of(@year, month, ym.last_day_of_month)\n else\n LocalDate.of(@year, month, @day)\n end\n end", "title": "" }, { "docid": "16846046a1b7ee38c42bd0c50f9153ec", "score": "0.67640644", "text": "def month(time)\n Time.parse(time.to_s).strftime('%Y-%m')\n end", "title": "" }, { "docid": "0e007bd3e0394dd70c9929eda8664302", "score": "0.67622423", "text": "def zeller_month_number(month_number)\n\tmonth_number = month_number.to_i\n\tconverter_hash = {01=>13, 02=>14, 03=>3, 04=>4, 05=>5, 06=>6, 07=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12}\n\tconverter_hash[month_number]\nend", "title": "" }, { "docid": "435d00311b15feb656fa2701ff2e3a89", "score": "0.6747524", "text": "def month; Integer.new(object.month); end", "title": "" }, { "docid": "c9c2d1ad1e25e2a85f7150bf1f1a2129", "score": "0.67433846", "text": "def date_next_month(month)\n t = Time.now\n m = month || t.month + 1\n Time.utc(t.year, m, 1)\n end", "title": "" }, { "docid": "05ad5e8f388fbc932f4baa9437570f8e", "score": "0.6733028", "text": "def number_to_full_month_name(month_number)\n case month_number\n when 1\n return \"January\"\n when 2\n return \"February\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 5\n return \"May\"\n when 6\n return \"June\"\n when 7\n return \"July\"\n when 8\n return \"August\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n when 11\n return \"November\"\n when 12\n return \"December\"\n else\n return \"This number is not valid\"\n end\nend", "title": "" }, { "docid": "d18ec2a6735ed54461d6542fb74a25a0", "score": "0.67317426", "text": "def number_to_full_month_name(number)\n return case number\n when 1\n \"January\"\n when 3\n \"March\"\n when 4\n \"April\"\n when 9\n \"September\"\n when 10\n \"October\"\n end\nend", "title": "" }, { "docid": "754c3285742587e7f0592f4192c49e3a", "score": "0.6729035", "text": "def month_code\n if Calendar.leap_year?(year)\n leap_year_month_codes[month]\n else\n month_codes[month]\n end\n end", "title": "" }, { "docid": "b70a95d3d27d1731b8fa9c84e39fb60d", "score": "0.6715381", "text": "def number_to_full_month_name(n)\n n = n - 1\n month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\nreturn month[n]\nend", "title": "" }, { "docid": "8fa63783cc60cd84545106a0f789b2da", "score": "0.67087877", "text": "def start_of_month( date )\n date - date.day + 1\n end", "title": "" }, { "docid": "a156c941203386366e0ea84bf3ea5a81", "score": "0.67054886", "text": "def name_of_month_to_digit(month)\n name_of_month = {\"\"=>0, \"jan\"=>1, \"feb\"=>2, \"mar\"=>3, \"apr\"=>4, \"may\"=>5, \"jun\"=>6, \"jul\"=>7, \"aug\"=>8, \"sep\"=>9, \"oct\"=>10, \"nov\"=>11, \"dec\"=>12}\n name_of_month[\"#{month}\"]\n end", "title": "" }, { "docid": "41507b433b31b216dfb741267579e1f0", "score": "0.6697203", "text": "def month_name(number)\n if @options[:use_month_numbers]\n number\n elsif @options[:add_month_numbers]\n \"#{number} - #{month_names[number]}\"\n else\n month_names[number]\n end\n end", "title": "" }, { "docid": "239e488acd3f86e6acb477e783cb7827", "score": "0.66927934", "text": "def month_word(m)\n case m\n when 1\n \"Jan\"\n when 2\n \"Feb\"\n when 3\n \"Mar\"\n when 4 \n \"Apr\"\n when 5 \n \"May\"\n when 6 \n \"Jun\"\n when 7 \n \"Jul\"\n when 8 \n \"Aug\"\n when 9 \n \"Sep\"\n when 10 \n \"Oct\"\n when 11\n \"Nov\"\n when 12\n \"Dec\"\n else\n \"\"\n end\n end", "title": "" }, { "docid": "497d14d5870ba2fafc4b2c2a3bc8751c", "score": "0.6692352", "text": "def number_to_short_month_name(month_number)\n return Date::ABBR_MONTHNAMES[month_number]\n # return number_to_short_month_name(month_number)[0..2]\nend", "title": "" }, { "docid": "c1f6a292cfcb8fb9e52a055680e09312", "score": "0.6689304", "text": "def month_url(year, month)\n url(:month, {:year => year, :month => Padding::pad_single_digit(month)})\n end", "title": "" }, { "docid": "ac7ee3f6c3709d2632da225ea7d98df1", "score": "0.6675984", "text": "def month\n end", "title": "" }, { "docid": "ac7ee3f6c3709d2632da225ea7d98df1", "score": "0.6675984", "text": "def month\n end", "title": "" }, { "docid": "04a5a4b7693ec0895c9a7b1362a8778b", "score": "0.66741705", "text": "def month_url(year, month)\n url(:month, {:year => year, :month => ::Feather::Padding::pad_single_digit(month)})\n end", "title": "" }, { "docid": "258bdf78dbc0586de105ed9363b61a35", "score": "0.66685593", "text": "def number_to_short_month_name(number)\n number_to_full_month_name(number)[0..2]\nend", "title": "" }, { "docid": "fb2c14bfdbb4b134aa46d8a9f0b1ac16", "score": "0.6655707", "text": "def to_month\n return self if self.nil?\n if (1..12).include?(self.to_i)\n I18n.t('date.month_names')[self.to_i]\n end\n end", "title": "" }, { "docid": "dc05bcf1a72f37049e09b585c9ba1529", "score": "0.6654901", "text": "def number_to_full_month_name(number)\n month_name = case number\n when 1\n \"January\"\n when 3\n \"March\"\n when 4\n \"April\"\n when 9\n \"September\"\n when 10\n \"October\"\n end\n return month_name\nend", "title": "" }, { "docid": "ae13a69f53fbb71ebdfab2ca830f6b11", "score": "0.66534764", "text": "def start_of_month(year, month_param)\n merch_month = get_merch_month_param(month_param)\n retail_calendar.start_of_month(year, merch_month)\n end", "title": "" }, { "docid": "5ec2a6ced11d450bfb07431f54b9ffc6", "score": "0.6653212", "text": "def month_name(month)\n Date::MONTHNAMES[month]\n end", "title": "" }, { "docid": "01a043950ba095de8bab9d76776235b7", "score": "0.66483265", "text": "def number_to_short_month_name(num)\n number_to_full_month_name(num).slice(0..2)\nend", "title": "" }, { "docid": "9cea232b143f119757cc813dd999a9f0", "score": "0.6632948", "text": "def month_link(month_date)\n link_to(I18n.localize(month_date, :format => \"%B\").upcase, {:month => month_date.month, :year => month_date.year})\n end", "title": "" }, { "docid": "9f18079ae836ef46da52e09b2f5597f5", "score": "0.66324055", "text": "def daysinmonth(year, month)\n return (Date.new(year, 12, 31) << (12-month)).day\n end", "title": "" }, { "docid": "9f18079ae836ef46da52e09b2f5597f5", "score": "0.66324055", "text": "def daysinmonth(year, month)\n return (Date.new(year, 12, 31) << (12-month)).day\n end", "title": "" }, { "docid": "3b4530cea4b9f4351bd411a51fe62da1", "score": "0.6630175", "text": "def number_to_full_month_name(month_number)\n month_name = {1 => \"January\",\n 3 => \"March\",\n 9 => \"September\"}\n return month_name[month_number]\nend", "title": "" }, { "docid": "31ce065eb187c779de195bd5a44d507f", "score": "0.66298544", "text": "def number_to_short_month_name(month_num)\n if (month_num == 1)\n return \"Jan\"\n elsif (month_num == 4)\n return \"Apr\"\n elsif (month_num == 10)\n return \"Oct\"\n\n end\nend", "title": "" }, { "docid": "856364b0fdae949cf414d30f84d4a1a9", "score": "0.65998846", "text": "def month\r\n if attributes[\"month\"].blank?\r\n m = self.published_at? ? self.published_at.month : \"\"\r\n else\r\n m = attributes[\"month\"]\r\n end\r\n m.blank? ? \"\" : m.to_s.rjust(2,\"0\")\r\n end", "title": "" }, { "docid": "aef22215f67e25ad10efab62ba038eb0", "score": "0.6597791", "text": "def capital_expenditure_month(month=nil,year=nil)\n capital_expenditure_sub_method('month')\n end", "title": "" }, { "docid": "2a5afc253b00be3952c47a67b4418024", "score": "0.6596549", "text": "def first_day_of_the_month\n day_of_month = 1\n month = @month\n # puts @month\n year = @year\n #convert month and year\n # month = ((month + 9) % 12)+3\n # puts month\n # month = 7\n # year = year - (month / 10)\n if month == 1 or month == 2\n month = month + 12\n year = year -1\n end\n #1st day of the month\n (((month + 1) * 26 / 10).floor + year + (year / 4).floor + 6 * (year / 100).floor + (year / 400).floor) % 7\n end", "title": "" }, { "docid": "b1f452d32723a35987198c481f1bb355", "score": "0.65898204", "text": "def to_start_of_month(date)\n s = date.split(\"-\");\n return Date.new(s[0].to_i,s[1].to_i,1).strftime(\"%Y-%m-%d\")\n end", "title": "" }, { "docid": "cf88a1aa197bb7bc9532e4a1abba8a3c", "score": "0.6585858", "text": "def getMonth()\n\tprint \"Enter a month (1 = Jan): \"\n\tretVal = gets().to_i()\n\t\n\tif (1..12).include?(retVal) then\n\t\treturn retVal;\n\telse\n\t\tputs \"Invalid. Month must be between 1 and 12. Got: #{retVal}\"\n\t\treturn getYear()\n\tend\nend", "title": "" }, { "docid": "2397717f6d144758edc0720620d6eddd", "score": "0.65816337", "text": "def month\n @date_time_value.month\n end", "title": "" }, { "docid": "2397717f6d144758edc0720620d6eddd", "score": "0.65816337", "text": "def month\n @date_time_value.month\n end", "title": "" }, { "docid": "5cd0bd1d9f0124f06a14127c011900d1", "score": "0.65802234", "text": "def parse_month(month)\n lower = month.downcase\n if lower =~ /^jan/\n @month = 1\n elsif lower =~ /^feb/\n @month = 2\n elsif lower =~ /^mar/\n @month = 3\n elsif lower =~ /^apr/\n @month = 4\n elsif lower =~ /^may/\n @month = 5\n elsif lower =~ /^jun/\n @month = 6\n elsif lower =~ /^jul/\n @month = 7\n elsif lower =~ /^aug/\n @month = 8\n elsif lower =~ /^sep/\n @month = 9\n elsif lower =~ /^oct/\n @month = 10\n elsif lower =~ /^nov/\n @month = 11\n elsif lower =~ /^dec/\n @month = 12\n else\n raise \"Invalid month: #{month}\"\n end\n end", "title": "" }, { "docid": "f778cf2ec60e80adb44763de17e6c879", "score": "0.6575917", "text": "def month=(value)\n @month = value\n end", "title": "" }, { "docid": "f778cf2ec60e80adb44763de17e6c879", "score": "0.6575917", "text": "def month=(value)\n @month = value\n end", "title": "" } ]
f6548d8af5e8e5e750b9c64b5e645acc
Sets the given version string as the compilable version for all known buildable modules in the given directory hierarchy. restores the default version string for all modules if nil. === Parameters
[ { "docid": "e69012db8ebcd5b6152d38685637843f", "score": "0.78949565", "text": "def set_version_for_modules(base_dir_path, version_string = nil)\n restore_original_version = version_string.nil?\n version_string = DEFAULT_WINDOWS_MODULE_VERSION if restore_original_version\n\n # match Windows-style version string to regular expression. Windows\n # versions require four fields (major.minor.build.revision) but we\n # accept three fields per RightScale convention and default the last\n # field to one.\n version_parse = (version_string + \".1\").match(/(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)/)\n raise \"Invalid version string\" unless version_parse\n\n # get individual values.\n major_version_number = version_parse[1].to_i\n minor_version_number = version_parse[2].to_i\n build_version_number = version_parse[3].to_i\n revision_version_number = version_parse[4].to_i\n\n version_string = \"#{major_version_number}.#{minor_version_number}.#{build_version_number}.#{revision_version_number}\"\n\n # generate copyright string for current year or default copyright\n # years to soothe source control.\n copyright_year = restore_original_version ? DEFAULT_COPYRIGHT_YEARS : \"2010-#{Time.now.year}\"\n copyright_string = \"Copyright (c) #{copyright_year} RightScale Inc\"\n\n # find and replace version string in any kind of source file used by\n # C# modules that might contain version or copyright info.\n ::Dir.chdir(base_dir_path) do\n # C# assembly info.\n ::Dir.glob(File.join('**', 'AssemblyInfo.c*')).each do |file_path|\n replacements = {\n /\\[assembly\\: *AssemblyVersion\\(\\\"\\d+\\.\\d+\\.\\d+\\.\\d+\\\"\\)\\]/ => \"[assembly: AssemblyVersion(\\\"#{version_string}\\\")]\",\n /\\[assembly\\: *AssemblyFileVersion\\(\\\"\\d+\\.\\d+\\.\\d+\\.\\d+\\\"\\)\\]/ => \"[assembly: AssemblyFileVersion(\\\"#{version_string}\\\")]\",\n /\\[assembly\\: *AssemblyCopyright\\(\\\".*\"\\)\\]/ => \"[assembly: AssemblyCopyright(\\\"#{copyright_string}\\\")]\",\n /\\[assembly\\: *AssemblyCopyrightAttribute\\(\\\".*\"\\)\\]/ => \"[assembly: AssemblyCopyrightAttribute(\\\"#{copyright_string}\\\")]\"\n }\n replace_in_file(file_path, replacements)\n end\n\n # C# manifests.\n ::Dir.glob(File.join('**', '*.manifest')).each do |file_path|\n replacements = {/\\<assemblyIdentity +version=\\\"\\d+\\.\\d+\\.\\d+\\.\\d+\\\"/ => \"<assemblyIdentity version=\\\"#{version_string}\\\"\"}\n replace_in_file(file_path, replacements)\n end\n\n # C++ resource files.\n ::Dir.glob(File.join('**', '*.rc')).each do |file_path|\n replacements = {\n /FILEVERSION +\\d+, *\\d+, *\\d+, *\\d+/ => \"FILEVERSION #{major_version_number}, #{minor_version_number}, #{build_version_number}, #{revision_version_number}\",\n /PRODUCTVERSION +\\d+, *\\d+, *\\d+, *\\d+/ => \"PRODUCTVERSION #{major_version_number}, #{minor_version_number}, #{build_version_number}, #{revision_version_number}\",\n /VALUE +\"FileVersion\", *\\\"\\d+, *\\d+, *\\d+, *\\d+\\\"/ => \"VALUE \\\"FileVersion\\\", \\\"#{version_string}\\\"\",\n /VALUE +\"FileVersion\", *\\\"\\d+\\.\\d+\\.\\d+\\.\\d+\\\"/ => \"VALUE \\\"FileVersion\\\", \\\"#{version_string}\\\"\",\n /VALUE +\"ProductVersion\", *\\\"\\d+, *\\d+, *\\d+, *\\d+\\\"/ => \"VALUE \\\"ProductVersion\\\", \\\"#{version_string}\\\"\",\n /VALUE +\"ProductVersion\", *\\\"\\d+\\.\\d+\\.\\d+\\.\\d+\\\"/ => \"VALUE \\\"ProductVersion\\\", \\\"#{version_string}\\\"\",\n /VALUE +\"LegalCopyright\", *\\\".*\\\"/ => \"VALUE \\\"LegalCopyright\\\", \\\"#{copyright_string}\\\"\"\n }\n replace_in_file(file_path, replacements)\n end\n\n # wix installer project main source.\n ::Dir.glob(File.join('**', 'Product.wxs')).each do |file_path|\n # the Windows Installer only cares about the first three elements of the version\n installerized_version = \"#{major_version_number}.#{minor_version_number}.#{build_version_number}\"\n replacements = {/\\<\\?define ProductVersion=\\\"\\d+\\.\\d+\\.\\d+\\\"/ => \"<?define ProductVersion=\\\"#{installerized_version}\\\"\"}\n replace_in_file(file_path, replacements)\n\n # when producing a new installer, a new product code is required\n new_guid = restore_original_version ? \"{00000000-0000-0000-0000-000000000000}\" : generate_guid\n replacements = {/\\<\\?define ProductCode=\\\"\\{.*\\}\\\"/ => \"<?define ProductCode=\\\"#{new_guid}\\\"\"}\n replace_in_file(file_path, replacements)\n end\n end\n true\n end", "title": "" } ]
[ { "docid": "64c690b1d43afc6bec0f0a63cf47ca91", "score": "0.58354485", "text": "def restore_default_version(base_dir_path)\n set_version_for_modules(base_dir_path, version_string = nil)\n true\n end", "title": "" }, { "docid": "0e264fe6602ef19e37ded0a7e4d0d4b2", "score": "0.57395256", "text": "def propagate_version(**args)\n\treturn unless ENV.key? 'CI'\n\n\tversion = get_package_key(key: :version)\n\n\tUI.message \"Propagating version: #{version}\"\n\tUI.message 'into the Info.plist and build.gradle files'\n\n\tbuild_numbers = generate_build_numbers\n\tUI.message \"Version codes are {CI: #{build_numbers[:ci]}, distribution: #{build_numbers[:build]}}\"\n\n\tversion = \"#{version.split('-')[0]}-pre\" if should_nightly?\n\tUI.message \"Actually putting #{version} into the binaries (because we're doing a nightly)\"\n\n\t# encode build number into js-land --- we've already fetched it, so we'll\n\t# never set the \"+\" into the binaries\n\tunless version.include? '+'\n\t\t# we always want the CI build number in js-land\n\t\tset_package_data(data: { version: \"#{version}+#{build_numbers[:ci]}\" })\n\tend\n\n\tcase lane_context[:PLATFORM_NAME]\n\twhen :android\n\t\tset_gradle_version_name(version_name: version, gradle_path: lane_context[:GRADLE_FILE])\n\t\tset_gradle_version_code(version_code: build_numbers[:build], gradle_path: lane_context[:GRADLE_FILE])\n\twhen :ios\n\t\t# we're splitting here because iTC can't handle versions with dashes in them\n\t\tincrement_version_number(version_number: version.split('-')[0], xcodeproj: ENV['GYM_PROJECT'])\n\t\tincrement_build_number(build_number: build_numbers[:build], xcodeproj: ENV['GYM_PROJECT'])\n\tend\nend", "title": "" }, { "docid": "51f1f7fa38b814f11ec52cecc4dba01d", "score": "0.57085645", "text": "def configure_version\n if base_dir\n versions = (base_dir + 'releases' + 'start_erl.data').read\n versions.split(\" \")[1]\n end\n end", "title": "" }, { "docid": "1384c138a029a01bfd397e9386a5e902", "score": "0.5622342", "text": "def version(str=nil) (str ? (@version = str) : @version); end", "title": "" }, { "docid": "10b3fa8c4a6e21e3a55c5884454b9c04", "score": "0.54606336", "text": "def set_current version\n raise VersionNotFound.new unless File.exist?( directory + version )\n raise InvalidVersion.new unless version =~ /^v\\d+$/\n # need to do this, or ln_s will put the symlink *into* the old dir\n File.unlink directory + CURRENT if File.exist? directory + CURRENT\n FileUtils.ln_s version, directory + CURRENT, force: true\n end", "title": "" }, { "docid": "ce3da8fa08511a1f0c918a2e4b7a2b46", "score": "0.5452513", "text": "def set_version; end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.543498", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.543498", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.543498", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.543498", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "b9bdf940bbb274c87eb7095512acb3bd", "score": "0.5411497", "text": "def version!(str)\n component!(Ki::Component.component_from_version(str)).version!(str)\n end", "title": "" }, { "docid": "822a6ee1d326d6fb32be0403623e2dd9", "score": "0.54047275", "text": "def module_release_version(module_path, tag_version, pr_version, build_number, is_node_module)\n\n if is_node_module\n package_json = JSON.parse(File.read(\"#{module_path}/package.json\"))\n old_version = SemVersion.new(package_json['version'])\n else\n module_artifact = maven_module_info(module_path)\n old_version = SemVersion.new(module_artifact.version.to_s)\n end\n\n if !tag_version.to_s.strip.empty?\n\n # Remove leading v\n if tag_version.start_with?('v')\n tag_version = tag_version[1..-1]\n end\n\n if module_path == '' || module_path == '.' || module_path == 'bom' || module_path == 'parent' || module_path == 'grandparent'\n return tag_version\n else\n # foo/bar/baz/qux --> foo\n root_module_path = module_path.split(/\\//, 2).first\n\n commit_count = `git rev-list --count HEAD -- #{root_module_path}`.to_s.strip\n commit_hash = `git rev-list HEAD -- #{root_module_path} | head -1`.to_s.strip[0, 6]\n\n return \"#{old_version.major_number}.#{old_version.minor_number}.#{commit_count}-x#{commit_hash}\"\n end\n\n elsif !pr_version.to_s.strip.empty?\n if is_node_module\n return \"#{old_version.major_number}.#{old_version.minor_number}.0-PR#{pr_version}.#{build_number}\"\n else\n return \"40.#{pr_version}-SNAPSHOT\"\n end\n\n else\n if is_node_module\n return \"#{old_version.major_number}.#{old_version.minor_number}.0-SNAPSHOT.#{build_number}\"\n else\n return nil\n end\n end\nend", "title": "" }, { "docid": "0960ede54a0dd27c1c40cd1239327025", "score": "0.5345589", "text": "def version=(new_version)\n return @version = nil if new_version.nil?\n if new_version.is_a?(Version)\n temp_version = new_version\n elsif new_version.is_a?(String)\n v = new_version\n temp_version = Version.from_s(v)\n else\n raise NotDrupalVersionError\n end\n raise NotDrupalVersionError, \"Incompatible version for project #{self.extended_name}: #{temp_version.long}\" if temp_version.core != self.core\n @version = temp_version\n end", "title": "" }, { "docid": "74313da95771dcce154f83ad6102488c", "score": "0.5344208", "text": "def set_version(version)\n\t\t\tversion=version.tr('+_','.')\n\t\t\t@version=Gem::Version.new(version) rescue Gem::Version.new(\"0.#{version}\")\n\t\tend", "title": "" }, { "docid": "b8244cfc0e98afb8481d6772417aaf03", "score": "0.533359", "text": "def full_version=(value)\n @full_version = value\n end", "title": "" }, { "docid": "2567744453d920a7ca8411ec62e497fc", "score": "0.5297297", "text": "def propagate_version(**args)\n version = get_package_key(key: :version)\n build = current_build_number(track: args[:track] || nil)\n\n UI.message \"Propagating version: #{version}\"\n UI.message 'into the Info.plist and build.gradle files'\n\n # encode build number into js-land\n set_package_data(data: { version: \"#{version}+#{build}\" })\n\n case lane_context[:PLATFORM_NAME]\n when :android\n set_gradle_version_name(version_name: version, gradle_path: lane_context[:GRADLE_FILE])\n set_gradle_version_code(version_code: build, gradle_path: lane_context[:GRADLE_FILE])\n when :ios\n # we're splitting here because iTC can't handle versions with dashes in them\n increment_version_number(version_number: version.split('-')[0], xcodeproj: ENV['GYM_PROJECT'])\n increment_build_number(build_number: build, xcodeproj: ENV['GYM_PROJECT'])\n end\nend", "title": "" }, { "docid": "e6163247733fe1fca3564abef1a06542", "score": "0.5291678", "text": "def build_version_list()\n @version_names = []\n Dir.foreach(\"#{@home}/versions\") do |filename|\n @version_names.push(filename) unless (filename[0,1] == \"_\") || (filename[0,1] == \".\")\n end\n @version_names.sort!\n raise \"Found no version directories.\" unless @version_names.length > 0\nend", "title": "" }, { "docid": "3fd2cb0a8c4d697751d32f56e74beddc", "score": "0.5280534", "text": "def version(s = nil)\n s ? @version = s : @version\n end", "title": "" }, { "docid": "1d806805b6f7755836eeb3c4c107bdec", "score": "0.5267831", "text": "def version_set(value)\n version.set \"#{value}\"\n end", "title": "" }, { "docid": "abeee6080ff480d0433276fb287b8e6d", "score": "0.52662474", "text": "def use_version(v)\n before(:each) do\n self.class.opt(:versions, v)\n end\n end", "title": "" }, { "docid": "b7d0d1f2b98ab38be333ebecef06579a", "score": "0.525846", "text": "def normalize_version(str)\n default = \"0.0.1\"\n\n if str.nil? or str.empty?\n default\n elsif str.match /^(\\d)+[.](\\d)+[.](\\d)+$/\n str\n elsif str.match /^((\\d)+[.])*(\\d)+$/\n extend_version(str)\n elsif str.match /^([\\d\\w]+)[.]([\\d\\w]+)[.]([\\d\\w]+)$/\n deletter_version(str)\n else\n default\n end\n end", "title": "" }, { "docid": "50ebe2744d83e56fb75c232cdf195df2", "score": "0.5251163", "text": "def initialize version_string\n @version_string = version_string\n version_string =~ /([\\.\\d]+)(RC\\d)*/\n @version = $1.to_s\n @rc = $2.to_s\n mj,mn,patch = @version.split('.')\n @version = \"#{mj.to_i}.#{mn.to_i}.#{patch.to_i}\"\n end", "title": "" }, { "docid": "79205e473203554cd5dc77ebd75286e3", "score": "0.5234989", "text": "def version=(arg)\n @version = arg.to_s\n end", "title": "" }, { "docid": "9fa31550bb3dfdd183a9d85a300783ae", "score": "0.521715", "text": "def version s=nil; @version = s if s; @version end", "title": "" }, { "docid": "944f1fb3d4a854d6882c838ae775d509", "score": "0.51994973", "text": "def method_version=(value)\n @children['method-version'][:value] = value\n end", "title": "" }, { "docid": "944f1fb3d4a854d6882c838ae775d509", "score": "0.51994973", "text": "def method_version=(value)\n @children['method-version'][:value] = value\n end", "title": "" }, { "docid": "a4d44d894f49f5233ab97f5959a830aa", "score": "0.5181799", "text": "def versions=(value)\n @children['versions'][:value] = value\n end", "title": "" }, { "docid": "2f95d253162f250b709ff7b8b72f7fe1", "score": "0.517883", "text": "def version=(version); end", "title": "" }, { "docid": "2f95d253162f250b709ff7b8b72f7fe1", "score": "0.517883", "text": "def version=(version); end", "title": "" }, { "docid": "c4c981c72e2560a7ed3d48d4b51f9e39", "score": "0.5176176", "text": "def set_version\n config[SET_VERSION]\n end", "title": "" }, { "docid": "efc017f1e11e0a5d82c50f0e859ee40d", "score": "0.51704496", "text": "def set_version(text)\n self.version = text\n self\n end", "title": "" }, { "docid": "ab3388326e74062327b214ac848933f8", "score": "0.51628006", "text": "def bump\n ints = build_array_from_version_string\n ints.pop if ints.size > 1\n ints[-1] += 1\n self.class.new(ints.join(\".\"))\n end", "title": "" }, { "docid": "d7e35a5e9ff96f8c83a16e991c760b76", "score": "0.5151218", "text": "def set_component_versions(env_id, plugin, component_versions)\n default_attributes = Hash.new\n\n component_versions.each do |component_name, version|\n version_hash = Hash.from_dotted_path(version_attribute(plugin, component_name), version)\n default_attributes.deep_merge!(version_hash)\n end\n\n log.info \"Setting component versions #{component_versions}\"\n\n unless env = chef_connection.environment.find(env_id)\n raise EnvironmentNotFound.new(env_id)\n end\n\n env.default_attributes.merge!(default_attributes)\n env.save\n end", "title": "" }, { "docid": "c3c8d5abdf8686dbaf9b5d0a9248453e", "score": "0.5150399", "text": "def modified_version\n # If installing through `brew install sapling --HEAD`, version will be HEAD-<hash>, which\n # still doesn't make `setuptools` happy. However, since installing through this method\n # will get a git repo, we can use the ci/tag-name.sh script for determining the version no.\n build_version = if version.to_s.start_with?(\"HEAD\")\n Utils.safe_popen_read(\"ci/tag-name.sh\").chomp + \".dev\"\n else\n version\n end\n segments = build_version.to_s.split(/[-+]/)\n \"#{segments.take(2).join(\"-\")}+#{segments.last}\"\n end", "title": "" }, { "docid": "e45ef3e418880939782b1763843b5d0a", "score": "0.5150265", "text": "def janky_workaround_for_processing_all_our_different_version_strings(version_string)\n v = nil\n [\n Opscode::Version::Rubygems,\n Opscode::Version::GitDescribe,\n Opscode::Version::OpscodeSemVer,\n Opscode::Version::SemVer,\n Opscode::Version::Incomplete\n ].each do |version|\n begin\n break v = version.new(version_string)\n rescue\n nil\n end\n end\n\n if v.nil?\n raise InvalidDownloadPath, \"Unsupported version format '#{version_string}'\"\n else\n return v\n end\n end", "title": "" }, { "docid": "54016dda8ddb57f7db9519ba080e410c", "score": "0.5149549", "text": "def versioned_maven_module(module_path, file_paths)\n file_paths_str = file_paths.respond_to?('each') ? file_paths.join(' ') : file_paths\n version = `git describe --tags --match \"v[0-9]*\" --abbrev=6 HEAD 2>/dev/null`.to_s.strip\n if version.empty?\n commit_count = `git rev-list --count HEAD -- #{file_paths_str}`.to_s.strip\n commit_hash = `git rev-list HEAD -- #{file_paths_str} | head -1`.to_s.strip[0, 6]\n version = \"v0-#{commit_count}-g#{commit_hash}\"\n end\n\n version.gsub!('v', '')\n\n artifact = maven_module_info(module_path)\n\n artifact.version = version\n\n artifact\nend", "title": "" }, { "docid": "6ffddc7179669f09fe3ea02d660f37b3", "score": "0.5125088", "text": "def version_string(include_buildnum = T.unsafe(nil)); end", "title": "" }, { "docid": "6ffddc7179669f09fe3ea02d660f37b3", "score": "0.5125088", "text": "def version_string(include_buildnum = T.unsafe(nil)); end", "title": "" }, { "docid": "8bf75ec730ccf4bcda1c87e0c6f1796f", "score": "0.511019", "text": "def load_versioning\n if @project_root and Pkg::Util::Version.git_tagged?\n @ref = Pkg::Util::Version.git_sha_or_tag\n @short_ref = Pkg::Util::Version.git_sha_or_tag(7)\n @version = Pkg::Util::Version.get_dash_version\n @gemversion = Pkg::Util::Version.get_dot_version\n @ipsversion = Pkg::Util::Version.get_ips_version\n @debversion = Pkg::Util::Version.get_debversion\n @origversion = Pkg::Util::Version.get_origversion\n @rpmversion = Pkg::Util::Version.get_rpmversion\n @rpmrelease = Pkg::Util::Version.get_rpmrelease\n else\n puts \"Skipping determination of version via git describe, Pkg::Config.project_root is not set to the path of a tagged git repo.\"\n end\n end", "title": "" }, { "docid": "f0a30257da7a5f3a763661cd5c97442c", "score": "0.509536", "text": "def set_commit_version_of_steps\n steps.select{|s| !s.component_version.blank?}.group_by(&:component_id).each_pair{ |component_id, steps|\n steps.last.update_attribute(:own_version, true) if steps.last\n }\n end", "title": "" }, { "docid": "472eb82d5a2018f349e6c9b8f22f1d4a", "score": "0.5094602", "text": "def initialize(version_string, starting_major = 1)\n @major = starting_major\n @minor = 0\n @build = 0\n @revision = 0\n version_string.gsub!(/\\s\\n\\r/, '')\n return unless version_string =~ /[\\d]+([.\\d]*)/\n version_string = version_string.split('.')\n @major = version_string[0].to_i\n return if version_string[1].nil?\n @minor = version_string[1].to_i\n return if version_string[2].nil?\n @build = version_string[2].to_i\n return if version_string[3].nil?\n @revision = version_string[3].to_i\n end", "title": "" }, { "docid": "f44bbeec42970920467f879f45cb332f", "score": "0.5091537", "text": "def agent_version str\n @version = str\n end", "title": "" }, { "docid": "f44bbeec42970920467f879f45cb332f", "score": "0.5091537", "text": "def agent_version str\n @version = str\n end", "title": "" }, { "docid": "2d391096600eac4bebde79e6a4d9d394", "score": "0.5089717", "text": "def set_version\n ret = opts['proto'] + \"/\" + opts['version']\n\n if (opts['version_random_valid'])\n ret = opts['proto'] + \"/\" + ['1.0', '1.1'][rand(2)]\n end\n\n if (opts['version_random_invalid'])\n ret = Rex::Text.rand_text_alphanumeric(rand(20)+1)\n end\n\n ret << \"\\r\\n\"\n end", "title": "" }, { "docid": "fa0062b08ea61a458fbf38557de62e0e", "score": "0.5061784", "text": "def initialize(version_string)\n begin\n @major, @minor, @patch = version_string.split('.').map(&:to_i)\n @patch ||= 0\n rescue NoMethodError\n @major, @minor, @patch = [0,0,0]\n end\n end", "title": "" }, { "docid": "4471d10948ee4fedcaff4a80483b0af9", "score": "0.50611264", "text": "def load_versions\n @versions = []\n mods = Pathname.new(@location).children.select(&:directory?)\n \n mods.each do |m|\n if File.exists?(\"#{m}/.pemversion\")\n deets = YAML.safe_load(File.open(\"#{m}/.pemversion\"),[Symbol])\n @versions << Pem::Module::Version.new(deets['version'],deets['location'],deets['type'],deets['source'],@name)\n else\n Pem::Logger.logit(\"YAML not found for #{m}\")\n end\n end\n\n if @versions.length > 0\n @pem.modules[name] = self\n end\n \n rescue StandardError => err\n Pem::Logger.logit(err, :fatal)\n raise(err)\n end", "title": "" }, { "docid": "2be23ec6c7b5ebab300d0d58e0fe2596", "score": "0.5036971", "text": "def AppVersion=(v)", "title": "" }, { "docid": "5a7c1216ed2296190f284ad87d4b3647", "score": "0.50236535", "text": "def update_version\n self.fetch_release_history if @release_xml.nil?\n return self.version unless @release_xml\n version_list = []\n version_nodes = @release_xml.xpath(\"/project/releases/release[status='published']/version\")\n version_nodes.each do |n|\n v = n.child.to_s\n # Remove version specifications that do not start with self.core.\n # This seemingly superfluous test is needed because, for example,\n # imce-7.x has a 'master' version (oh my!).\n next if v !~ /^#{self.core.to_i}\\./\n v.sub!(\"#{self.core}-\", '') unless self.drupal?\n version_list.push(Version.new(self.core, v))\n end\n self.version = self.best_release(version_list)\n debug \"Version updated: #{extended_name}\"\n end", "title": "" }, { "docid": "85d71e82e72c5c2e5e3f5e073c8bac20", "score": "0.50232565", "text": "def use version: :latest, **_options\n unless version =~ version_regex\n raise ArgumentError, \"Invalid format '#{version}' - please try a version in format `x.x.x(f|p)x`\"\n end\n\n if current.eql? version\n raise ArgumentError, \"Invalid version '#{version}' - version is already active\"\n end\n\n unless list.include? version\n raise \"Invalid version '#{version}' - version is not available\"\n end\n\n desired_version = File.join(UNITY_INSTALL_LOCATION,\"Unity-\"+version)\n FileUtils.rm_f(UNITY_LINK) if File.exist? UNITY_LINK\n FileUtils.ln_s(desired_version, UNITY_LINK, :force => true)\n desired_version\n end", "title": "" }, { "docid": "7baec2fee40bf88b04c935f6c5e8a34c", "score": "0.5016618", "text": "def load_versions\n begin\n @versions = []\n mods = Pathname.new(@location).children.select(&:directory?)\n \n mods.each do |m|\n if File.exists?(\"#{m}/.pemversion\")\n deets = YAML.safe_load(File.open(\"#{m}/.pemversion\"),[Symbol])\n @versions << Pem::Datamodule::Version.new(\n deets['version'],\n deets['location'],\n deets['type'],\n deets['source'],\n @name,\n deets['prefix'],\n deets['branch'],\n )\n else\n Pem::Logger.logit(\"YAML not found for #{m}\")\n end\n end\n\n if @versions.length > 0\n @pem.datamodules[@name] = self\n end\n rescue StandardError => err\n Pem::Logger.logit(err, :fatal)\n raise(err)\n end\n end", "title": "" }, { "docid": "6d02d3a6a9a14fc79efec4602314ad76", "score": "0.50007546", "text": "def set_Version(value)\n set_input(\"Version\", value)\n end", "title": "" }, { "docid": "ce9fa7071d79f6e14621da90af9d1bbd", "score": "0.49999356", "text": "def versionize(path)\n path % {:version => version}\n end", "title": "" }, { "docid": "27cb349beced8fafe95f48e55b4f4901", "score": "0.49805677", "text": "def update_version_method(version, semver_type)\n contents = File.read(\"build.gradle\")\n contents = contents.gsub(/version '\\d+.\\d+.\\d+'/, \"version '#{version}'\")\n File.open(\"build.gradle\", \"w\") do |file|\n file.puts contents\n end\nend", "title": "" }, { "docid": "16c46c76e63283b72822185e6f026539", "score": "0.49787113", "text": "def set_version(fdir)\n file_version = \"#{fdir}/version\"\n unless File.exist? file_version\n file_safe_write file_version, self.class.grammar_hash(fdir)\n end\n end", "title": "" }, { "docid": "93cc03c7a5447a5762e37b76e0115753", "score": "0.49750054", "text": "def version=(version)\n @version = version if Versions.include? version\n end", "title": "" }, { "docid": "1332d624da539b96297fc0449affd3dc", "score": "0.4969105", "text": "def version_string\n @version_string || compute_version_string\n end", "title": "" }, { "docid": "17f93a9ac312f8cd79c500717cefd1fc", "score": "0.49677876", "text": "def set_version\n self.version = 0\n end", "title": "" }, { "docid": "2c69f81694d221aae0fd3478b3f58d6b", "score": "0.4966197", "text": "def base_pkg_version(version = Pkg::Config.version)\n return \"#{dot_version(version)}-#{Pkg::Config.release}\".split('-') if final?(version) || Pkg::Config.vanagon_project\n\n if version.include?('SNAPSHOT')\n new_version = dot_version(version).sub(/\\.SNAPSHOT/, \"-0.#{Pkg::Config.release}SNAPSHOT\")\n elsif version.include?('rc')\n rc_ver = dot_version(version).match(/\\.?rc(\\d+)/)[1]\n new_version = dot_version(version).sub(/\\.?rc(\\d+)/, '') + \"-0.#{Pkg::Config.release}rc#{rc_ver}\"\n else\n new_version = dot_version(version) + \"-0.#{Pkg::Config.release}\"\n end\n\n if new_version.include?('dirty')\n new_version = \"#{new_version.sub(/\\.?dirty/, '')}dirty\"\n end\n\n new_version.split('-')\n end", "title": "" }, { "docid": "b21cd74e9b3891e2de67d46bc13a2a81", "score": "0.49552882", "text": "def version(arg = nil)\n set_or_return(:version,\n arg,\n kind_of: String,\n default: 'latest',\n callbacks: {\n 'Can\\'t set both a `version` and a `package_url`' =>\n ->(_) { package_url.nil? },\n 'Invalid version string' => ->(a) { valid_version?(a) }\n })\n end", "title": "" }, { "docid": "9fe04ccf536de16699dafbf5ee5b12b8", "score": "0.49547228", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "9fe04ccf536de16699dafbf5ee5b12b8", "score": "0.49546212", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "d6a544aa332c085b304c9eab41f53fb1", "score": "0.49544385", "text": "def current_version_only=(value)\n @children['current-version-only'][:value] = value\n end", "title": "" }, { "docid": "9fe04ccf536de16699dafbf5ee5b12b8", "score": "0.49541777", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "718e9120b3be7c6bacb0db745ef9d873", "score": "0.4954007", "text": "def version(arg = nil)\n set_or_return(:version,\n arg,\n kind_of: String,\n default: 'latest',\n callbacks: {\n 'Can\\'t set both a `version` and a `package_url`' =>\n ->(_) { package_url.nil? },\n 'Invalid version string' =>\n ->(a) { ::ChefDk::Helpers.valid_version?(a) }\n })\n end", "title": "" }, { "docid": "abacda742deeb8c7d009cae9b146d8be", "score": "0.49524662", "text": "def set_Version(value)\n set_input(\"Version\", value)\n end", "title": "" }, { "docid": "abacda742deeb8c7d009cae9b146d8be", "score": "0.49524662", "text": "def set_Version(value)\n set_input(\"Version\", value)\n end", "title": "" }, { "docid": "abacda742deeb8c7d009cae9b146d8be", "score": "0.49524662", "text": "def set_Version(value)\n set_input(\"Version\", value)\n end", "title": "" }, { "docid": "d8306389e4b4fdb4f323a5836f51e17b", "score": "0.4952146", "text": "def ver=(value)\n @children['ver'][:value] = value\n end", "title": "" }, { "docid": "197fc357c985d001f5c10ea2a86168e0", "score": "0.49436897", "text": "def set_version(active_version)\r\n fail \"Version must be a positive integer\" unless version.to_s.is_positive_integer?\r\n fail \"Can't set negative version\" if active_version < 0\r\n fail \"This version of a description does not exist\" unless descriptions.size >= active_version\r\n\r\n @version = active_version-1\r\n end", "title": "" }, { "docid": "93a441c577369b3c58d8ade04a3c173a", "score": "0.4940968", "text": "def _version_module(version)\n self.class.version_module(version)\n end", "title": "" }, { "docid": "ca41b1b35baa168212bd65ddb1cf9ba4", "score": "0.4932651", "text": "def full_version_string; end", "title": "" }, { "docid": "9e69f5437e0c50abbc28195523d12ac3", "score": "0.49223256", "text": "def version(major, minor = 0, revision = 0)\n @version = [major, minor, revision]\n end", "title": "" }, { "docid": "01bbfbdd8ec0f7f32e5c5050993b5bd3", "score": "0.49196067", "text": "def version(val=NULL_ARG)\n @given_version = val unless val.equal?(NULL_ARG)\n @override_version || @given_version\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.48836547", "text": "def version=(value)\n @version = value\n end", "title": "" }, { "docid": "5d8636c3f9ac6bbf8e972cbfa869e141", "score": "0.48832592", "text": "def set_version(fdir)\n file_version = \"#{fdir}/version\"\n unless File.exist? file_version\n File.write file_version, grammar_hash(fdir), encoding: \"utf-8\"\n end\n self\n end", "title": "" }, { "docid": "0ce5cf466984b14e7b536256963d7ae8", "score": "0.48774076", "text": "def version(ver)\n @component.version = ver\n end", "title": "" }, { "docid": "e7e45cf46e1e377173de330380209402", "score": "0.4868561", "text": "def setVersion(major = 0, minor = 0, revision = 0)\n @currentVersion = MutableVersion.new(major, minor, revision)\n end", "title": "" }, { "docid": "d0d9c68f81ef25dc5c95995bf93d0bca", "score": "0.4865681", "text": "def set_msi_version_from_project\n # build_version looks something like this:\n # dev builds => 11.14.0-alpha.1+20140501194641.git.94.561b564\n # => 0.0.0+20140506165802.1\n # rel builds => 11.14.0.alpha.1 || 11.14.0\n #\n # MSI version spec expects a version that looks like X.Y.Z.W where\n # X, Y, Z & W are 32 bit integers.\n #\n # MSI source files expect two versions to be set in the msi_parameters:\n # msi_version & msi_display_version\n\n versions = project.build_version.split(/[.+-]/)\n @msi_version = \"#{versions[0]}.#{versions[1]}.#{versions[2]}.#{project.build_iteration}\"\n @msi_display_version = \"#{versions[0]}.#{versions[1]}.#{versions[2]}\"\n end", "title": "" }, { "docid": "725e8b3f8f5e0da6200f27d086c0dbd1", "score": "0.48649046", "text": "def version=(value)\n @version = Wow::Package::Version.from_json(value)\n end", "title": "" }, { "docid": "8dc57217fc25f779d3727ac745389f17", "score": "0.48582786", "text": "def replace_api_version(target_path, api_version)\n Pathname.glob(target_path + '*').each do |path|\n if File.directory?(path)\n Pathname.glob(path + '*').each do |p|\n replace_text_body!(p, api_version)\n end\n else\n replace_text_body!(path, api_version)\n end\n end\n end", "title": "" }, { "docid": "2251954f23be41e06a079210ed1500e4", "score": "0.48472887", "text": "def version(value = nil)\n if value.nil?\n @version\n else\n @version = value\n end\n end", "title": "" }, { "docid": "e00eeede52cece83975935be4878b20f", "score": "0.48408276", "text": "def versions(args={}, &bl)\n recursive = args[:recursive]\n dev_deps = args[:dev_deps]\n\n versions = args[:versions] || {}\n versions.merge!({ self.name => Polisher::VersionChecker.versions_for(self.name, &bl) })\n args[:versions] = versions\n\n if recursive\n self.deps.each { |dep|\n unless versions.has_key?(dep)\n gem = Polisher::Gem.retrieve(dep)\n versions.merge! gem.versions(args, &bl)\n end\n }\n\n if dev_deps\n self.dev_deps.each { |dep|\n unless versions.has_key?(dep)\n gem = Polisher::Gem.retrieve(dep)\n versions.merge! gem.versions(args, &bl)\n end\n }\n end\n end\n versions\n end", "title": "" }, { "docid": "ed624454710c1962059e6c84a10589ad", "score": "0.4830755", "text": "def version_file\n 'lib/common/version.rb'\nend", "title": "" }, { "docid": "00a0e700ff1d2669a870ad3fc1c66041", "score": "0.48276547", "text": "def version=(p0) end", "title": "" }, { "docid": "00a0e700ff1d2669a870ad3fc1c66041", "score": "0.48276547", "text": "def version=(p0) end", "title": "" }, { "docid": "00a0e700ff1d2669a870ad3fc1c66041", "score": "0.48276547", "text": "def version=(p0) end", "title": "" }, { "docid": "47176d491966524780056605b0e50f26", "score": "0.48244262", "text": "def update_version_file(semantic_version)\n create_version_file(@version_file_path)\n\n version_text = File.read(@version_file_path)\n version_contents = version_text\n .gsub(/ VERSION = \"[0-9]+\\.[0-9]+\\.[0-9]+\"/,\n \" VERSION = \\\"#{ semantic_version }\\\"\")\n File.open(@version_file_path, \"w\") { |file| file.puts version_contents }\n\n `git add \"#{ @version_file_path }\"`\n\n if :rails_gem == @project_type\n `(cd #{ File.expand_path(Rails.root) }; bundle install)`\n `git add \"#{ File.expand_path(Rails.root.join(\"../../Gemfile.lock\")) }\"`\n end\n end", "title": "" } ]
2a2ca6ba813f9119775e4f895422e402
standard search via home page or results page
[ { "docid": "4a3c1db4fbe2523a1ea197f61f8d45e0", "score": "0.0", "text": "def search\n\n\t\t@default_subject = \"Bird\"\n\t\t@syllables = \".\"\n\t\t@begins = \".\"\n\t\t@ends = \".\"\n\t\t\n\t\t\n\t\tif params[:subject]\n\n\t\t\t@search_subject = Word.get_subject_record params[:subject]\n\t\t\t\n\t\t\tunless @search_subject\n\t\t\t\treturn redirect_to words_search_path, :notice => \"Not found! Sorry\"\n\t\t\tend\n\t\t\t\n\t\t\tunless params[:syllables] == '' or params[:syllables].nil? # if no. of syllables given, replace default value\n\t\t\t\t@syllables = params[:syllables]\n\t\t\tend\n\n\t\t\tunless params[:begins] == '' or params[:begins].nil? # if no. of syllables given, replace default value\n\t\t\t\t@begins = params[:begins]\n\t\t\tend\n\n\t\t\tunless params[:ends] == '' or params[:ends].nil? # if no. of syllables given, replace default value\n\t\t\t\t@ends = params[:ends]\n\t\t\tend\n\t\t\t\n\t\t\t@list_info = Word.get_lists @search_subject.id\n\t\t\t\n\t\t\t@list_info.each do |i| # if the search term is the same as list, have list be the first one shown\n\t\t\t\tif i.list_name.downcase == params[:subject].downcase\n\t\t\t\t\t@match_found = \"match was found\"\n\t\t\t\t\t@current_list_id = i.list_id\n\t\t\t\t\t@current_list_name = i.list_name\n\t\t\t\t\tbreak\n\t\t\t\telse #if search term isn't a list name, just use first list in results\n\t\t\t\t\t@match_found = \"match was not found\"\n\t\t\t\t\t@current_list_id = @list_info.first.list_id \n\t\t\t\t\t@current_list_name = @list_info.first.list_name\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\t@word_list = Word.get_results @current_list_id, @syllables, @begins, @ends\n\t\t\n\t\telsif params[:list_subject] #user clicks on list name\n\n\t\t\t@search_subject = Word.get_subject_record params[:list_subject]\n\t\t\t\n\t\t\t@list_info = Word.get_lists @search_subject.id\n\t\t\t\n\t\t\t@current_list_name = @search_subject.subject\n\t\t\t\n\t\t\t@word_list = Word.get_results @search_subject.id, @syllables, @begins, @ends\n\n\t\telse\n\n\t\t\t@search_subject = Word.get_subject_record @default_subject\n\t\n\t\t\t@list_info = Word.get_lists @search_subject.id\n\t\t\n\t\t\t@current_list = @search_subject.subject\n\t\t\n\t\t\t@word_list = Word.get_results @search_subject.id, @syllables, @begins, @ends\n\t\t\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "7f4dcb1aed674f00d0ed578ba5a88b36", "score": "0.77866185", "text": "def perform_search\n if self.class == Alchemy::Admin::PagesController && params[:query].blank?\n params[:query] = \"lorem\"\n end\n return if params[:query].blank?\n @search_results = search_results\n if paginate_per\n @search_results = @search_results.page(params[:page]).per(paginate_per)\n end\n end", "title": "" }, { "docid": "fe40c685e7edf2bbc3ba154e0a40c852", "score": "0.7679349", "text": "def index\n @page_title = t('titles.search_results')\n @query = params[:query]\n allowed_punctuation = [\"/\",\"-\"]\n @query = sanitize_param_value(@query, allowed_punctuation) if @query.present?\n authorize_query!(@query)\n\n pdf_only_search_results? ? search_pdf_only : search_site_only\n\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.7666348", "text": "def search\n end", "title": "" }, { "docid": "dfa246bd237534d14f835057a4c0e786", "score": "0.7661336", "text": "def search\n \n end", "title": "" }, { "docid": "9c3f40e4675de196badf1eb514439fd2", "score": "0.76453435", "text": "def search\n\t\t\n\tend", "title": "" }, { "docid": "38e238bef783ca8e24175e4acc8c8fb5", "score": "0.7627218", "text": "def search\n\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.7626488", "text": "def search\n\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.7626488", "text": "def search\n\n end", "title": "" }, { "docid": "8ed033b827b1a4454c0d3074aec2a909", "score": "0.76161116", "text": "def search\n simple_search\n end", "title": "" }, { "docid": "c7b471ffe37745ab09336446ae8be962", "score": "0.7611034", "text": "def search\n \n end", "title": "" }, { "docid": "f26b3b48f0187929733c074cff08be88", "score": "0.75564104", "text": "def search\n \tend", "title": "" }, { "docid": "e312c77c55c8b72b0773f9eb3b349eab", "score": "0.7553005", "text": "def search\nend", "title": "" }, { "docid": "0dd363023d54d8dee94e195d91bf8ff8", "score": "0.75328016", "text": "def search\n @results = []\n if params[:q] and params[:q].length > 0\n @results = StaticPage.full_text_search(\n params[:q],\n [StaticPage::Component::HELP, StaticPage::Component::USER_MANUAL])\n end\n @query = params[:q].truncate(50)\n @results_summary = @query.length > 0 ?\n \"Results for \\\"#{@query}\\\"\" : \"Help Search\"\n end", "title": "" }, { "docid": "5b2b1d0224c3722d2441eaf60e2a2307", "score": "0.74396884", "text": "def run_search\n\t\t\tsearch.search\n\t\tend", "title": "" }, { "docid": "25c773de1f112e0a675289e54f50d4e1", "score": "0.7434123", "text": "def Search\n\n end", "title": "" }, { "docid": "b48a5639a509a90558188104471a8d5a", "score": "0.74296206", "text": "def search\n redirect_to root_path(query: params[:query])\n\tend", "title": "" }, { "docid": "1149bb35fd460f4fdf56f6e3896a60df", "score": "0.74235284", "text": "def search\n if params[:q]\n # run the search and return some posts\n @posts = Post.find_by_string(params[:q])\n $page_title = 'Search results for: &quot;' + params[:q] + '&quot;'\n render :template => 'search/results'\n end\n end", "title": "" }, { "docid": "403b388d76574b7ca1a1d540c7fa440e", "score": "0.7411267", "text": "def search;end", "title": "" }, { "docid": "8a7ea062241bbeb872b12b575362ba89", "score": "0.7396754", "text": "def display_filtered_search_results(search); end", "title": "" }, { "docid": "8a7ea062241bbeb872b12b575362ba89", "score": "0.7396754", "text": "def display_filtered_search_results(search); end", "title": "" }, { "docid": "2efb91e1529ee4c5df7172d24ba1527a", "score": "0.73898584", "text": "def perform_search\n return paged(ordered) if paged? && ordered?\n return paged if paged? \n return ordered if ordered?\n basic_search \n end", "title": "" }, { "docid": "05b5fa5c4c0fb13b184fcf8a74591bbb", "score": "0.7388684", "text": "def run_search\n if data.empty?\n puts 'No matches.'\n elsif options[:long]\n do_search\n elsif options[:fields]\n do_search_fields\n else\n do_search_brief\n end\n end", "title": "" }, { "docid": "465476731cb819035c44e3b7c221e943", "score": "0.736424", "text": "def search\r\n context_id = params[:s].sub(/^([a-zA-Z]+)/,'') rescue render_return\r\n context = $1\r\n query = params[:q] ? (params[:q].size > 2 ? \"title LIKE '%#{params[:q]}%'\" : \"false\") : \r\n (context == \"all\" ? \"false\" : \"true\") \r\n @search_context,@result_documents,@paginator = begin case context\r\n when \"uid\"\r\n ones_documents(context_id,query)\r\n when \"c\"\r\n course_documents(context_id,query)\r\n when \"nid\"\r\n school_documents(context_id,query)\r\n when \"all\"\r\n classtalk_documents(query)\r\n else\r\n raise\r\n end\r\n rescue\r\n [nil,[],nil]\r\n end\r\n end", "title": "" }, { "docid": "bea7dd4982c70ca54d5b7e5aea335064", "score": "0.73613364", "text": "def search\n Log.add_info(request, params.inspect)\n\n list\n render(:action => 'list')\n end", "title": "" }, { "docid": "bea7dd4982c70ca54d5b7e5aea335064", "score": "0.73613364", "text": "def search\n Log.add_info(request, params.inspect)\n\n list\n render(:action => 'list')\n end", "title": "" }, { "docid": "bea7dd4982c70ca54d5b7e5aea335064", "score": "0.73613364", "text": "def search\n Log.add_info(request, params.inspect)\n\n list\n render(:action => 'list')\n end", "title": "" }, { "docid": "bea7dd4982c70ca54d5b7e5aea335064", "score": "0.73613364", "text": "def search\n Log.add_info(request, params.inspect)\n\n list\n render(:action => 'list')\n end", "title": "" }, { "docid": "626f2e7ee988b6af00b877499f8539cf", "score": "0.7345067", "text": "def advanced_search\n \n end", "title": "" }, { "docid": "e245531c26b02fdd0c796fc7ffd06435", "score": "0.73367256", "text": "def search\n @active_page_title = \"Pesquisar\"\n search_string = params[:search]\n if search_string.length < 1 then\n redirect_to \"/\"\n end\n\n facade = ArticlesFacade.new(ArticlesService.new(ArticlesDao.new))\n @articles = facade.get_sorted_relevant_articles(search_string)\n end", "title": "" }, { "docid": "49a47d43dcd7c238dc1afb98c6c73a3d", "score": "0.7333059", "text": "def search\n @work_search_results = nil\n @novel_search_results = nil\n @user_search_results = nil\n @title = 'Search'\n\n if params.has_key?(:q) && params[:q].length > 0\n search_keys = params[:q].split\n @work_search_results = Work.tagged_with(search_keys, :any => true, :order_by_matching_tag_count => true).where(is_private: false).paginate(page: params[:page], per_page: 10)\n @novel_search_results = Novel.tagged_with(search_keys, :any => true, :order_by_matching_tag_count => true).paginate(page: params[:page], per_page: 3)\n @user_search_results = User.tagged_with(search_keys, :any => true, :order_by_matching_tag_count => true).paginate(page: params[:page], per_page: 3)\n else\n @work_search_results = Work.where(is_private: false).order('created_at DESC').paginate(page: params[:page], per_page: 10)\n @novel_search_results = Novel.all.order('updated_at DESC').paginate(page: params[:page], per_page: 3)\n @user_search_results = User.all.order('created_at DESC').paginate(page: params[:page], per_page: 3)\n end\n end", "title": "" }, { "docid": "70be5ba4fc07eaa1735a31dfcf915710", "score": "0.7332992", "text": "def search\n \tphrase = \"%#{params[:phrase]}%\"\n \t@id = \"browser_#{params[:type].pluralize}\"\n \t@collection = params[:type].camelize.constantize.find(:all, :conditions => [\"title LIKE ?\", phrase], :limit => 50 )\n \trender :layout => false\n end", "title": "" }, { "docid": "9500edaea083f3700c05701570f4469f", "score": "0.73296386", "text": "def route_search\r\n if params[:q]\r\n redirect_to search_results_url(params[:q], 'users')\r\n else\r\n redirect_to explore_path\r\n end\r\n end", "title": "" }, { "docid": "2b3fb83279ce5a44bddbd0d2ed9c066a", "score": "0.7306427", "text": "def search\n # calls search.html.erb by default \n end", "title": "" }, { "docid": "0fb94b180374982c6b3a578150d0183d", "score": "0.73044276", "text": "def search\n @search_documents = find_search_documents\n render layout: \"layouts/full_page\"\n end", "title": "" }, { "docid": "7fb1673d828f1011d5f7f74deeb0460c", "score": "0.73010534", "text": "def handle_search(env)\n query_string = env['QUERY_STRING']\n query = query_string[query_string.index('q=') + 2, query_string.length]\n query = CGI::unescape(query)\n \n results = Queries.search_for(query)\n # common header. TODO: DRY it.\n html = '<html><body>'\n html += '<form action=\"search\" method=\"GET\"><input id=\"q\" name=\"q\" /></form>'\n \n if results.length == 0\n html += '<p>No results found</p>'\n else\n results.each do |row|\n html += to_html(row, query)\n end\n end\n \n html += '</body></html>' # common footer. TODO: DRY it.\n \n return html\n end", "title": "" }, { "docid": "bb08281cd31521d75815d9e47ec0b05c", "score": "0.7287115", "text": "def perform_search\n if @preview_mode && params[:query].blank?\n params[:query] = 'lorem'\n end\n return if params[:query].blank?\n @search_results = get_search_results\n end", "title": "" }, { "docid": "c0bc6b70a27bef8f7487cd235fe9ee5b", "score": "0.7258199", "text": "def results\n # if request.post?\n @query = params[:query] \n redirect_to :action => :search and return if @query.nil? or @query.empty?\n # @results = Post.find_by_contents(@search_term)\n @total, @results = Post.full_text_search(@query, :page => (params[:page]||1)) \n @pages = pages_for(@total)\n end", "title": "" }, { "docid": "32d94a102706d02be4bec728f3256c35", "score": "0.7255623", "text": "def search\n index\n end", "title": "" }, { "docid": "e7efb3351c04ba508c1cceb1d4f471f1", "score": "0.72337145", "text": "def search\n if params[:use_highlights]\n @questions = Question.highlight_tsearch(params[:q])\n else\n @questions = Question.plain_tsearch(params[:q])\n end\n\n if @questions.any?\n render :results\n else\n render :no_results\n end\n end", "title": "" }, { "docid": "169a9003c4ff06938d0953add9e3713f", "score": "0.72261643", "text": "def search\n go_to_manage_soc\n on ManageSocPage do |page|\n page.term_code.set @term_code\n page.go_action\n end\n end", "title": "" }, { "docid": "99c0680afbcce4057a74c4feccf25c30", "score": "0.7220803", "text": "def search\n @title = params[:controller].camelize.demodulize.tableize.singularize.capitalize + ' Search' \n @model, @search_stat = Commonx::CommonxHelper.search(params)\n @results_url = 'search_results_' + params[:controller].camelize.demodulize.tableize.downcase + '_path'\n @erb_code = find_config_const('search_params_view')\n end", "title": "" }, { "docid": "99c0680afbcce4057a74c4feccf25c30", "score": "0.7219095", "text": "def search\n @title = params[:controller].camelize.demodulize.tableize.singularize.capitalize + ' Search' \n @model, @search_stat = Commonx::CommonxHelper.search(params)\n @results_url = 'search_results_' + params[:controller].camelize.demodulize.tableize.downcase + '_path'\n @erb_code = find_config_const('search_params_view')\n end", "title": "" }, { "docid": "2c0b2b39f71122a7a3982998ed75a639", "score": "0.7209772", "text": "def display_search(search); end", "title": "" }, { "docid": "2c0b2b39f71122a7a3982998ed75a639", "score": "0.7209772", "text": "def display_search(search); end", "title": "" }, { "docid": "0547ca2f76edad561cc0b351e4a66a19", "score": "0.72032905", "text": "def search\n @search_config = YAML.load(File.open(File.join(RAILS_ROOT,\"config\",\"search.yml\")))\n\n if @params['search_terms'].nil? then\n @search_terms = @search_config['default_search_terms']\n else \n @search_terms = @params['search_terms'].split\n end\n\n @count = @params['count'].to_i || -1\n \n self.send(\"#{@search_config['search_backend']}_search\")\n end", "title": "" }, { "docid": "3e2486f3b0f3a823496a494d341706f9", "score": "0.7191309", "text": "def global_search\n unless params[:global_search_text].blank?\n search_text=\"%\" + params[:global_search_text] + \"%\"\n @pages=Page.find(:all, :conditions=>\"name like '#{search_text}'\")\n end\n render :partial=>'/custom/global_search', :object=>@pages\n end", "title": "" }, { "docid": "34c8aaa585d58c4882380975ea47cfea", "score": "0.7191111", "text": "def searched\n\n end", "title": "" }, { "docid": "48db02cc688076262e7611a6f36ad98e", "score": "0.7184993", "text": "def search\n index\n render :index\n end", "title": "" }, { "docid": "48db02cc688076262e7611a6f36ad98e", "score": "0.7184993", "text": "def search\n index\n render :index\n end", "title": "" }, { "docid": "48db02cc688076262e7611a6f36ad98e", "score": "0.7184993", "text": "def search\n index\n render :index\n end", "title": "" }, { "docid": "48db02cc688076262e7611a6f36ad98e", "score": "0.7184993", "text": "def search\n index\n render :index\n end", "title": "" }, { "docid": "dfb76db28b45e7299d6e705ac87a5c5f", "score": "0.71716934", "text": "def search\n unless params[:search_text].blank?\n search_text=\"%\" + params[:search_text] + \"%\"\n @pages=Page.find(:all, :conditions=>\"name like '#{search_text}'\")\n end\n render :partial=>'/custom/search', :object=>@pages\n end", "title": "" }, { "docid": "7a056b944430c7958c59d377ebaddc09", "score": "0.7149323", "text": "def search\n search_query = params[:q]\n # TODO: search comments here\n # This is a collection route, so:\n # - we don't need a resource id\n # - we should return a collection\n head :ok # just return 200 OK without rendering nothing\n end", "title": "" }, { "docid": "ac781a6b6c5edea4d25114857638c042", "score": "0.7102499", "text": "def search\n @list_action = true\n render_response(\"shared/collection\") do find_collection end\n end", "title": "" }, { "docid": "e537faf636d1476fa6477a4a3b60b2b8", "score": "0.708837", "text": "def searchresults\n q = params[:q] || \"\"\n @results = Page.find(:all, :conditions =>\n [\"lower(title) like lower(?)\", \"%\" + q + \"%\"],\n :order => 'title')\n end", "title": "" }, { "docid": "c86c915de7c6ba12f879333540cedf41", "score": "0.7077539", "text": "def index\n @current_user = current_user\n @contains = Contain.get_search_object(params[:search], params[:title], params[:author], params[:published], current_user)\n end", "title": "" }, { "docid": "4476a8aeb62f5cfa7ace57f5da106c13", "score": "0.70742846", "text": "def search\n\n @power_generators = PowerGenerator.search_by_name(params['search']).page(params['page'])\n flash.now[:search] = \"Pesquisando por: #{params['search']}\"\n\n render :index\n end", "title": "" }, { "docid": "abdfad125cebebe14b3af81abd3e6e68", "score": "0.7072492", "text": "def search_results\n \n # if search parameters match, list matching items in descending order \n #if none of the items match still display all along with the \"none found\" message, as per products/index.html.erb\n if params[:search]\n @products = Product.search(params[:search]).order(\"title DESC\")\n else\n @products = Product.all.order(\"title DESC\")\n end\n end", "title": "" }, { "docid": "59a0ea5c92ff24944ac7de82ae51462b", "score": "0.70599335", "text": "def search\n case request.method_symbol\n when :get\n search_get\n when :post\n search_post\n end\n end", "title": "" }, { "docid": "83698da74588c28059ba20b1e24d9489", "score": "0.7050875", "text": "def search \n if params[:search]\n @members = Member.full_text_search params[:search]\n @events = Event.full_text_search params[:search]\n end\n render 'shared/search_results'\n end", "title": "" }, { "docid": "0c628fc9cb146a9b2c6d63334f423b21", "score": "0.70476997", "text": "def custom_search(options = {})\n get_search_results(options).results\n end", "title": "" }, { "docid": "540553154d5913581a93c9c8eddd7e7b", "score": "0.70442295", "text": "def results\n params[:budget] = 0 unless !params[:budget].empty?\n if params[:search].blank?\n flash[:notice] = \" You must enter a country you want to visit.\"\n render 'static_pages/home'\n elsif Page.exists?(name: params[:search])\n #this would have been loaded at the start of the app, and routes to pages#show\n redirect_to \"/#{params[:search]}?budget=#{params[:budget]}&duration=#{params[:duration]}\"\n else\n redirect_to controller: 'itineraries', action: 'index', query: { search: params[:search],\n duration: params[:duration], budget: params[:budget] }\n\n end\n end", "title": "" }, { "docid": "2d8bfe3d393ed79238e9f8f94688772e", "score": "0.70421827", "text": "def index\n add_breadcrumb I18n.t('general.searcher'), :controller => \"search\", :action => \"index\"\n start = Time.now\n # Busca en usuarios\n @users = User.search(params[:search]) if params[:users]\n # Busca en clientes\n\t\t@clients = Client.search(params[:search]) if params[:clients]\n\t\t# Busca en proyectos\n\t\t@projects = Project.search(params[:search]) if params[:projects]\n # Busca en Contenidos\n @contents = Content.search(params[:search]) if params[:contents]\n\n @time = Time.now - start\n end", "title": "" }, { "docid": "dc767561383e0850d671e080db5ca535", "score": "0.70368487", "text": "def search\n# @solitems = Solitem.search(params[:q1]).\n# paginate(page: params[:page], per_page: 15)\n @solitems = Solitem.search(params[:q1])\n# if @solitems.present?\n# @solitems.paginate(page: params[:page], per_page: 15)\n# end\n# render \"index\"\n\n end", "title": "" }, { "docid": "af2f19b41f251c491b66a9c7e95319b9", "score": "0.7027674", "text": "def index\n if params[:search]\n @links = Link.where(\"title like ? or summary like ?\", \"%#{params[:search]}%\", \"%#{params[:search]}%\").order(score: :desc).page(params[:page]).per(20)\n render :search\n else\n Link.all.each\n @links = Link.order(score: :desc).page(params[:page]).per(20)\n end\n end", "title": "" }, { "docid": "e023157a408bbcb09086c51f896ea2e4", "score": "0.7020527", "text": "def search(live = false)\n restrict('allow only admins') or begin\n @phrase = (request.raw_post || request.query_string).slice(/[^=]+/)\n if @phrase.blank?\n render :nothing => true\n else\n if @phrase == 'all'\n @results = Doctor.find(:all)\n else\n @sqlphrase = \"%\" + @phrase.to_s + \"%\"\n @results = Doctor.find(:all, :conditions => [ \"friendly_name LIKE ? OR alias LIKE ? OR telephone LIKE ?\", @sqlphrase, @sqlphrase, @sqlphrase])\n end\n @search_entity = @results.length == 1 ? \"Doctor\" : \"Doctors\"\n logger.error \"#{@results.length} results.\"\n render(:partial => 'shared/live_search_results') if live\n end\n end\n end", "title": "" }, { "docid": "d88e045ee5ce13bfc57bc3ba5edafabc", "score": "0.7011077", "text": "def search\n userInput = params[:q]\n if(userInput != \"\") \n @posts = Post.where(id: search_posts(userInput)).page(params[:page]).per(10)\n render action: \"index\"\n else \n redirect_to '/board'\n end\n end", "title": "" }, { "docid": "5a29cd36da6ebb5272ea36d5978f745d", "score": "0.70026773", "text": "def search(args = {})\n call('search', args)\n end", "title": "" }, { "docid": "e8fbfc385ad98c7ae0462b22b8d7b0d7", "score": "0.70018977", "text": "def simple_search\n sstring = params[:search]\n if sstring.blank?\n render :partial => \"patients/blank_search_term\"\n else\n @patients = Patient.search(sstring)\n render :partial => \"patients/results\", :locals => {:patients => @patients}\n end\n end", "title": "" }, { "docid": "156d2a8aeb55c3a0834bb11e1331f122", "score": "0.700134", "text": "def search(param) \n end", "title": "" }, { "docid": "d729083cdfa6d3c4f9f315186e66b10d", "score": "0.6985208", "text": "def execute_action\n if custom_search?\n :search\n else\n :custom_search\n end\n end", "title": "" }, { "docid": "6d08e1c2942a75f7d5b350fee0643e3a", "score": "0.6981206", "text": "def search\n @query = params[:q]\n @page_num = params[:page]\n @results = nil\n\n # Start at the first page\n if @page_num.nil? or @page_num.empty?\n @page_num = 0\n end\n\n if not @query.nil? and not @query.strip().empty?\n offset = @page_num.to_i * NodeHelper::PAGE_SIZE.to_i\n\n # Get the results\n @results = Node.near(@query, 5)\n\n # Sort by distance\n @results.sort!{|a,b| a.distance <=> b.distance}\n\n # Only keep a page of results\n @results = @results.slice(offset, NodeHelper::PAGE_SIZE.to_i + 1)\n end\n\n render('search')\n end", "title": "" }, { "docid": "25e0614d32f74f012651f710840b4cbc", "score": "0.6976948", "text": "def custom_search\n\t\tunless request.xhr? || params[:page].nil? || params[:search].nil?\n\t\t\tredirect_to root_path\n\t\tend\n\t\tsql = \"1=1\"\n\t\tsql = sql\n\t\t# Data receives a search of unity procon\n\t\tdata = UnityProcon.where(\"uf_procon = ?\", params[:search]).paginate(:page=>1)\n\t\trender :json=>data.to_json\n\t\tCUSTOM.LOGGER.info(\"Searched a unity procon #{data.to_yaml}\")\n\tend", "title": "" }, { "docid": "e5dbbaf7d47fd4160cc191db58b48d13", "score": "0.6975653", "text": "def search\n redirect_to get_create_search_index_url(:key => 'keyword', :value => params[:q], :new => true)\n end", "title": "" }, { "docid": "514f096bdce3a39b30dd86cd3df90b38", "score": "0.69716394", "text": "def basic_search(model)\n return model unless params[:search]\n\n model.search(params[:search])\n end", "title": "" }, { "docid": "260f7e5603ba3b3c1c44b50e240ccfa5", "score": "0.69670653", "text": "def search\n @search_results = Product.search_it(params[:search_it]) if params[:search_it].present?\n end", "title": "" }, { "docid": "975f4ecd3a4b026a5cb456d990766304", "score": "0.6963824", "text": "def search\n\t\tsearchForm = homePage.form(:action => \"https://www.qoo10.sg/gmkt.inc/Search/Default.aspx\")\n\t\tsearchForm.field_with(:name => \"keyword\").value = @input\n\t\tsearchPage = @agent.submit(searchForm)\n\t\t@searchData = Nokogiri::HTML(searchPage.body)\n\tend", "title": "" }, { "docid": "d15515f79e8d7b31b0179def91fa48eb", "score": "0.695017", "text": "def index\n begin\n # for returning to the same page on exceptions\n session[:return_to] ||= request.referer\n\n # check to see if the search limit has been exceeded\n session[\"search_limit_exceeded\"] = false\n search_limit = Rails.configuration.search_limit\n page_i = params[:page].to_i\n per_page_i = params[:per_page].present? ? params[:per_page].to_i : 20\n requested_results = per_page_i * page_i\n if requested_results > search_limit\n logger.debug(\"******** #{__FILE__}:#{__LINE__}:#{__method__}: search limit exceeded.\")\n session[\"search_limit_exceeded\"] = true\n end\n # @bookmarks = current_or_guest_user.bookmarks\n logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} params = #{params.inspect}\"\n extra_head_content << view_context.auto_discovery_link_tag(:rss, url_for(params.to_unsafe_h.merge(:format => 'rss')), :title => t('blacklight.search.rss_feed') )\n extra_head_content << view_context.auto_discovery_link_tag(:atom, url_for(params.to_unsafe_h.merge(:format => 'atom')), :title => t('blacklight.search.atom_feed') )\n # set_bag_name\n # make sure we are not going directly to home page\n if !params[:qdisplay].nil?\n params[:qdisplay] = ''\n end\n search_session[:per_page] = params[:per_page]\n temp_search_field = ''\n journal_titleHold = ''\n if (!params[:range].nil?)\n check_dates(params)\n end\n temp_search_field = ''\n if !params[:q].blank? and !params[:search_field].blank? # and !params[:search_field].include? '_cts'\n if params[:q].include?('%2520')\n params[:q].gsub!('%2520',' ')\n end\n if params[:q].include?('%2F') or params[:q].include?('/')\n params[:q].gsub!('%2F','')\n params[:q].gsub!('/','')\n end\n if params[:search_field] == 'isbn%2Fissn' or params[:search_field] == 'isbn/issn'\n params[:search_field] = 'isbnissn'\n end\n if params[\"search_field\"] == \"journal title\"\n journal_titleHold = \"journal title\"\n # params[:f] = {'format' => ['Journal/Periodical']}\n end\n params[:q] = sanitize(params)\n if params[:search_field] == 'call number' and !params[:q].include?('\"')\n tempQ = params[:q]\n end\n # check_params(params)\n if !tempQ.nil?\n params[:qdisplay] = tempQ\n end\n else\n if params[:q].blank?\n temp_search_field = params[:search_field]\n else\n if params[:search_field].nil?\n params[:search_field] = 'quoted'\n end\n check_params(params)\n end\n if params[:q_row] == [\"\",\"\"]\n params.delete(:q_row)\n end\n end\n if !params[:search_field].nil?\n if !params[:q].nil? and !params[:q].include?(':') and params[:search_field].include?('cts')\n params[:q] = params[:search_field] + ':' + params[:q]\n end\n end\n if !params[:q].nil?\n if params[:q].include?('_cts')\n display = params[:q].split(':')\n params[:q] = display[1]\n end\n end\n # params[:mm] = \"100\"\n params[:mm] = \"1\"\n # params[:q] = '\"journal of parasitology\"'\n # params[:search_field] = 'quoted'\n # params[:sort]= ''\n # params = {\"utf8\"=>\"✓\", \"controller\"=>\"catalog\", \"action\"=>\"index\", \"q\"=>\"(+title:100%) OR title_phrase:\\\"100%\\\"\", \"search_field\"=>\"title\", \"qdisplay\"=>\"100%\"}\n logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} params = #{params.inspect}\"\n # params[:q] = '(+title_quoted:\"A news\" +title:Reporter)'\n # params[:search_field] = 'advanced'\n # params[:q] = '(water)'\n (@response, deprecated_document_list) = search_service.search_results session[\"search_limit_exceeded\"]\n @document_list = deprecated_document_list\n logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} response = #{@response[:responseHeader].inspect}\"\n #logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} document_list = #{@document_list.inspect}\"\n if temp_search_field != ''\n params[:search_field] = temp_search_field\n end\n if journal_titleHold != ''\n params[:search_field] = journal_titleHold\n end\n if params[:search_field] == 'author_quoted'\n params[:search_field] = 'author/creator'\n end\n # why keep this block if nothing is being done inside it?\n # commenting it out 5/18/21. Remove July sprint '21.\n if @response[:responseHeader][:q_row].nil?\n # params.delete(:q_row)\n # params[:q] = @response[:responseHeader][:q]\n # params[:search_field] = ''\n # params[:advanced_query] = ''\n # params[:commit] = \"Search\"\n # params[:controller] = \"catalog\"\n # params[:action] = \"index\"\n end\n if params.nil? || params[:f].nil?\n @filters = []\n else\n @filters = params[:f] || []\n end\n\n # Will comment out the method 5/18/21. Remove July sprint '21.\n # clean up search_field and q params. May be able to remove this\n # cleanup_params(params)\n\n @expanded_results = {}\n ['worldcat'].each do |key|\n @expanded_results [key] = { :count => 0 , :url => '' }\n end\n\n # Expand search only under certain conditions\n tmp = BentoSearch::Results.new\n if !(params[:search_field] == 'call number')\n if expandable_search?\n # DISCOVERYACCESS-6734 - skip entire worldcat search that was intended to provide a count for worldcat results\n query = ( params[:qdisplay]?params[:qdisplay] : params[:q]).gsub(/&/, '%26')\n key = :worldcat\n source_results = {\n :count => 1,\n :url => BentoSearch.get_engine(key).configuration.link + query,\n }\n @expanded_results = {}\n @expanded_results[key.to_s] = source_results\n end\n end\n @controller = self\n if session[\"search_limit_exceeded\"]\n flash.now.alert = I18n.t('blacklight.search.search_limit_exceeded')\n end\n respond_to do |format|\n format.html { }\n format.rss { render :layout => false }\n format.atom { render :layout => false }\n format.json { render json: { response: { document: deprecated_document_list } } }\n end\n\n if !params[:q_row].nil?\n params[:show_query] = make_show_query(params)\n search_session[:q] = params[:show_query]\n end\n\n if !params[:qdisplay].blank?\n params[:q] = params[:qdisplay]\n search_session[:q] = params[:show_query]\n # params[:q] = qparam_display\n search_session[:q] = params[:q]\n # params[:sort] = \"score desc, pub_date_sort desc, title_sort asc\"\n end\n rescue ArgumentError => e\n logger.error e\n flash[:notice] = e.message\n redirect_to session.delete(:return_to)\n end\n end", "title": "" }, { "docid": "2fcafd9e2ac705f5c133e45237dd3ad2", "score": "0.694759", "text": "def search\n @results = []\n if params[:q] and params[:q].length > 0\n @results = StaticPage.full_text_search(\n params[:q], [StaticPage::Component::COLLECTION_ID_GUIDE])\n end\n @query = params[:q].truncate(50)\n @results_summary = @query.length > 0 ?\n \"Results for \\\"#{@query}\\\"\" : \"Collection ID Guide Search\"\n end", "title": "" }, { "docid": "ddb1b3da4ce4373d4015db86f935c87b", "score": "0.6941742", "text": "def search\n @items = Item.find(:all, :conditions => {:code => params[:item][:query]})\n render :action => \"index\"\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "3320267193f45ddb71a2363e084b4102", "score": "0.69386435", "text": "def adv_search\r\n\r\n redirect_to :action => :search\r\n end", "title": "" }, { "docid": "842b36ab034987f065e144243995ad69", "score": "0.693527", "text": "def search\n @search = Item.search do\n fulltext params[:search]\n end\n @items = @search.results\n end", "title": "" }, { "docid": "b0047b4b9e2fa63b3595bda3bcf65d58", "score": "0.69345635", "text": "def search\n\t\t# Check if the keyword is blank\n \tif params[:keyword].blank?\n\t\t flash.now[:danger] = \"Please provide a search keyword\"\n\t\t return redirect_to \"/home\"\n \tend\t\n\n \tcurrent_page = params[:page]\n\n \tif current_page.blank?\n \t current_page = 1 # Default current page\n \tend\n\n\t\t# Initialize the Flickr Api\n\t\t# The following DI mechanims has been user to inject dependency to make the code more testable. \n\t\t# We could inject a mock api class to avoid real api interaction during testing\n\t\tflickr = get_flickr_api \n\n\t\t# Perform the photos search\n\t\tphotos = flickr.photos.search(:tags => params[:keyword],:per_page => Rails.configuration.x.flickr.per_page, :page => current_page)\n\t\tphotos.pages;\n\t\t# Manage the recent search list\n\t\tpush_recent_search params[:keyword]\n\t\t\t\n\t\trecent_search = RecentSearch.where(\"user_id=?\",session[:user_id]).order('updated_at desc').all\n\n\t\trender 'results' , :locals => {:keyword => params[:keyword],:photos => photos,:current_page => current_page,:recent_search => recent_search}\n\tend", "title": "" } ]
3663f9d329a105b8f67412853a928657
Check if the provided serviceline qualifies as a valid parent without causing and infinite loop
[ { "docid": "de42d859cd0a351c4853c1f4fa6116d5", "score": "0.0", "text": "def validHeirachy(original)\n if self.parent.present? && self.parent.slug != original.slug\n self.parent.validHeirachy(original)\n elsif self.parent.present? && self.parent.slug == original.slug\n false\n else \n true\n end\n end", "title": "" } ]
[ { "docid": "6d321aed768ef1eff5ef34079f143896", "score": "0.6795846", "text": "def parent?\n !@child_pid.nil?\n end", "title": "" }, { "docid": "bed67af6e0b1803ad23c72905ff3dd59", "score": "0.6689302", "text": "def is_immediate_parent?( potential_parent )\n \n potential_parent = configuration_for_configuration_or_instance( potential_parent )\n\n return @parents.include?( potential_parent )\n \n end", "title": "" }, { "docid": "f171c7c9e92cbbe9dc5b21855739492c", "score": "0.6613828", "text": "def is_parent?( potential_parent )\n \n is_parent = false\n \n potential_parent = configuration_for_configuration_or_instance( potential_parent )\n\n if @parent.equal?( potential_parent ) or\n @parent && @parent.is_parent?( potential_parent )\n is_parent = true\n end\n \n return is_parent\n \n end", "title": "" }, { "docid": "3ee4d8329efcc18c42dca8fde5f6bf47", "score": "0.6608838", "text": "def is_valid_parent?(child)\n return true\n end", "title": "" }, { "docid": "15b178e31134601e4bb0fe86a6eedf78", "score": "0.6584875", "text": "def parent_singleton?\n parent? && parent_id.nil?\n end", "title": "" }, { "docid": "147036e3d48f8bd184d75a2c27b6b77a", "score": "0.65814304", "text": "def has_parent?\n return !@parent_identity.nil?\n end", "title": "" }, { "docid": "f95613df8f82b0755d99550944b4d697", "score": "0.6558971", "text": "def parent_singleton?\n parent_param.nil?\n end", "title": "" }, { "docid": "fb6b517e852fe90286a92c1ed7c746a4", "score": "0.65461946", "text": "def is_parent?( potential_parent )\n \n return @parent ? @parent.equal?( potential_parent ) || @parent.is_parent?( potential_parent ) \n : false\n \n end", "title": "" }, { "docid": "fb3b9429c9c2bca6df937a2bbb7c350d", "score": "0.6524305", "text": "def isParentChannel(child, parent)\n ret = false\n begin\n channel = @connection.call(\"channel.software.getDetails\", @sid, child)\n if channel['parent_channel_label'] == parent\n ret = true\n end\n rescue Exception => ex\n puts \"Something went wrong: \" + ex\n ensure\n return ret\n end\n end", "title": "" }, { "docid": "1ef5a59e1645d0ffd1afde497c5d36b9", "score": "0.65169954", "text": "def parent_singleton?\n parent_id.nil?\n end", "title": "" }, { "docid": "735861d95450dafa1ff30915cf41df11", "score": "0.65042335", "text": "def should_contact_parent?\n parent && requires_parental_guidance?\n end", "title": "" }, { "docid": "bfd8044abf5b20609f6a699393c20555", "score": "0.64866906", "text": "def has_parent?\n not self.parents[0].nil?\n end", "title": "" }, { "docid": "7cba9ea1545e9fde185ab1923fc7d775", "score": "0.64744294", "text": "def is_in_parent_process?\n\n (sub_instance_id == '')\n end", "title": "" }, { "docid": "f00d2cd830ca3204a29fcabbe862c255", "score": "0.6451666", "text": "def has_parent?\n\t\t!self.network.nil?\n\tend", "title": "" }, { "docid": "f4a6f1cc1d8743fc88a60be172fded57", "score": "0.6436322", "text": "def has_parent?\n !parent.nil?\n end", "title": "" }, { "docid": "a8abaa2d6ba56856d0a26ad2748b8a2e", "score": "0.6429329", "text": "def is_parent?\n return true\n end", "title": "" }, { "docid": "a8abaa2d6ba56856d0a26ad2748b8a2e", "score": "0.6429329", "text": "def is_parent?\n return true\n end", "title": "" }, { "docid": "1ad4b22dba7083e02551b7f676a2ed92", "score": "0.6409993", "text": "def is_parent?\n return false\n end", "title": "" }, { "docid": "f5ef71769d3b6ff369c1769ca7f8f687", "score": "0.6407689", "text": "def validate_shared_parent\n end", "title": "" }, { "docid": "f06aadea981ba95ce1ca53fd6378ad1b", "score": "0.63860554", "text": "def parent?\r\n not parent.nil?\r\n end", "title": "" }, { "docid": "970170d4547b2ce4fca4320f8f42b6c6", "score": "0.63817424", "text": "def parent_causes_cycle\n traverse_down {|rq| return true if rq.id == parent_id}\n return false\n end", "title": "" }, { "docid": "9774d045770de81b0b3fdb06de33bb97", "score": "0.6352928", "text": "def has_parent?\n !parent.nil?\n end", "title": "" }, { "docid": "8e0c336a73345f8da8f922c6457128cf", "score": "0.63417745", "text": "def has_parent?\n !orphan?\n end", "title": "" }, { "docid": "2a6f5b36c73c8e46730d8cd92b4e0205", "score": "0.6336036", "text": "def is_parent?( potential_parent )\n \n potential_parent = configuration_for_configuration_or_instance( potential_parent )\n\n return @parents.include?( potential_parent ) ||\n @parents.any? { |this_parent| this_parent.is_parent?( potential_parent ) }\n \n end", "title": "" }, { "docid": "940ced0f86de83a5a0f511a4c48661eb", "score": "0.6328416", "text": "def is_parent?\n @parent_id == 0\n end", "title": "" }, { "docid": "b94222271c4aa8b9c4e87a1fc937610e", "score": "0.63252705", "text": "def has_parent?\n @parent.nil?\n end", "title": "" }, { "docid": "50b3e68ee66251a61e7124d417711e8e", "score": "0.631712", "text": "def missing_parent?\n false\n end", "title": "" }, { "docid": "b5f52384ae5862c6c985f7e057e3a20a", "score": "0.63128614", "text": "def has_parent?; end", "title": "" }, { "docid": "373cc3ef073ec66f343e112460e00fbf", "score": "0.6292384", "text": "def has_parent?\n \n return @parent ? true : false\n \n end", "title": "" }, { "docid": "f0c52f46ee2804bb3fa1983b277ccfad", "score": "0.6289422", "text": "def parent?\n !parent.nil?\n end", "title": "" }, { "docid": "8fc3dc85525fe87a5794e860f514723d", "score": "0.62863207", "text": "def parent?\n return true if (params[:parent] && params[:parent_id] && @parent = params[:parent].classify.constantize.find(params[:parent_id]))\n !(%w{NilClass TrueClass FalseClass}.include? @parent.class.to_s)\n end", "title": "" }, { "docid": "653bbaa32784a9fd3d56ee1b3553d130", "score": "0.6280636", "text": "def parent?\n !@parent.nil?\n end", "title": "" }, { "docid": "6f107ffb6080c04254e91d49e07c57ea", "score": "0.6268841", "text": "def parent?\r\n not self.parent.nil?\r\n end", "title": "" }, { "docid": "aeca2c70d64958ff81bc0a47a01155dd", "score": "0.6267546", "text": "def parent_is_not_child\n parent_is_child = false\n candidate = Neuron.find_by(id: parent_id)\n while candidate.present? && candidate.parent_id.present? && !parent_is_child\n parent_is_child = candidate.parent_id == id\n candidate = candidate.parent\n end\n errors.add(\n :parent,\n I18n.t(\n \"activerecord.errors.messages.circular_parent\",\n child: parent.to_s,\n parent: self.to_s\n )\n ) if parent_is_child\n end", "title": "" }, { "docid": "5de17b454eaea06312da848e6d7df3d2", "score": "0.6256103", "text": "def is_parent()\n !in_child\n end", "title": "" }, { "docid": "6948ef57ad2ef168b7c1651d14d96093", "score": "0.6254416", "text": "def has_parent?\n return self.parent.nil? ? false : true\n end", "title": "" }, { "docid": "a07e8b4da3cee29b374b0aba07f15296", "score": "0.62468135", "text": "def parent?\n !parent.nil?\n end", "title": "" }, { "docid": "9f489d7a3f77ffe12c15839ca5fae98d", "score": "0.62461627", "text": "def parent_correct?(id,parent)\n\n # get the suggested pathname .. using the pathname library here.\n path = Pathname.new(id).dirname\n\n # get the parent ci from the rest interface\n xml = RestClient.get \"#{@base_url}/ci/#{path}\", {:accept => :xml, :content_type => :xml}\n\n # get the parent type from the xml\n parenttype = XmlSimple.xml_in(xml,{'KeepRoot' => true}).keys.to_s\n # check if the actual parenttype is among the valid ones\n return true if parent.include? parenttype\n\n return false\n end", "title": "" }, { "docid": "fdcf4d32dc8621d79f9b55c4b78a3925", "score": "0.62442756", "text": "def parent?\r\n false\r\n end", "title": "" }, { "docid": "effd08a1c76099ffad8964b8299fc799", "score": "0.6238513", "text": "def current_parent?(parent)\n parent == current_parent\n end", "title": "" }, { "docid": "d382c57b6082e9979d6be51652cb366a", "score": "0.62311226", "text": "def should_contact_parent?\n requires_parental_guidance?\n end", "title": "" }, { "docid": "f985bf0909b63f250e683bfc49abdda1", "score": "0.62259525", "text": "def parent?\n children.exists?\n end", "title": "" }, { "docid": "88d3f6b44c8822cd0c6161ed718a19e7", "score": "0.6223538", "text": "def child_of?(parent); end", "title": "" }, { "docid": "88d3f6b44c8822cd0c6161ed718a19e7", "score": "0.6223538", "text": "def child_of?(parent); end", "title": "" }, { "docid": "5f64f5c708c9ba522215cb4a2557e501", "score": "0.6212846", "text": "def parent?\r\n true \r\n end", "title": "" }, { "docid": "d113da924f9ae584be2c5a891b0bc9dc", "score": "0.6197781", "text": "def parent?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "b37274170f4d1d9e72f37b04145be883", "score": "0.61937666", "text": "def parent?\n !!@parent\n end", "title": "" }, { "docid": "cd94c0c8dd3e31d677dac58c2f61b19a", "score": "0.61573035", "text": "def isInParent?(ident)\n key = ident.to_sym\n return @parent.isIn?(key)\n end", "title": "" }, { "docid": "84fd58ea6470246bcb28b4eb3e5920b4", "score": "0.61399835", "text": "def parent?\n false\n end", "title": "" }, { "docid": "a2e883485180728ba6acaa3eb20036dc", "score": "0.613919", "text": "def parent?\n not self.parent.nil?\n end", "title": "" }, { "docid": "d672a60bc77a87b525363aa6bd9740fe", "score": "0.6106824", "text": "def is_child?\n @parent_id > 0\n end", "title": "" }, { "docid": "fee33a02b5dda3709c3fbcf965608bf9", "score": "0.60976344", "text": "def parent_of?(node)\n self == node.parent\n end", "title": "" }, { "docid": "b6055139360c86008c388016ed91baaf", "score": "0.6095425", "text": "def is_child?\n return (@parent != nil)\n end", "title": "" }, { "docid": "a1420b02c0413d620764f85e4b017cbe", "score": "0.6083652", "text": "def child?\n !parent.nil?\n end", "title": "" }, { "docid": "a6dfb307cf4f8fe7118a94f9d4701c4c", "score": "0.60750306", "text": "def check_if_parent(all_jobs, child, parent)\n #return false if child == nil or parent == nil\n while child != nil\n return true if all_jobs[child][\"parent\"] == parent\n child = all_jobs[child[\"parent\"]]\n end\n return false\nend", "title": "" }, { "docid": "a14e4f5e7f221099c3e48891df21595a", "score": "0.60714656", "text": "def resource_has_parents?(resource)\n if !resource.persisted?\n params[:parent_id]\n else\n resource.decorate.respond_to?(:decorated_parent) && !resource.decorate.decorated_parent.nil?\n end\n end", "title": "" }, { "docid": "648ec73b57c6a8a4b73bc4c6a81831ca", "score": "0.6065934", "text": "def child_of?(parent)\n parent_hwnd= parent.is_a?(self.class) ? parent.hwnd : parent\n child=WinUser.IsChild(parent_hwnd, hwnd)\n child!=WIN_FALSE\n end", "title": "" }, { "docid": "e82618c80491aca8b821d8503527e211", "score": "0.6062949", "text": "def has_parent?\n not @parent_folder.nil?\n end", "title": "" }, { "docid": "98d650581c52836772daeed2f3d4712d", "score": "0.6059049", "text": "def parent?\n if resources_configuration[:polymorphic][:optional]\n parents_symbols.size > 1 || !parent_type.nil?\n else\n true\n end\n end", "title": "" }, { "docid": "e6bf69cc1f5c923801596e9838301685", "score": "0.6049816", "text": "def parent_path?(parent, child)\n child.to_s.index(parent.to_s) == 0\n end", "title": "" }, { "docid": "538ba64afbded97990da40bbace3b498", "score": "0.60487956", "text": "def parent_of?(node)\n node && node == tlq(false) || node == trq(false) || node == blq(false) || node == brq(false)\n end", "title": "" }, { "docid": "c9a71f5f4a8c4ae4db5fee0dae9359f7", "score": "0.60483605", "text": "def parent_present?\n !(@request_params[:parent_id].blank? || @request_params[:parent_type].blank?)\n end", "title": "" }, { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": "0.60479015", "text": "def parent?\n !parent_model_name.nil?\n end", "title": "" }, { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": "0.60479015", "text": "def parent?\n !parent_model_name.nil?\n end", "title": "" }, { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": "0.60479015", "text": "def parent?\n !parent_model_name.nil?\n end", "title": "" }, { "docid": "adb9fe1ad7cd9ede466a64cbd0b0bc5d", "score": "0.60362124", "text": "def deploy_parents_is_transverse(parent = nil)\n\n query = \"parent_id = 0 and is_transverse = 1\"\n if parent != nil\n query += \" and id = \" + parent.id.to_s\n end\n\n ChecklistItemTemplate.find(:all,:conditions=>[query]).each do |ct|\n ct.deploy_as_parent_is_transverse\n end\n end", "title": "" }, { "docid": "733f25a2c06f96c8cd4b9f9978bbb90d", "score": "0.60324204", "text": "def child?\n @spec.key?('parent')\n end", "title": "" }, { "docid": "87ffc12d76eb58dfe11614a46ccb46c0", "score": "0.60320324", "text": "def parent?\n children.present?\n end", "title": "" }, { "docid": "e6f5b893f19ac643a554cded367129c4", "score": "0.60293394", "text": "def valid_parent_child(par,chd)\n \tassert(chd.db_parent == par && par[chd.key] == chd && par.find_key(chd) == chd.key, \"Invalid Database Parent Child Relationship\" )\n end", "title": "" }, { "docid": "dc5aac88a4d0eda327f1f2b25001b952", "score": "0.60198057", "text": "def child?\n !parent.nil?\n end", "title": "" }, { "docid": "dc5aac88a4d0eda327f1f2b25001b952", "score": "0.60198057", "text": "def child?\n !parent.nil?\n end", "title": "" }, { "docid": "7a65811dbdde0bc86a407d05ebfb55f9", "score": "0.6011253", "text": "def parent?\n parent_key_id.present?\n end", "title": "" }, { "docid": "8ae87511fd7f5067540989f1193783aa", "score": "0.6008171", "text": "def is_a_parent( context_sym )\n detector = detector_for( context_sym )\n ( detector.nil? || detector.is_a_parent_context() )\n end", "title": "" }, { "docid": "ad59624dd94a7833f01a7c97ebcd01cd", "score": "0.60023475", "text": "def validate_parent_instance_node(instance_node, _child_node)\n !survey.node_maps.select { |i| i.node == self }.collect do |node_map|\n if node_map.parent\n node_map.parent.node.validate_parent_instance_node(instance_node, self)\n # Hit top node\n else\n true\n end\n end.include?(false)\n end", "title": "" }, { "docid": "a2a3183f3fe68977e79e2fc2d4188a77", "score": "0.60011804", "text": "def parenthesize?\n !parent.equal?(Root.instance) && !parent.kind_of?(Join)\n end", "title": "" }, { "docid": "7ddc8430d99323b57645e3ab1bcd9ade", "score": "0.59922826", "text": "def parent_of?(other)\n not self.children.index(other).nil?\n end", "title": "" }, { "docid": "3433316b93b1404c1a387404d8ca340f", "score": "0.5989169", "text": "def has_parents?\n \n return @parent ? true : false\n \n end", "title": "" }, { "docid": "82c1ce58531531bc66d5b316f6465f25", "score": "0.59886545", "text": "def parent_of?(node)\n if !persisted?\n start = (self.started_at - node.started_at) * 1000000\n start <= 0 && (start + self.duration >= node.duration)\n else\n self.id == node.parent_id\n end\n end", "title": "" }, { "docid": "1cec21d30d47bed039de1c0ff94897b0", "score": "0.59828234", "text": "def has_parent_collection?(path)\n return_value = false\n if File.expand_path(\"..\",path).match('\\|pid\\|')\n #logger.debug(\"has parent collection\")\n return_value = true\n end\n return_value\nend", "title": "" }, { "docid": "0dcbc8f5b62f68288817856102f2df50", "score": "0.5981745", "text": "def parent?\n children.any?\n end", "title": "" }, { "docid": "2d6d2c73fd118862c02fc98edb2dfa72", "score": "0.5981028", "text": "def check_credits_parent()\n # Récupère tous les parents\n p_n_pairs = Tree.find_nodes(@root, @target.data.sigles_array()[0])\n if(p_n_pairs != :error && !p_n_pairs.empty?)\n result = true\n p_n_pairs.each do |p, n|\n if(p != nil) # Si = nil, aucun parent n'existe\n # Crée un checker et vérifie les crédits sur les enfants du parent\n tree_scc = TreeStructuralConstraintsChecker.new(p, @root)\n result &= tree_scc.check_credits_children()\n tree_scc.report.list.each do |line|\n @report.write(\"Check de la structure des parents : \" + line, $structural_category)\n end\n end\n end\n return result\n else\n return !p_n_pairs ==:error \n end\n end", "title": "" }, { "docid": "d3e2c0702d7d91106b6890efd38879a7", "score": "0.5976731", "text": "def check_parent\n\t\tunless @root\n\t\t\tunless @parent.nil?\n\t\t\t\treturn @parent.value\n\t\t\tend\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "dde153737346c2eb8d025534f50eeee9", "score": "0.59737176", "text": "def has_parent_id?\n self.parent_id.to_s.is_i?\n end", "title": "" }, { "docid": "7d6eeb1e2c4bc98491e5ecdea1d1974b", "score": "0.59573114", "text": "def parent_a_container?(hpricot_element)\n hpricot_element.parent.name == hpricot_element.name + \"s\" || hpricot_element.parent.search(\"> #{hpricot_element.name}\").size > 1\n end", "title": "" }, { "docid": "1aa076fd4db07febc8ab662b2530a432", "score": "0.59569633", "text": "def invalid_parent?(node, field)\n field.parent && node.children.first.children.last != field.parent\n end", "title": "" }, { "docid": "10e4f01b56c953544abb0642e9293847", "score": "0.59520733", "text": "def child?\n !parent_id.nil?\n end", "title": "" }, { "docid": "e50536a35e968de3612dea7ed0582d69", "score": "0.5946942", "text": "def has_child?\n\t# filter the process table for process that have our pid as a parent\n @child = Sys::ProcTable.ps.select{ |pe| pe.ppid == @pid }\n\t@child.any?\n end", "title": "" }, { "docid": "364c33ce7f2e5e48c5c356ba6c3aa6c9", "score": "0.59456116", "text": "def has_parent?(taxon)\n parent_taxon = self.parent\n while parent_taxon.present?\n return true if parent_taxon == taxon\n parent_taxon = parent_taxon.parent\n end\n false\n end", "title": "" }, { "docid": "be8cd787e9ceaeedddd8dff720696d62", "score": "0.5945388", "text": "def check_parent_exist?(obj)\n if obj.class.eql? Box\n unless User.exists? obj.user_id\n box = Box.where(user_id: obj.user_id).where.not(id: obj.id).first\n box.destroy_container! if box\n end\n else\n unless Box.exists? obj.box_id\n component = Component.where(box_id: obj.box_id).where.not(id: obj.id).first\n component.destroy_container! if component\n end\n end\n end", "title": "" }, { "docid": "c4c4248619480b1bd5ca3b16e1971c3f", "score": "0.5933529", "text": "def is_parent?\n return (@child_folders.length > 0)\n end", "title": "" }, { "docid": "bef29b325643a37bde6427dc35707a3f", "score": "0.5930235", "text": "def child?\r\n true\r\n end", "title": "" }, { "docid": "f6b1021a54970af588db8fa98a96434b", "score": "0.5913426", "text": "def parent?(object)\n parent_ids.include? object.id\n end", "title": "" }, { "docid": "69728abf2f22368c453eb85e44553541", "score": "0.5911484", "text": "def is_a_parent_context()\n @context_type.parent_context_name.nil?\n end", "title": "" }, { "docid": "69728abf2f22368c453eb85e44553541", "score": "0.5911484", "text": "def is_a_parent_context()\n @context_type.parent_context_name.nil?\n end", "title": "" }, { "docid": "6528460b479bf3df72427c13281251aa", "score": "0.5907955", "text": "def notifying_parent?\n @notifying_parent ||= !@options.delete(:suppress)\n end", "title": "" }, { "docid": "749a4d5f84f7cc5987a9f7761ee7599c", "score": "0.59069073", "text": "def child?\n @child_pid.nil?\n end", "title": "" }, { "docid": "57be1c438943e828f0b4645e9069b1e7", "score": "0.5901071", "text": "def child?\n !!parent\n end", "title": "" }, { "docid": "09dd090bd3bdac74088fa955ee4bfae9", "score": "0.5894079", "text": "def parent?(element)\n @parent_keys.keys.any? { |key| @equivalence.call(key, element) }\n end", "title": "" }, { "docid": "dc1c1811eeebc6752319b9ff1115d6d8", "score": "0.5892886", "text": "def validate\n\n @parent_critical_chain_interaction_log = CriticalChainInteractionLog.where(\n id: @parent_id\n ).first\n\n return error_with_data(\n 'j_s_gasj_1',\n 'something_went_wrong',\n GlobalConstant::ErrorAction.default\n ) if @parent_critical_chain_interaction_log.blank?\n\n @client_id = @parent_critical_chain_interaction_log.client_id\n\n success\n\n end", "title": "" }, { "docid": "50661f2b3c3e86151cbfbc9b71953620", "score": "0.58921874", "text": "def parent_id?(item)\n parent.id && item.send(foreign_key).eql?(parent.id)\n end", "title": "" }, { "docid": "1274e14ef8d3a7c00e8ffeb07c7f2814", "score": "0.5889427", "text": "def validate_parent_instance_node(instance_node, child_node)\n\t\t\t!self.survey.node_maps.select { |i| i.node == self}.collect { |node_map|\n\t\t\t\tif node_map.parent\n\t\t\t\t\tnode_map.parent.node.validate_parent_instance_node(instance_node, self)\n\t\t\t\t# Hit top node\n\t\t\t\telse\n\t\t\t\t\ttrue\n\t\t\t\tend\n\t\t\t}.include?(false)\n\t\tend", "title": "" } ]
ffae51ae93486b9f5477f2bb8edebdbd
Deletes a security policy from this domain Deletes the security policy along with all the rules
[ { "docid": "9642d5cb59bfef2a1060221043fad24b", "score": "0.699731", "text": "def delete_security_policy_for_domain(domain_id, security_policy_id, opts = {})\n delete_security_policy_for_domain_with_http_info(domain_id, security_policy_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "eda6d77add81e32c0852f2f8cfa5799b", "score": "0.7055457", "text": "def delete_policy\n request = delete_policy_request\n request.send\n end", "title": "" }, { "docid": "be76a96a936f69c325685921b0389af0", "score": "0.70012754", "text": "def delete_security_policy_for_domain_0(domain_id, security_policy_id, opts = {})\n delete_security_policy_for_domain_0_with_http_info(domain_id, security_policy_id, opts)\n nil\n end", "title": "" }, { "docid": "76dc422b4ce40e77064139638d476a57", "score": "0.6959174", "text": "def delete_ids_security_policy(domain_id, policy_id, opts = {})\n delete_ids_security_policy_with_http_info(domain_id, policy_id, opts)\n nil\n end", "title": "" }, { "docid": "ea36a1377335d871c300d058edffec8d", "score": "0.6683592", "text": "def remove_policy(_sec, _ptype, _rule); end", "title": "" }, { "docid": "15cd1c1cba1dece75e9e1aea8a32909e", "score": "0.65790015", "text": "def delete_policy(name)\n post_command(\"delete-policy\", { \"name\" => name })\n logger.info(\"Deleted razor policy %s\" % name)\n end", "title": "" }, { "docid": "755e689549ebd8b6136ddbbcc08b2147", "score": "0.65451735", "text": "def remove_policy(sec, ptype, rule)\n return false unless has_policy(sec, ptype, rule)\n\n model[sec][ptype].policy.delete(rule)\n\n true\n end", "title": "" }, { "docid": "b86990fbd348ce293c27d6cfce7ec04c", "score": "0.6454884", "text": "def delete_ids_security_policy_0(domain_id, policy_id, opts = {})\n delete_ids_security_policy_0_with_http_info(domain_id, policy_id, opts)\n nil\n end", "title": "" }, { "docid": "86be3769d48e25ce87413914acc9abf4", "score": "0.64401144", "text": "def delete_policy(role)\n Service.call(RBACApiClient::PolicyApi) do |api_instance|\n Service.paginate(api_instance, :list_policies, :name => @prefix).each do |policy|\n api_instance.delete_policy(policy.uuid) if policy.roles.map(&:uuid).include?(role.uuid)\n end\n end\n end", "title": "" }, { "docid": "8e4c11fdc16c4ce3f6ec088b6edb1c65", "score": "0.6425063", "text": "def security_policies_policy_name_delete(authorization, policy_name, opts = {})\n data, status_code, headers = security_policies_policy_name_delete_with_http_info(authorization, policy_name, opts)\n [data, status_code, headers]\n end", "title": "" }, { "docid": "2ee85fd8b099fd27f369b5a11ef601d9", "score": "0.6360341", "text": "def remove_policy(sec, ptype, rule)\n return false unless model.remove_policy(sec, ptype, rule)\n\n make_persistent :remove_policy, sec, ptype, rule\n end", "title": "" }, { "docid": "21478ca92db7de3b962925118a1c77ae", "score": "0.6329429", "text": "def delete_policy(policy, opts = {})\n raise ArgumentError unless policy.is_a? String\n c = @client[\"#{@account}/policies/#{policy}\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_delete(c, headers)\n end\n\n end", "title": "" }, { "docid": "014e60278b9a3de4905bdb70746e2ed0", "score": "0.6327571", "text": "def delete_security_rule_0(domain_id, security_policy_id, rule_id, opts = {})\n delete_security_rule_0_with_http_info(domain_id, security_policy_id, rule_id, opts)\n nil\n end", "title": "" }, { "docid": "f36655282fe270d902d36092f105dfbf", "score": "0.63196295", "text": "def destroy\n policy = Policy.find(params[:id])\n @policy.destroy\n redirect_to policies_path\n end", "title": "" }, { "docid": "9eeec3867919f178f1324b9f9cf7209b", "score": "0.62891245", "text": "def remove_policy(*params)\n remove_named_policy('p', *params)\n end", "title": "" }, { "docid": "3eb2946ab5f33b6a57203190dd5e4eef", "score": "0.6258191", "text": "def delete_policy(policy_arn)\n request(\n 'Action' => 'DeletePolicy',\n 'PolicyArn' => policy_arn,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "title": "" }, { "docid": "e44d1f9836025a6731a6c55d069a4288", "score": "0.61283946", "text": "def delete_policy(uuid, opts = {})\n delete_policy_with_http_info(uuid, opts)\n nil\n end", "title": "" }, { "docid": "388faacc1fd835a08a8d56b1d0171b4d", "score": "0.61189336", "text": "def remove_policies(sec, ptype, rules)\n return false unless model.remove_policies(sec, ptype, rules)\n\n make_persistent :remove_policies, sec, ptype, rules\n end", "title": "" }, { "docid": "de6ef7ff93e39d3e7a1da6779f40d233", "score": "0.6084831", "text": "def delete_security_policy_for_domain_with_http_info(domain_id, security_policy_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain ...'\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain\"\n end\n # verify the required parameter 'security_policy_id' is set\n if @api_client.config.client_side_validation && security_policy_id.nil?\n fail ArgumentError, \"Missing the required parameter 'security_policy_id' when calling PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain\"\n end\n # resource path\n local_var_path = '/infra/domains/{domain-id}/security-policies/{security-policy-id}'.sub('{' + 'domain-id' + '}', domain_id.to_s).sub('{' + 'security-policy-id' + '}', security_policy_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, 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: PolicySecurityEastWestSecurityDistributedFirewallRulesApi#delete_security_policy_for_domain\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "46ef14b6f3ae78ff7e237d542beb3953", "score": "0.6060534", "text": "def delete_escalation_policy(id)\n boolean_from_response :delete, \"/escalation_policies/#{id}\"\n end", "title": "" }, { "docid": "6f54465831829d66025dec0c68f1dc36", "score": "0.60019886", "text": "def destroy\n @policy.destroy?\n if !@admin.eql?(current_user)\n @admin.destroy\n head :no_content\n else\n head :forbidden\n end\n end", "title": "" }, { "docid": "381ed66d0489a98776d4c1ea55a12546", "score": "0.5996986", "text": "def delete\n client_opts = {}\n client_opts[:auto_scaling_group_name] = group.name\n client_opts[:policy_name] = name\n client.delete_policy(client_opts)\n nil\n end", "title": "" }, { "docid": "8ce649032df3311b561723885f530746", "score": "0.5979252", "text": "def delete_security_rule(domain_id, security_policy_id, rule_id, opts = {})\n delete_security_rule_with_http_info(domain_id, security_policy_id, rule_id, opts)\n nil\n end", "title": "" }, { "docid": "c1d92dee7be0001b1dd2b86f7e234144", "score": "0.59644926", "text": "def delete_security_using_delete(security_id, opts = {})\n delete_security_using_delete_with_http_info(security_id, opts)\n nil\n end", "title": "" }, { "docid": "647a2895020afb412ddde0bcded9b431", "score": "0.5948688", "text": "def delete_policy\n super\n end", "title": "" }, { "docid": "b9155c9255e1136cb9c8744c58a04d2d", "score": "0.5942888", "text": "def delete_policy(project_name, preheat_policy_name, opts = {})\n delete_policy_with_http_info(project_name, preheat_policy_name, opts)\n nil\n end", "title": "" }, { "docid": "1cd2552150497cbe49f6b46e839d517f", "score": "0.588976", "text": "def delete_security_policy_for_domain_0_with_http_info(domain_id, security_policy_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain_0 ...'\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain_0\"\n end\n # verify the required parameter 'security_policy_id' is set\n if @api_client.config.client_side_validation && security_policy_id.nil?\n fail ArgumentError, \"Missing the required parameter 'security_policy_id' when calling PolicySecurityEastWestSecurityDistributedFirewallRulesApi.delete_security_policy_for_domain_0\"\n end\n # resource path\n local_var_path = '/global-infra/domains/{domain-id}/security-policies/{security-policy-id}'.sub('{' + 'domain-id' + '}', domain_id.to_s).sub('{' + 'security-policy-id' + '}', security_policy_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, 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: PolicySecurityEastWestSecurityDistributedFirewallRulesApi#delete_security_policy_for_domain_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "964a40198cb845aac4a68c323d65b23e", "score": "0.5888965", "text": "def remove_policies(sec, ptype, rules)\n rules.each do |rule|\n return false unless has_policy(sec, ptype, rule)\n end\n\n model[sec][ptype].policy.reject! { |rule| rules.include? rule }\n\n true\n end", "title": "" }, { "docid": "9d2e6ecb43d9785ce483c298ea638809", "score": "0.5884384", "text": "def remove_policies(rules)\n remove_named_policies('p', rules)\n end", "title": "" }, { "docid": "877dcb9fe098d5f26bd3d65fd98b07e0", "score": "0.5880677", "text": "def destroy\n @escalation_policy = EscalationPolicy.find(params[:id])\n @escalation_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to escalation_policies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "fba75be2a9fe1da9c21d5e6deae956fb", "score": "0.5857756", "text": "def delete\n\n client.delete_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name)\n\n nil\n\n end", "title": "" }, { "docid": "89e8138c2d8f40876ff54a1131522212", "score": "0.5843205", "text": "def destroy\n authorize @health\n\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to back_path || healths_url, notice: 'Insurance policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ab5cec702cce217c2242c8edb86ff4a9", "score": "0.5838962", "text": "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_url_protectionprovider: \")\n end", "title": "" }, { "docid": "0fdb73bfe4940eaa7a01a8a8e3deb5d2", "score": "0.5836621", "text": "def destroy\n @policy = Policy.find(params[:id])\n @policy.destroy\n flash[:notice] = 'Política removida com sucesso!'\n respond_to do |format|\n format.html { redirect_to(policies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dc7b202d13a788e3290992065968cc36", "score": "0.5823742", "text": "def revise_security_policies_revise(domain_id, security_policy_id, security_policy, opts = {})\n data, _status_code, _headers = revise_security_policies_revise_with_http_info(domain_id, security_policy_id, security_policy, opts)\n data\n end", "title": "" }, { "docid": "a0b40dbf62d5446a9f428325f74727be", "score": "0.5821551", "text": "def remove_policy\n\n client.set_load_balancer_policies_of_listener(\n :load_balancer_name => load_balancer.name,\n :load_balancer_port => port,\n :policy_names => [])\n\n nil\n\n end", "title": "" }, { "docid": "e72e48addf23abf6837e99f49e2a6ad1", "score": "0.58118284", "text": "def destroy\n @policyrule = Policyrule.find(params[:id])\n @policyrule.destroy\n\n respond_to do |format|\n format.html { redirect_to policyrules_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11f56f117d833d83307cc154955c2ad1", "score": "0.57989204", "text": "def destroy\n @policy = Policy.find(params[:id])\n @policy.destroy\n\n respond_to do |format|\n format.html { redirect_to policies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "682c9d6868bbae394673a4d6de86479a", "score": "0.5793099", "text": "def destroy\n @policy_rule.destroy\n respond_to do |format|\n format.html { redirect_to policy_rules_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7df1bfe0527c197bf533cdad584dff7d", "score": "0.57840014", "text": "def delete_shaping_policy(opts)\n opts = check_params(opts,[:policies])\n super(opts)\n end", "title": "" }, { "docid": "cdf7f4e90388ba89a19e38e207ab0c4e", "score": "0.5753829", "text": "def destroy\n @policy = @course.policies.find(params[:id])\n @policy.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_course_policies_url(@course)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ffb9f31e368f56474ff4312f0eefd517", "score": "0.5735575", "text": "def delete(key)\n @policy.delete(key)\n end", "title": "" }, { "docid": "d1f54e599911c826209777cd88455ba7", "score": "0.57338345", "text": "def destroy\n @sulabh_policy.destroy\n respond_to do |format|\n format.html { redirect_to sulabh_policies_url, notice: 'Sulabh policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59f1f9a7d72559148b4e9d9f35373ac3", "score": "0.57283926", "text": "def delete_user_policy(user_name, policy_name)\n request_hash = { 'UserName' => user_name,\n 'PolicyName' => policy_name }\n link = generate_request(\"DeleteUserPolicy\", request_hash)\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n end", "title": "" }, { "docid": "dc3552aa4cfbfe9aaca179535bf0fb1c", "score": "0.57283103", "text": "def delete(name)\n delete_policy(:policy_name => name)\n nil\n rescue Errors::NoSuchEntity => e\n nil\n end", "title": "" }, { "docid": "0fa1b6c8fa31ad8c6861486e9a8b16e7", "score": "0.57223165", "text": "def patch_security_policy_for_domain(domain_id, security_policy_id, security_policy, opts = {})\n patch_security_policy_for_domain_with_http_info(domain_id, security_policy_id, security_policy, opts)\n nil\n end", "title": "" }, { "docid": "6bcfd18e9be371f1ba6535d069354a06", "score": "0.5706429", "text": "def destroy\n @policy = Policy.find(params[:id])\n @policy.destroy\n\n respond_to do |format|\n format.html { redirect_to(policies_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "title": "" }, { "docid": "ab56497ba8d9ff5717d724ca1e635631", "score": "0.5690868", "text": "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cookie_securityprovider: \")\n end", "title": "" }, { "docid": "7127cadf89ebb92fa15d0c52a9282327", "score": "0.5679149", "text": "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7127cadf89ebb92fa15d0c52a9282327", "score": "0.5679149", "text": "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7127cadf89ebb92fa15d0c52a9282327", "score": "0.5679149", "text": "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7127cadf89ebb92fa15d0c52a9282327", "score": "0.5679149", "text": "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dcb389f44ed90aa930ae3c26308addec", "score": "0.5675495", "text": "def clear_policy\n %w[p g].each do |sec|\n next unless model.key? sec\n\n model[sec].each do |key, _ast|\n model[sec][key].policy = []\n end\n end\n end", "title": "" }, { "docid": "8363ce03623c4422aa51242f98a17e2c", "score": "0.56614375", "text": "def delete_group_policy(group_name, policy_name)\n request(\n 'Action' => 'DeleteGroupPolicy',\n 'GroupName' => group_name,\n 'PolicyName' => policy_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "title": "" }, { "docid": "fa6ac18c2a2988b35c1eef5c251ad14a", "score": "0.56600654", "text": "def destroy\n @privacy_policy = PrivacyPolicy.find(params[:id])\n @privacy_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to privacy_policies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5038b75c83ddd93efc34aa95304ab7e1", "score": "0.5644677", "text": "def destroy\n @penalty_policy = LatePolicy.find(params[:id])\n begin\n @penalty_policy.destroy\n rescue StandardError\n flash[:error] = 'This policy is in use and hence cannot be deleted.'\n end\n redirect_to controller: 'late_policies', action: 'index'\n end", "title": "" }, { "docid": "e6b8ef38980d3dadc73464716c16825e", "score": "0.56399643", "text": "def revise_security_policies_revise_0(domain_id, security_policy_id, security_policy, opts = {})\n data, _status_code, _headers = revise_security_policies_revise_0_with_http_info(domain_id, security_policy_id, security_policy, opts)\n data\n end", "title": "" }, { "docid": "9af72707b750f6f9d6ee44e0451c6143", "score": "0.5638048", "text": "def policy_sim_remove\n @edit = session[:edit]\n @explorer = @edit[:explorer]\n session[:policies].delete(params[:del_pol].to_i)\n policy_sim_build_screen\n replace_main_div(:partial => \"layouts/policy_sim\")\n end", "title": "" }, { "docid": "723e403d5ab430712438e78899c2539e", "score": "0.56236553", "text": "def destroy\n @pages_privacy_policy = Pages::PrivacyPolicy.find(params[:id])\n @pages_privacy_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_privacy_policies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "977687519d33aae7613fd802adb235de", "score": "0.56228894", "text": "def destroy\n @security = Security.find(params[:id])\n @security.destroy\n\n respond_to do |format|\n format.html { redirect_to securities_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "45c18eef32297124c614100dfee05611", "score": "0.562146", "text": "def destroy\n \t@privacy_policy.destroy\n \trespond_to do |format|\n \t\tformat.html { redirect_to privacy_policies_url, notice: 'Privacy Policy was successfully destroyed.' }\n \t\tformat.json { head :no_content }\n \tend\n end", "title": "" }, { "docid": "1ad019382066d523d9a4d20bcc4891bf", "score": "0.5621106", "text": "def destroy\n @penalty_policy = LatePolicy.find(params[:id])\n begin\n @penalty_policy.destroy\n rescue StandardError\n flash[:error] = \"This policy is in use and hence cannot be deleted.\"\n end\n redirect_to controller: 'late_policies', action: 'index'\n end", "title": "" }, { "docid": "95aa0fcc3b8dd7b24c3400450149cb0f", "score": "0.5609571", "text": "def destroy\n Puppet.debug(\"Calling securitypolicy_provider destroy method: \")\n # getting the authorization token for WAF.\n login_instance = Login.new\n auth_header = login_instance.get_auth_header\n security_policy_instance = SwaggerClient::SecurityPolicyApi.new\n # getting token end\n policyName=@resource[:name]\n Puppet.debug(\"WAF security policy name in manifest: #{policyName}\")\n data, status_code, headers = security_policy_instance.security_policies_policy_name_delete(auth_header,policyName,{})\n # We clear the hash here to stop flush from triggering.\n @property_hash.clear\n return data\nend", "title": "" }, { "docid": "e222dfa152de6a995813ba7191d847f0", "score": "0.55771536", "text": "def destroy\n @security.destroy\n respond_to do |format|\n format.html { redirect_to securities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f13fafc3c61fcfa21152e4864ee017dd", "score": "0.5560467", "text": "def delete_ids_security_policy_with_http_info(domain_id, policy_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy ...'\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy\"\n end\n # verify the required parameter 'policy_id' is set\n if @api_client.config.client_side_validation && policy_id.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_id' when calling PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy\"\n end\n # resource path\n local_var_path = '/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}'.sub('{' + 'domain-id' + '}', domain_id.to_s).sub('{' + 'policy-id' + '}', policy_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, 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: PolicySecurityEastWestSecurityDistributedIdsRulesApi#delete_ids_security_policy\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1219d8a2de15bc005ce4ed0f3805ab1d", "score": "0.5545055", "text": "def destroy\n @insurance_policy.destroy\n respond_to do |format|\n format.html { redirect_to insurance_policies_url, notice: 'Insurance policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1219d8a2de15bc005ce4ed0f3805ab1d", "score": "0.5545055", "text": "def destroy\n @insurance_policy.destroy\n respond_to do |format|\n format.html { redirect_to insurance_policies_url, notice: 'Insurance policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cdc8417cd1e24ba543bdac1179584ec6", "score": "0.5535822", "text": "def delete_access_policy(access_policy_uid)\n # checks if all required parameters are set\n \n raise ArgumentError, 'Missing required parameter \"access_policy_uid\"' if access_policy_uid.nil?\n \n\n op = NovacastSDK::Client::Operation.new '/access_policies/{access_policy_uid}', :DELETE\n\n # path parameters\n path_params = {}\n path_params['access_policy_uid'] = access_policy_uid\n op.params = path_params\n\n # header parameters\n header_params = {}\n op.headers = header_params\n\n # query parameters\n query_params = {}\n op.query = query_params\n\n # http body (model)\n \n\n \n # authentication requirement\n op.auths = [\n { name: 'accessKey', key: 'access_token', in_query: true }\n ]\n \n\n resp = call_api op\n\n \n NovacastSDK::EventV1::Models::AccessPolicy.from_json resp.body\n \n end", "title": "" }, { "docid": "69c1e318a2bda2b612e85d63128aa12d", "score": "0.55281925", "text": "def destroy\n @store_policy = Store::Policy.find(params[:id])\n @store_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to store_policies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be5da1194a02349a7c591549d0c0ea5a", "score": "0.55097586", "text": "def deletion_policy(deletion_policy = :unset_deletion_policy)\n return @deletion_policy if deletion_policy == :unset_deletion_policy\n\n @deletion_policy = deletion_policy\n end", "title": "" }, { "docid": "6653a4411c2a1d30d912b9145bdbd760", "score": "0.5496248", "text": "def security_policies_policy_name_delete_with_http_info(authorization, policy_name, _opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SecurityPolicyApi.security_policies_policy_name_delete ...'\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n raise ArgumentError, \"Missing the required parameter 'authorization' when calling SecurityPolicyApi.security_policies_policy_name_delete\"\n end\n # verify the required parameter 'policy_name' is set\n if @api_client.config.client_side_validation && policy_name.nil?\n raise ArgumentError, \"Missing the required parameter 'policy_name' when calling SecurityPolicyApi.security_policies_policy_name_delete\"\n end\n # resource path\n local_var_path = '/security-policies/{Policy Name}'.sub('{' + 'Policy Name' + '}', policy_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:Authorization] = authorization\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(:DELETE, 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: SecurityPolicyApi#security_policies_policy_name_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n [data, status_code, headers]\n end", "title": "" }, { "docid": "651f939334fc9fc3910c12605e366386", "score": "0.5480709", "text": "def remove_filtered_policy(sec, ptype, field_index, *field_values)\n return false unless model.key?(sec) && model[sec].include?(ptype)\n\n state = { tmp: [], res: false }\n model[sec][ptype].policy.each do |rule|\n state = filtered_rule(state, rule, field_values, field_index)\n end\n\n model[sec][ptype].policy = state[:tmp]\n state[:res]\n end", "title": "" }, { "docid": "e80f5ea51795a6dfa6ee08250b35e95a", "score": "0.547262", "text": "def destroy\n @policy.destroy?\n @employee.destroy\n head :no_content\n end", "title": "" }, { "docid": "ab2a59b5775a712d1a581a30a7f42d52", "score": "0.54540336", "text": "def destroy\n @role_policy.destroy\n respond_to do |format|\n format.html { redirect_to role_policies_url, notice: 'Role policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f54282a40a54b86dbf00612e09c42068", "score": "0.5452775", "text": "def delete_group_policy(group_name, policy_name)\n request_hash = { 'GroupName' => group_name,\n 'PolicyName' => policy_name }\n link = generate_request(\"DeleteGroupPolicy\", request_hash)\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n end", "title": "" }, { "docid": "3db334d920d932e7ba05e53cfaab3153", "score": "0.54514986", "text": "def remove_filtered_policy(sec, ptype, field_index, *field_values)\n return false unless model.remove_filtered_policy(sec, ptype, field_index, *field_values)\n\n make_persistent :remove_filtered_policy, sec, ptype, field_index, *field_values\n end", "title": "" }, { "docid": "8aeb48aebd584fa3859a71320bacb7a3", "score": "0.5449973", "text": "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_url_normalizationprovider: \")\n end", "title": "" }, { "docid": "3a096f63ba10bfccd9b15612913e75a4", "score": "0.5448696", "text": "def destroy\n @privacypolicy.destroy\n respond_to do |format|\n format.html { redirect_to privacypolicies_url, notice: 'Privacypolicy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a98bf7cc0a3104402087aec909e30acd", "score": "0.5443961", "text": "def delete_ids_security_policy_0_with_http_info(domain_id, policy_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy_0 ...'\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy_0\"\n end\n # verify the required parameter 'policy_id' is set\n if @api_client.config.client_side_validation && policy_id.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_id' when calling PolicySecurityEastWestSecurityDistributedIdsRulesApi.delete_ids_security_policy_0\"\n end\n # resource path\n local_var_path = '/global-infra/domains/{domain-id}/intrusion-service-policies/{policy-id}'.sub('{' + 'domain-id' + '}', domain_id.to_s).sub('{' + 'policy-id' + '}', policy_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, 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: PolicySecurityEastWestSecurityDistributedIdsRulesApi#delete_ids_security_policy_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "19a30ff6e58c8e7982bf856f3397e502", "score": "0.54398334", "text": "def delete_network_group_policy(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'group_policy_id' => options['group_policy_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/groupPolicies/{groupPolicyId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'groupPolicyId' => options['group_policy_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n end", "title": "" }, { "docid": "5fc8a85208e6ad277fa50fcec3833988", "score": "0.5427565", "text": "def patch_security_policy_for_domain_0(domain_id, security_policy_id, security_policy, opts = {})\n patch_security_policy_for_domain_0_with_http_info(domain_id, security_policy_id, security_policy, opts)\n nil\n end", "title": "" }, { "docid": "86545c7aa82fde0caf621b03bf41fb64", "score": "0.54241043", "text": "def delete_bios_policy(moid, opts = {})\n delete_bios_policy_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "76fb186cc0bd129287688429e6fafe99", "score": "0.54213995", "text": "def delete_dns_security_profile(profile_id, opts = {})\n delete_dns_security_profile_with_http_info(profile_id, opts)\n nil\n end", "title": "" }, { "docid": "f2304836cf8c2c83b870924805dca9c5", "score": "0.5410953", "text": "def remove_policy_rcd\n policy_rcd = File.join @target, 'usr', 'sbin', 'policy-rc.d'\n log.debug \"Removing Policy: #{policy_rcd}\"\n FileUtils.rm_f policy_rcd\n end", "title": "" }, { "docid": "56a7cd76aa2a94e6f340b39a311499bb", "score": "0.53562367", "text": "def delete_stale_policy!(serial_num, desired_policy)\n node = find_node(serial_num)\n if node && node[\"policy\"] && desired_policy.casecmp(node[\"policy\"][\"name\"]) != 0\n # Delete any pre-existing policy so that desired_policy can be added\n delete_node_policy(node)\n logger.info(\"Deleted stale policy and tags from server %s\" % serial_num)\n end\n end", "title": "" }, { "docid": "185b0784223983721ebd3992852814aa", "score": "0.53459334", "text": "def destroy\n @policy_attribute = PolicyAttribute.find(params[:id])\n @policy_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to policy_attributes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "341594c6fb33dc98de7cb811e2d17dad", "score": "0.534592", "text": "def delete_drop_policy(opts)\n opts = check_params(opts,[:drop_policies])\n super(opts)\n end", "title": "" }, { "docid": "2fcedfab50982a15efdb121e6f98cb51", "score": "0.5340125", "text": "def delete_network_switch_settings_qos_rule(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'qos_rule_id' => options['qos_rule_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/switch/settings/qosRules/{qosRuleId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'qosRuleId' => options['qos_rule_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n end", "title": "" }, { "docid": "e3e05ccd550176ca68f7fda06a428be6", "score": "0.53361666", "text": "def destroy\n @shorewallpolicy = Shorewallpolicy.find(params[:id])\n @shorewallpolicy.destroy\n\t\tredirect_to edit_host_path(@shorewallpolicy.host)\n\n end", "title": "" }, { "docid": "1d7ea5b0a2b4061fc02438853724938b", "score": "0.53320605", "text": "def delete_redirection_policy(domain_id, redirection_policy_id, opts = {})\n delete_redirection_policy_with_http_info(domain_id, redirection_policy_id, opts)\n nil\n end", "title": "" }, { "docid": "2ee32ba1ca2ae0db70f5e4ccf9eda16f", "score": "0.53125566", "text": "def delete_security_exclusion_using_delete(security_exclusion_id, opts = {})\n delete_security_exclusion_using_delete_with_http_info(security_exclusion_id, opts)\n nil\n end", "title": "" }, { "docid": "57d2b3081ef9cdbc2d9df0e8be11add6", "score": "0.5306223", "text": "def destroy\n @policy_detail.destroy\n respond_to do |format|\n format.html { redirect_to policy_details_url, notice: 'Policy detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e85b7eb4edf2a3836f60bad0140c9f1", "score": "0.52903", "text": "def delete_iam_ldap_policy(moid, opts = {})\n delete_iam_ldap_policy_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "b033ce52c866da92b57ce8ae19fc7b40", "score": "0.5275897", "text": "def remove_policies(rules)\n # stub method\n puts \"call add_named_policies rules = #{rules}\"\n end", "title": "" }, { "docid": "69081f48692467edd76891763c81213a", "score": "0.52734864", "text": "def delete_rule(*p)\n topic_name, subscription_name, rule_name = _rule_args(*p)\n\n delete_resource_entry(:rule, topic_name, subscription_name, rule_name)\n end", "title": "" }, { "docid": "a5d5162e83486149709df050b527399d", "score": "0.52621335", "text": "def delete_policy(policy_id, opts = {})\n data, _status_code, _headers = delete_policy_with_http_info(policy_id, opts)\n return data\n end", "title": "" }, { "docid": "9c3f1d64c210a61b3e0fdea55e0f90f3", "score": "0.5243853", "text": "def delete_segment_security_profile(segment_security_profile_id, opts = {})\n delete_segment_security_profile_with_http_info(segment_security_profile_id, opts)\n nil\n end", "title": "" }, { "docid": "3d5e5e7b5a0bbf3a84b31c471842a4e4", "score": "0.52376294", "text": "def security_policies_post(authorization, security_policy, opts = {})\n data, status_code, headers = security_policies_post_with_http_info(authorization, security_policy, opts)\n [data, status_code, headers]\n end", "title": "" }, { "docid": "8477df7671044c22262b00cac5dde534", "score": "0.52370906", "text": "def delete_vmedia_policy(moid, opts = {})\n delete_vmedia_policy_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "0612f0371141a6cc30a17b84a274212c", "score": "0.52359384", "text": "def destroy\n @store_policy.destroy\n respond_to do |format|\n format.html { redirect_to store_policies_url, notice: 'Store policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "493e41039f0959465fdaff86d442c21a", "score": "0.52296233", "text": "def delete(element)\n assignments.delete_if{ |assgn| assgn.include?(element) }\n links.delete_if{ |link| link.include?(element) }\n associations.delete_if { |_,assoc| assoc.include?(element) }\n policy_elements.delete(element)\n end", "title": "" } ]
6825256a1be89658fd419048a8f143e2
grid traversal methods we check the movements before mutating position so it's not jittery when rendered
[ { "docid": "24f5df6ce5399374706eb35c372f1765", "score": "0.0", "text": "def move_up\n current_y = position[0] - 1\n position[0] = (current_y < 0 ) ? (width-1) : current_y\n end", "title": "" } ]
[ { "docid": "cf58fd1826733dec89cccb8fa8254dce", "score": "0.6801285", "text": "def grid_move(new_grid_pos)\n @grid_pos = new_grid_pos\n @ori_x = original_x\n @ori_y = original_y\n self.battle_phase = :move\n end", "title": "" }, { "docid": "916d3565ac69ae696d386780fecd3d5c", "score": "0.66849923", "text": "def update_player_route\n @passed_positions ||= []\n @starting_position = [@selected_unit.x, @selected_unit.y]\n ### The cursor was located outside of the highlighted tiles\n if @outside_of_range\n @outside_of_range = false\n # The cursor moves back into the range, and over a spot where arrow was drawn\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n # It found the spot where the arrow was drawn\n if result\n @passed_positions = @passed_positions[0, result+1]\n # If moved back into range and over the unit's location\n elsif [cursor.x,cursor.y] == [@selected_unit.x, @selected_unit.y]\n @passed_positions = []\n # If the cursor moves back into range but not where an arrow was drawn\n elsif @positions[cursor.x][cursor.y].is_a?(MoveTile)\n # See if can extend current path to here\n added_path = extend_path(@selected_unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@selected_unit.x][@selected_unit.y],\n @positions[cursor.x][cursor.y])\n end\n # Did not move back in range; still outside \n else\n @outside_of_range = true\n end\n \n \n else\n ### If position player moves over was already passed over\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n if result\n @passed_positions = @passed_positions[0, result+1]\n ### If position is outside of available positions...\n elsif !@positions[cursor.x][cursor.y].is_a?(MoveTile)\n # Activate switch to tell game player is out of move range\n @outside_of_range = true\n ### If the cursor is anywhere in the range EXCEPT on the selected unit\n elsif [cursor.x,cursor.y] != [@selected_unit.x, @selected_unit.y]\n # See if can extend current path to here\n added_path = extend_path(@selected_unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@selected_unit.x][@selected_unit.y],\n @positions[cursor.x][cursor.y])\n end\n ### Else player is back to the unit's position\n else\n # Reset all stored values (starting fresh)\n @passed_positions = []\n end\n end\n draw_route unless @outside_of_range\n end", "title": "" }, { "docid": "7f3f4186c44a0e45ff19955adf7ef187", "score": "0.6622064", "text": "def move\n # Choose a random cell\n # JAVI: Extend this part of the method to choose cell with lower number of surveys (on average)\n cell = cells_around(@loc).rand\n \n # possibly a good location\n # first look ahead \n if !touches_path? cell, @path, @loc \n \n # do 1 more look ahead for each further possible step to avoid this:\n #\n # . . . . .\n # v < < . .\n # v . ^ . .\n # v . ^ < .\n # v . x o .\n # v x ? x .\n # > > ^ . .\n # . . . . . \n #\n # ^v<> = path\n # o = start\n # ? = possible good looking next move\n # x = shows that this is a dead end. All further steps are not allowed.\n #\n # Therefore, if any further step from cell is possible, then we're good to go\n \n # Configure future\n future_path = @path.dup\n future_path << cell\n second_steps = cells_around(cell)\n \n # If at least one of the future steps is valid, go for it\n second_steps.each do |ss|\n if !touches_path? ss, future_path, cell\n @path << cell\n @loc = cell\n @distance -= 1 \n return true\n end\n end \n end \n \n Rails.logger.debug \"*****************\"\n Rails.logger.debug \"Location: #{@loc.to_s}, New move: #{cell.to_s}.\"\n Rails.logger.debug \"Path: #{@path.to_s}\" \n \n false \n #cells = Cell.all :conditions => \"(x = #{@x-1} AND y = #{@y}) OR (x = #{@x+1} AND y = #{@y}) OR (x = #{@x} AND y = #{@y-1}) OR (x = #{@x} AND y = #{@y+1})\",\n # :order => \"positive_count + negative_count ASC\"\n \n # if all the cells have already been surveyed, weight index to those with few surveys \n #if cells.size == 4\n # i = rand(3)\n # i = (i - (i * 0.1)).floor \n # @x = cells[i].x\n # @y = cells[i].y\n # return\n #end\n \n # if there are empty cells, make a new cell where there's a gap and use that \n #[@x, @y-1] *<-- ALWAYS GOING DOWN\n #existing_cells = cells.map {|c| [c.x, c.y]}\n #survey_cell = (possible_cells - existing_cells).rand\n end", "title": "" }, { "docid": "13abc20f64a37648e3440664a6ac173d", "score": "0.6601523", "text": "def walk(grid, x, y)\n [N, S, E, W].shuffle.each do |dir|\n nx, ny = x + DX[dir], y + DY[dir]\n if nx >= 0 && ny >= 0 && ny < grid.length && nx < grid[ny].length && grid[ny][nx] == 0\n grid[y][x] |= dir\n grid[ny][nx] |= OPPOSITE[dir]\n \n return [nx, ny]\n end\n end\n \n nil\nend", "title": "" }, { "docid": "d8804a04150a98f3682939e1baf94bef", "score": "0.65718263", "text": "def obstructed?(current_pos,other_pos,board)\n # debugger\n tester = other_pos\n # puts tester\n # sleep 2\n\n #\n # (-1..1).each do |i|\n # (-1..1).each do |j|\n\n\n if other_pos[0] > current_pos[0] #New position is below us\n if other_pos[1] > current_pos[1] #new position is on our right--bishop move\n tester[0] -= 1\n tester[1] -= 1\n until tester == current_pos\n # puts board.grid[tester[0]][tester[1]]\n # puts !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # sleep 2\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # return false if the piece at tester is not a nul piece\n tester[0] -= 1\n tester[1] -= 1\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] -= 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n elsif other_pos[1] == current_pos[1] #new position is on our level horizontally\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n elsif other_pos[0] < current_pos[0] #New position is above us\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[0] += 1\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] += 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n else #new position is on our level horizontally\n until tester == current_pos\n tester[0] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n else #new position is at our level vertically\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n end\n end\n\n return false if board.grid[other_pos[0]][other_pos[1]].color == self.color\n # puts \"hello\"\n # sleep(2)\n true\n\n end", "title": "" }, { "docid": "1b5459a7e4735680070d9ec04ba6f473", "score": "0.6552661", "text": "def update_player_route\n #@passed_positions = []\n ### The cursor was located outside of the highlighted tiles\n if @outside_of_range\n @outside_of_range = false\n # The cursor moves back into the range, and over a spot where arrow was drawn\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n # It found the spot where the arrow was drawn\n if result\n @passed_positions = @passed_positions[0, result+1]\n # If moved back into range and over the unit's location\n elsif [cursor.x,cursor.y] == [@unit.x, @unit.y]\n @passed_positions = []\n # If the cursor moves back into range but not where an arrow was drawn\n elsif @positions[cursor.x][cursor.y].is_a?(MoveTile)\n # See if can extend current path to here\n added_path = extend_path(@unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@unit.x][@unit.y],\n @positions[cursor.x][cursor.y])\n end\n # Did not move back in range; still outside \n else\n @outside_of_range = true\n end\n \n \n else\n ### If position player moves over was already passed over\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n if result\n @passed_positions = @passed_positions[0, result+1]\n ### If position is outside of available positions...\n elsif !@positions[cursor.x][cursor.y].is_a?(MoveTile)\n # Activate switch to tell game player is out of move range\n @outside_of_range = true\n ### If the cursor is anywhere in the range EXCEPT on the selected unit\n elsif [cursor.x,cursor.y] != [@unit.x, @unit.y]\n # See if can extend current path to here\n added_path = extend_path(@unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@unit.x][@unit.y],\n @positions[cursor.x][cursor.y])\n end\n ### Else player is back to the unit's position\n else\n # Reset all stored values (starting fresh)\n @passed_positions = []\n end\n end\n draw_route unless @outside_of_range\n end", "title": "" }, { "docid": "8bdca3466ac826d9ea27fc578d975f64", "score": "0.6422763", "text": "def assignGrid grid\n @grid = grid\n\n #if starting point of rover is at an obstacle, move rover over till hit free spot\n if @grid.obstacles.include?(@currentPos)\n print \"Grid has obstacle at rover starting position. Landed rover at (\"\n\n loop do\n moveForward\n break if !@grid.obstacles.include?(@currentPos)\n end\n\n print \"#{@currentPos.x}, #{@currentPos.y}) instead\\n\"\n end\n end", "title": "" }, { "docid": "37160c8e85af5f231f18fc03aa41106c", "score": "0.6405125", "text": "def next_move\n return false if @n.zero? && @grid.empty?\n show_path\n end", "title": "" }, { "docid": "71295781463ff72bbd522c47203f30ed", "score": "0.63601613", "text": "def build_next_moves current_node\n cur_pos = current_node.value \n\n (0...8).each do |col|\n (0...8).each do |row|\n next_pos = [col, row] \n if valid_move?(cur_pos,next_pos)\n current_node.add_child(PolyTreeNode.new(next_pos))\n @all_positions[next_pos] = true \n end\n end\n end\n end", "title": "" }, { "docid": "60e4867d494cb7b1ce381d2b683296e1", "score": "0.63450456", "text": "def move_if_needed\n positions.each {|dir, pos|\n t = tile_at(pos)\n if t\n @direction, @position = directions.invert[dir], pos\n # Update the image so that the user actually sees the bug\n # turning if it did.\n update_image\n t.on\n return true\n end\n }\n return false\n end", "title": "" }, { "docid": "bf976eca23ef025a2c305435339532fd", "score": "0.63034755", "text": "def update\n update_grid = Array.new(@grid_height) { Array.new(@grid_width, 0) }\n update_grid.each_index do |row|\n update_grid[row].each_index do |col|\n num_neighbours = get_num_neighbours col, row\n if (@grid[row][col] == 1 && num_neighbours.between?(2, 3)) ||\n (@grid[row][col] == 0 && num_neighbours == 3)\n update_grid[row][col] = 1\n end\n end\n end\n @grid = update_grid\n end", "title": "" }, { "docid": "9bd0eb234169c6992c09c73aeee67b9d", "score": "0.628889", "text": "def nextMove(n,r,c,grid)\n return false if n == 0 && grid.empty?\n\n bot_position = getBotPosition(n, grid)\n princess_position = findPrincessPosition(n, grid)\n\n bot = bot_position.flatten!\n princess = princess_position.flatten!\n\n return false unless bot[0] == r\n if bot[0] < princess[0]\n puts 'DOWN'\n elsif bot[0] > princess[0]\n puts 'UP'\n elsif bot[1] > princess[1]\n puts 'LEFT'\n elsif bot[1] < princess[1]\n puts 'RIGHT'\n end\nend", "title": "" }, { "docid": "64bc307b64d21703ca66037b245506f9", "score": "0.62881935", "text": "def process_movement\n # Delete the graphics associated to moving\n @ranges.each{|tile| tile.visible = false}\n @ranges = []\n @arrow_path.each{|a| a.dispose}\n @arrow_path = []\n # Move the cursor back to the selected unit\n proc = Proc.new{@selected_unit.selected = false\n @show_move = false\n @selected_unit.sprite.move(@passed_positions)\n @selected_unit.stop_capture if @passed_positions.size != 0}\n cursor.add_move_action(@selected_unit.x, @selected_unit.y, proc)\n # go to phase 3\n @phase = 3\n end", "title": "" }, { "docid": "a10e48c6e7265b9793db653193cf3ed1", "score": "0.62796676", "text": "def next_move(_n, bot_pos_x, bot_pos_y, princess_position, _grid)\n case\n when princess_position[0] - bot_pos_x < 0 then move = 'UP'\n when princess_position[0] - bot_pos_x > 0 then move = 'DOWN'\n when princess_position[1] - bot_pos_y < 0 then move = 'LEFT'\n when princess_position[1] - bot_pos_y > 0 then move = 'RIGHT'\n end\n move\n end", "title": "" }, { "docid": "982759c8fafd5dea82f99646ddac94a4", "score": "0.62777036", "text": "def update_view\n end_offsets = []\n color_sign = ((@color == :black) ? -1 : 1)\n \n end_offsets = []\n \n @legal_moves = end_offsets\n if color == :black\n if @coordinates.first == 6\n end_offsets << [5, @coordinates.last]\n end_offsets << [4, @coordinates.last]\n else\n end_offsets << [@coordinates.first + color_sign, @coordinates.last] unless @board.tiles[@coordinates.first + color_sign, @coordinates.last] \n end\n else\n if @coordinates.first == 1\n end_offsets << [2, @coordinates.last]\n end_offsets << [3, @coordinates.last]\n else\n end_offsets << [@coordinates.first + color_sign, @coordinates.last] unless @board.tiles[@coordinates.first + color_sign, @coordinates.last]\n end\n end\n # p \"updateview\"\n # p @board\n # p @coordinates.last + 1\n # # p @board.tiles[1,0]\n # p @board.tiles[@coordinates.first - 1][@coordinates.last + 1]\n \n if inside_bounds?([@coordinates.first + color_sign, @coordinates.last - 1])\n left_corner = @board.tiles[@coordinates.first + color_sign][@coordinates.last - 1]\n if (!left_corner.nil? && left_corner.color != color)\n end_offsets << left_corner.coordinates\n end\n end\n\n if inside_bounds?([@coordinates.first + color_sign, @coordinates.last + 1])\n # p [@coordinates.first + color_sign, @coordinates.last + 1]\n # if !@board.tiles[@coordinates.first + color_sign, @coordinates.last + 1].nil?\n \n # p \"right corner: #{@board.tiles[@coordinates.first + color_sign][@coordinates.last + 1]}\"\n right_corner = @board.tiles[@coordinates.first + color_sign][@coordinates.last + 1]\n if (!right_corner.nil? && right_corner.color != color)\n end_offsets << right_corner.coordinates\n end\n end\n @legal_moves = end_offsets\n \n end", "title": "" }, { "docid": "fdd284972b7e7aa59c3acc6652503be9", "score": "0.62511903", "text": "def update_smooth_movements\n return unless @start_move\n update_smooth_x\n update_smooth_y\n check_move_end\n end", "title": "" }, { "docid": "6b3f76ae954a62cab7f536c1903f3d86", "score": "0.6206879", "text": "def update_grid_for_moved_entity(entity, old_x, old_y)\n cells_before = cells_overlapping(old_x, old_y)\n cells_after = cells_overlapping(entity.x, entity.y)\n\n (cells_before - cells_after).each do |s|\n raise \"#{entity} not where expected\" unless s.delete? entity\n end\n (cells_after - cells_before).each {|s| s << entity }\n end", "title": "" }, { "docid": "3c474e99e6f0261182dc8051f01ad79c", "score": "0.61855626", "text": "def do_x_move\n puts \"doing x move from #{@pos.inspect}\"\n along_1 = [@pos[0], @pos[1] + @y_move]\n # in the right column or direct move impassable\n if @y_moved == @y_dist or impassable?(along_1)\n #move up or down\n if @go_up\n if passable?(up_1)\n move_up\n elsif passable?(down_1)\n move_down\n else\n if at_dead_end?(@pos)\n do_dead_end_move\n else\n do_y_move\n end\n end\n else\n if passable?(down_1)\n move_down\n elsif passable?(up_1)\n move_up\n else\n if at_dead_end?(@pos)\n do_dead_end_move\n else\n do_y_move\n end\n end\n end\n else\n if passable?(along_1)\n @x_moved += @x_move\n @pos = along_1\n @visited << @pos\n @moved += 1\n else\n do_y_move\n end\n end\n end", "title": "" }, { "docid": "5d69ea4a658cb6e3a5a6c3f07a59357a", "score": "0.6174375", "text": "def move_valid?(x, y)\n (0...@columns).cover?(x) && (0...@rows).cover?(y) && !@visited[x][y]\n end", "title": "" }, { "docid": "15598f3592c5bbffaf7f9c78d86f3ca3", "score": "0.61556566", "text": "def move_by_velocity_if_valid\n # Consider refactoring Display to be in instance of an object instead of a static class\n return [] if velocity == [0,0]\n head = @positions.first\n tail = @positions.last\n new_y = velocity.first + head.first\n new_x = velocity.last + head.last\n\n tile_traversable = Display.instance_variable_get(:@tiles)[new_y][new_x].traversable\n collision_with_tail = @positions.include? [new_y, new_x]\n\n if tile_traversable && !collision_with_tail\n Display.draw tail.first, tail.last, ' '\n @positions.unshift [ new_y, new_x]\n Display.draw @positions.first.first, @positions.first.last, char\n return @positions.pop\n end\n\n return false\n end", "title": "" }, { "docid": "9fd8375209b7aaf6c3d61965499a28a7", "score": "0.61547726", "text": "def moves\n # All pieces can stay in place\n [[0,0]]\n end", "title": "" }, { "docid": "e0f1b031782cbcec4766cab4162a704b", "score": "0.6152892", "text": "def update_move\n update_last_coordinate\n @point.update_move\n update_placement\n move_animation(diff_x, diff_y)\n end", "title": "" }, { "docid": "043b9cdf78b28d1d387b685d145b11e2", "score": "0.6134933", "text": "def process_moving_entity(entity)\n unless @registry[entity.registry_id]\n puts \"#{entity} not in registry yet, no move to process\"\n yield\n return\n end\n\n before_x, before_y = entity.x, entity.y\n\n yield\n\n if moved = (entity.x != before_x || entity.y != before_y)\n update_grid_for_moved_entity(entity, before_x, before_y)\n # Note: Maybe we should only wake entities in either set\n # and not both. For now we'll wake them all\n (\n entities_bordering_entity_at(before_x, before_y) +\n entities_bordering_entity_at(entity.x, entity.y)\n ).each(&:wake!)\n end\n\n moved\n end", "title": "" }, { "docid": "a4faf6fba6a108734a9e1740fe349fb0", "score": "0.6130433", "text": "def update_move\n self.x = screen_x\n self.y = screen_y\n update_move_arch if @type == Arched\n end", "title": "" }, { "docid": "7a1ada533fa81f348f046fc62ab5acfd", "score": "0.61179686", "text": "def move(position, curr_player, other_player, path = 0)\n posibles = []\n \n #add [2,0]\n other = false\n curr = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] + 2, position[1]] || piece.position == [position[0] + 1, position[1]]\n other = true\n end\n end\n curr_player.pieces.each do |piece|\n if piece.position == [position[0] + 2, position[1]] || piece.position == [position[0] + 1, position[1]]\n curr = true\n end\n end\n if (!other && !curr) && @path == 0\n posibles << [2, 0]\n end\n \n #add [1,0]\n other = false\n curr = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] + 1, position[1]]\n other = true\n end\n end\n curr_player.pieces.each do |piece|\n if piece.position == [position[0] + 1, position[1]]\n curr = true\n end\n end\n if !other && !curr\n posibles << [1, 0]\n end\n \n #add [1, -1]\n other = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] + 1, position[1] - 1]\n other = true\n end\n end\n if other\n posibles << [1, -1]\n end\n \n #add [1,1]\n other = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] + 1, position[1] + 1]\n other = true\n end\n end\n if other\n posibles << [1, 1]\n end\n select_moves(position, posibles)\n end", "title": "" }, { "docid": "282a7466272621aa9aaebde92e4c02e7", "score": "0.61030704", "text": "def choppy_movement_tb\n @tb_grid_mv = @tb_grid_mv == 3 ? 0 : @tb_grid_mv + 1\n if TactBattleManager.tact_battle? && @tb_grid_mv == 2 \n Sound.play_cursor if Input.dir4 > 0 && @x == @real_x && @y == @real_y\n mv_by_input_tb_mod\n end\n end", "title": "" }, { "docid": "36f4fd387f05a400872513120d3862f7", "score": "0.60892713", "text": "def tick\n # Make the movement\n self.position = position.moved_in(direction)\n\n # Change direction\n lookup_result = Cart.direction_lookup[[direction, grid[position]]]\n self.direction = lookup_result unless lookup_result.nil?\n\n # Handle intersections\n if grid[position] == '+'\n case next_intersection_action\n when :turn_left\n self.next_intersection_action = :straight\n self.direction = {\n up: :left, left: :down, down: :right, right: :up\n }[self.direction]\n\n when :straight\n self.next_intersection_action = :turn_right\n\n when :turn_right\n self.next_intersection_action = :turn_left\n self.direction = {\n up: :right, right: :down, down: :left, left: :up\n }[self.direction]\n end\n end\n end", "title": "" }, { "docid": "73f16253c8af4c71711b45f83d368361", "score": "0.6055798", "text": "def mutate\n # Creates a deep copy of the grid to examine without issue\n copy = JSON.parse(JSON.generate(@grid))\n \n # Using neighbors instead of num_neighbors to avoid a potential\n # naming conflict with get_neighbors' num_neighbors\n neighbors = 0\n \n # Uses copy as a function to update the grid\n # Note: the state of copy does not change\n for i in 0..@height-1\n for j in 0..@width-1\n neighbors = get_neighbors(i, j, copy)\n if copy[i][j] == LIVE\n if neighbors < 2 or neighbors > 3\n # Cell dies\n @grid[i][j] = DEAD\n else\n # Cell stays alive\n @grid[i][j] = LIVE\n end\n elsif copy[i][j] == DEAD\n if neighbors == 3\n # Cell comes back to life\n @grid[i][j] = LIVE\n end\n end\n end\n end\n end", "title": "" }, { "docid": "22f7e42e80ed47a90b3e30fa27376d33", "score": "0.60496336", "text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "title": "" }, { "docid": "22f7e42e80ed47a90b3e30fa27376d33", "score": "0.60496336", "text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "title": "" }, { "docid": "d5b5a17e034396b05e2949a6f9975c82", "score": "0.60463303", "text": "def valid_move?(current_obj, next_obj, current_cell, test_cell)\n cc_row = current_cell[0]\n cc_col = current_cell[1]\n tc_row = test_cell[0]\n tc_col = test_cell[1]\n\n next_obj == current_obj &&\n cc_row == tc_row - 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row - 1 && cc_col == tc_col || \\\n cc_row == tc_row - 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col || \\\n cc_row == tc_row + 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row && cc_col == tc_col - 1 \n end", "title": "" }, { "docid": "086e35cb3e58b6c5da89deea101185d6", "score": "0.60404164", "text": "def valid_move?(new_x, new_y)\n true\n end", "title": "" }, { "docid": "ddb609b8a006b3db18993efbea6819fb", "score": "0.6024869", "text": "def move_valid?(x, y)\n (0...@width).cover?(x) && (0...@height).cover?(y) && !@visited[x][y]\n end", "title": "" }, { "docid": "25e6fbfe8e351e405359975aeb1cf8bc", "score": "0.60087085", "text": "def process_pathfinding_movement\n return clear_pathfinding_moves if trigger_movement_key?\n return clear_pathfinding_moves if @pathfinding_goal && adjacent?(@pathfinding_goal.x, @pathfinding_goal.y)\n return if moving?\n return unless @pathfinding_moves.size > 0 && @move_poll.empty?\n @move_poll << @pathfinding_moves.shift\n @followers.move if self.is_a?(Game_Player)\n interpret_move\n end", "title": "" }, { "docid": "6f6dee8785304cc16cde77c0352b6782", "score": "0.5999631", "text": "def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n if !moved && sleep_now?\n puts \"#{self} going to sleep...\"\n @moving = false\n end\n end", "title": "" }, { "docid": "a7dccca0ea01c05cd6ee81891c6cd54b", "score": "0.5999017", "text": "def grid_modified!\n end", "title": "" }, { "docid": "aa28b008a23a57f4075ed5513d88fd9d", "score": "0.5993574", "text": "def drag_to_order_internal( dimension, items, positions )\n if items.length == 1\n return true\n end\n\n while true\n current=$driver.find_element( items[0][0].to_sym, items[0][1] )\n\n current_loc = current.location.send( dimension )\n jitter = 0\n if dimension == :x\n jitter = current.size.width\n else\n jitter = current.size.height\n end\n\n diff = positions[0] - current_loc\n\n $debug and print \"In drag_to_order_internal: current: #{current}\\n\"\n $debug and print \"In drag_to_order_internal: d0: #{positions[0]}\\n\"\n $debug and print \"In drag_to_order_internal: current_loc: #{current_loc}\\n\"\n $debug and print \"In drag_to_order_internal:diff : #{diff}\\n\"\n\n # Increase the absolute value of diff slightly, and keep the\n # sign\n fixed_diff = diff != 0 ? ((diff.abs + jitter - 1) * (diff/diff.abs)) : 0\n if diff.abs > jitter\n x = 0\n y = 0\n if dimension == :x\n x = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n if dimension == :y\n y = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n\n hover_and_move_slow( items[0][0].to_sym, items[0][1], x, y )\n else\n break\n end\n end\n\n drag_to_order_internal( dimension, items[1..-1], positions[1..-1] )\n end", "title": "" }, { "docid": "e669dfde2042dc5aba8c37aaf4b8a84b", "score": "0.59837234", "text": "def explore\n rover_bay.each do |r|\n if pass_path_check?(r)\n move(r)\n else\n raise \"There is a collision\\nin placement #{r.coordinate.inspect}, please revise instruction set #{r.command.inspect}\"\n end\n end\n end", "title": "" }, { "docid": "0bc6570fddac7f44034bffc2457038a3", "score": "0.5979745", "text": "def need_update(member)\n return false if (member.x == @x and member.y == @y) \n return false if player_distance(member) and not @start_moving\n return false if @move_update.empty?\n @start_moving = true\n if @move_update[0] == 'move_left'\n return false if (member.x + 1 == @x and member.y == @y)\n elsif @move_update[0] == 'move_right'\n return false if (member.x - 1 == @x and member.y == @y)\n elsif @move_update[0] == 'move_up'\n return false if (member.y + 1 == @y and member.x == @x)\n elsif @move_update[0] == 'move_down'\n return false if (member.y - 1 == @y and member.x == @x)\n elsif @move_update[0] == 'move_upper_left'\n return false if (member.x + 1 == @x and member.y + 1 == @y)\n elsif @move_update[0] == 'move_upper_right'\n return false if (member.x - 1 == @x and member.y + 1 == @y)\n elsif @move_update[0] == 'move_lower_left'\n return false if (member.x + 1 == @x and member.y - 1 == @y)\n elsif @move_update[0] == 'move_lower_right'\n return false if (member.x - 1 == @x and member.y - 1 == @y)\n end\n return true\n end", "title": "" }, { "docid": "319f09bfbef77d0aba19614b06f99951", "score": "0.5976051", "text": "def move2(position, curr_player, other_player, path = 0)\n posibles = []\n \n #add [-2,0]\n other = false\n curr = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] - 2, position[1]] || piece.position == [position[0] - 1, position[1]]\n other = true\n end\n end\n curr_player.pieces.each do |piece|\n if piece.position == [position[0] - 2, position[1]] || piece.position == [position[0] - 1, position[1]]\n curr = true\n end\n end\n if (!other && !curr) && @path == 0\n posibles << [-2, 0]\n end\n \n #add [-1,0]\n other = false\n curr = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] - 1, position[1]]\n other = true\n end\n end\n curr_player.pieces.each do |piece|\n if piece.position == [position[0] - 1, position[1]]\n curr = true\n end\n end\n if !other && !curr\n posibles << [-1, 0]\n end\n \n #add [-1,1]\n other = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] - 1, position[1] + 1]\n other = true\n end\n end\n if other\n posibles << [-1, 1]\n end\n \n #add [-1, -1]\n other = false\n other_player.pieces.each do |piece|\n if piece.position == [position[0] - 1, position[1] - 1]\n other = true\n end\n end\n if other\n posibles << [-1, -1]\n end\n select_moves(position, posibles)\n end", "title": "" }, { "docid": "7562605a0a38c4fbd47b53f9b52f506d", "score": "0.5971122", "text": "def render_grid\n\t\t@grid_w.times.with_index do |x|\n\t\t\t@grid_h.times.with_index do |y|\n\t\t\t\tif !@has_enviroment_rendered\n \t \t\trender_wall x, y if @grid[x][y]==1\n\t\t\t\tend\n\t\t \trender_player x, y if @grid[x][y]==2\n \tend\n end\n #each_cell do |x, y, v|\n # render_wall x, y if !@has_environment_rendered && v == 1 \n # render_player x, y if v == 2\n #end\n\t\t@has_enviroment_rendered = true\n\tend", "title": "" }, { "docid": "59fd69413cc25a67fb50d7ab8169c57c", "score": "0.5970242", "text": "def move\n if @vect_acc > 0 || @vect_acc < 0\n if (@vect_acc > 0 && @vect_v < @max_v) || (@vect_acc < 0 && @vect_v > @max_v)\n @vect_v += @vect_acc\n else\n @vect_v = @max_v\n @vect_acc = 0\n end\n end\n vel_x = Gosu.offset_x(@vect_angle, @vect_v)\n vel_y = Gosu.offset_y(@vect_angle, @vect_v)\n can_move_x = true\n can_move_y = true\n new_hitbox = HitBox.new(@hb.x+vel_x, @hb.y, @hb.w, @hb.h)\n $WINDOW.current_map.solid_tiles.each do |tile|\n if tile.hb.check_brute_collision(new_hitbox)\n can_move_x = false\n end\n end\n\n new_hitbox = HitBox.new(@hb.x, @hb.y+vel_y, @hb.w, @hb.h)\n $WINDOW.current_map.solid_tiles.each do |tile|\n if tile.hb.check_brute_collision(new_hitbox)\n can_move_y = false\n end\n end\n\n @hb.y += vel_y if can_move_x || @floater\n @hb.x += vel_x if can_move_y || @floater\n end", "title": "" }, { "docid": "1ab763a20133af9ab264eec7ce57b77a", "score": "0.595708", "text": "def vertical_move\n @initial_pos[0] == @final_pos[0] \n end", "title": "" }, { "docid": "26266ffb7d80510cca08bbb23d392623", "score": "0.59520906", "text": "def moving?; @moving; end", "title": "" }, { "docid": "26266ffb7d80510cca08bbb23d392623", "score": "0.59520906", "text": "def moving?; @moving; end", "title": "" }, { "docid": "0be300ae951def0cfbe1dd133d3d2c94", "score": "0.5951377", "text": "def move\n\t\tunless @y >= 0 then\n\t\t\t@y += 1\n\t\tend\n\t\tif @x_total <= 150 and @y_total <= 150 then\n\t\t\t@x += 1\n\t\t\t@y += 1\n\t\t\t@x_total +=1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 150 and @y_total > 150 and @x_total < 300 and @y_total < 300 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 298 and @y_total > 298 and @x_total < 450 and @y_total < 450 then\n\t\t\t@y +=1\n\t\t\t@x -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 448 and @y_total > 448 and @x_total < 600 and @y_total < 600 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total == 599 and @y_total == 599 then\n\t\t\t@x_total = @y_total = 0\n\t\tend\n\tend", "title": "" }, { "docid": "96b64fcf6ca107f5650a5b0a9816dd11", "score": "0.5946995", "text": "def moves\n # overridden in slideable/stepable modules\n end", "title": "" }, { "docid": "55bf813474d61f63c9bdb01acdda5fa1", "score": "0.59467024", "text": "def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n @moving = false if !moved && sleep_now?\n\n moved\n end", "title": "" }, { "docid": "a1441dcceaca4443d849441b52b6ba3b", "score": "0.59404397", "text": "def new_move_positions(node)\n new_moves = KnightPathFinder.valid_moves(node.value).reject {|move| @visited_positions.include? move}\n new_moves.each {|move| @visited_positions << move}\n new_moves\n end", "title": "" }, { "docid": "9f0fc50b3526defea6092ee819ac8749", "score": "0.5937462", "text": "def movement(row1, col1, board)\n\n possible_moves=Array.new\n if @color==\"white\"\n # checking square in front\n if row1+1<8 && board.get_square(row1+1,col1).occupied==false\n possible_moves <<[row1+1,col1]\n\n #checking 2 squares forward\n if @position==\"initial\" && !board.get_square(row1+2,col1).occupied\n possible_moves <<[row1+2,col1]\n end\n end\n\n # checking attacking squares\n if row1+1<8 && col1-1>=0\n atk_sq1 = board.get_square(row1+1,col1-1)\n\n if atk_sq1.occupied && atk_sq1.piece.color != @color || !atk_sq1.occupied && atk_sq1.en_passanted\n possible_moves <<[row1+1,col1-1]\n end\n end\n if row1+1<8 && col1+1<8\n atk_sq2 = board.get_square(row1+1,col1+1)\n if atk_sq2.occupied && atk_sq2.piece.color != @color || !atk_sq2.occupied && atk_sq2.en_passanted\n possible_moves <<[row1+1,col1+1]\n end\n end\n\n elsif @color==\"black\"\n # checking square in front\n if row1-1>=0 && board.get_square(row1-1,col1).occupied==false\n possible_moves <<[row1-1,col1]\n\n # checking for 2 squares forward\n if @position==\"initial\" && board.get_square(row1-2,col1).occupied==false\n possible_moves <<[row1-2,col1]\n end\n end\n\n # checking attacking squares\n if row1-1>=0 && col1-1>=0\n atk_sq1 = board.get_square(row1-1,col1-1)\n if (atk_sq1.occupied && atk_sq1.piece.color != @color) || (!atk_sq1.occupied && atk_sq1.en_passanted)\n possible_moves <<[row1-1,col1-1]\n end\n end\n if row1-1>=0 && col1+1<8\n atk_sq2 = board.get_square(row1-1,col1+1)\n if (atk_sq2.occupied && atk_sq2.piece.color != @color) || (!atk_sq2.occupied && atk_sq2.en_passanted)\n possible_moves <<[row1-1,col1+1]\n end\n end\n end\n\n #removing moves that go off the board\n possible_moves = possible_moves.select do |a|\n a[0]>=0 && a[0]<8 && a[1]>=0 && a[1]<8\n end\n\n return possible_moves\n\n end", "title": "" }, { "docid": "ab6b87d439d2ac15bdfbf3aebcff6da0", "score": "0.5936758", "text": "def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end", "title": "" }, { "docid": "af259b7c6a55457dc4f812e24b510b6c", "score": "0.5934358", "text": "def grow_unblocked_moves_in_dir(dx,dy)\n start_x, start_y = self.pos\n #start for rook white === [7,0]\n # [6,0]\n # [5,0]\n # [4,0]\n # [3,0]\n # [2,0]\n\n dx = -1 #first iteration UP\n dy = 0\n\n\n 1.step do |i|\n start_x += dx\n start_y += dy\n if self.board.rows[start_x][start_y].empty? #[6,0]\n\n end\n # create an array to collect moves\n\n # get the piece's current row and current column\n\n\n # in a loop:\n # continually increment the piece's current row and current column to \n # generate a new position\n # stop looping if the new position is invalid (not on the board); the piece \n # can't move in this direction\n # if the new position is empty, the piece can move here, so add the new \n # position to the moves array\n # if the new position is occupied with a piece of the opposite color, the \n # piece can move here (to capture the opposing piece), so add the new \n # position to the moves array\n # but, the piece cannot continue to move past this piece, so stop looping\n # if the new position is occupied with a piece of the same color, stop looping\n\n # return the final moves array\n end\n \nend", "title": "" }, { "docid": "8d4361ce836ef8f6e7c86674d799b0d8", "score": "0.59201056", "text": "def update_move\n return unless @moving\n \n grad = direction(@destx,@desty,self.x,self.y)\n \n if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0\n self.x += Math.cos(grad).abs * @move_speed if self.x < @destx\n self.y += Math.sin(grad).abs * @move_speed if self.y < @desty\n self.x -= Math.cos(grad).abs * @move_speed if self.x > @destx\n self.y -= Math.sin(grad).abs * @move_speed if self.y > @desty\n \n @move_old = Graphics.frame_count\n end\n if @move_speed > 0 # Check if sprite can't reach that point\n self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and\n (@destx - self.x).abs <= @move_speed\n self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and\n (@desty - self.y).abs <= @move_speed\n end\n if self.x == @destx and self.y == @desty\n @moving = false\n end\n end", "title": "" }, { "docid": "291cefad771d17f629eb0dd3633f0ca0", "score": "0.5916761", "text": "def change_gridview(dx, dy)\n rec = @grid_viewport.rect\n @grid_viewport.rect.set(rec.x+dx,rec.y+dy,rec.width,rec.height)\n for row in @tiles\n for box in row\n box.moveby(dx, dy)\n end\n end\n end", "title": "" }, { "docid": "d869cafb70b437ebd66494bc3327289f", "score": "0.5911668", "text": "def update args\n\n\t\t# Normalise the mouse position to the board origin\n\t\tmouse_x = ( ( args.inputs.mouse.x - @board_x ) / @cell_size ).floor\n\t\tmouse_y = ( ( args.inputs.mouse.y - @board_y ) / @cell_size ).floor\n\n\t\t# Handle if there's been a click, if we're still playing\n\t\tif !@victorious && ( @burniation == -1 ) && args.inputs.mouse.click\n\n\t\t\t# Save me some typing later on... ;-)\n\t\t\tcell_idx = (mouse_y*@width) + mouse_x\n\n\t\t\t# The user can do one of three things; click left, click right,\n\t\t\t# or click both. Somwhow we have to handle all of this!\n\t\t\tif mouse_x.between?( 0, @width-1 ) && mouse_y.between?( 0, @height-1 ) && args.inputs.mouse.button_left && args.inputs.mouse.button_right\n\n\t\t\t\t# Clear around an already-cleared cell\n\t\t\t\tif @cell_status[cell_idx] == :status_revealed\n\t\t\t\t\tuncover mouse_y, mouse_x, true\n\t\t\t\tend\n\n\t\t\t# If the user wants to add a gold pile to a covered cell, that's easy\n\t\t\telsif args.inputs.mouse.button_right\n\n\t\t\t\t# Needs to be on the board, and over a covered cell\n\t\t\t\tif mouse_x.between?( 0, @width-1 ) && mouse_y.between?( 0, @height-1 ) && @cell_status[cell_idx] != :status_revealed\n\n\t\t\t\t\t# We maintain a list of gold pile co-ordinates, and just toggle\n\t\t\t\t\t@cell_status[cell_idx] = ( @cell_status[cell_idx] == :status_gold ) ? :status_covered : :status_gold\n\n\t\t\t\tend\n\n\t\t\t# If the user clicks on the board, work out where.\n\t\t\telsif args.inputs.mouse.button_left\n\n\t\t\t\t# Obviously can only act if they're over the board\n\t\t\t\tif mouse_x.between?( 0, @width-1 ) && mouse_y.between?( 0, @height-1 )\n\n\t\t\t\t\t# If this is the first cell, spawn dragons!\n\t\t\t\t\tif !@spawned\n\t\t\t\t\t\tspawn_dragons mouse_y, mouse_x\n\t\t\t\t\tend\n\n\t\t\t\t\t# And then simply uncover the cell here\n\t\t\t\t\tuncover mouse_y, mouse_x\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t# Redraw the board\n\t\t\trender_board\n\n\t\tend\n\n\n\t\t# Check to see if they clicked on the restart button instead\n\t\tif args.inputs.mouse.x.between?( @label_x, @label_x + @label_width ) &&\n\t\t args.inputs.mouse.y.between?( @label_restart_y, @label_restart_y + @size_restart.y )\n\n\t\t\t# If the mouse is clicked down, we've clicked the button\n\t\t \tif args.inputs.mouse.down\n\t\t \t\t@restart_clicked = true\n\t\t \tend\n\n\t\t \tif @restart_clicked && args.inputs.mouse.up\n\t\t \t\t@restart_clicked = false\n\t\t \t\tsize\n\t\t \t\trender_board\n\t\t \tend\n\n\t\tend\n\n\t\t# Now check for end conditions; have we flagged all the dragons we seek?\n\t\tif ( @spawned ) && ( !@victorious) && ( @burniation == -1 ) &&\n\t\t ( @cell_status.count( :status_gold ) == @dragon_count )\n\n\t\t\t# Then automagically reveal all non-flagged cells\n\t\t\t@end_tick = args.tick_count\n\t\t\t@victorious = true\n\t\t\t@cell_status.map! { |cell|\n\t\t\t\tcell == :status_covered ? :status_revealed : cell\n\t\t\t}\n\n\t\t\t# Redraw the board\n\t\t\trender_board\n\n\t\tend\n\n\t\t# Have we revealed a dragon?!\n\t\tif @burniation == -1\n\t\t\t@dragons.each_with_index { |dragon, index|\n\t\t\t\tif ( dragon == DRAGON ) && ( @cell_status[index] == :status_revealed )\n\t\t\t\t\t@burniation = index\n\t\t\t\t\t@victorious = false\n\t\t\t\t\t@end_tick = args.tick_count\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\n\tend", "title": "" }, { "docid": "68e4fd19b76eb8bc0de083dfbad188b5", "score": "0.5905648", "text": "def update_move\n return unless @moving\n movinc = @move_speed == 0 ? 1 : @move_speed\n if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0\n self.x += movinc if self.x < @destx\n self.x -= movinc if self.x > @destx\n self.y += movinc if self.y < @desty\n self.y -= movinc if self.y > @desty\n @move_old = Graphics.frame_count\n end\n if @move_speed > 1 # Check if sprite can't reach that point\n self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and\n (@destx - self.x).abs <= @move_speed\n self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and\n (@desty - self.y).abs <= @move_speed\n end\n if self.x == @destx and self.y == @desty\n @moving = false\n end\nend", "title": "" }, { "docid": "a8083ec72308a805e1497857ddbed077", "score": "0.5903134", "text": "def mouse_over_grid2?\n inputs.mouse.point.inside_rect?(move_and_scale_up(grid.rect))\n end", "title": "" }, { "docid": "6340eb6563f6e1be3ec597b837e4b0c4", "score": "0.5901895", "text": "def vert_move(new_x, new_y)\n if pawn_white?\n (self.moved >= 1 && new_y == (self.y + 1)) || \\\n (self.moved == 0 && new_y <= (self.y + 2))\n else # Black pawn\n (self.moved >= 1 && (self.y - 1) == new_y) || \\\n (self.moved == 0 && (self.y - 2) <= new_y)\n end\n end", "title": "" }, { "docid": "93ffb8934bd37b474a04ea8124ece892", "score": "0.5899316", "text": "def change_grid(grid, list, starting_pos, i, hash)\n\tpos = starting_pos.dup\n\ttotal_steps = 0\n\tlist.each do |command|\n\t\tdir = command[0]\n\t\tmag = command[1..-1].to_i\n\t\tdraw_path(grid, pos, dir, mag, i, total_steps, hash)\n\t\ttotal_steps += mag\n\tend\nend", "title": "" }, { "docid": "b45f0e1f1dedb6f9c5d6409c445ab1fe", "score": "0.5885566", "text": "def input_move(column, player)\n placed = false\n return false unless (1..width).include?(column)\n\n grid.reverse_each do |row|\n if row[column - 1] == empty_cell && placed == false\n row[column - 1] = player\n placed = true\n end\n end\n placed\n end", "title": "" }, { "docid": "e9b6ccb2d30f8db77eb8c84ac9572456", "score": "0.58844775", "text": "def try_move row, column, path\n if row >= 0 and row < @level.size and\n column >= 0 and column < @level.last.size and\n @level[row] and @level[row][column] and\n path.is_not_yet_explored?(row, column)\n @moves_queue << [row, column, path]\n end\n end", "title": "" }, { "docid": "7c493bec97435bb5ba95c6730b663650", "score": "0.5883371", "text": "def mutate()\n\t\t# make a copy of grid and fill it with zeros\n\t\ttemp = Array.new(@rows)\n\t\tfor i in (0...@rows)\n\t\t\ttemp[i] = Array.new(@cols)\n\t\t\ttemp[i].fill(0)\n\t\tend\n\n #\n\t\t# TO DO: set values in temp grid to next generation\n\t\t#\n\t\tfor k in 0...@rows\n\t\t\tfor h in 0...@cols\n\t\t\t\tif (@grid[k][h]==1 && getNeighbors(k, h) < 2)\n\t\t\t\t\ttemp[k][h] = 0\n\t\t\t\telsif (@grid[k][h]==1 && getNeighbors(k, h) >3)\n\t\t\t\t\ttemp[k][h] = 0\n\t\t\t\telsif (@grid[k][h]==0 && getNeighbors(k, h) == 3)\n\t\t\t\t\ttemp[k][h] = 1\n\t\t\t\telse\n\t\t\t\t\ttemp[k][h] = @grid[k][h]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\n\n\n # DO NOT DELETE THE CODE BELOW\n\t\t@grid = temp\n\tend", "title": "" }, { "docid": "af7bf9fdb0a199628cd818cbeb146713", "score": "0.5881028", "text": "def calc_new_generation\n @current_gen_same_as_prev = true\n # Prepare grid clone creating a clone to avoid wrong cells neighbours status\n next_gen_cell_board = Array.new(rows) do |row|\n Array.new(cols) do |col|\n Cell.new(col, row, cell_board[row][col].alive?)\n end\n end\n @cell_board.each do |row|\n row.each do |element|\n live_neighbours_count = live_neighbours_around_cell(element).length()\n if element.alive? && (live_neighbours_count < 2 || live_neighbours_count > 3)\n next_gen_cell_board[element.y][element.x].die!\n @current_gen_same_as_prev = false\n elsif element.dead? && live_neighbours_count == 3\n next_gen_cell_board[element.y][element.x].revive!\n @current_gen_same_as_prev = false\n end\n end\n end\n @cell_board = next_gen_cell_board;\n end", "title": "" }, { "docid": "abf98788990bdb7678dfde2e534c0292", "score": "0.588015", "text": "def move\n return unless placed?\n # no need to use a loop since the length is only 2\n new_x = @pos_x + @direction[:x]\n new_y = @pos_y + @direction[:y]\n\n return unless valid_position?(new_x, new_y)\n set_position(new_x, new_y)\n end", "title": "" }, { "docid": "bab333cd42c8068179ea024b30a4df46", "score": "0.5876564", "text": "def new_move_positions(pos)\n new_positions = KnightPathFinder.valid_moves(pos) - @considered_positions\n @considered_positions += new_positions\n new_positions\n end", "title": "" }, { "docid": "cf3917c0fada881a833789c6d0f84b3b", "score": "0.58731407", "text": "def children\n # temp_dup[[i, j]] = @next_mover_mark # mark the board\n if @next_mover_mark == :x\n @next_mover_mark = :o\n bob = :x\n else\n @next_mover_mark = :x\n bob = :o\n end\n temp_dup = self.board.dup\n next_moves = []\n temp_dup.rows.each_with_index do |row, i|\n row.each_with_index do |col, j|\n # debugger\n if temp_dup.empty?([i, j])\n # next moes << tttn.new([board with mark placed on i,j], themark, prev_movepos)\n # next_moves << [i, j] \n \n temp_dup[[i, j]] = @next_mover_mark # mark the board\n \n \n next_moves << TicTacToeNode.new(temp_dup, @next_mover_mark, [i,j] )\n \n #temp_dup[[i, j]] = @next_mover_mark # mark the board\n \n end\n nil\n end\n end\n next_moves\n #returns nodes from all game states ???\n end", "title": "" }, { "docid": "9bd7153b6bd8e0c923e7e2d1f5e395e2", "score": "0.586735", "text": "def next_generation\n new_grid = generate_grid\n\n @x.times do |x|\n @y.times do |y|\n # If there are more than one nodes on a square, rotate them.\n if @grid[x][y].length > 1\n new_nodes = []\n @grid[x][y].each do |node|\n # Don't want to introduce nil elements into the grid\n new_direction = rotate_direction(node)\n new_nodes << new_direction unless new_direction.nil?\n end\n\n @grid[x][y] = new_nodes\n end\n\n # If we are at an edge, reverse direction\n @grid[x][y].each do |node|\n if (x == 0 and node == :left) or\n (x == @x - 1 and node == :right) or\n (y == 0 and node == :up) or\n (y == @y - 1 and node == :down)\n\n @grid[x][y].delete node\n\n # Don't want to introduce nil elements into the grid.\n new_direction = reverse_direction(node)\n @grid[x][y] << new_direction unless new_direction.nil?\n end\n end\n\n # Finally, perform the relevant moves\n @grid[x][y].each do |node|\n case node\n when :up\n new_grid[x][y-1] << :up\n when :down\n new_grid[x][y+1] << :down\n when :left\n new_grid[x-1][y] << :left\n when :right\n new_grid[x+1][y] << :right\n end\n end\n end\n end\n\n return new_grid\n end", "title": "" }, { "docid": "f10a90a914a1ea9aa4002be303f0d1c0", "score": "0.58593935", "text": "def obstructed_move?(row, col)\n current_row = self.row_position\n current_col = self.col_position\n\n # check if piece is blocking the path in positive vertical direction\n if current_col == col && row > current_row\n for i in (current_row+1...row)\n self.game.occupied?(i, col)\n end\n end\n\n # check if piece is blocking the path in negative vertical direction\n if current_col == col && row < current_row\n for i in (row+1...current_row)\n self.game.occupied?(i, col)\n end\n end\n\n # check if piece is blocking the path in positive horizontal direction\n if current_row == row && col > current_col\n for i in (current_col+1...col)\n self.game.occupied?(row, i)\n end\n end\n\n # check if piece is blocking the path in negative horizontal direction\n if current_row == row && col < current_col\n for i in (col+1...current_col)\n self.game.occupied?(row, i)\n end\n end\n\n return false\n end", "title": "" }, { "docid": "72352e0d5a35617ed5516d0fcdc46f2c", "score": "0.58507204", "text": "def iterate\r\n\t\tif @gameover\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tk = @args.inputs.keyboard\r\n\r\n\t\tif k.key_down.up\r\n\t\t\trotate\r\n\t\tend\r\n\r\n\t\t#nie wychodzenie poza ramki\r\n\t\tif k.key_down.left && @current_piece_x>0\r\n\t\t\t@current_piece_x -= 1\r\n\t\tend\r\n\t\tif k.key_down.right && ((@current_piece_x+@current_piece.length) < @grid_w)\r\n\t\t\t@current_piece_x += 1\r\n\t\tend\r\n\t\tif (k.key_down.down || k.key_held.down) && !colliding\r\n\t\t\t@next_move -= 3 #ile razy szybciej\r\n\t\tend\r\n\r\n\t\t@next_move -= 1\r\n\t\tif @next_move <= 0\r\n\t\t\t#jeżeli koliduje to umieszczamy na stałe klocek w tym miejscu (zapisując na planszy jego kratki jako 1)\r\n\t\t\tif colliding\r\n\t\t\t\tplant_current_piece\r\n\t\t\telse\r\n\t\t\t\t@next_move =10\r\n\t\t\t\t@current_piece_y += 1\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "d1c11a6ef7d302b05f3075b7a407f815", "score": "0.585002", "text": "def normal_moves\n direction = NORMAL_MOVES[self.color]\n \n [check_validity(direction)]\n \n if pos_valid \n item_at_pos = @board.get_piece(current_row,current_col)\n \n if item_at_pos.nil? || item_at_pos.color != self.color\n [current_row, current_col]\n end\n end\n \nend", "title": "" }, { "docid": "1e6379cb249eb42fdae31639f8584a71", "score": "0.5849998", "text": "def move_path\n\t\t## Find current or next cell\n\t\t#cell = find_cell by: :pos, x: @x, y: @y, return_on_found: true\n\t\tcell = find_closest_cell by: :pos, x: @x, y: @y unless (@path.nil?)\n\t\tif (cell.nil? || @path.nil?)\n\t\t\tdecr_vel [:x,:y]\n\t\t\treturn\n\t\tend\n\n\t\t## Move towards point\n\t\tvels = []\n\t\t# Move up\n\t\tif (cell.pos(:y) < @y)\n\t\t\tvels << :up\n\n\t\t# Move down\n\t\telsif (cell.pos(:y) > @y)\n\t\t\tvels << :down\n\t\tend\n\n\t\t# Move left\n\t\tif (cell.pos(:x) < @x)\n\t\t\tvels << :left\n\n\t\t# Move right\n\t\telsif (cell.pos(:x) > @x)\n\t\t\tvels << :right\n\t\tend\n\n\t\tincr_vel vels\n\t\t@path.delete cell if (((@x-8)..(@x+8)).include?(cell.pos(:x)) && ((@y-8)..(@y+8)).include?(cell.pos(:y)))\n\tend", "title": "" }, { "docid": "8981171e3adffbdd5003c6a0b07412d5", "score": "0.584838", "text": "def process_cursor_move\n return unless super && @allow_change_enemy\n if Input.trigger?(:L)\n turn_page(-1)\n update_scene_index\n elsif Input.trigger?(:R)\n turn_page(1)\n update_scene_index\n end\n return true\n end", "title": "" }, { "docid": "5b3da1cd47440c211a0a2f903ea65890", "score": "0.5845147", "text": "def occupy_grid(from_x, from_y, the_direction, the_distance, wire_index, the_base_steps, in_grid_hash)\n if the_direction.upcase == \"U\"\n the_step_x, the_step_y = 0, 1\n elsif the_direction.upcase == \"D\"\n the_step_x, the_step_y = 0, -1\n elsif the_direction.upcase == \"L\"\n the_step_x, the_step_y = -1, 0\n elsif the_direction.upcase == \"R\"\n the_step_x, the_step_y = 1, 0\n end\n the_walk_x, the_walk_y = from_x, from_y\n\n 0.upto(the_distance - 1) do |the_step_num|\n the_key = \"#{the_walk_x}_#{the_walk_y}\"\n in_grid_hash[the_key] ||= [-1,-1]\n\n in_grid_hash[the_key][wire_index] = the_base_steps + the_step_num if in_grid_hash[the_key][wire_index] < 1\n\n the_walk_y += the_step_y\n the_walk_x += the_step_x\n end\n return the_walk_x, the_walk_y\nend", "title": "" }, { "docid": "8e0d4e7596f9a26e846c81903fe0e36f", "score": "0.5844678", "text": "def move\n if @x + @x_vel < 0\n net_move = (-2 * @x) - @x_vel\n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n elsif @x + @x_vel > (1280 - @w)\n net_move = (2 * (1280 - @w - @x)) - @x_vel \n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n else\n @truex += @x_vel\n @x += @x_vel\n end\n\n if @y + @y_vel < 0\n net_move = (-2 * @y) - @y_vel\n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n elsif @y + @y_vel > (720 - @h)\n net_move = (2 * (720 - @h - @y)) - @y_vel \n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n else\n @truey += @y_vel\n @y += @y_vel\n end\n end", "title": "" }, { "docid": "8811fdf373f51164c44b5b4d5d41f492", "score": "0.5844307", "text": "def process_inputs\n if inputs.mouse.down\n state.world_lookup = {}\n x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid\n\n if state.world.any? { |loc| loc == [x, y] } # checks if coordinates duplicate\n state.world = state.world.reject { |loc| loc == [x, y] } # erases tile space\n else\n state.world << [x, y] # If no duplicates, adds to world collection\n end\n end\n\n # Sets dx to 0 if the player lets go of arrow keys.\n if inputs.keyboard.key_up.right\n state.dx = 0\n elsif inputs.keyboard.key_up.left\n state.dx = 0\n end\n\n # Sets dx to 3 in whatever direction the player chooses.\n if inputs.keyboard.key_held.right # if right key is pressed\n state.dx = 3\n elsif inputs.keyboard.key_held.left # if left key is pressed\n state.dx = -3\n end\n\n #Sets dy to 5 to make the player ~fly~ when they press the space bar\n if inputs.keyboard.key_held.space\n state.dy = 5\n end\n end", "title": "" }, { "docid": "fe493a9225da587e6641e96f96b5521e", "score": "0.58440894", "text": "def step_through_iterative_division_maze_generator(grid, state)\n unless state[:finished_init]\n draw_canvas_border(grid)\n state[:finished_init] = true\n end\n new_chamber = divide(grid, state[:current_chamber])\n if new_chamber\n state[:current_chamber] = new_chamber[0]\n state[:todo_chamber].push(new_chamber[1])\n elsif !state[:todo_chamber].empty?\n state[:current_chamber] = state[:todo_chamber].pop\n elsif !state[:generation_complete]\n state[:generation_complete] = true\n end\nend", "title": "" }, { "docid": "5f0ab7e1a93c53701c0b33fd0f2d46ac", "score": "0.5842584", "text": "def valid_move?(board, index)\n index.between?(0, 8) && position_taken?(board, index) == false\n\nend", "title": "" }, { "docid": "65bddcfdba104d0cc42e041a535efdab", "score": "0.5840989", "text": "def possible_jumps\n pos_jumps = [ ]\n row, col = @pos\n move_diffs.each do |row_change, col_change| \n jumped_piece = [row + row_change, col + col_change]\n new_position = [row + (row_change * 2), (col + col_change * 2)]\n unless @grid[jumped_piece].nil? || @grid[jumped_piece].color == @color\n pos_jumps << new_position\n end\n end\n pos_jumps\n end", "title": "" }, { "docid": "1933e0c5b2241e0cc3f6d4b503962549", "score": "0.58390635", "text": "def nextMove(n,r,c,grid)\n # place m on grid at r,c\n actions = generate_path(grid, 'm','p')\n puts actions[0]\n grid[r][c] = '-'\n if actions[0] == 'LEFT'\n grid[r][c-1]='m'\n elsif actions[0] == 'RIGHT'\n grid[r][c+1]='m'\n elsif actions[0] == 'UP'\n grid[r-1][c]='m'\n elsif actions[0] == 'DOWN'\n grid[r+1][c]='m'\n end\n actions[0]\n end", "title": "" }, { "docid": "e5b7ff9e044325cba25d15494c21c926", "score": "0.583615", "text": "def live_neighbours_around_cell(cell)\n live_neighbours = []\n\n #check top cell\n if cell.x_axis > 0\n # puts \"Cell dimen1: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check right cell\n if cell.y_axis < (columns-1)\n # puts \"Cell dimen2: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check left cell\n if cell.y_axis > 0\n # puts \"Cell dimen3: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom cell\n if cell.x_axis < (rows-1)\n # puts \"Cell dimen4: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top left\n if cell.x_axis > 0 and cell.y_axis > 0\n # puts \"Cell dimen5: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top right\n if cell.x_axis > 0 and cell.y_axis < (columns-1)\n # puts \"Cell dimen6: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom left\n if cell.x_axis < (rows - 1) and cell.y_axis > 0\n # puts \"Cell dimen7: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom right\n if cell.x_axis < (rows - 1) and cell.y_axis < (columns - 1)\n # puts \"Cell dimen8: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n live_neighbours\n end", "title": "" }, { "docid": "fa751349549bba49b816119736148ac1", "score": "0.58231056", "text": "def generate_moves\n @delta.each do |step|\n new_pos = [@pos[0] + step[0], @pos[1] + step[1]]\n @move_list << new_pos if valid_coord?(new_pos)\n end\n end", "title": "" }, { "docid": "91cc6d7b3b7afcd04725a824a89851ea", "score": "0.5816669", "text": "def move()\n case @mov_dir\n when :right\n if @coord_x == @max_x\n @max_x += 1 # Moving out of bounds. No need to do anything because Ruby rocks! :P\n end\n @coord_x += 1\n \n when :up\n if @coord_y == 0\n @map.unshift [] # Moving out of bounds. Adds a new line to the top\n @max_y += 1\n else\n @coord_y -= 1\n end\n \n when :down\n if @coord_y == @max_y\n @max_y += 1\n @map.push [] # Moving out of bounds. Adds a new line to the bottom\n end\n @coord_y += 1\n \n when :left\n if @coord_x == 0\n @map.each do |a| # Moving out of bounds. Adds a new line to the left\n a.unshift ' ' \n end\n @max_x += 1\n else\n @coord_x -= 1\n end\n end\n end", "title": "" }, { "docid": "46863e191edbc0d014b195d6897749ad", "score": "0.5810439", "text": "def update_visited_moves\n visited_coordinates << [x , y]\n end", "title": "" }, { "docid": "aefbdf2305274e74f2123d16a96946ba", "score": "0.5805552", "text": "def new_move_positions(pos)\n moves_arr = []\n\n #Generate all possible moves from current pos\n moves_arr << [pos[0] + 2, pos[1] - 1]\n moves_arr << [pos[0] + 1, pos[1] + 2]\n moves_arr << [pos[0] + 2, pos[1] + 1]\n moves_arr << [pos[0] + 1, pos[1] - 2]\n moves_arr << [pos[0] - 2, pos[1] + 1]\n moves_arr << [pos[0] - 1, pos[1] + 2]\n moves_arr << [pos[0] - 2, pos[1] - 1]\n moves_arr << [pos[0] - 1, pos[1] + 2]\n\n #use valid moves to remove already visited pos\n\n moves_arr.map! do |move|\n range = (0..7)\n\n debugger\n\n if !range.include?(move[0]) || !range.include?(move[1])\n next\n elsif visited_positions.include?(move)\n next\n end\n\n end\n\n\n #push new moves into visited_positions\n @visited_positions += moves_arr\n end", "title": "" }, { "docid": "5d7af4faff219f897d6d39fb023afc50", "score": "0.5804296", "text": "def update_move\n if !@ch.moving? && @moves.size > 0\n @moves.shift if proccess_move(@moves[0])\n end\n end", "title": "" }, { "docid": "5ad6f80f9c2b771414d394e2c52cfcc1", "score": "0.5801727", "text": "def cavity grid\n # copy_g = grid\n\n # # size = copy_g[0].length\n\n # copy_g.delete_at(size-1)\n # copy_g.delete_at(0)\n\n # copy_g[0].delete_at(size-1)\n # copy_g[0].delete_at(0)\n\n # # p copy_g\n\n # center = []\n\n # size = grid.size -1\n\n\n # (1..size).each do |i|\n # j = size - i\n # center << [i,j]\n # center << [i,j+1]\n # end\n # p center\n\ncenter = []\ncavity = []\nsize = grid.size-1\n\ncopy_g = grid\n\ngrid.each_with_index do |x, xi|\n x.each_with_index do |y, yi|\n\n\n if xi != 0 && yi != 0 && xi != size && yi != size\n # p \"element [#{xi}, #{yi}] is #{y}\"\n center << [xi, yi]\n\n if grid[xi][yi + 1] < y && grid[xi][yi - 1] < y\n cavity << [xi, yi]\n copy_g[xi][yi] = 'X'\n end\n\n end\n end\nend\n\np center\np cavity\np copy_g\n\nend", "title": "" }, { "docid": "27b60d46250a19c0839d4ae9ec757f8d", "score": "0.579861", "text": "def check_ship (horv,x1,y1)\n if horv==1 #build in vertical position row increases\n (x1..x1+4).each { |r| # row changes y stayes same\n sq=self.squares.find{|s| s.rowid == r && s.colid==y1}\n if !sq.empty\n return true\n end #if\n }\n else\n (y1..y1+4).each { |c| # row changes y stayes same\n sq=self.squares.find{|s| s.rowid == x1 && s.colid==c}\n if !sq.empty\n return true\n end\n }\n end #horv\n return false # nothing to hit\n end", "title": "" }, { "docid": "c502e40772a19bac0437170a5967c2ad", "score": "0.57976365", "text": "def refresh()\n checkPosition(@object.x, @object.y)\n end", "title": "" }, { "docid": "eb133feb35aa0b83d936c2cd06503117", "score": "0.57955", "text": "def pos\n\t\tif not moved_to.nil? and moved?\n\t\t\tsquare.neighbor( moved_to )\n\t\telse\n\t\t\tsquare\n\t\tend\n\tend", "title": "" }, { "docid": "d37b0a83c2d8d584553f9db23672d175", "score": "0.5795232", "text": "def play_move!( m )\n self.delete_if { |pos, piece| pos == m.to_coord || pos == m.captured_piece_coord }\n\n piece_moved = self.delete(m.from_coord)\n self[m.to_coord] = piece_moved\n\n if m.castled==1\n castling_rank = m.to_coord.rank.to_s\n [['g', 'f', 'h'], ['c', 'd', 'a']].each do |king_file, new_rook_file, orig_rook_file|\n #update the position of the rook corresponding to the square the king landed on\n\tif m.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 #TODO investigate why this method is getting called multiply per moves << Move.new\n return unless piece_moved\n ep_from_rank, ep_to_rank, ep_rank = EN_PASSANT_CONFIG[ piece_moved.side ]\n @en_passant_square = ( piece_moved.function == :pawn &&\n m.from_coord.rank == ep_from_rank && \n m.to_coord.rank == ep_to_rank ) ? m.from_coord.file + ep_rank.to_s : 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.delete(m.to_coord)\n self[m.to_coord] = Queen.new(piece_moved.side, :promoted)\n #puts self.to_s if m.to_coord == 'a8'\n #debugger if m.to_coord == 'a8'\n end\n \n self\n end", "title": "" }, { "docid": "bc219292f23669faf454d58853d1a357", "score": "0.579387", "text": "def each_move\n SQ.select { |i| @colors[i] == @mx }.each do |f|\n if @pieces[f] == PAWN\n t = f + UP[@mx]\n yield(f, t + 1) if @colors[t + 1] == @mn && SQ120[SQ64[t] + 1] != NULL\n yield(f, t - 1) if @colors[t - 1] == @mn && SQ120[SQ64[t] - 1] != NULL\n next unless @colors[t] == EMPTY\n yield(f, t)\n yield(f, t + UP[@mx]) if @colors[t + UP[@mx]] == EMPTY && (f >> 3) == (SIDE[@mx] - 1).abs\n next\n end\n STEPS[@pieces[f]].each do |s|\n t = SQ120[SQ64[f] + s]\n while t != NULL\n yield(f, t) if @colors[t] != @mx\n break if @pieces[f] == KING || @pieces[f] == KNIGHT || @colors[t] != EMPTY\n t = SQ120[SQ64[t] + s]\n end\n end\n end\n end", "title": "" }, { "docid": "787a26d83edaaa2e38e47523e36b89d5", "score": "0.5792628", "text": "def valid_move?(board,index)\n if index < 0\n false\n else\n if index > 8\n false\n else\n !position_taken?(board,index)\n end\n end\nend", "title": "" }, { "docid": "23b1387c7ea7a6e5d22ff7cf89f78216", "score": "0.5792464", "text": "def capture_move?(x_new, y_new)\n target = game.pieces.where(\"x_pos = ? AND y_pos = ?\", x_new, y_new).first\n return false if target.nil?\n if move_type(x_new, y_new) == :diagonal && x_diff(x_new) == 1 && y_diff(y_new) == 1\n target.color != self.color && target.type != \"King\"\n end\n end", "title": "" }, { "docid": "7a536eecc5a174eac5cdd7335b5b7947", "score": "0.5791296", "text": "def update_position!(next_move)\n table.x = next_move[:x]\n table.y = next_move[:y]\n end", "title": "" }, { "docid": "b1a9dcf58285a4fe8dfcade6423dad52", "score": "0.57862025", "text": "def game_over \n # all the grid's cells are full and different numbers \n end", "title": "" }, { "docid": "52aedbc272dff11d61ef6ec88ee44822", "score": "0.57773143", "text": "def can_move_to?(position, color)\n @grid.each do |row|\n row.each do |square|\n if (square != nil && square.color == color &&\n square.moves.include?(position))\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "547452954c3e9dfd20cc66e8360ccb05", "score": "0.5775293", "text": "def new_move_pos(pos)\n all_possible_moves = KnightPathFinder.valid_moves(pos)\n all_possible_moves = all_possible_moves.reject {|pot_moves| @visited_pos.include?(pot_moves)}\n @visited_pos += all_possible_moves\n all_possible_moves\n end", "title": "" }, { "docid": "722bc585cc6df39ad1f3e8e96c473e80", "score": "0.57715756", "text": "def traverse_grid(rows, cols, dead_zones, paths)\n paths ||= Array.new(rows) {Array.new(cols)}\n\n #recursive step\n return traverse_grid(rows-1, cols) || traverse_grid(rows, cols-1)\nend", "title": "" }, { "docid": "7cf1d282dc3f229dcdabe7288c2fb58d", "score": "0.57673395", "text": "def up\n @y.positive? ? $theGrid[@y-1][@x] : nil\n end", "title": "" }, { "docid": "cf736c19f5c3eb67cdd13f17b3382033", "score": "0.5760695", "text": "def grow_unblocked_moves_in_dir(dx, dy)\n x, y = @pos\n valid_positions = []\n new_x = x + dx\n new_y = y + dy\n new_pos = [new_x, new_y]\n \n while @board.valid_pos?(new_pos) \n # debugger\n\n next_piece = @board[new_pos]\n if next_piece.empty?\n valid_positions << new_pos\n elsif self.color != next_piece.color\n valid_positions << new_pos\n break\n else\n break\n end\n\n new_x += dx\n new_y += dy\n new_pos = [new_x, new_y] \n \n end\n\n valid_positions\n end", "title": "" }, { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.57550675", "text": "def update_position\n end", "title": "" } ]
dfd7f1d414867dc780e83fe951df1bfd
Determine the content type of this request as indicated by the ContentType header.
[ { "docid": "ebf121ff9841a3b6eb7ddbba6c77306b", "score": "0.8243681", "text": "def content_type\n header = @env[CONTENT_TYPE_NAME]\n @content_type ||= (header && MediaTypeIdentifier.load(header)).freeze\n end", "title": "" } ]
[ { "docid": "dc5b6b02040e471f8f5c41c86462f1f9", "score": "0.842568", "text": "def request_content_type\n request.respond_to?(:media_type) ? request.media_type : request.content_type\n end", "title": "" }, { "docid": "b63e5993ccb04f4478e057495d294794", "score": "0.83901775", "text": "def content_type\n @content_type ||= MediaTypeIdentifier.load(headers['Content-Type']).freeze\n end", "title": "" }, { "docid": "a31254b0f39a241a973032db20b19795", "score": "0.8385692", "text": "def content_type\n @request.env['CONTENT_TYPE']\n end", "title": "" }, { "docid": "a31254b0f39a241a973032db20b19795", "score": "0.8385692", "text": "def content_type\n @request.env['CONTENT_TYPE']\n end", "title": "" }, { "docid": "53b92ffaf479beb4f1187752d2f4d903", "score": "0.830878", "text": "def content_type\n params['HTTP_CONTENT_TYPE']\n end", "title": "" }, { "docid": "15c58e9b458bce150ef015af27f63848", "score": "0.8219305", "text": "def content_type\n @headers['content-type']\n end", "title": "" }, { "docid": "979d54d9cbb561c9028f07b148963335", "score": "0.81971526", "text": "def content_type\n MediaTypeIdentifier.load(headers['Content-Type']).freeze\n end", "title": "" }, { "docid": "94f069182784eb260fc3655fb8cb9f5c", "score": "0.8194239", "text": "def content_type\n @content_type ||= headers.find { |k, _| k.downcase == \"content-type\" }&.last&.sub(/;.*\\z/, \"\")\n end", "title": "" }, { "docid": "4fc19a461f0263d3d29e714008b8404e", "score": "0.8166533", "text": "def content_type\n @http_header.content_type\n end", "title": "" }, { "docid": "5ea393fe2e3c259394e8673514986a12", "score": "0.81603354", "text": "def request_content_type\n\t\treturn self.headers_in['Content-type']\n\tend", "title": "" }, { "docid": "a0f1db83e82d06b5fc1624a055c8238c", "score": "0.80927205", "text": "def content_type\n self['Content-Type'][0]\n end", "title": "" }, { "docid": "e7edad4c765bd3339e2131d404c30ec7", "score": "0.8057412", "text": "def content_type\n headers['content-type'].first\n end", "title": "" }, { "docid": "e7edad4c765bd3339e2131d404c30ec7", "score": "0.8057412", "text": "def content_type\n headers['content-type'].first\n end", "title": "" }, { "docid": "84d348e18e1010f0f032c4e01b6f5b3f", "score": "0.8044542", "text": "def content_type\n unless content_type_set?\n @_content_type = perform_content_negotiation\n raise Merb::ControllerExceptions::NotAcceptable.new(\"Unknown content_type for response: #{@_content_type}\") unless\n Merb.available_mime_types.has_key?(@_content_type)\n headers['Content-Type'] = Merb.available_mime_types[@_content_type].first\n end\n @_content_type\n end", "title": "" }, { "docid": "8727d1977076f052ec189734fbf5358e", "score": "0.8011083", "text": "def contenttype\n self['Content-Type'][0]\n end", "title": "" }, { "docid": "fc33860879c7a9f90e0afbe706047f3b", "score": "0.80064183", "text": "def content_type\n return @content_type unless @content_type.nil?\n @content_type = content_type_from_accept_header if accept_header?\n @content_type || default_response_type || default_content_type || DEFAULT_CONTENT_TYPE\n end", "title": "" }, { "docid": "a2783e1ba249054b618f5e4b398ebd28", "score": "0.7996455", "text": "def content_type\n headers['Content-Type']\n end", "title": "" }, { "docid": "628082c79f2e51f50fec9f67d151467a", "score": "0.7981722", "text": "def content_type\n @content_type ||= case headers[:content_type]\n when /json/ then :json\n when /yaml/ then :yaml\n else headers[:content_type]\n end\n end", "title": "" }, { "docid": "20b569f32221270815523ffedb853322", "score": "0.7945876", "text": "def content_type\n @content_type ||= begin\n if @env['CONTENT_TYPE'] =~ /^([^,\\;]*)/\n Mime::Type.lookup($1.strip.downcase)\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "91ba9340025eacc2607b998d2387146b", "score": "0.7932127", "text": "def content_type\n @content_type\n end", "title": "" }, { "docid": "91ba9340025eacc2607b998d2387146b", "score": "0.7931315", "text": "def content_type\n @content_type\n end", "title": "" }, { "docid": "91ba9340025eacc2607b998d2387146b", "score": "0.7931315", "text": "def content_type\n @content_type\n end", "title": "" }, { "docid": "91ba9340025eacc2607b998d2387146b", "score": "0.7931315", "text": "def content_type\n @content_type\n end", "title": "" }, { "docid": "feff2796337ecdc9a675de213a64ae9d", "score": "0.7930551", "text": "def content_type\n ((self.headers.values_at(\"content-type\", \"Content-Type\").compact.first || \"\").split(\";\").first || \"\").strip\n end", "title": "" }, { "docid": "aef270b3c91af84b822ada4382a7e4c6", "score": "0.79245365", "text": "def content_type\n _head[:content_type]\n end", "title": "" }, { "docid": "80dd3f1c0c243e2736a3b2b4714af61e", "score": "0.7916941", "text": "def content_type\n\t\treturn self.headers[ :content_type ]\n\tend", "title": "" }, { "docid": "a97f0a257485af533823dd131aaa5cd1", "score": "0.7911485", "text": "def response_content_type(request)\n if UNSPECIFIED_CONTENT_TYPES.include?(request.accept)\n request.content_type\n else\n request.accept\n end\n end", "title": "" }, { "docid": "282280c66a5b5fd9dd5e50ea4b83e1f5", "score": "0.788772", "text": "def content_type\n header['content-type'] && header['content-type'].first.split(';').first\n end", "title": "" }, { "docid": "b44e17eddc48f56a0e5eb72ab0424d77", "score": "0.7882889", "text": "def content_type\n data[:content_type]\n end", "title": "" }, { "docid": "18ad16a919ede305bdf1c0f9f7ed89df", "score": "0.7861359", "text": "def content_type\n response.headers['content-type']\n end", "title": "" }, { "docid": "c5b63ac73d8d79980f7823b049022c5d", "score": "0.78553724", "text": "def content_type\n @body.content_type\n end", "title": "" }, { "docid": "151ebe31e1da01ee74a3e24cb3d7acb6", "score": "0.7846134", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "87b82c38cf0a4bf4d2c9249ebba8e79e", "score": "0.7828587", "text": "def content_type\n Mime::Type.lookup(content_type_without_parameters)\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.7827944", "text": "def content_type\n return @content_type\n end", "title": "" }, { "docid": "5ee5f23a199603a29ab650fdf403cc16", "score": "0.7822169", "text": "def content_type\n #; [!95g9o] returns env['CONTENT_TYPE'].\n return @env['CONTENT_TYPE']\n end", "title": "" }, { "docid": "d804605eeb6cbaaa0e32268e7a3e6e7e", "score": "0.78143483", "text": "def content_type\n @env[CONST_CONTENT_TYPE]\n end", "title": "" }, { "docid": "8a32ff0e5d96e8d560ed915e645803b0", "score": "0.78108656", "text": "def content_type\n instance_read(:content_type)\n end", "title": "" }, { "docid": "77f4a80f0ce83ff94dc09cfc44a2e11b", "score": "0.77956015", "text": "def content_type\n instance_read(:content_type)\n end", "title": "" }, { "docid": "d2a94beedb93ad1c42183ead3d8edb5b", "score": "0.77930945", "text": "def content_type\n @content_type || accepts || DEFAULT_CONTENT_TYPE\n end", "title": "" }, { "docid": "57495c5aadad5573593e21d77e588816", "score": "0.7792952", "text": "def content_type\n headers['Content-Type'] ? Webbed::MediaType.new(headers['Content-Type']) : nil\n end", "title": "" }, { "docid": "0da7d69a0d225dc176818d5694c8df66", "score": "0.7786022", "text": "def content_type\n type = content_type_parse\n type || 'application/octet-stream'\n end", "title": "" }, { "docid": "1e4b71b196b20b219f1f911519452bd4", "score": "0.7766136", "text": "def content_type\n (response['Content-Type'] || '')\n end", "title": "" }, { "docid": "1e4b71b196b20b219f1f911519452bd4", "score": "0.7766136", "text": "def content_type\n (response['Content-Type'] || '')\n end", "title": "" }, { "docid": "9fe48b60f3b460c6e1d79a124d502581", "score": "0.77458555", "text": "def content_type\n\t type = header('Content-Type') or return\n\t MimeType.new(type)\n\tend", "title": "" }, { "docid": "b2e0dcf99ea46877392543085763581f", "score": "0.77442443", "text": "def content_type\n (@response['Content-Type'] || '')\n end", "title": "" }, { "docid": "1471e1365df74af18d55760a8faa657f", "score": "0.7719879", "text": "def content_type\n headers['Content-Type']\n end", "title": "" }, { "docid": "16b9fec7f68e7308b34769efe5ccc25d", "score": "0.7705494", "text": "def content_type\n self.object_metadata[:content_type]\n end", "title": "" }, { "docid": "5d55c3d35e46c4e589e8184e3a9ba878", "score": "0.7695358", "text": "def content_type ty\n mime_ty = MIME_TYPES[ty.to_s]\n raise ArgumentError, \"bad content type: #{ty.inspect}\" unless mime_ty\n request.response_content_type = mime_ty\n end", "title": "" }, { "docid": "5d55c3d35e46c4e589e8184e3a9ba878", "score": "0.7695358", "text": "def content_type ty\n mime_ty = MIME_TYPES[ty.to_s]\n raise ArgumentError, \"bad content type: #{ty.inspect}\" unless mime_ty\n request.response_content_type = mime_ty\n end", "title": "" }, { "docid": "fc9cfac18cabe5580f97da0505ef806c", "score": "0.76745397", "text": "def content_type\n @content_type ||= (binary_mime_type? || binary?) ? mime_type :\n (encoding ? \"text/plain; charset=#{encoding.downcase}\" : \"text/plain\")\n end", "title": "" }, { "docid": "f28983a37c94b794ea28270d1f588b08", "score": "0.76662093", "text": "def content_mime_type\n env[\"json_api.request.content_type\"] ||= begin\n if env['CONTENT_TYPE'] =~ /^([^,\\;]*)/\n Mime::Type.lookup($1.strip.downcase)\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "3a30fbe9bbcbc888c82ef446e66ecdae", "score": "0.76647985", "text": "def content_type\n response.headers['Content-Type'] || ''\n end", "title": "" }, { "docid": "3a30fbe9bbcbc888c82ef446e66ecdae", "score": "0.76647985", "text": "def content_type\n response.headers['Content-Type'] || ''\n end", "title": "" }, { "docid": "d3abcfe27eb5149430c33b0d110d5347", "score": "0.7629601", "text": "def content_mime_type\n type = headers[\"content-type\"]\n mime = type && MIME::Types[type[/^\\S*/]]\n mime && mime.first\n end", "title": "" }, { "docid": "c4ed88797dcc5043a6755a4e4d24925e", "score": "0.76151854", "text": "def content_media_type\n return unless headers['Content-Type']\n\n headers['Content-Type'].split(';').first\n end", "title": "" }, { "docid": "69bb1859ddde5dfa7172d65ef1586675", "score": "0.76102006", "text": "def parsed_content_type_header\n parse_content_type(get_header(CONTENT_TYPE))\n end", "title": "" }, { "docid": "7975b7d277dd6bac7bcaf8bf5c861859", "score": "0.75868326", "text": "def content_type( default = nil )\n if h = @header['content-type']\n h.content_type || default\n else\n default\n end\n end", "title": "" }, { "docid": "6c701374c75ce21792286c1fd1954c19", "score": "0.7570819", "text": "def content_type(fmt = nil)\n @_content_type = (fmt || _perform_content_negotiation) unless @_content_type\n @_content_type\n end", "title": "" }, { "docid": "66eac599211dc503887c23dcfd78fe95", "score": "0.7566066", "text": "def content_type\n return @content_type unless @content_type.nil?\n @content_type ||= content_type_validator.nil? ? nil : content_type_validator.options[:content_type].to_s\n end", "title": "" }, { "docid": "65f9dc031629e7a5bdb479ffd76c8927", "score": "0.75599575", "text": "def content_type\n @content_type ||= begin\n type = Rack::Mime.mime_type(format_extension)\n type[/^text/] ? \"#{type}; charset=utf-8\" : type\n end\n end", "title": "" }, { "docid": "7a14850ece805826f7d3bff4a15aeb5e", "score": "0.7555732", "text": "def content_type\n @content_type ||= binary? ? mime_type :\n (encoding ? \"text/plain; charset=#{encoding.downcase}\" : \"text/plain\")\n end", "title": "" }, { "docid": "1934c6841bec58c79dad1340b83c5f8b", "score": "0.755509", "text": "def content_type\n options[:content_type]\n end", "title": "" }, { "docid": "ff089ac237419509e9c9a2e4482f1d2b", "score": "0.754638", "text": "def media_type\n parsed_content_type_header.mime_type\n end", "title": "" }, { "docid": "ea1a03dde47e8da41cf8a6911090e0f2", "score": "0.7525395", "text": "def content_type\n return unless content_media_type\n\n content_media_type.split('/').first\n end", "title": "" }, { "docid": "9bca0a7b40b76e73f53fa33f4aeabc7a", "score": "0.7521038", "text": "def content_type\n ((response.headers.values_at('content-type', 'Content-Type').compact.first || '').split(';').first || '').strip\n end", "title": "" }, { "docid": "d16b9a7c7f5c3b92781a2786a4ddea10", "score": "0.7504278", "text": "def content_type\n ((response.headers.values_at('content-type', 'Content-Type').compact.first || '').split(';').first || '').strip\n end", "title": "" }, { "docid": "d16b9a7c7f5c3b92781a2786a4ddea10", "score": "0.7504278", "text": "def content_type\n ((response.headers.values_at('content-type', 'Content-Type').compact.first || '').split(';').first || '').strip\n end", "title": "" }, { "docid": "40a175ac5bd3516c410faf46b8e8e2b5", "score": "0.7500667", "text": "def content_type\n resource.content_type\n end", "title": "" }, { "docid": "cda87ae0a5517e5889d40e1bdb01c844", "score": "0.7490417", "text": "def content_type\n self.header 'Content-Type'\n end", "title": "" }, { "docid": "e901e1573f0e4c6b886761665e4fcb8a", "score": "0.7454418", "text": "def content_type_with_parameters\n content_type_from_legacy_post_data_format_header ||\n env['CONTENT_TYPE'].to_s\n end", "title": "" }, { "docid": "2bc4c08e32c0d53488b56d5a880a82d6", "score": "0.7441419", "text": "def content_type_header?(header)\n request.content_type == header\n end", "title": "" }, { "docid": "2bc4c08e32c0d53488b56d5a880a82d6", "score": "0.7441419", "text": "def content_type_header?(header)\n request.content_type == header\n end", "title": "" }, { "docid": "456dcbb210da58fdefce5e2c26b2f382", "score": "0.7441277", "text": "def content_type_from_accept_header\n best_q_match(accept, configuration.mime_types)\n end", "title": "" }, { "docid": "ae1b2a8f73062bd2b34de4a23030e219", "score": "0.7440398", "text": "def content_type ; @request.env['CONTENT_TYPE'] ; end", "title": "" }, { "docid": "75d628c8daa7705566e7c55fc3b6e2c5", "score": "0.73923177", "text": "def content_type\n content_type_class.constantize if content_type_class\n end", "title": "" }, { "docid": "08553b8cfa7b1b34c9abf0387be1c0a7", "score": "0.7385084", "text": "def content_type\n document[:contentType]\n end", "title": "" }, { "docid": "08553b8cfa7b1b34c9abf0387be1c0a7", "score": "0.7385084", "text": "def content_type\n document[:contentType]\n end", "title": "" }, { "docid": "564cd78d76014c82b2757388c4a19b22", "score": "0.73818827", "text": "def content_type(obj)\r\n if obj.is_a? File\r\n return MIME::Types.type_for(obj.path).first\r\n else\r\n return obj.headers_hash[\"content-type\"]\r\n end\r\n end", "title": "" }, { "docid": "5a8ad9b79c1568db2eee0a53010d506f", "score": "0.7374123", "text": "def content_type?(request)\n config[:type].each{ |regex| return true if request.env[\"CONTENT_TYPE\"] =~ regex }\n false\n end", "title": "" }, { "docid": "0935256ebc6a920eeb3e49f4f1b4a119", "score": "0.73318356", "text": "def media_type\n _, content_type = self.headers.detect do |h, v|\n h.downcase == 'Content-Type'.downcase\n end\n if content_type\n return content_type[/^([^;]*);?.*$/, 1].strip.downcase\n else\n return nil\n end\n end", "title": "" }, { "docid": "52746d7521b0cdb3682af82038108b9f", "score": "0.73157936", "text": "def content_type\n @attributes[:content_type]\n end", "title": "" }, { "docid": "cb34a0e555507136aac450d3723df4ee", "score": "0.7302828", "text": "def content_type(object)\r\n if object.is_a? File\r\n return MIME::Types.type_for(object.path).first\r\n else\r\n return object.meta[\"content-type\"]\r\n end\r\n end", "title": "" }, { "docid": "ea9036bf55642426bfe9e37a3a21aa67", "score": "0.7276207", "text": "def content_type\n content_type_id ? CONTENT_TYPES[content_type_id] : nil\n end", "title": "" }, { "docid": "02640f951ece7f937d56c9fb9e846146", "score": "0.726917", "text": "def content_type\n @content_type ||= ::MIME::Types.type_for(filename).first.to_s\n end", "title": "" }, { "docid": "184289ad1b495765d95a3c137aece4b4", "score": "0.72543937", "text": "def get_content_type\n self.send(\"#{prefix}_content_type\")\n end", "title": "" }, { "docid": "10484225130f9a309b50f0cd7c30e8d0", "score": "0.7254023", "text": "def content_type\n puts 'content_type'\n end", "title": "" }, { "docid": "b4395cc4e7ddb6aec5a05f5d8353dd2c", "score": "0.7225287", "text": "def content_type(type = nil)\n @content_type = type unless type.nil?\n @content_type ||= 'application/json'\n end", "title": "" }, { "docid": "d85b37f9c74e2e99b33017eefdca758c", "score": "0.7220726", "text": "def acceptable_content_type?\n\t\treq = self.request or return true\n\t\tanswer = req.accepts?( self.content_type )\n\t\tself.log.warn \"Content-type %p NOT acceptable: %p\" %\n\t\t\t[ self.content_type, req.accepted_mediatypes ] unless answer\n\n\t\treturn answer\n\tend", "title": "" }, { "docid": "00052f803d9fe42783152a657c8ea06b", "score": "0.720932", "text": "def content_type\n @env[Merb::Const::UPCASE_CONTENT_TYPE]\n end", "title": "" }, { "docid": "f60bb8ef2f3fd61be6140a6ea6526598", "score": "0.7207224", "text": "def content_type\n object.content_type.try(:underscore)\n end", "title": "" }, { "docid": "34c6f8f54e73f9df09734d9748cfeef7", "score": "0.7206613", "text": "def content_type\n @gapi.content_type\n end", "title": "" }, { "docid": "738a9977c3fa1364bd665a32808af8fb", "score": "0.71851474", "text": "def content_type=(value)\n @content_type = value\n end", "title": "" }, { "docid": "738a9977c3fa1364bd665a32808af8fb", "score": "0.71851474", "text": "def content_type=(value)\n @content_type = value\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "75948313f8262ddece10124bede011b6", "score": "0.0", "text": "def set_super_fan\n @super_fan = SuperFan.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@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.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
28896847dd9177f2d6b09eec889fe8b3
compile apex classes toCompile what to compile returns compilation results
[ { "docid": "75afc539de94e7722bf22ade4a31f096", "score": "0.8017005", "text": "def compileClasses(toCompile)\r\n\t\tif @successfulLogin\r\n\t\t\treturn @sfApex.compileClasses(:scripts => toCompile)\r\n\t\tend\r\n\tend", "title": "" } ]
[ { "docid": "58076b9a19ee9fbce77dab50cf3e4b7c", "score": "0.76522726", "text": "def compileclass\n \n end", "title": "" }, { "docid": "41ceb3537b0f33c2ebe4159a027779a9", "score": "0.7230596", "text": "def compile\n end", "title": "" }, { "docid": "41ceb3537b0f33c2ebe4159a027779a9", "score": "0.7230596", "text": "def compile\n end", "title": "" }, { "docid": "546eae1d473220656747d39137418df0", "score": "0.7202806", "text": "def compile; end", "title": "" }, { "docid": "546eae1d473220656747d39137418df0", "score": "0.7202806", "text": "def compile; end", "title": "" }, { "docid": "d0d7d52cfee7eb428b58217f3db87842", "score": "0.71790034", "text": "def compile\n end", "title": "" }, { "docid": "1689152762c0ef6133fd6ecdcc18153b", "score": "0.7148068", "text": "def compile\n \n end", "title": "" }, { "docid": "31415fa34f331abfd8c8019f3a182285", "score": "0.7017155", "text": "def compile\n command = []\n command << @acompc_path\n command << @acompc_extra_opts\n command << \"-source-path\"\n command << @source_path\n command << \"-include-classes\"\n command << @include_classes.join(\" \")\n command << \"-output\"\n command << @output_path \n process(command)\n end", "title": "" }, { "docid": "984a7274f2f076ac059e746e0bdc2924", "score": "0.6986649", "text": "def compiledo\n\n end", "title": "" }, { "docid": "4dbce7c7e6c8e2c0763ca29b5d5e94a9", "score": "0.6778335", "text": "def compile\n @rest.each do |py|\n begin\n Compiler.compile_file py, nil, @print\n rescue Compiler::Error => e\n e.show\n end\n end\n end", "title": "" }, { "docid": "7fe1428fd56438e453d50dafa004877d", "score": "0.67508644", "text": "def compile(*args); end", "title": "" }, { "docid": "7fe1428fd56438e453d50dafa004877d", "score": "0.67508644", "text": "def compile(*args); end", "title": "" }, { "docid": "377228ef37730ffc23f146fa22b2a769", "score": "0.6743668", "text": "def compile!; end", "title": "" }, { "docid": "76367544513e930277a74655dcd8206e", "score": "0.6681244", "text": "def compile\n\t\t\tcompile = Cfp_Compile.new @cf,@parser\n\t\t\t@codetree.each do | code |\n\t\t\t\tcompile.do_compile code\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "9324d6c63fbdaabe190a9fed208f8150", "score": "0.664338", "text": "def compile\n raise 'must subclass'\n end", "title": "" }, { "docid": "13ddf37c4f651637803126533474fbb3", "score": "0.6635042", "text": "def compile\n raise \"Method 'compile' must be defined\"\n end", "title": "" }, { "docid": "18566d9cd49b15608c922dafcd106028", "score": "0.6601004", "text": "def _compile!\n _compile_skipped!\n _compile_record!\n _compile_serialization!\n end", "title": "" }, { "docid": "d4b77b978d87b7a92921febbd923f636", "score": "0.6509966", "text": "def compile\n fail \"Method 'compile' must be defined\"\n end", "title": "" }, { "docid": "d4b77b978d87b7a92921febbd923f636", "score": "0.6509966", "text": "def compile\n fail \"Method 'compile' must be defined\"\n end", "title": "" }, { "docid": "f64d1059875fedc90be095293f42ad68", "score": "0.65063274", "text": "def compile\n @source_code\n end", "title": "" }, { "docid": "1efb6978f2e6d08b46486c56771fe585", "score": "0.6466151", "text": "def compiler; end", "title": "" }, { "docid": "1efb6978f2e6d08b46486c56771fe585", "score": "0.6466151", "text": "def compiler; end", "title": "" }, { "docid": "47d148d907b06c048ba8636d932cbcee", "score": "0.6399156", "text": "def compile\n overlay_java\n end", "title": "" }, { "docid": "c2734ff5630564e1a97d82f3cc1ce588", "score": "0.6386336", "text": "def compile\n define_inspect_method\n define_eql_method\n define_equivalent_method\n define_hash_method\n\n self\n end", "title": "" }, { "docid": "af405b514d66d7e1d2342d0d6033550b", "score": "0.6342893", "text": "def compile\n define_inspect_method\n define_eql_method\n define_equivalent_method\n define_hash_method\n self\n end", "title": "" }, { "docid": "23f7f11fe5baa614ab00b9165069987d", "score": "0.63371235", "text": "def compile(_argv)\n puts generate_compile_output\n end", "title": "" }, { "docid": "91c15f3c1d4b10b13a1c213be5d78c43", "score": "0.6327387", "text": "def compile\n generate_pdf(nil, false)\n generate_crossref\n # generate_jats\n end", "title": "" }, { "docid": "0ce275eb43fec34387348e04f104932f", "score": "0.63167804", "text": "def compile\n @static_compiler ||= StaticCompiler.new self\n static_compiler.compile\n end", "title": "" }, { "docid": "e0ee1e5afde96bf32869a6e3cca88541", "score": "0.63127214", "text": "def compile(*args)\n\t filtered_args, vm = prepare_call(args)\n\t CompiledCall.new(self, filtered_args, vm)\n\tend", "title": "" }, { "docid": "e0851b515da6701b986fd04b95a216e2", "score": "0.62776685", "text": "def compile\n generate_pdf\n generate_xml\n generate_html\n generate_crossref\n end", "title": "" }, { "docid": "c0dd838f28f8d9934ea55bcb868b9cac", "score": "0.6271247", "text": "def compile_code(entry, stage_klass)\n\t\t@tobe_compiled.push [entry, stage_klass]\n\tend", "title": "" }, { "docid": "61298ef9085634ee624e2873e472c56e", "score": "0.6265406", "text": "def compile!\n raise NotImplementedError\n end", "title": "" }, { "docid": "369c1d744085c1a2e84385eb123bd705", "score": "0.6246596", "text": "def compile\n depends :init, :resolve_dependencies\n\n if @no_compile\n loud_message(\"--no-compile option found. Skipping compilation.\")\n else\n compile_only = config_source['compile_only']\n unless compile_only.nil?\n loud_message(\"compile_only option found. Only specified modules will be compiled.\")\n module_names = compile_only.split(/,/)\n module_names.each do |name|\n build_module = @module_set[name]\n build_module.compile(@jvm_set, @build_results, ant, config_source, @build_environment)\n end\n else\n @module_set.each do |build_module|\n build_module.compile(@jvm_set, @build_results, ant, config_source, @build_environment)\n end\n end\n end\n end", "title": "" }, { "docid": "8612af272d6abaaf51ef31af2e5f399e", "score": "0.6236173", "text": "def compile()\n raise \"Not Implemented\"\n end", "title": "" }, { "docid": "ce518ebd241ba376838f9c73eda5636e", "score": "0.62236845", "text": "def compileif\n\n end", "title": "" }, { "docid": "d9f0b41848daaf4754d149317abd9dca", "score": "0.6202614", "text": "def compile_all\n preprocess_scripts\n preprocess_styles\n preprocess_slim\n copy_other_files\n self\n end", "title": "" }, { "docid": "5120a502b21d22f3b7d10b05c78d6d9b", "score": "0.6189511", "text": "def generate_java_from_and_to_methods(classname, attributes)\n\t\tcode = []\n\t\t# TODO\n\t\tcode\n\tend", "title": "" }, { "docid": "4a5d02645298a62981b9a597ddd3fced", "score": "0.61629677", "text": "def compile exp\n alloc_vtable_offsets(exp)\n compile_main(exp)\n # after the main function, we ouput all functions and constants\n # used and defined so far.\n output_functions\n output_vtable_thunks\n output_vtable_names\n output_constants\n @e.flush\n end", "title": "" }, { "docid": "7925c0804a363e23bfb7637455616087", "score": "0.61596864", "text": "def makeCompile()\n\t\t\t\tAntr::Make.setupMake(@@builder, 'make')\n\t\t\tend", "title": "" }, { "docid": "eee12d45f189f65d77bf251660375e71", "score": "0.6142076", "text": "def compile\n \n init_compile\n \n #first check the scope\n if @scope.nil? or not @productions.has_key? @scope.to_sym\n raise \"You must give a legal scope\"\n end\n \n compile_scope\n \n #compile and eval all the productions\n @productions.values.each { |prod| compile_production(prod) }\n \n class_eval(@code)\n @compiled = true\n end", "title": "" }, { "docid": "1ef225dbc7e6a1d4ab489c997ce7225b", "score": "0.6125408", "text": "def compile\n @output = @ast.compile_to_ruby\n end", "title": "" }, { "docid": "cf15544a4ad1ec3bd51e59bac9999da0", "score": "0.6106769", "text": "def compile\r\n require 'netlinx/compiler'\r\n compiler = NetLinx::Compiler.new\r\n result = compiler.compile self\r\n end", "title": "" }, { "docid": "a5fca4bdae9fea66116ece751f1504b6", "score": "0.6097157", "text": "def compilelet\n\n end", "title": "" }, { "docid": "aed7f2f527028610974d7b04153fb3d1", "score": "0.6056991", "text": "def compileCXX(params)\n\t\traise \"to be implemented by subclasses\"\n\tend", "title": "" }, { "docid": "7e47e744fe51cf26f6f944ffff6898e8", "score": "0.6050999", "text": "def generate\n\tself.generate_native\n\tself.generate_fallback\n\tself.compile\nend", "title": "" }, { "docid": "87d7aff716115af5a4869b9c564f0e73", "score": "0.60313994", "text": "def compilesubroutine\n\n end", "title": "" }, { "docid": "baed0058e4f80f7a273a72ae976901ab", "score": "0.60224754", "text": "def compile\n cmd = \"java -jar #{compiler_file_location}\"\n cmd << \" --compilation_level #{@compilation_level}\" if @compilation_level\n cmd << \" --formatting #{@formatting}\" if @formatting\n all_files.each do |file|\n cmd << \" --js #{file}\"\n end\n cmd << \" --js_output_file #{output_path}\"\n \n output = `#{cmd}`\n \n output_path\n end", "title": "" }, { "docid": "78fe7903ff30d63d1a423934bfcdad35", "score": "0.60109854", "text": "def compile_additions\n internal_compiler.compile_additions\n end", "title": "" }, { "docid": "78fe7903ff30d63d1a423934bfcdad35", "score": "0.60109854", "text": "def compile_additions\n internal_compiler.compile_additions\n end", "title": "" }, { "docid": "7fa234d93d4de62b8f6199d653ba81af", "score": "0.6007621", "text": "def compile(individuo)\n compileString = \"javac -classpath libs/robocode.jar robots/Individuo\"+individuo.to_s+\"/Individuo\"+individuo.to_s+\".java\"\n system(compileString)\n end", "title": "" }, { "docid": "b16a9343e20e16794050bceb0c643164", "score": "0.60043156", "text": "def compile\n Ruhoh::Program.compile(@args[1])\n end", "title": "" }, { "docid": "a350f9fc1874aa050fd90a7f8bd920c8", "score": "0.59993535", "text": "def args; @compiler.args; end", "title": "" }, { "docid": "89b7b0de9251e396e26d40ed45cee6f1", "score": "0.5980902", "text": "def prepared(includeClassName: false)\n compile(encode: false, includeClassName: includeClassName)\n end", "title": "" }, { "docid": "002d519d68da294bb72ac794083e06b1", "score": "0.5962039", "text": "def compileSrc(deploy_dir, build_classpath, src_dir)\n ant.javac( :memoryMaximumSize => @@javac_max_mem, :fork => \"yes\", :executable => @@java_home+\"\\\\bin\\\\javac\", :target =>@@java_version, :debug => @@debug, :destdir => deploy_dir, :includeantruntime => @@includeantruntime) do\n classpath :refid => build_classpath\n src { pathelement :location => src_dir }\n end\nend", "title": "" }, { "docid": "f0e652aa1094f2222444f1e784fc1a38", "score": "0.59614426", "text": "def compile\n cleanup\n compass_build\n sprockets_build\n mustache_build\n end", "title": "" }, { "docid": "5b8370b40eb8d4d3914c4543042c019a", "score": "0.59601104", "text": "def compile_java\n mkdir_p \"pkg/classes\"\n sh \"javac -Xlint -Xlint:-serial -g -target 1.5 -source 1.5 -d pkg/classes #{jruby_classpath} #{FileList['src/**/*.java'].join(' ')}\"\nend", "title": "" }, { "docid": "a78409b363215e29bd10ce4924e540e6", "score": "0.5959526", "text": "def compile\n command = []\n command << @mxmlc_path\n command << @mxmlc_extra_opts\n command << \"-source-path #{@source_paths.join(\" \")}\"\n command << \"-library-path+=#{@library_path}\" unless @library_path.blank?\n command << \"-output\"\n command << escape(@swf_path)\n command << \"-debug=#{@debug}\" unless @debug.nil? \n command << \"--\"\n command << escape(@target_file)\n process(command)\n end", "title": "" }, { "docid": "a1831203f1200a189014b16a8f8e61e1", "score": "0.59504205", "text": "def compile\n return unless @compile\n `mvn --quiet clean compile assembly:single`\n end", "title": "" }, { "docid": "3cb42bd92ecaa7e7026095896bd0240d", "score": "0.5934064", "text": "def compile\r\n compiler_results = []\r\n \r\n @projects.map do |project|\r\n project.systems.select do |system|\r\n ENV['NETLINX_ACTIVE_SYSTEM_ONLY'] ? system.active : true\r\n end\r\n end.flatten.each do |system|\r\n system.compile.each { |result| compiler_results << result }\r\n end\r\n \r\n compiler_results\r\n end", "title": "" }, { "docid": "328bf800d89cb927f215d2b22eed1817", "score": "0.59259355", "text": "def _compile!\n code = @collection.attributes.map do |_,attr|\n %{\n def deserialize_#{ attr.mapped }(value)\n #{ attr.load_coercer }(value)\n end\n }\n end.join(\"\\n\")\n\n instance_eval <<-EVAL, __FILE__, __LINE__\n def to_record(entity)\n if entity.id\n Hash[#{ @collection.attributes.map{|name,attr| \":#{ attr.mapped },#{ attr.dump_coercer }(entity.#{name})\"}.join(',') }]\n else\n Hash[].tap do |record|\n #{ @collection.attributes.reject{|name,_| name == @collection.identity }.map{|name,attr| \"value = #{ attr.dump_coercer }(entity.#{name}); record[:#{attr.mapped}] = value unless value.nil?\"}.join('; ') }\n end\n end\n end\n\n def from_record(record)\n ::#{ @collection.entity }.new(\n Hash[#{ @collection.attributes.map{|name,attr| \":#{name},#{attr.load_coercer}(record[:#{attr.mapped}])\"}.join(',') }]\n )\n end\n\n #{ code }\n EVAL\n end", "title": "" }, { "docid": "87882a679c96fe2756c38d41e48998e2", "score": "0.58960354", "text": "def interpret\n @ins.each do |inst|\n compile inst\n end\n end", "title": "" }, { "docid": "3930d9c22a51ee854ec124482022d1fa", "score": "0.585709", "text": "def compile(fns, option = RakeOption::new)\n ret = []\n [fns].flatten.each {|fn|\n obj_fn = (option.obj_tag+[fn.ext('')]).join('-').gsub('/','-').ext(OBJ_EXT)\n case File.extname(fn)\n when '.cpp', '.cxx', '.cc'\n file obj_fn => fn do |t|\n sh \"#{option.compiler || CXX} #{fn} -c -o #{obj_fn} #{option.compile.join(' ')}\"\n end\n when '.cu'\n file obj_fn => fn do |t|\n sh \"#{option.compiler || NVCC} #{fn} --keep -c -o #{obj_fn} #{option.compile.join(' ')}\"\n # leave .cubin and .ptx , remove any other intermediate files\n im_files = ['cudafe?.*', 'linkinfo', 'cu.cpp', 'fatbin.*', 'hash', 'cpp?.*'].map{|excess_ext|\n fn.ext(excess_ext)\n }\n sh \"rm -f #{im_files.join(' ')}\"\n end\n CLEAN.include(fn.ext('ptx'))\n CLEAN.include(fn.ext('*.cubin'))\n end\n CLEAN.include(obj_fn)\n ret.push(obj_fn)\n }\n return ret\nend", "title": "" }, { "docid": "aa42e058211f67ea18c5ca5166dab752", "score": "0.5841022", "text": "def make_source\n @namespace = common_class_prefix if meta(:namespace) == \"true\"\n @prefix = meta(:classprefix) if meta(:classprefix)\n master_files = [ \"TalkEnumeration.swift\", \"TalkProtocol.swift\", \"TalkGlossary.swift\"]\n master_files.each { |template| generate_template(template) }\n \n @base[:class].each do |cls|\n @current_class = cls\n @current_class[:field] ||= []\n file_base = filename_for_class(cls)\n generate_template(file_base+\".swift\", \"class.swift.erb\")\n end\nend", "title": "" }, { "docid": "47259850cca7fe63eba7f989f7627b0f", "score": "0.5816574", "text": "def execute( io = $stderr )\n raise 'No source files' if @source_files.nil? || @source_files.empty?\n \n io.puts 'javac …' if @verbose\n \n execute_compiler(io)\n end", "title": "" }, { "docid": "e17d3fe95c34fbc43127013b9860c553", "score": "0.5807422", "text": "def compile\n compile_conditions\n compile_params\n @generator = Generator.new(@segments, @symbol_conditions, @identifiers).compiled\n end", "title": "" }, { "docid": "9c05dfe2d71d407129cab0cbeb0938f1", "score": "0.5804484", "text": "def compile\n helper :truthy\n\n fun_name = top_scope.new_temp\n ff = \"#{fun_name}.$$ff\"\n\n push \"(typeof #{fun_name} === 'undefined' ? (#{fun_name} = function(from, to){\"\n push \" if (typeof #{ff} === 'undefined') #{ff} = false;\"\n push \" var retval = #{ff};\"\n push \" if (!#{ff}) {\"\n push \" #{ff} = retval = $truthy(from());\"\n push \" }\"\n push \" #{excl}if (#{ff}) {\"\n push \" if ($truthy(to())) #{ff} = false;\"\n push \" }\"\n push \" return retval;\"\n push \"}) : #{fun_name})(\"\n push \" function() { \", stmt(compiler.returns(from)), \" },\"\n push \" function() { \", stmt(compiler.returns(to)), \" }\"\n push \")\"\n end", "title": "" }, { "docid": "5ce879f1637eb4170df026eac0eb7052", "score": "0.5802539", "text": "def compile(*paths)\n open {|m| m.compile(paths) }\n end", "title": "" }, { "docid": "35ccac4e809831dbf264b14ca054579e", "score": "0.5796575", "text": "def compile(caller=nil)\n FileUtils.mkdir_p tmp_path unless File.directory?(tmp_path)\n ddputs(\"Compiling cloud #{self.name} to #{tmp_path/\"etc\"/\"#{dependency_resolver_name}\"}\")\n dependency_resolver.compile_to(ordered_resources, tmp_path/\"etc\"/\"#{dependency_resolver_name}\", caller)\n end", "title": "" }, { "docid": "75bed7eb3d84f185f87c748c915689d7", "score": "0.5774935", "text": "def compileClass2(tokens, compilerInfo)\n str = \"\"\n table = SymbolsTable.new(tokens[1][1], [], [])\n i = 0\n #terminal class\n if notToLarge(tokens, i) and isCorrectToken(tokens, i, \"class\")\n i+=1\n end\n\n # terminal className, check if legal!\n if notToLarge(tokens, i) and isIdentifier(tokens[i][1])\n this = tokens[i][1]\n i+=1\n end\n\n # terminal {\n if notToLarge(tokens, i) and isCorrectToken(tokens, i, \"{\")\n i+=1\n end\n\n #classVarDec*\n\n resultList = compileClassVarDec2(tokens, compilerInfo, i, table)\n table = resultList[0]\n i = resultList[1]\n\n #subroutineDec*\n resultList = compileSubroutineDec2(tokens, compilerInfo, i, this, table)\n str += resultList[0]\n methodsTableList = resultList[1]\n i = resultList[2]\n\n # terminal }\n if notToLarge(tokens, i) and isCorrectToken(tokens, i, \"}\")\n end\n\n\n return [str, table, methodsTableList]\nend", "title": "" }, { "docid": "528bd18eb70ee338bc358ed6232e9405", "score": "0.57688296", "text": "def compile\n stdin, stdout, stderr = Open3.popen3(\"java org.antlr.Tool #{@@GRAMMARDIR}/#{@@GRAMMARFILE}\")\n eput = []\n stderr.each do |line| eput << line end\n\n ecount = 0\n eput.each do |line|\n puts line\n if !line.match(/error|warning/).nil? then ecount += 1 end\n end\n\n IO.popen(\"javac #{@@GRAMMARDIR}/#{File.basename(@@GRAMMARFILE, '.g')}*.java\") do |io|\n io.each_line {}\n end\n\n return ecount\n end", "title": "" }, { "docid": "af1d64d25d3276553a9dbe109ae3ecb0", "score": "0.5768465", "text": "def run_all\n compile(Dir['**/*.ts'])\n end", "title": "" }, { "docid": "0e39cd399de973653c4fc44d313284da", "score": "0.5765292", "text": "def compile(*args, &block)\n instance_exec(*args, &block)\n end", "title": "" }, { "docid": "6e3bbf0de51350c2f58db6dcf6bcfd34", "score": "0.5760352", "text": "def compile(*args)\n # List of user-added flags\n params = { :flags => [], :o => \"\", :c => \"$(CC)\" }\n args.each do |arg|\n if arg.class == Hash then arg.each_pair do |k, v|\n if k.is_in [:input, :i, \"input\" ] then params[:i] = v.to_macro\n elsif k.is_in [:output, :o, \"output\" ] then params[:o] = v.to_macro\n elsif k.is_in [:compiler, :c, \"compiler\"] then params[:c] = v.to_macro\n end\n end\n else\n case arg\n when :to_obj, :obj, \"-c\" then params[:flags].push \"-c\"\n when :to_asm, :asm, \"-S\" then params[:flags].push \"-S\"\n when :debug, \"-g\"; then params[:flags].push \"-g\"\n when :$@, \"$@\" then params[:o] = \"$@\"\n else params[:flags].push arg.to_macro\n end\n end\n end\n if params[:i].nil?\n # Add the rule's dependencies as inputs\n params[:i] = mfr.dependencies.find_all { |d| not d.has_suffix(\".h\") }\n else\n # Turn an individual string into a list\n params[:i] = [params[:i]].flatten.join \" \"\n end\n params[:o] = \"-o #{params[:o]}\" unless params[:o] == \"\"\n params[:flags] = params[:flags].join \" \"\n mfr.compile params\nend", "title": "" }, { "docid": "59de52fe1c6e0afc4a4413d5c81d029a", "score": "0.573938", "text": "def javac( source_files, options = nil, &block )\n Pangolin::exec_command(Pangolin::Javac.new(*source_files), options, block)\nend", "title": "" }, { "docid": "aa31b85c6dd0750c7a3b8db22be4f03c", "score": "0.5736792", "text": "def compile(code)\n parser = RubyParser.new\n sexp = parser.parse(code)\n # pp sexp\n \n visitor = Visitor.new(@generator, self)\n visitor.visit(sexp)\n \n @generator.program\n end", "title": "" }, { "docid": "ec76019ea7d10cd5afea5386e84e31ad", "score": "0.57216436", "text": "def compileall(from, to)\n require 'coffeecompiler'\n \n outDir = File.expand_path to\n coffeeDir = File.expand_path from\n puts \"Compiling all files: #{coffeeDir} -> #{outDir}\"\n compiler = CoffeeCompiler.new './globalizer.coffee'\n begin\n compiler.compileAll(__FILE__, coffeeDir, outDir)\n rescue Exception => ex\n puts ex.inspect\n end\n\nend", "title": "" }, { "docid": "02eb2366cc83183ede014064296f99f8", "score": "0.57093424", "text": "def commands_for_vm\n [{:write_file => {:filename => 'Pirate.java', :content => @process_code}},\n {:execute => {:command => 'javac -cp $LIB$/java $PATH$/Pirate.java', :stderr => 'compile', :permissions => 'read-write'}},\n {:execute => {:command => 'echo ok', :stdout => 'ok'}}]\n end", "title": "" }, { "docid": "33edc49fb834585a7ac8ce812502ef2c", "score": "0.5708242", "text": "def compileexpressionlist\n\n end", "title": "" }, { "docid": "973f7edd00097be3d73a40e8c0af6fba", "score": "0.5707401", "text": "def pre_compile_execute(arg_hash); end", "title": "" }, { "docid": "fef95a568c73c825fc08c826c493e36e", "score": "0.570444", "text": "def compile_all\n preprocess_scripts\n preprocess_styles\n preprocess_slim\n copy_mp3\n self\n end", "title": "" }, { "docid": "145424f063fa093efbf9bae5ac6185ed", "score": "0.5699269", "text": "def compileparameterlist\n\n end", "title": "" }, { "docid": "884e4052c8c7c2fdf2a8e2520fcef9b9", "score": "0.56975925", "text": "def compile_source_files(project)\n @obj_files = []\n num_errors = 0\n error_str = ''\n\n # Compile files\n project.files.each do |src_file|\n print \" #{src_file}\"\n\n # Get the object filename \n obj_file = BAKE_DIR + src_file.sub(/\\.[\\w+]+$/, \".o\")\n @obj_files << obj_file\n\n # Build the compile command\n command = \"g++ -c #{src_file} -o #{obj_file}\"\n if !project.inc_paths.empty?\n command += ' -I' + project.inc_paths.join(' -I')\n end\n\n # Run the command and save output in a temp file\n system(command + ' &> ' + COMPILER_OUTPUT_FILEPATH)\n \n # If the command failed, record the errors\n if !$?.success?\n print \" (failed)\"\n num_errors += 1\n error_str += Utils.read_file(COMPILER_OUTPUT_FILEPATH, ' ')\n end\n print \"\\n\"\n end\n\n # Raise errors if we encountered any\n raise \"\\nCompiler errors:\\n\\n#{error_str}\\n\" if num_errors > 0\n end", "title": "" }, { "docid": "498f231deacf31a65ede1de85fd55344", "score": "0.56913906", "text": "def generate_from_and_to_methods(classname, attributes)\n\t\tcase @language\n\t\twhen :java, :java_lombok\n\t\t\treturn generate_java_from_and_to_methods(classname, attributes)\n\t\twhen :ruby\n\t\t\treturn generate_ruby_from_and_to_methods(classname, attributes)\n\t\telse \n\t\t\terror_and_exit \"Could not convert to output language #{@language}\"\n\t\tend\n\tend", "title": "" }, { "docid": "ddfc21a48e61b5dc13807a2e6e19a633", "score": "0.5674463", "text": "def compile_data\n # See lib/compiler.rb Compiler.compile_project, it\n # operates on the compilers in aggregate. Those compilers\n # don't use #compile nor #compile_data and the code\n # needs to stay in sync.\n @project.compile_each_organism do |org|\n self.create_row_for_organism(org)\n end\n end", "title": "" }, { "docid": "4463e27691cfdddf51827deebf546268", "score": "0.5672979", "text": "def do_classes\n\n # look for class renames like\n # %rename(Solvable) _Solvable;\n # typedef struct _Solvable {} XSolvable; /* expose XSolvable as 'Solvable' */\n\n extends = Hash.new\n @body.scan(/^%rename\\s*\\(([^\\\"\\)]+)\\)\\s+([_\\w]+);/) do |class_name, struct_name|\n#\tputs \"rename #{class_name} -> #{struct_name}\"\n\textend_name = struct_name.to_s\n\t@body.scan(/typedef\\s+struct\\s+#{struct_name}\\s*\\{[^}]*\\}\\s*(\\w+);/) do |ename|\n\t extend_name = ename.to_s\n\tend\n\t\n#\tputs \"extend #{extend_name}, class #{class_name}, struct #{struct_name}\"\n\t# find the corresponding '%extend' directive\n\t@body.scan(/^%extend\\s+(#{extend_name}|#{struct_name})\\s*\\{(.*)\\}/mx) do |name,content|\n\t # now check if we have multiple %extend, the regexp above is greedy and will match all of them\n\t while content.to_s =~ /^%extend/\n\t content = $` # discard %extend and everything behind\n\t end\n\t extends[name] = true\n\t cn = class_name.to_s\n\t cn.capitalize! unless cn[0,1] =~ /[A-Z_]/\n\t swig_class = handle_class_module(\"class\", cn, :parent => \"rb_cObject\", :content => content.to_s, :extend_name => name)\n\tend\n end\n @body.scan(/^%extend\\s*(\\w+)\\s*\\{(.*)\\}/mx) do |class_name,content|\n\tcn = class_name.to_s\n\tunless extends[cn]\n#\t puts \"Class #{cn}\"\n\t cn.capitalize! unless cn[0,1] =~ /[A-Z_]/\n\t swig_class = handle_class_module(\"class\", cn, :parent => \"rb_cObject\", :content => content)\n\t extends[cn] = true\n\tend\n end\n end", "title": "" }, { "docid": "d67dbfcc88b922763f036452c8e1d59f", "score": "0.5660976", "text": "def compile\n # This will hold the dict @fragments\n @fragment = []\n\n bridge_support_files.each do |file_path|\n doc = xml_document(file_path)\n\n next unless doc.root.has_elements?\n\n puts \"Compiling: %s\" % file_path.split(\"/\").last\n\n doc.root.each_element do |node|\n case node.name\n when \"class\"\n parse_class(node)\n when \"informal_protocol\"\n parse_class(node)\n when \"function\"\n parse_function(node)\n when \"constant\"\n parse_constant(node)\n when \"enum\"\n parse_enum(node)\n when \"cftype\"\n when \"function_alias\"\n when \"opaque\"\n when \"string_constant\"\n when \"struct\"\n end\n end\n end\n \n # Sort the @fragment\n @fragment.sort!\n \n # Remove duplicates, not sure if this really works\n @fragment.uniq!\n\n return to_plist\n end", "title": "" }, { "docid": "80966062f9fdd7a55e4e3cc109249216", "score": "0.5659517", "text": "def compile(sources, cflags)\n outputs = []\n for s in sources\n ext = File.extname(s)\n \n case ext\n when '.c'\n cc = 'gcc'\n \tlang_flags = '-std=gnu11 $CFLAGS $CPPFLAGS'\n when '.cpp', '.cc'\n cc = 'g++'\n \tlang_flags = '-std=gnu++14 $CXXFLAGS $CPPFLAGS'\n else\n raise \"Unknown extension #{ext}\"\n end\n\n output = s + '.o'\n outputs << output\n puts \"#{cc} -o #{output} #{lang_flags} #{cflags} -c #{s}\\n\"\n end\n\n return outputs\nend", "title": "" }, { "docid": "bafe66cb2ae2e4d1338801323a8d1bae", "score": "0.565708", "text": "def compile\n generate_pdf\n generate_crossref\n end", "title": "" }, { "docid": "1f8a236b78a7a8e03e0cb077083bf005", "score": "0.56569016", "text": "def main(path)\n testFiles = getTestFiles\n for i in 0..testFiles.size-1\n #compileAndTranslate(testFiles[i])\n end\n\n compileAndTranslate(path)\nend", "title": "" }, { "docid": "dfcea1fcbd832fd4d710923f48fafc4d", "score": "0.56543463", "text": "def compile(encode: true, includeClassName: false)\n run_callbacks :prepare do\n q = {} #query\n q[:limit] = @limit if @limit.is_a?(Numeric) && @limit > 0\n q[:skip] = @skip if @skip > 0\n\n q[:include] = @includes.join(\",\") unless @includes.empty?\n q[:keys] = @keys.join(\",\") unless @keys.empty?\n q[:order] = @order.join(\",\") unless @order.empty?\n unless @where.empty?\n q[:where] = Parse::Query.compile_where(@where)\n q[:where] = q[:where].to_json if encode\n end\n\n if @count && @count > 0\n # if count is requested\n q[:limit] = 0\n q[:count] = 1\n end\n if includeClassName\n q[:className] = @table\n end\n q\n end\n end", "title": "" }, { "docid": "25fcb33bc4bb620e43c163feb4e9cf1e", "score": "0.56537676", "text": "def compile( code )\n code = compile_kernel( code )\n compile_types( YAML.load( code ) )\n compile_words( YAML.load( code ) )\n end", "title": "" }, { "docid": "0ab85ec212fad47a7fe24468681de720", "score": "0.5652977", "text": "def compile(source, options = T.unsafe(nil)); end", "title": "" }, { "docid": "1d0d2f7b7e642b84f08b2ccf1a52291b", "score": "0.5652177", "text": "def compilers\n init_compilers\n @method_compilers\n end", "title": "" }, { "docid": "f46d8b9b770467ae98521b06072c8be4", "score": "0.56497777", "text": "def compile\n evaluator\n self\n end", "title": "" }, { "docid": "2860013ca6a18888f924830682580627", "score": "0.5648859", "text": "def compile_source\n return unless @source\n @attributes = CompiledAttributes.new\n instance_eval(@source)\n @attributes\n end", "title": "" }, { "docid": "7883e5f446bf8ca30e2863aae6621c1f", "score": "0.5643143", "text": "def build_src(dir)\n\n # Models\n for filename in @asts[:model].keys\n path = get_path(filename)\n File.new(\"#{dir}/#{path}\", 'w').puts(@ruby2ruby.process(@asts[:model][filename]))\n end\n\n # Controllers\n for filename in @asts[:controller].keys\n path = get_path(filename)\n begin\n File.new(\"#{dir}/#{path}\", 'w').puts(@ruby2ruby.process(@asts[:controller][filename]))\n rescue\n end\n end\n\n # Views\n for filename in @asts[:view].keys\n path = filename\n begin\n File.new(\"#{path}\", 'w').puts(\"<% protect do %> \"+@gparser.convert_to_erb(@asts[:view][filename],@ruby2ruby)+\"<% end %>\")\n rescue\n txt = File.read path\n File.new(path, 'w').puts \"<% protect do %> #{txt} <% end %>\"\n end\n end\n\n # Libraries\n for filename in @asts[:library].keys\n File.new(\"#{dir}/lib/#{filename}\", 'w').puts(@ruby2ruby.process(@asts[:library][filename]))\n end\n\n # Singleton files\n begin\n File.new(\"#{dir}/db/schema.rb\", \"w\").puts(@ruby2ruby.process(@asts[:migration]))\n rescue\n end\n File.new(\"#{dir}/app/helpers/application_helper.rb\", \"w\").puts(@ruby2ruby.process(@asts[:helper]))\n File.new(\"#{dir}/db/migrate/99999999999999_add_taint_fields.rb\",\"w\").puts(@asts[:taint_migration])\n end", "title": "" }, { "docid": "822fc0803fe3b4b286218f5de33858d2", "score": "0.5636879", "text": "def compile\n # Set the client's parameters into the top scope.\n set_node_parameters\n create_settings_scope\n\n evaluate_main\n\n evaluate_ast_node\n\n evaluate_node_classes\n\n evaluate_generators\n\n finish\n\n fail_on_unevaluated\n\n @catalog\n end", "title": "" }, { "docid": "65a800050029041f4e3923bab6747e6e", "score": "0.563664", "text": "def compile\n Ruhoh::Friend.say { plain \"Compiling for environment: '#{@env}'\" }\n FileUtils.rm_r config['compiled_path'] if File.exist?(config['compiled_path'])\n FileUtils.mkdir_p config['compiled_path']\n\n # Run the resource compilers\n compilers = @collections.all\n # Hack to ensure assets are processed first so post-processing logic reflects in the templates.\n compilers.delete('stylesheets')\n compilers.unshift('stylesheets')\n compilers.delete('javascripts')\n compilers.unshift('javascripts')\n\n\n compilers.each do |name|\n collection = collection(name)\n next unless collection.compiler?\n collection.load_compiler.run\n end\n\n # Run extra compiler tasks if available:\n if Ruhoh.const_defined?(:Compiler)\n Ruhoh::Compiler.constants.each {|c|\n compiler = Ruhoh::Compiler.const_get(c)\n next unless compiler.respond_to?(:new)\n task = compiler.new(self)\n next unless task.respond_to?(:run)\n task.run\n }\n end\n\n true\n end", "title": "" }, { "docid": "eef8f6a9bf6f678a81ade915f23c7cee", "score": "0.5629539", "text": "def compile( code )\n code = compile_kernel( code )\n compile_types( YAML.load( code ) )\n mdl = compile_model( YAML.load( code ), nil ) #Kernel.model )\n Program.new( mdl )\n end", "title": "" }, { "docid": "c6993676f7942449d7d098c2735c6f2a", "score": "0.5620523", "text": "def compile\n # Load the directory entries\n if File.directory?(@_dir)\n\n completions = []\n\n Dir.glob(\"#{@_dir}/*.bridgesupport\") do |x|\n file = File.open(x)\n doc = REXML::Document.new(file)\n\n if doc.root.has_elements?\n STDERR.puts(\"Compiling: %s\" % x) if DebugEnabled\n\n doc.root.each_element do |node|\n case node.name\n when \"class\", \"informal_protocol\"\n completions += self.parse_class(node)\n when \"function\"\n completions += self.parse_function(node)\n when \"function_alias\"\n completions += self.parse_alias(node)\n when \"constant\"\n completions += self.parse_constant(node)\n when \"string_constant\"\n completions += self.parse_string(node)\n when \"enum\"\n completions += self.parse_enum(node)\n when \"struct\"\n # <TODO>\n when \"cftype\"\n # <TODO>\n when \"opaque\"\n # <TODO>\n when \"depends_on\"\n # <TODO>\n when \"interface\"\n # <TODO> for android\n else\n STDERR.puts \"Unknown node #{node.name}\"\n end\n end\n end\n end\n\n # Output results\n STDERR.print(\"Sorting ...\") if DebugEnabled\n\n jobj = JsonObject.new\n jobj[\"scope\"] = \"source.ruby.rubymotion\"\n jobj[\"completions\"] = completions.uniq.sort { |x, y| x.to_s <=> y.to_s }\n\n STDERR.puts(\" done\") if DebugEnabled\n\n return jobj.to_json\n end\n end", "title": "" } ]
020c04739bdfe0ba8e5772da581e1555
GET /corpora/1 GET /corpora/1.json
[ { "docid": "1a0f27b84e7b99a5abe00caeb810cfb1", "score": "0.64728695", "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": "c21f04a17c87d5ddb48983a93514620b", "score": "0.7620643", "text": "def index\n @corpora = Corpus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corpora }\n end\n end", "title": "" }, { "docid": "278bed541a95bb87060e1c0f101e695c", "score": "0.70046455", "text": "def show\n @corp = Corp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corp }\n end\n end", "title": "" }, { "docid": "03abda06d7dbdfca5a26f8496778c3e6", "score": "0.6893087", "text": "def index\n @corpora = Corpus.all\n end", "title": "" }, { "docid": "03abda06d7dbdfca5a26f8496778c3e6", "score": "0.6893087", "text": "def index\n @corpora = Corpus.all\n end", "title": "" }, { "docid": "4bfa9ba812eb9bf5c802c2ff48a69c2c", "score": "0.66723984", "text": "def show\n @corporation = Corporation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corporation }\n end\n end", "title": "" }, { "docid": "4bfa9ba812eb9bf5c802c2ff48a69c2c", "score": "0.66723984", "text": "def show\n @corporation = Corporation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corporation }\n end\n end", "title": "" }, { "docid": "2fb0aabb4b52785d22da8f56429c0701", "score": "0.64300567", "text": "def index\n @corporations = Corporation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corporations }\n end\n end", "title": "" }, { "docid": "c233e05b5b3a40ae26ea6f83e183a1c0", "score": "0.63765275", "text": "def new\n @corp = Corp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corp }\n end\n end", "title": "" }, { "docid": "d8b1d442b8b2ff391936b65127ebc3d1", "score": "0.636684", "text": "def index\n @corals = Coral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corals }\n end\n end", "title": "" }, { "docid": "fce4fafaa6ca69ca64cb8a2716084643", "score": "0.634652", "text": "def corpora_with_http_info(project_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TtsApi.corpora ...\"\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling TtsApi.corpora\"\n end\n # resource path\n local_var_path = \"/projects/{projectID}/corpora\".sub('{' + 'projectID' + '}', project_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'CorporaCollection')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TtsApi#corpora\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d09e101e9aca9b458aa1582eda72df39", "score": "0.6206769", "text": "def show\n @corpus_neutral = CorpusNeutral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus_neutral }\n end\n end", "title": "" }, { "docid": "19795a7d70307b6082d903431a18cb44", "score": "0.61146396", "text": "def index\n @cursoacademicos = Cursoacademico.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursoacademicos }\n end\n end", "title": "" }, { "docid": "fd785afa7bf428915197ff6cd07dba99", "score": "0.6106429", "text": "def show\n @coral = Coral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coral }\n end\n end", "title": "" }, { "docid": "d096a423d8f4ba1d9c9474c4d578adb7", "score": "0.6095755", "text": "def show\n @corporation_saldo = CorporationSaldo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corporation_saldo }\n end\n end", "title": "" }, { "docid": "23cbfeb1331db20f514b66aeefe338fc", "score": "0.60375124", "text": "def new\n @corporation = Corporation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corporation }\n end\n end", "title": "" }, { "docid": "ecb51298646b1e4e258acedb7a7b981a", "score": "0.59593886", "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": "e4d24bacd13e1d74fb061efded6c7be7", "score": "0.5936912", "text": "def show\n @corpus_lead = CorpusLead.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus_lead }\n end\n end", "title": "" }, { "docid": "fdc1dbf589acf89f633d992afe0af075", "score": "0.5909784", "text": "def index\n cors_allow_origin_header(response)\n render json: begin\n @authority.all\n rescue NotImplementedError\n nil\n end\n end", "title": "" }, { "docid": "d503333cac06d92ccbc313f86e2f8f19", "score": "0.5908968", "text": "def show\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curso }\n end\n end", "title": "" }, { "docid": "ab1d5bdee483192d40d050205637b75e", "score": "0.58948225", "text": "def index\n @domains = Domain.all\n\n render json: @domains\n end", "title": "" }, { "docid": "a5a6e4c5431623ee1ea4da03169c3e30", "score": "0.58946896", "text": "def index\n @curriculos = Curriculo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @curriculos }\n end\n end", "title": "" }, { "docid": "7f1796a133bbd968a1cfc10c872c18f7", "score": "0.5887133", "text": "def show\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @curso }\n end\n end", "title": "" }, { "docid": "229e90929026a813fe6f7a130e3f67cf", "score": "0.5880155", "text": "def index\n @convos = Convo.all\n render json: @convos\n end", "title": "" }, { "docid": "121d477554ed2da5933060722f113c9f", "score": "0.5856013", "text": "def index\n @casos = Caso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @casos }\n end\n end", "title": "" }, { "docid": "30870f916a87733a5211bc0cd8f72ada", "score": "0.5851851", "text": "def getOrganization(orgId)\n\tresponse = RestClient.get(\"https://api.trello.com/1/organizations/\"+orgId+\"?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "5b962db9e9992efc13cdaf058c33a0a8", "score": "0.5845133", "text": "def show\n @loco = Loco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loco }\n end\n end", "title": "" }, { "docid": "98a5d45af4066752c89fc4ed34b709b8", "score": "0.58131677", "text": "def show\n @corpus_anews = CorpusAnew.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus_anews }\n end\n end", "title": "" }, { "docid": "d7154131a4d94200ed235f08eba18459", "score": "0.58033276", "text": "def index\n logger.warn 'Linked data authorities do not support retrieving all terms.'\n head :not_found\n end", "title": "" }, { "docid": "d7154131a4d94200ed235f08eba18459", "score": "0.58033276", "text": "def index\n logger.warn 'Linked data authorities do not support retrieving all terms.'\n head :not_found\n end", "title": "" }, { "docid": "a573e4b028012e3999e3b0f80d068377", "score": "0.5797657", "text": "def show\n @consumidor = Consumidor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consumidor }\n end\n end", "title": "" }, { "docid": "d939cfac054bccce927d8ebfe9ccbb04", "score": "0.57941073", "text": "def index\n # specifying json format in the URl\n\t\turi = \"#{API_BASE_URL}/companies.json\"\n\t\t\n # It will create new rest-client resource so that we can call different methods of it\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n # this next line will give you back all the details in json format, \n #but it will be wrapped as a string, so we will parse it in the next step.\n \n companies = rest_resource.get\n\n # we will convert the return data into an array of hash. see json data parsing here\n @companies = JSON.parse(companies, :symbolize_names => true)\n end", "title": "" }, { "docid": "1d41b6ee620dbd85dd46888bd8fe8f5f", "score": "0.5783497", "text": "def show\n @corpus_item = CorpusItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus_item }\n end\n end", "title": "" }, { "docid": "4112047181774d87cd1f27345fe2075b", "score": "0.5763144", "text": "def index\n @logos = current_company.logos.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @logos }\n end\n end", "title": "" }, { "docid": "3391527f87f64dd379570730a8ca17ae", "score": "0.57604283", "text": "def index\n @conductors = Conductor.all\n render :json => @conductors\n end", "title": "" }, { "docid": "eb40784899ac9f9f5f8b1d0cfc29240a", "score": "0.5753562", "text": "def index\n @cursos = Curso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursos }\n end\n end", "title": "" }, { "docid": "a452af31d042ebc766b4bd22cb49d242", "score": "0.57105434", "text": "def index\n @torneos = Torneo.all\n render json: @torneos, status: :ok\n end", "title": "" }, { "docid": "a1c2718430be8712dfb2956a0b7264d3", "score": "0.5710378", "text": "def index\n @corporations = Corporation.all\n end", "title": "" }, { "docid": "a1c2718430be8712dfb2956a0b7264d3", "score": "0.5710378", "text": "def index\n @corporations = Corporation.all\n end", "title": "" }, { "docid": "a213135f274ce6ebaeab0f98c93aa87a", "score": "0.57090807", "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": "ad93012f460fe02f9328a1635287d83e", "score": "0.5684821", "text": "def index\n documentaries = Documentary.all\n json_response(documentaries)\n end", "title": "" }, { "docid": "3a84198e0c8ff36bd6ee832294da7d57", "score": "0.5682767", "text": "def index\n @search = Corretor.search(params[:q])\n @corretors = @search.result\n \n @corretors = Corretor.paginate :page => params[:page], :order => 'created_at DESC', :per_page => 10\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @corretors }\n end\n end", "title": "" }, { "docid": "1b86caab697b8b0f552d3a1ad0dabe29", "score": "0.56797534", "text": "def index\n @codigos = Codigo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @codigos }\n end\n end", "title": "" }, { "docid": "0b91d6617b0fc60e8f5e58a746f57653", "score": "0.56751084", "text": "def index\n repos = owner.repos\n render json: repos\n end", "title": "" }, { "docid": "257584ec5b1e263124d87dd4a79d3903", "score": "0.5669225", "text": "def index\n @ss_corals = SsCoral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ss_corals }\n end\n end", "title": "" }, { "docid": "e8c19a02c77d7499702c9ea1b974469c", "score": "0.5667514", "text": "def index\n @distritos = Distrito.all\n\n render json: @distritos\n end", "title": "" }, { "docid": "f835dd603ce08f39a89a1350066b11a9", "score": "0.56625533", "text": "def index\n @orgaos = Orgao.all\n\n render json: @orgaos\n end", "title": "" }, { "docid": "312da0523f0689b3a3621a3f5dc2b840", "score": "0.5661495", "text": "def new\n @corpus_neutral = CorpusNeutral.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corpus_neutral }\n end\n end", "title": "" }, { "docid": "bcb8174ebbbd655d76582518c620b7b9", "score": "0.5658215", "text": "def index\n @curriculums = Curriculum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @curriculums }\n end\n end", "title": "" }, { "docid": "afdb98801882d6eee5a25e69817a58bc", "score": "0.5653728", "text": "def index\n @response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\")\n @companies = []\n @response.each do |comp|\n @companies.push(comp)\n end\n end", "title": "" }, { "docid": "1676408660da614b870daec8bc9b0c5a", "score": "0.5647655", "text": "def index\n @resolvers = Resolver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resolvers }\n end\n end", "title": "" }, { "docid": "c188204e2896acb9ecbe54058eaa515f", "score": "0.5646861", "text": "def index\n @chores = Chore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chores }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.5638872", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.5638872", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "fe105c06f484ca17edd478a76b065da0", "score": "0.5638872", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "23490f42c07f9cd0a6996bdf8c8d2e85", "score": "0.56351686", "text": "def index\n @authors = Author.all\n render json: @authors\n end", "title": "" }, { "docid": "114040945e26db02c7671ebbf818c892", "score": "0.5633395", "text": "def index\n @categoria_cotas = CategoriaCota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categoria_cotas }\n end\n end", "title": "" }, { "docid": "64a989c42306e451f5c5357fba4725c0", "score": "0.56272787", "text": "def companies\n @companies = AccountingEntity.find(params[:id]).companies\n\n respond_to do |format|\n format.html { render \"companies/index.html\" } # show.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "f18e804159e6020161fdde15e8be1013", "score": "0.56252724", "text": "def index\n @coordinators = Coordinator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordinators }\n end\n end", "title": "" }, { "docid": "6c84f756cc95632a4db82b75738978a6", "score": "0.5623923", "text": "def show\n @oclc = Oclc.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oclc }\n end\n end", "title": "" }, { "docid": "03a8f02df2a98c485aa3e9f4d8634f70", "score": "0.56100124", "text": "def index\n authors = Author.all\n render json: authors\n end", "title": "" }, { "docid": "f676b52d64089a01b79a90cd3b112fc9", "score": "0.5604949", "text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "c81b7ad78d49f0cf549d42e6224249df", "score": "0.5603736", "text": "def show\n client = Marvelite::API::Client.new(:public_key => ENV['MARVEL_KEY'], :private_key => ENV['MARVEL_SECRET'])\n .characters(:name => 'Spider-Man').to_json\n client = JSON.parse(client)\n comics = client['data']['results']\n render json: comics\n end", "title": "" }, { "docid": "e3210d193bafa63fa02a3ca4cf908d2b", "score": "0.56035376", "text": "def index\n @cotas = Cota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cotas }\n end\n end", "title": "" }, { "docid": "b93b2c12f8de7c7dba26ddbdf70ecc2e", "score": "0.5597448", "text": "def index\n @counselors = Counselor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @counselors }\n end\n end", "title": "" }, { "docid": "021e043f33b2cde0e76d872fb63b423b", "score": "0.55961525", "text": "def index\n @content_for_title = \"Мои компании\"\n @companies = @current_user.companies.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "7828499b659774071e431998b094d573", "score": "0.5594041", "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": "8f8637d20520f8bf1bf77865fd5a5f24", "score": "0.55935997", "text": "def new\n @corporation_saldo = CorporationSaldo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corporation_saldo }\n end\n end", "title": "" }, { "docid": "b29055e0ec2d250b3ce59fd154acceed", "score": "0.55911535", "text": "def show\n @comprador = Comprador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comprador }\n end\n end", "title": "" }, { "docid": "2de43c0fc35a52ab963ee6e3f0cb954b", "score": "0.5589384", "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": "9cea8f34a48e3bf8d37c6382627f3252", "score": "0.55863273", "text": "def index\n @companies = Company.find(:all, order: japanese? ? \"kana\" : \"ascii\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "e49fd845c1f5d5d5fde3a5ec23a73a27", "score": "0.5583973", "text": "def show\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ontology }\n end\n end", "title": "" }, { "docid": "e49758d11e337469facff4b8c494621b", "score": "0.5582132", "text": "def show\n @decorate_company = DecorateCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @decorate_company }\n end\n end", "title": "" }, { "docid": "4bc36e44ca9d6388b321416767f7482e", "score": "0.5581521", "text": "def index\n @page_header = \"Тарифы для Корпораций\"\n @rate_corpos = RateCorpo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rate_corpos }\n end\n end", "title": "" }, { "docid": "ee3029455524337d5200bb53831eb690", "score": "0.55805176", "text": "def index\n @competes = Compete.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@competes) }\n\t\tend\n\n end", "title": "" }, { "docid": "9fe5b74350eb744599a9ac97ec3148b4", "score": "0.5566302", "text": "def index\n @companies = current_user.company.agencies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "c722779dd84fa14a6423affd748a9ccc", "score": "0.5564736", "text": "def index\n @collaborations = Collaboration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collaborations }\n end\n end", "title": "" }, { "docid": "690982d293ef4d8087940dcfe71b91e1", "score": "0.55620044", "text": "def index\n @descuento_clientes = DescuentoCliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @descuento_clientes }\n end\n end", "title": "" }, { "docid": "e7afe00203c1bb61070905a16d535f43", "score": "0.5561598", "text": "def index\n @title = \"Страховые компании\"\n @insurance_companies = InsuranceCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_companies }\n end\n end", "title": "" }, { "docid": "40ad535dd874715dcd0fde5ad67bfb7a", "score": "0.5554162", "text": "def index\n @company = Company.find(current_user.company.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "114bdc38a448d90508b9b9ac3a70e226", "score": "0.555166", "text": "def index\n\n @domains = Domain.where(user_id: current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @domains }\n end\n end", "title": "" }, { "docid": "9ceb4b9bc8b5a4227697de747779f229", "score": "0.55507714", "text": "def index\n @companies = Company.all(:order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "7dd903dee5f0a89aeafb4b03807a692c", "score": "0.5550387", "text": "def show\n @emergency_corporation = EmergencyCorporation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emergency_corporation }\n end\n end", "title": "" }, { "docid": "0e508ac9075d7df69e4423d5f258cdb4", "score": "0.55497205", "text": "def show\n @colaborador = Colaborador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colaborador }\n end\n end", "title": "" }, { "docid": "a8cbd642f06149fcd45d972b1bbf54dc", "score": "0.55447304", "text": "def index\n @companies = @klass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "title": "" }, { "docid": "2e0ae8ea08891cd7890ee7a47be1601a", "score": "0.5544299", "text": "def index\n @organizations = Organization.all\n\n render json: @organizations\n end", "title": "" }, { "docid": "2e0ae8ea08891cd7890ee7a47be1601a", "score": "0.5544299", "text": "def index\n @organizations = Organization.all\n\n render json: @organizations\n end", "title": "" }, { "docid": "dcf4eb6afa14b7f9aae1870c7f40901c", "score": "0.5543453", "text": "def new\n @coral = Coral.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @coral }\n end\n end", "title": "" }, { "docid": "dcf4eb6afa14b7f9aae1870c7f40901c", "score": "0.5543453", "text": "def new\n @coral = Coral.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @coral }\n end\n end", "title": "" }, { "docid": "3414f1c63db4e4aa38ba8270f383f0ff", "score": "0.5543161", "text": "def index\n @lacs = Lac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lacs }\n end\n end", "title": "" }, { "docid": "8e1abd1795c29bc436d5ced01a91a98d", "score": "0.55426097", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend", "title": "" }, { "docid": "d9a1f8698e02fc5375052370f3d92d70", "score": "0.5537262", "text": "def show\n @counselor = Counselor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @counselor }\n end\n end", "title": "" }, { "docid": "955d75f19747940f486c9e073e09c51f", "score": "0.55371636", "text": "def index\n @companies = Company.all\n respond_to do |format|\n format.json { render :json => @companies }\n end\n end", "title": "" }, { "docid": "630c92091e6880cba0e2833774efc882", "score": "0.5535278", "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": "47aeb2c71e55446d0a3b75ac09831054", "score": "0.5534991", "text": "def index\n @denuncias = Denuncia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @denuncias }\n end\n end", "title": "" }, { "docid": "9c5db75756db33054e4ca8d640db2433", "score": "0.5534688", "text": "def create\n @corp = Corp.new(params[:corp])\n\n respond_to do |format|\n if @corp.save\n format.html { redirect_to @corp, notice: 'Corp was successfully created.' }\n format.json { render json: @corp, status: :created, location: @corp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @corp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b287f4c50a3bc5574e96191e16c117ec", "score": "0.5530339", "text": "def show\n @porcelain = Porcelain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @porcelain }\n end\n end", "title": "" }, { "docid": "2ad5814a1028304cccc7832896ba8694", "score": "0.5522064", "text": "def companies\n render json: Company.all.to_json\n end", "title": "" }, { "docid": "5c4e966c63a3d8445f374eec082c1f78", "score": "0.55166125", "text": "def show\n @corpus_negative = CorpusNegative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus_negative }\n end\n end", "title": "" }, { "docid": "3bed1046465d3076809564705211cc72", "score": "0.5511856", "text": "def index\n @authors = Author.all\n\n standard_response @authors\n end", "title": "" }, { "docid": "398db70ef04c4110ab1721faf229a188", "score": "0.5510331", "text": "def index\n @corretoras = Corretora.all\n end", "title": "" } ]
000e1324c7738d77aa91c4339e8cbfab
when applying a rootbased patch to a prototype we will have to change directory to that prototype, just for when we apply the patch. and..?
[ { "docid": "df70c4043ff619c680652c0990dd8e21", "score": "0.59360754", "text": "def process_patch_opts_for_directory switch_h, opts, src, dest, site_path\n return unless opts[:subset] == 'root'\n if ! opts[:proto_to_content]\n command_abort(\"we need to test this for root patching for this target\")\n end\n # it's not explicitly an available pass-thru option\n fail(\"huh?\") if switch_h['--directory'] ||\n switch_h.keys.grep(/^-p\\d+$/).any?\n proto = proto_path(site_path)\n # for a path like './a/Rules', we cd to the root of the proto, so we\n # want to disregard two levels of path context.\n switch_h['-p2'] = ''\n switch_h['--directory'] = proto\n nil\n end", "title": "" } ]
[ { "docid": "bd8c74545493d6b9ceb601c14f06cdbb", "score": "0.688814", "text": "def patches\n # Makefile patch\n DATA\n end", "title": "" }, { "docid": "d743c8aa1aff63227720922a8d0ee277", "score": "0.67763513", "text": "def setup\n patch_path\n end", "title": "" }, { "docid": "a6d2e276d02c66970a03a21e13d8cf37", "score": "0.6564752", "text": "def patch; end", "title": "" }, { "docid": "6f6ec52bd7261923347508e2abc31b87", "score": "0.6560458", "text": "def original_dir; end", "title": "" }, { "docid": "6f6ec52bd7261923347508e2abc31b87", "score": "0.6560458", "text": "def original_dir; end", "title": "" }, { "docid": "d2612defaf4f4ee3defc6c845debfe8a", "score": "0.6286142", "text": "def patch_dir\n @patch_dir ||= [release_dir, 'extracting', Time.now.strftime(\"%Y%m%d%H%M%S\")] * '.'\n end", "title": "" }, { "docid": "36d25c38197fc8aa56f49e10498105f7", "score": "0.62731445", "text": "def patch(product_code = 'DSO', flavor = OPENSOURCE)\n @no_demo = true\n $patch = true\n \n # Do error checking first, before going through the lengthy dist target\n descriptor_file = self.patch_descriptor_file.to_s\n unless File.readable?(descriptor_file)\n raise(\"Patch descriptor file does not exist: #{descriptor_file}\")\n end\n\n patch_descriptor = YAML.load_file(descriptor_file)\n unless patch_descriptor['level'] && patch_descriptor['files'].is_a?(Array)\n raise(\"Invalid patch descriptor file\")\n end\n\n patch_level = config_source['level'] || patch_descriptor['level']\n $XXX_patch_level = patch_level\n\n if config_source[MAVEN_REPO_CONFIG_KEY]\n @internal_config_source[MAVEN_CLASSIFIER_CONFIG_KEY] = \"patch#{patch_level}\"\n end\n\n dist(product_code, flavor)\n\n begin\n # Warn if patch level is not a positive integer\n i = Integer(patch_level)\n raise(\"not a positive integer\") if i < 0\n rescue\n loud_message(\"WARNING: patch level is not a positive integer\")\n end\n\n puts(\"Building patch level #{patch_level}\")\n\n # executables will get different permissions in patch tar\n patch_files = Array.new\n patch_bin_files = Array.new\n\n Dir.chdir(product_directory.to_s) do\n # Make sure patch-data.txt and RELEASE-NOTES.txt are included in the patch\n patch_files << create_patch_data(patch_level, @config_source, FilePath.new('lib', 'resources'))\n patch_files << 'RELEASE-NOTES.txt'\n\n patch_descriptor['files'].each do |file|\n raise(\"Patch may not include build-data.txt\") if file =~ /build-data\\.txt$/\n\n path = file.to_s\n unless File.readable?(path)\n raise(\"Patch descriptor file references non-existant file: #{path}\")\n end\n\n if file =~ /\\.sh$|\\.bat$|\\.exe$|\\.dll$|\\/bin\\/|\\/libexec\\//\n patch_bin_files << path\n else \n patch_files << path\n end\n end\n\n patch_file_name = File.basename(Dir.pwd) + \"-patch#{patch_level}.tar.gz\"\n patch_file = FilePath.new(self.dist_directory, patch_file_name)\n ant.tar(:destfile => patch_file.to_s, :compression => 'gzip', :longfile => 'gnu') do\n ant.tarfileset(:dir => Dir.pwd, :includes => patch_files.join(','))\n unless patch_bin_files.empty?\n ant.tarfileset(:dir => Dir.pwd,\n :includes => patch_bin_files.join(','),\n :mode => 755)\n end\n end\n \n if config_source['target']\n ant.copy(:file => patch_file.to_s, :todir => config_source['target'], :verbose => true)\n end\n \n end\n end", "title": "" }, { "docid": "169e0a622cbbeb40c5bd9b92bb7f45e9", "score": "0.6269821", "text": "def patch_directory(target_dir, patch_dir, whitelist = nil)\n if File.directory?(patch_dir)\n Packager.warn \"Applying overlay (patch) from: #{patch_dir} to #{target_dir}, whitelist: #{whitelist}\"\n if !whitelist\n Dir.mktmpdir do |dir|\n FileUtils.cp_r(\"#{patch_dir}/.\", \"#{dir}/.\")\n Dir.glob(\"#{dir}/**/*\").each do |file|\n prepare_patch_file(file)\n end\n FileUtils.cp_r(\"#{dir}/.\",\"#{target_dir}/.\")\n end\n else\n require 'tempfile'\n whitelist.each do |pattern|\n files = Dir[\"#{patch_dir}/#{pattern}\"]\n files.each do |f|\n if File.exist?(f)\n tmpfile = Tempfile.new(File.basename(f))\n FileUtils.cp_r(f, tmpfile)\n prepare_patch_file(tmpfile.path)\n target_file = File.join(target_dir,File.basename(f))\n FileUtils.cp_r(tmpfile, target_file)\n Packager.warn \"Patch target (#{target_file}) with #{tmpfile.path}\"\n end\n end\n end\n end\n\n # We need to commit if original files have been modified\n # so add a commit\n orig_files = Dir[\"#{patch_dir}/**\"].reject { |f| f[\"#{patch_dir}/debian/\"] }\n return orig_files.size > 0\n else\n Packager.warn \"No patch dir: #{patch_dir}\"\n return false\n end\n end", "title": "" }, { "docid": "2c19398654f425f1b3f8528d2e888b3a", "score": "0.62144583", "text": "def patch?; end", "title": "" }, { "docid": "2c19398654f425f1b3f8528d2e888b3a", "score": "0.62144583", "text": "def patch?; end", "title": "" }, { "docid": "2c19398654f425f1b3f8528d2e888b3a", "score": "0.62144583", "text": "def patch?; end", "title": "" }, { "docid": "bbfd47753e80e0080e2d5f15b3ef0bda", "score": "0.6164057", "text": "def patch=(_arg0); end", "title": "" }, { "docid": "9e6a06c410c61f68fdb1e13fff3afcbe", "score": "0.6145252", "text": "def patch\n target = \".\"\n THEMED_DIRS.each do |themed_dir|\n if @options[:reverse]\n source = File.join(rails_env.root, GIT_DIR, name, themed_dir)\n dir = File.join(rails_env.root, themed_dir, \"themes\", name)\n else\n dir = File.join(rails_env.root, GIT_DIR, name, themed_dir)\n source = File.join(rails_env.root, themed_dir, \"themes\", name)\n end\n FileUtils.cd(dir, :verbose => @options[:verbose])\n RakeUtils.test_directory(source)\n tmp = File.join(rails_env.root, \"tmp/patch.diff\")\n run_command_without_check(\"diff -ur #{target} #{source} > #{tmp}\")\n run_command_without_check(\"patch -p0 < #{tmp}\")\n end\n end", "title": "" }, { "docid": "6cc49a88549a08a8c1ffcfcf0166ded2", "score": "0.61186844", "text": "def perform_patch; end", "title": "" }, { "docid": "9d183eef44b52fcf919cfb42fede249e", "score": "0.61165595", "text": "def mirror_spec_gemdir\n define_directories\n FileUtils.mkdir_p( @scratch_dir )\n FileUtils.cp_r( @idx_spec_datadir, @scratch_dir )\n end", "title": "" }, { "docid": "8dda6e854992d38fa299c04cf55b74b5", "score": "0.60787284", "text": "def patch_directory(target_dir, patch_dir,\n whitelist: nil,\n options: {})\n if File.directory?(patch_dir)\n Packager.warn \"Applying overlay (patch) from: #{patch_dir} to #{target_dir}, whitelist: #{whitelist}\"\n if !whitelist\n Dir.mktmpdir do |dir|\n FileUtils.cp_r(\"#{patch_dir}/.\", \"#{dir}/.\")\n Dir.glob(\"#{dir}/**/*\").each do |file|\n prepare_patch_file(file, options: options)\n end\n FileUtils.cp_r(\"#{dir}/.\",\"#{target_dir}/.\")\n end\n else\n require 'tempfile'\n whitelist.each do |pattern|\n files = Dir[\"#{patch_dir}/#{pattern}\"]\n files.each do |f|\n if File.exist?(f)\n tmpfile = Tempfile.new(File.basename(f))\n FileUtils.cp_r(f, tmpfile)\n prepare_patch_file(tmpfile.path, options: options)\n target_file = File.join(target_dir,File.basename(f))\n FileUtils.cp_r(tmpfile, target_file)\n Packager.warn \"Patch target (#{target_file}) with #{tmpfile.path}\"\n end\n end\n end\n end\n\n # We need to commit if original files have been modified\n # so add a commit\n orig_files = Dir[\"#{patch_dir}/**\"].reject { |f| f[\"#{patch_dir}/debian/\"] }\n return orig_files.size > 0\n else\n Packager.warn \"No patch dir: #{patch_dir}\"\n return false\n end\n end", "title": "" }, { "docid": "6a2aefa1533bc66155c190357946c5b4", "score": "0.60447556", "text": "def thor_root_glob; end", "title": "" }, { "docid": "9ee496288b72972ffcb2697d6a4baf95", "score": "0.6043695", "text": "def set_realpath\n return super if Node.source.eql?(:node) || persisted?\n\n self.parent ||= owner.owner.parent.component_dir\n base_path = \"#{parent.path}/#{owner.name}\"\n self.path ||= \"#{base_path}.yml\"\n FileUtils.touch(path)\n binding.pry\n nodes << Node::ComponentDir.new(path: base_path)\n super\n end", "title": "" }, { "docid": "acf6c138536dc42882fca2071438fb6c", "score": "0.6032077", "text": "def mirror_spec_gemdir\n define_directories\n FileUtils.mkdir_p(@scratch_dir)\n FileUtils.cp_r(@idx_test_datadir, @scratch_dir)\n end", "title": "" }, { "docid": "fc318715e19aec67c8bcb4ae7b854eb3", "score": "0.6020567", "text": "def copy_gems \n end", "title": "" }, { "docid": "d6d2cf40974d2db00689d8007c00b31a", "score": "0.59495634", "text": "def prop_patch(_path, _prop_patch)\n end", "title": "" }, { "docid": "5884edf3028a808ba11c9e1792725b22", "score": "0.588398", "text": "def patch(file = T.unsafe(nil)); end", "title": "" }, { "docid": "61912a8563b40fcc0d9e8d29551639fc", "score": "0.5855219", "text": "def write_source_patches\n from_directory do\n id = @git.latest_id(\"tetra: sources-tarball\")\n destination_path = File.join(full_path, packages_dir, name)\n @git.format_patch(\"src\", id, destination_path)\n end\n end", "title": "" }, { "docid": "f5c9ac1a181b5139c7bdeb5ad6a3b4cd", "score": "0.5842285", "text": "def refresh\n super do |modified|\n return unless modified\n `createrepo -d #{@dir}` #TODO: --update switch?\n end\n end", "title": "" }, { "docid": "7af6f789fd4f746570f13ca8a911580d", "score": "0.5841551", "text": "def write(dotfile)\n new_dir = File.join(ROOT_DIR, 'diffs', 'new')\n FileUtils.mkdir_p new_dir\n FileUtils.cp File.join(ROOT_DIR, 'base', dotfile), new_dir\n Dir.chdir new_dir\n patchfile = File.join(ROOT_DIR, 'patches', dotfile)\n system \"#{PATCH} #{patchfile}\" if File.exists? patchfile\n FileUtils.cp File.join(new_dir, dotfile), HOME_DIR\nend", "title": "" }, { "docid": "a511a92ddb7646f866fbb490cfda7031", "score": "0.5801672", "text": "def patch_extends home, xpath, type = nil, opt = {}\n type ||= 'ems'\n\n Dir.chdir home do\n map = {}\n\n File.glob(xpath).each do |file|\n begin\n doc = REXML::Document.file file\n rescue\n Util::Logger::exception $!\n\n return nil\n end\n\n name = nil\n\n if file =~ /\\/trunk\\//\n name = File.basename $`\n end\n\n if name.nil?\n return nil\n end\n\n REXML::XPath.each(doc.root, type.to_s) do |e|\n e.each_element do |element|\n action = element.name\n dirname = element.attributes['dirname'].to_s\n\n map[name] ||= {}\n map[name][action] ||= {\n :zip => {},\n :ignore => []\n }\n\n REXML::XPath.each(element, 'file') do |file_element|\n src = file_element.attributes['name']\n dest = file_element.attributes['dest']\n\n if not src.nil? and not dest.nil?\n map[name][action][:zip][dest.strip.vars(opt)] = File.join home, name, 'trunk', dirname, src.strip.vars(opt)\n end\n end\n\n REXML::XPath.each(element, 'ignore') do |ignore_element|\n ignore_path = ignore_element.attributes['name'].to_s.strip.vars opt\n\n Dir.chdir File.join(name, 'trunk', dirname) do\n File.glob(ignore_path).each do |path|\n map[name][action][:ignore] << File.join(home, name, 'trunk', dirname, path)\n end\n end\n end\n end\n end\n end\n\n map\n end\n end", "title": "" }, { "docid": "ca238a3b4da1a3a76b4c7d1c22cc9c2f", "score": "0.5790609", "text": "def patches\n DATA if not build.devel?\n end", "title": "" }, { "docid": "5766919dd74c92a988022f831020ff83", "score": "0.57780385", "text": "def patch\n if options[:reverse]\n source = File.join(rails_env.root, SITES_DIR, name)\n target = File.join(rails_env.root, \"config\")\n else\n target = File.join(rails_env.root, SITES_DIR, name)\n source = File.join(rails_env.root, \"config\")\n end\n FileUtils.cd(target, :verbose => options[:verbose])\n if File.directory?(source)\n tmp = File.join(rails_env.root, \"tmp/patch.diff\")\n self.class.run_command_without_check(\"diff -u -x #{self.class.exclude_files.join(' -x ')} . #{source} > #{tmp}\")\n self.class.run_command_without_check(\"patch -p0 < #{tmp}\")\n else\n @@out.error \"Source directory not found '#{source}'\"\n @@out.important \"Aborting...\"\n exit 1\n end\n end", "title": "" }, { "docid": "a46612d5dd370f9fbafb3a6ba3449d61", "score": "0.57537496", "text": "def apply_patch(patch)\n arr_opts = []\n arr_opts << '-3'\n arr_opts << '-'\n\n Dir.chdir(@git_work_dir) do \n command('apply', arr_opts) do |io|\n io.puts(patch)\n end\n end\n end", "title": "" }, { "docid": "f44ed6fda2306925f8f1b72d169cbcea", "score": "0.57501316", "text": "def patch(what)\n what.class_eval do\n alias_method :_old_asset_path, :asset_path\n def asset_path(asset, opts = {})\n out = _old_asset_path asset, opts = {}\n return unless out\n\n environment.parent.used.add(environment.find_asset \\\n resolve(asset))\n out\n end\n end\n end", "title": "" }, { "docid": "6b3d6af3e1ade5f41124866b57a6b326", "score": "0.57497054", "text": "def patch(path, **args); end", "title": "" }, { "docid": "60057b5972ec57f05542b8b9142b7976", "score": "0.5749035", "text": "def root_dir; end", "title": "" }, { "docid": "142525d0612f76d0e8ae3cdd3c9de243", "score": "0.57179654", "text": "def add_to_master(full_patch_path)\n # If the master doesn't exist, create it with <chadoxml> tag\n master_xmlfile = File.join(self.command_object.command, \"applied_patches_#{self.command_object.project_id}.chadoxml\")\n unless File.exists?(master_xmlfile) then\n File.open(master_xmlfile, \"w\"){|mxf| mxf.puts \"<chadoxml>\\n</chadoxml>\" }\n end\n \n # Get the contents of the patch to be added to the master file\n patchfile_contents = \"\"\n File.open(full_patch_path, \"r\"){|pf|\n # Add each line to the string, except for the <chadoxml>tags\n while line = pf.gets\n patchfile_contents += line unless line =~ /<\\/*chadoxml>/\n end\n }\n \n # Store the updated master patchfile in a string\n master_with_new = \"<chadoxml>\\n\"\n \n # First, open it to get the contents out\n File.open(master_xmlfile, \"r+\"){|mxf|\n # IF the first line isn't <chadoxml>, complain\n if mxf.gets != \"<chadoxml>\\n\" then\n raise Exception \"First line of master patch file was unexpected!\"\n else\n # Add the patchfile data to the new master string,\n # then add the rest of the master file\n master_with_new += patchfile_contents\n while nextline = mxf.gets\n master_with_new += nextline\n end\n end\n }\n # Then, open it again, and write the new data to it.\n File.open(master_xmlfile, \"w\"){|mxf|\n mxf.puts master_with_new\n } \n\n end", "title": "" }, { "docid": "4cbeddd334963a4b17f8961518868215", "score": "0.5699397", "text": "def dc_reload_patches\r\n DrgCms.paths(:patches).each do |patches| \r\n Dir[\"#{patches}/**/*.rb\"].each { |file| require_dependency(file) }\r\n end\r\nend", "title": "" }, { "docid": "4cbeddd334963a4b17f8961518868215", "score": "0.5699397", "text": "def dc_reload_patches\r\n DrgCms.paths(:patches).each do |patches| \r\n Dir[\"#{patches}/**/*.rb\"].each { |file| require_dependency(file) }\r\n end\r\nend", "title": "" }, { "docid": "0c68e37824719d643dc0299071422606", "score": "0.5696025", "text": "def test_prepares_makes_parent_directory_of_path\r\n root = Root.new(root_dir)\r\n non_dir = File.join(root_dir, 'non')\r\n \r\n assert_equal false, File.exists?(non_dir)\r\n begin\r\n path = File.join(root_dir, 'non/existant/path')\r\n assert_equal path, root.prepare('non/existant/path')\r\n assert_equal false, File.exists?(path)\r\n assert_equal true, File.exists?(File.dirname(path))\r\n ensure\r\n FileUtils.rm_r(non_dir) if File.exists?(non_dir)\r\n end\r\n end", "title": "" }, { "docid": "fb63140af7006a8674335cfe567a5e2b", "score": "0.5694785", "text": "def apply_patch(patch, file)\n if File.exist?(\"changes.patch\")\n puts \"\\n\\n=== Diff ===\"\n puts File.read(\"changes.patch\")\n end\n if agree(\"Would you like to apply this patch?\")\n puts \"Applying patch ...\"\n p sh(\"patch #{file} changes.patch\")\n else\n abort \"Patch skipped, exiting\"\n end\nend", "title": "" }, { "docid": "a93b60c42fedac6eb234d9f00f171022", "score": "0.56809264", "text": "def patch_main_ruby_files\n each_main_ruby_files do |main|\n puts \"Patching #{main}\"\n patch_ruby_file(main)\n end\n end", "title": "" }, { "docid": "62ca82af929b3347aca1c39b3c73fbc8", "score": "0.5676547", "text": "def apply_podfile_patch\n Podfile.class_eval do\n\n alias_method :original_dependencies, :dependencies\n\n def lockfile=(lockfile)\n @lockfile = lockfile\n end\n\n def dependencies\n original_dependencies.map do |dep|\n\n unless dep.external_source\n version = @lockfile.version(dep.name)\n url = \"https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/#{dep.root_name}/#{version}/#{dep.root_name}.podspec.json\"\n\n dep.external_source = { :podspec => url }\n dep.specific_version = nil\n dep.requirement = Requirement.create({ :podspec => url })\n end\n\n dep\n end\n end\n\n def target_definition_list\n root_target_definitions.map { |td| [td, td.recursive_children] }.flatten.map do |target|\n target.lockfile = @lockfile\n target\n end\n end\n end\n end", "title": "" }, { "docid": "8a7d7b5c7e3c41876a9b63b5aa65de7c", "score": "0.56742865", "text": "def patch_pkg_dir(package_name, global_patch_dir, whitelist = nil, pkg_dir = Dir.pwd)\n if global_patch_dir\n if !package_name\n raise ArgumentError, \"DebianPackager::patch_pkg_dir: package name is required, but was nil\"\n end\n pkg_patch_dir = File.join(global_patch_dir, package_name)\n if File.exist?(pkg_patch_dir)\n return patch_directory(pkg_dir, pkg_patch_dir, whitelist)\n end\n end\n end", "title": "" }, { "docid": "fde77536e70fbc1737e30dc22845dffe", "score": "0.5647755", "text": "def install_package_patch(patch_filename)\r\n @log.debug \"install_package_patch: #{patch_filename}\"\r\n @dialog_sw = @gui_progress.get_sw_dlgdialog\r\n begin\r\n @out_package_down = patch_filename\r\n @dialog_sw.update_progress(@update_prg_ind = 15) if @dialog_sw\r\n untar_downloaded_package\r\n @dialog_sw.update_progress(@update_prg_ind = 80) if @dialog_sw\r\n execute_manifest\r\n @dialog_sw.update_progress(@update_prg_ind =90) if @dialog_sw\r\n restart_application\r\n rescue\r\n str = \"Install new software version failed.\\n -> #{$!}\"\r\n @log.error(str)\r\n raise(\"Errore: update del programma NON riuscita.\\nCausa:\\n#{str}\") \r\n end\r\n end", "title": "" }, { "docid": "8f13dc06ab2b177c40001c220272ffa9", "score": "0.56434673", "text": "def populate!\n Info << \"populating directory structure with defaults for `#{name}`\"\n\n sources =\n if defined?(Spec)\n Info << \"!!! using testing skeleton\"\n Backbite::Source.join('spec/.spec_skel')\n end\n sources = [Backbite::Source.join('skel'), sources].compact\n\n %w'textfilter plugins components export misc archive'.each do |w|\n sources.each do |source|\n (st = source.join(w)).entries.grep(/^[^\\.]/).each do |e|\n t = @directory.join(w)\n if st.join(e).exist? and\n not (Backbite::globals[:force] or defined? Spec)\n Warn << \"POPULATE: skipping #{st.join(e).to_s.split('/')[-3..-1].join('/')} (use FORCE=1 to overwrite)\"\n next\n end\n Info << \" cp #{st.join(e)} to #{w}/#{e}\" \n system(\"mkdir -p #{t} && cp #{st.join(e).to_s} #{t}/\")\n end\n end\n end\n end", "title": "" }, { "docid": "310c0bbeefdc360ef897ab4c79f16ea7", "score": "0.56186754", "text": "def patches\n DATA if ARGV.build_head?\n end", "title": "" }, { "docid": "b8fab69d7a52201875b2821054c2fe8e", "score": "0.5614842", "text": "def make_directory_tree\n project_tmp = \"#{Pkg::Util::File.mktemp}/#{@package_name}\"\n @scratch = \"#{project_tmp}/#{@title}\"\n @working_tree = {\n 'scripts' => \"#{@scratch}/scripts\",\n 'resources' => \"#{@scratch}/resources\",\n 'working' => \"#{@scratch}/root\",\n 'payload' => \"#{@scratch}/payload\",\n }\n puts \"Cleaning Tree: #{project_tmp}\"\n rm_rf(project_tmp)\n @working_tree.each do |key, val|\n mkdir_p(val)\n end\n\n if File.exist?('ext/osx/postflight.erb')\n Pkg::Util::File.erb_file 'ext/osx/postflight.erb', \"#{@working_tree['scripts']}/postinstall\", false, :binding => binding\n end\n\n if File.exist?('ext/osx/preflight.erb')\n Pkg::Util::File.erb_file 'ext/osx/preflight.erb', \"#{@working_tree['scripts']}/preinstall\", false, :binding => binding\n end\n\n if File.exist?('ext/osx/prototype.plist.erb')\n Pkg::Util::File.erb_file 'ext/osx/prototype.plist.erb', \"#{@scratch}/prototype.plist\", false, :binding => binding\n end\n\n if File.exist?('ext/packaging/static_artifacts/PackageInfo.plist')\n cp 'ext/packaging/static_artifacts/PackageInfo.plist', \"#{@scratch}/PackageInfo.plist\"\n end\nend", "title": "" }, { "docid": "75f73de731f53b9af2d75577d8ff83d9", "score": "0.5591104", "text": "def add_shadowfax_repo_to_source_path\n if __FILE__ =~ %r{\\Ahttps?://}\n source_paths.unshift(tempdir = Dir.mktmpdir(\"rails-template-\"))\n at_exit { FileUtils.remove_entry(tempdir) }\n git :clone => [\n \"--quiet\",\n \"https://github.com/heyogrady/shadowfax.git\",\n tempdir\n ].map(&:shellescape).join(\" \")\n else\n source_paths.unshift(File.dirname(__FILE__))\n end\nend", "title": "" }, { "docid": "743eafc8640d282c8f7585ee0b47f4d0", "score": "0.5579454", "text": "def prepend_chdir()\n if @config_dir\n\tKitchenplan::Log.debug \"Invoking resolver #{self.name} from #{@config_dir}\"\n\t\"cd #{@config_dir} ; #{Dir.pwd}/\"\n else\n\t\"\"\n end\n end", "title": "" }, { "docid": "3ef173bed629a60ae11d5e4feacd09ba", "score": "0.5578991", "text": "def patch(*args, &block); end", "title": "" }, { "docid": "7477c42ade93a09ca4a190989915d67d", "score": "0.55594945", "text": "def recompute_paths\n @cd_fs = File.join base, 'cd'\n @cd2_fs = File.join base, 'cd2'\n @ext_fs = File.join base, 'ext'\n @pkg = File.join base, 'pkg'\n \n @iso = File.join base, 'core.iso'\n @iso2 = File.join base, 'remix.iso'\n @fs_cpgz = File.join cd_fs, 'boot/core.gz'\n @fs2_cpgz = File.join cd2_fs, 'boot/core.gz'\n @ext_cpgz = File.join pkg, 'remix_ext.gz'\n end", "title": "" }, { "docid": "4bdb757e1f26565163a745ec5be5852c", "score": "0.5557293", "text": "def patch?; method == :patch; end", "title": "" }, { "docid": "4d8bd7ff47839395c8a9aa7e385bca30", "score": "0.55456895", "text": "def patches\n # Fixes link times and xattr on links for OSX\n DATA\n end", "title": "" }, { "docid": "a1e450cfac0bfbdc192d90a2243db162", "score": "0.5545414", "text": "def parent_directory\r\n end", "title": "" }, { "docid": "e88b72d03378e133628694a195fd0691", "score": "0.55435693", "text": "def apply(local_base_path,consolidated_patches)\n @output.puts(\"Paching...\")\n consolidated_patches.each_pair do |local_folder,files|\n local_folder_cleaned = local_folder.gsub(/^\\\\/,\"\")\n files.each_pair do |file,s3_folder|\n\n # Here there is a patch name convention, if it contains the word \"Baselines\", \n # it belongs to the baselines, that means that it may have subfolders in the s3 bucket\n # the subfolders has the same hierarchy has \"local_folder\"\n if s3_folder =~/Baseline/\n s3_file = File.join(s3_folder,local_folder_cleaned.gsub(/\\\\/,\"/\"),file)\n else\n s3_file = File.join(s3_folder,file) # this is OS independent\n end\n\n\n local_route = file_join(local_base_path,local_folder_cleaned,file)\n\n base_route = file_join(local_base_path,local_folder_cleaned)\n FileUtils.mkdir_p(base_route) unless File.directory?(base_route)\n \n # if the path contains a /../ it resolves it, s3 doesn't know how to do it\n # 001 - Baseline App/img/../hello.png => 001 - Baseline App/hello.png\n # 001 - Baseline App/../hello.png => hello.png\n s3_file.gsub!(/\\/?.*\\/\\.\\.\\//,\"\")\n\n s3_patch_file = get_s3_file(s3_file)\n raise (\"#{s3_file} not found. The xml file points to a file that doesn't exist on s3\") unless s3_patch_file\n local_md5 =''\n local_md5 = generate_md5_checksum_for_file(local_route) if File.exists?(local_route)\n remote_md5 = s3_patch_file.etag\n #@output.puts \"Local File #{local_route} got: #{local_md5}\"\n #@output.puts \"Remote File #{s3_file} got: #{remote_md5}\"\n unless local_md5 == remote_md5\n patch_number = extract_patch_number_from_folder(s3_folder)\n File.rename(local_route,local_route + \".bak.#{patch_number}\") if File.exists?(local_route)\n #size = 0\n size = s3_patch_file.content_length/1024\n @output.puts \"+Patching #{local_route} with s3://#{@s3_bucket}/#{s3_file} (#{size} KB) \"\n File.open(local_route,'wb') do |file|\n file << s3_patch_file.body\n end\n else\n @output.puts \"-Nothing to update. #{local_route} got the same md5 as s3://#{@s3_bucket}/#{s3_file} \"\n end\n end\n end\n end", "title": "" }, { "docid": "d6a9ceccc6cfdda85a5a7afa4d81e803", "score": "0.5539663", "text": "def patch(patchfile, level = '0', where = '/')\n temp_name = random_string\n begin\n fput(patchfile, temp_name, :mode => 0600)\n send(run_method, %{\n patch -p#{level} -tNd #{where} -r /dev/null < #{temp_name} || true\n })\n ensure\n delete temp_name\n end\n end", "title": "" }, { "docid": "8d679fa20e07dfa32eed0e24b0a30b35", "score": "0.55348235", "text": "def directory; end", "title": "" }, { "docid": "8d679fa20e07dfa32eed0e24b0a30b35", "score": "0.55348235", "text": "def directory; end", "title": "" }, { "docid": "8d679fa20e07dfa32eed0e24b0a30b35", "score": "0.55348235", "text": "def directory; end", "title": "" }, { "docid": "8d679fa20e07dfa32eed0e24b0a30b35", "score": "0.55348235", "text": "def directory; end", "title": "" }, { "docid": "8d679fa20e07dfa32eed0e24b0a30b35", "score": "0.55348235", "text": "def directory; end", "title": "" }, { "docid": "b21be1ed5376a81b9c8438332b8ab92a", "score": "0.55319136", "text": "def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end", "title": "" }, { "docid": "679df783bf08e32a59ef5f3b523f60f7", "score": "0.55173445", "text": "def spec_dirs; end", "title": "" }, { "docid": "ee1120909aa6e6a9999bfb7fc33249d7", "score": "0.5514244", "text": "def run_on_modifications(paths)\n end", "title": "" }, { "docid": "4608fc86b1053603fec598a77d77625e", "score": "0.5503763", "text": "def patch_path\n unless bindir_in_path?\n @original_path = ENV['PATH']\n ENV['PATH'] = [bindir, ENV['PATH']].join(File::PATH_SEPARATOR)\n end\n end", "title": "" }, { "docid": "286ff69c6ddba498d0fbbc22ec414a03", "score": "0.5494282", "text": "def directory=(_); end", "title": "" }, { "docid": "0091b5110abfb206d1e13dcc273bed25", "score": "0.5492668", "text": "def path=(new_path); end", "title": "" }, { "docid": "0091b5110abfb206d1e13dcc273bed25", "score": "0.5492668", "text": "def path=(new_path); end", "title": "" }, { "docid": "e008dede72190d4632c9f8a5b08efad5", "score": "0.5487963", "text": "def update\n\trequire 'fileutils'\n\trequire 'utopia/path'\n\t\n\troot = Pathname.new(context.root)\n\tpackage_root = root + \"node_modules\"\n\t\n\t# This is a legacy path:\n\tunless package_root.directory?\n\t\tpackage_root = root + \"lib/components\"\n\tend\n\t\n\tinstall_root = root + \"public/_components\"\n\t\n\tpackage_root.children.select(&:directory?).collect(&:basename).each do |package_directory|\n\t\tinstall_path = install_root + package_directory\n\t\tpackage_path = package_root + package_directory\n\t\t\n\t\tdist_path = package_path + 'dist'\n\t\t\n\t\tFileUtils::Verbose.rm_rf(install_path)\n\t\tFileUtils::Verbose.mkpath(install_path.dirname)\n\t\t\n\t\t# If a package has a dist directory, we only symlink that... otherwise we have to do the entire package, and hope that bower's ignore was setup correctly:\n\t\tif dist_path.exist?\n\t\t\tlink_path = Utopia::Path.shortest_path(dist_path, install_path)\n\t\telse\n\t\t\tlink_path = Utopia::Path.shortest_path(package_path, install_path)\n\t\tend\n\t\t\n\t\tFileUtils::Verbose.cp_r File.expand_path(link_path, install_path), install_path\n\tend\nend", "title": "" }, { "docid": "7f0b1def4de8a8fe2651fa081514bc2b", "score": "0.548727", "text": "def directory_makable?; end", "title": "" }, { "docid": "e686b92c70bc5c68f2cdd7d7904d0cf0", "score": "0.548569", "text": "def patches\n DATA unless ARGV.build_head?\n end", "title": "" }, { "docid": "2f877d834c360383fb1f0e216795ef50", "score": "0.5483885", "text": "def become_root( new_root, old_root )\n # do nothing\n end", "title": "" }, { "docid": "480765ab48ca9fe2c24c32e29f843636", "score": "0.5469349", "text": "def install\n inreplace \"myconfig\", \"source=/path/patch\", \"source=#{bin}\"\n inreplace \"patch.py\", \"/usr/bin/python\", \"/usr/bin/env python\"\n mv \"patch.py\", \"pacbio-patch\"\n bin.install \"pacbio-patch\"\n bin.install Dir[\"bin\"]\n libexec.install \"myconfig\"\n end", "title": "" }, { "docid": "1dfe6f542715f4d5c8b0324ea292e534", "score": "0.5462672", "text": "def patches\n DATA unless build.head?\n end", "title": "" }, { "docid": "29f1c45fec599149256e7a730d68ab18", "score": "0.5461832", "text": "def in_root; end", "title": "" }, { "docid": "1ec8a61922cd9ff140fb152cef56f7e8", "score": "0.5453155", "text": "def patch_ops\n return if @patch_ops.empty?\n \n Dir.glob(File.join(@player_src, '**', '*.java')).each do |file|\n old_contents = File.read file\n lines = old_contents.split(\"\\n\")\n\n stubs_enabled = true\n\n 0.upto(lines.count - 1) do |i|\n line = lines[i]\n if directive_match = /^\\s*\\/\\/\\$(.*)$/.match(line)\n directive = directive_match[1]\n case directive.strip.downcase\n when '+stubs', '-stubs'\n stubs_enabled = directive[0] == ?+\n end\n else\n @patch_ops.each do |op|\n op_type, target, source = *op\n \n case op_type\n when :stub_member\n if stubs_enabled\n line.gsub!(/(^|[^A-Za-z0-9_.])([A-Za-z0-9_.]*\\.)?#{source}\\(/) do |match|\n arg = ($2.nil? || $2.empty?) ? 'this' : $2[0..-2]\n \"#{$1}#{player_name}.#{target}(#{arg}, \"\n end\n end\n when :stub_static\n if stubs_enabled\n line.gsub! /(^|[^A-Za-z0-9_.])([A-Za-z0-9_.]*\\.)?#{source}\\(/,\n \"\\\\1#{player_name}.#{target}(\"\n end\n end\n end\n end\n end\n contents = lines.join(\"\\n\")\n File.open(file, 'wb') { |f| f.write contents } unless contents == old_contents\n end\n end", "title": "" }, { "docid": "99085aecf8c2c556d3098b3aef9e7ea7", "score": "0.54462713", "text": "def files_changed_in_patch(patchfile, tap)\n files = []\n formulae = []\n others = []\n File.foreach(patchfile) do |line|\n files << $1 if line =~ %r{^\\+\\+\\+ b/(.*)}\n end\n files.each do |file|\n if (tap && tap.formula_file?(file)) || (ARGV.include?(\"--legacy\") && file.start_with?(\"Library/Formula/\"))\n formula_name = File.basename(file, \".rb\")\n formulae << formula_name unless formulae.include?(formula_name)\n else\n others << file\n end\n end\n { :files => files, :formulae => formulae, :others => others }\n end", "title": "" }, { "docid": "2748b36d31d1f03678d4033b2311b027", "score": "0.544572", "text": "def update_path_if_needed\n if self.changed_attributes[\"git\"]\n erase_blog_folder\n generate_path!\n end\n end", "title": "" }, { "docid": "3e75545f40ea3f0614eb2eb62a13b98d", "score": "0.5444275", "text": "def spec_dirs=(_arg0); end", "title": "" }, { "docid": "7c01cb2dbba205577327390a9a59cae4", "score": "0.54438734", "text": "def patch(path, options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "cca9f5dafbf1fd74196b9a5e7c717cb6", "score": "0.54420745", "text": "def fixup_library(relative_path,full_path,dest_root,copy_self=true)\n prefix = \"@executable_path/../lib\"\n\n lines = %x[otool -L '#{full_path}'].split(\"\\n\")\n paths = lines.map { |x| x.split[0] }\n paths.shift # argument name\n\n return if @done[full_path]\n\n if copy_self then\n @done[full_path] = true\n new_path = File.join(dest_root,relative_path)\n internal_path = File.join(prefix,relative_path)\n FileUtils.mkdir_p(File.dirname(new_path))\n FileUtils.cp(full_path,new_path)\n File.chmod(0700,new_path)\n full_path = new_path\n system(\"install_name_tool\",\"-id\",internal_path,new_path)\n end\n\n paths.each do |path|\n next if File.basename(path) == File.basename(full_path)\n\n if self.class.needs_to_be_bundled(path) then\n puts \"Fixing %s in %s\" % [path.inspect,full_path.inspect]\n fixup_library(File.basename(path),path,dest_root)\n\n lib_name = File.basename(path)\n new_path = File.join(dest_root,lib_name)\n internal_path = File.join(prefix,lib_name)\n\n system(\"install_name_tool\",\"-change\",path,internal_path,full_path)\n end\n end\n end", "title": "" }, { "docid": "aeb0e793a300a6960bc1ed76e2f1bae8", "score": "0.5437144", "text": "def inherited(app)\n\t\t\t\tsuper\n\t\t\t\tapp.root_dir = File.dirname caller(2..2).first.split(':')[0]\n\t\t\tend", "title": "" }, { "docid": "4dd153884a303f387b7283d28eb8620f", "score": "0.5430712", "text": "def mirror_file(source, dest, copied = [], duplicated = [], postfix = '_override')\n base, rest = split_name(source)\n dst_dir = File.dirname(dest)\n dup_path = dst_dir / \"#{base}#{postfix}.#{rest}\" \n if File.file?(source)\n FileUtils.mkdir_p(dst_dir) unless File.directory?(dst_dir)\n if File.exists?(dest) && !File.exists?(dup_path) && !FileUtils.identical?(source, dest)\n # copy app-level override to *_override.ext\n FileUtils.copy_entry(dest, dup_path, false, false, true)\n duplicated << dup_path.relative_path_from(Merb.root)\n end\n # copy gem-level original to location\n if !File.exists?(dest) || (File.exists?(dest) && !FileUtils.identical?(source, dest))\n FileUtils.copy_entry(source, dest, false, false, true) \n copied << dest.relative_path_from(Merb.root)\n end\n end\n end", "title": "" }, { "docid": "a6ba81de575c33a31e928b0e2f67caae", "score": "0.54259455", "text": "def patch_data_file\n FilePath.new(self.build_data_dir, PATCH_DATA_FILE_NAME)\n end", "title": "" }, { "docid": "ca369a4d6e6c9f452aa0ec15045d555f", "score": "0.54246795", "text": "def patches\n {:p0 => [\n \"https://trac.macports.org/export/92117/trunk/dports/sysutils/e2fsprogs/files/patch-lib__Makefile.darwin-lib\"\n ]}\n end", "title": "" }, { "docid": "cd87cd2bc631fff4ec0e320d4f13acd0", "score": "0.5423891", "text": "def patch_jslint\n patch_file = File.expand_path('../jslint.js.patch', __FILE__)\n Dir.chdir(File.join(NODE_MODULES, 'nodelint/jslint')) do\n if File.read('jslint.js') !~ /shouldMethods/\n cmd = \"patch < #{patch_file}\"\n if system(cmd)\n puts \"patched jslint.js\"\n else\n $stderr.puts \"#{cmd} failed\"\n end\n end\n end\n end", "title": "" }, { "docid": "5250d0120690eb661771d5f9625052ff", "score": "0.5423243", "text": "def patches\n { :p1 => 'https://gist.github.com/nandub/2078dc43b068ef5b8ef9/raw/ae02204a1f790add0b375b5160863c215450c8d4/0001-live555-cmakefile' }\n end", "title": "" }, { "docid": "c0d37de12ebdb65aac3ea82768630c88", "score": "0.5423035", "text": "def change_ext_fs(&block)\n FileUtils.mkdir_p ext_fs\n Dir.chdir ext_fs do\n yield self\n end\n end", "title": "" }, { "docid": "7c09ae710c55cddb4d1f2f13593bb43f", "score": "0.541973", "text": "def process(spec)\n AllGems.logger.info \"Processing gem: #{spec.full_name}\"\n basedir = \"#{AllGems.data_directory}/#{spec.name}/#{spec.version.version}\"\n FileUtils.mkdir_p basedir\n AllGems.logger.info \"Created new directory: #{basedir}\"\n gempath = fetch(spec, \"#{basedir}/#{spec.full_name}.gem\")\n unpack(gempath, basedir)\n generate_documentation(spec, basedir)\n end", "title": "" }, { "docid": "dfcc08393dcb8d9ed10a9dfbf688625c", "score": "0.5414697", "text": "def dpkg_commit_changes(patch_name, directory = Dir.pwd)\n Dir.chdir(directory) do\n Packager.debug (\"commit changes to debian pkg: #{patch_name}\")\n # Since dpkg-source will open an editor we have to\n # take this approach to make it pass directly in an\n # automated workflow\n ENV['EDITOR'] = \"/bin/true\"\n system(\"dpkg-source\", \"--commit\", \".\", patch_name, :close_others => true)\n end\n end", "title": "" }, { "docid": "09774ff4e48b481e9368cdae66b9d02f", "score": "0.54061794", "text": "def patch_file_for(commit)\n @patch_dir.join 'git-patch-patch',\n # horrendous but necessary to ensure unicity\n # of path, without having an absolute path\n # that 'join' doesn't like\n Pathname(@t.directory).realpath.to_s.sub('/',''),\n commit.to_s,\n 'patch'\n end", "title": "" }, { "docid": "e76238ecc74ec65874df342cdf58ef29", "score": "0.5400173", "text": "def replace(entry, srcPath); end", "title": "" }, { "docid": "bfa4760a49c4c1fc7ced63bc7becfe1b", "score": "0.5395037", "text": "def patches\n {:p0 => [\n \"https://trac.macports.org/export/105275/trunk/dports/devel/orbit2/files/patch-linc2-src-Makefile.in.diff\",\n \"https://trac.macports.org/export/105275/trunk/dports/devel/orbit2/files/patch-configure.diff\"\n ]}\n end", "title": "" }, { "docid": "4ce9c70491871f0cc02a6220d19646fc", "score": "0.5392859", "text": "def patches\n { :p0 =>\n \"https://trac.macports.org/export/89267/trunk/dports/net/ushare/files/patch-configure.diff\"\n }\n end", "title": "" }, { "docid": "256dc9b5333ca123f8a804081e88bb58", "score": "0.53916717", "text": "def update_working_dir( index , path )\n unless Regulate.repo.bare\n Dir.chdir(::File.join(Regulate.repo.path, '..')) do\n if file_path_scheduled_for_deletion?(index.tree, path)\n Regulate.repo.git.rm({'f' => true}, '--', path)\n else\n Regulate.repo.git.checkout({}, 'HEAD', '--', path)\n end\n end\n end\n end", "title": "" }, { "docid": "eeef2b24f0519494b723847679be4a3c", "score": "0.53874886", "text": "def add_template_repository_to_source_path\n if __FILE__.match?(%r{\\Ahttps?://})\n require \"tmpdir\"\n source_paths.unshift(tempdir = Dir.mktmpdir(\"rails-prepper-\"))\n at_exit { FileUtils.remove_entry(tempdir) }\n git clone: [\n \"--quiet\",\n \"https://github.com/khrisnagunanasurya/rails-prepper.git\",\n tempdir,\n ].map(&:shellescape).join(\" \")\n\n if (branch = __FILE__[%r{rails-prepper/(.+)/template.rb}, 1])\n Dir.chdir(tempdir) { git checkout: branch }\n end\n else\n source_paths.unshift(File.dirname(__FILE__))\n end\nend", "title": "" }, { "docid": "a6ad4428114f15b1448dec8e3fb59745", "score": "0.53866035", "text": "def installPatch(file, name)\n @cmd = \" #{@CLIENT}\" + \" \\\"patch:list\\\"\"\n list = `#{@cmd}`\n \n # if list.match(/name/i) \n # puts \"Patch, #{name} already added. Skipping add.\"\n # else\n \n @cmd = \" #{@CLIENT}\" + \" \\\"patch:add file://\" + file + \"\\\"\" \n puts @cmd\n `#{@cmd}`\n #end\n\n @cmd = \" #{@CLIENT}\" + \" \\\"patch:install \" + name + \"\\\"\" \n puts @cmd\n `#{@cmd}`\n sleep(10)\n runOsgiCommand(\"patch:list\") \n end", "title": "" }, { "docid": "08d0f4bc48c82b348e97c3f003da7a18", "score": "0.5377899", "text": "def install_bundler_patch_in_target\n # TODO: reconsider --conservative flag. Had problems with it in place on Travis, but I think I want it.\n # cmd = \"#{ruby_bin}#{File::SEPARATOR}gem install -V --install-dir #{gem_home} --conservative --no-document --prerelease bundler-patch\"\n cmd = \"#{ruby_bin}#{File::SEPARATOR}gem install -V --install-dir #{gem_home} --no-document --prerelease bundler-patch\"\n shell_command cmd\n end", "title": "" }, { "docid": "c1860ecdf50415c0064808d4bfc06db2", "score": "0.5372623", "text": "def cwd; end", "title": "" }, { "docid": "c1860ecdf50415c0064808d4bfc06db2", "score": "0.5372623", "text": "def cwd; end", "title": "" }, { "docid": "6404e4ecb795c7e9b7c6209bb3a9e2f8", "score": "0.53715754", "text": "def deploy\n patch_replace? ? patch_replace : super\n end", "title": "" }, { "docid": "3974088835630f7be686efd09600d527", "score": "0.5369014", "text": "def patch_with(patches, options)\n @std, @output = [], []\n\n check_patch_command_is_installed\n extract_gem\n copy_in(options[:copy_in], @target_dir) if options[:copy_in]\n\n # Apply all patches\n patches.each do |patch|\n info 'Applying patch ' + patch\n @std << apply_patch(patch, options)\n end\n remove(options[:remove], @target_dir) if options[:remove]\n # Rebuild only if there weren't any problems\n build_patched_gem unless failed?\n\n options[:outfile] ||= File.join(@output_dir, @package.spec.file_name)\n FileUtils.mv((File.join @target_dir, @package.spec.file_name), options[:outfile]) unless options[:dry_run]\n\n # Return the path to the patched gem\n options[:outfile]\n end", "title": "" }, { "docid": "197f87c547ee1d98f7ebd39721090da4", "score": "0.5368336", "text": "def patches\n ['http://github.com/jts/sga/commit/b4efb323ed.diff',\n 'https://github.com/jts/sga/commit/dfe74633fb.diff'] unless build.head?\n end", "title": "" } ]
c3a7af52652cd82a137c8d9d9752f15d
mostra lo stato dell'obiettivo (nascosto, bloccato o sbloccato)
[ { "docid": "13fcddea942a898610e596c4a0efc4a0", "score": "0.0", "text": "def draw_achievement_description(desc)\n desc.each_with_index{|text, i| draw_text(4, line_height * (4 + i), contents_width, line_height, text, 1) }\n desc.size\n end", "title": "" } ]
[ { "docid": "d6201f7f3662405c0b66a7937be20354", "score": "0.6398106", "text": "def estatisticas\n\n @obj1 = categoria_percent\n \n @obj = avg_price_categoria\n\n @h = get_grafico(@obj,\"bar\")\n\n @h1 = get_grafico(@obj1,\"pie\")\n end", "title": "" }, { "docid": "97ecc9a0d815d803b81169f03ec3d51d", "score": "0.6277631", "text": "def gastoEnergeticoBasal ()\n if (self.datosAntropometricos.sexo == 0)\n (10 * self.datosAntropometricos.peso) + (6.25 * self.datosAntropometricos.talla * 100) - (5 * self.datosAntropometricos.edad) - 161\n elsif (self.datosAntropometricos.sexo == 1)\n (10 * self.datosAntropometricos.peso) + (6.25 * self.datosAntropometricos.talla * 100) - (5 * self.datosAntropometricos.edad) + 5\n end\n end", "title": "" }, { "docid": "1aad795c826afd0b1aaff6518d95e600", "score": "0.6084113", "text": "def show\n @comentario = Comentario.new\n suma = 0\n cont = 0\n @local.comentarios.each do |comentario|\n if comentario.valoracion\n suma += comentario.valoracion\n cont += 1\n end\n end\n @promedio = if cont != 0\n suma_f = suma.to_f\n (suma_f / cont.to_f).round 1\n else\n 0\n end\n end", "title": "" }, { "docid": "545b082397bf6e1630dab4894a2a6f80", "score": "0.6071259", "text": "def gastoEnergeticoBasal ()\n \tif (self.sexo == 0)\n \t\t(10 * self.peso) + (6.25 * self.talla * 100) - (5 * self.edad) - 161\n \telsif (self..sexo == 1)\n \t\t(10 * self.peso) + (6.25 * self.talla * 100) - (5 * self.edad) + 5\n \tend\n \tend", "title": "" }, { "docid": "d7d721693f4ff47428486b680d662d6e", "score": "0.6030562", "text": "def modelo_generico_cabecalho(doc, boleto)\n monta_logotipo(doc, boleto, 0.782, 19.717, 0.85)\n doc.moveto x: 4.813, y: 19.801\n doc.show \"#{boleto.banco}-#{boleto.banco_dv}\", tag: :medio\n doc.moveto x: 0.823, y: 20.942\n doc.show boleto.codigo_barras.linha_digitavel, tag: :menor_bold\n doc.moveto x: 1.121, y: 18.924\n doc.show truncar(boleto.cedente, 47), tag: :menor\n doc.moveto x: 9.9, y: 18.924\n doc.show boleto.agencia_conta_boleto.tr(' ', ''), tag: :menor\n doc.moveto x: 16.423, y: 18.924\n doc.show boleto.nosso_numero_boleto, tag: :menor\n doc.moveto x: 1.121, y: 17.984\n doc.show boleto.documento_numero, tag: :menor\n doc.moveto x: 14.139, y: 18.924\n doc.show boleto.quantidade, tag: :menor\n doc.moveto x: 7.0, y: 17.984\n doc.show boleto.documento_cedente.formata_documento.to_s, tag: :menor\n doc.moveto x: 10.602, y: 17.984\n doc.show boleto.data_vencimento.to_s_br, tag: :menor\n doc.text_area \"<menor>#{boleto.valor_documento.to_currency}</menor>\", width: 5.78, text_align: :right, x: 14.12, y: 17.984, tag: :menor\n doc.moveto x: 1.109, y: 17.089\n doc.show truncar(boleto.sacado, 109), tag: :menor\n end", "title": "" }, { "docid": "37c9da268715a92a1dcd635a0066eba4", "score": "0.6019288", "text": "def gasto_energetico_basal\n \n if @datos.sexo == 0\n\n (10 * @datos.peso) + (6.25 * @datos.talla) - (5 * @datos.edad) - 161\n \n elsif @datos.sexo == 1\n \n (10 * @datos.peso) + (6.25 * @datos.talla) - (5 * @datos.edad) + 5\n \n end\n \n end", "title": "" }, { "docid": "51a8c61fd6e6c9098c08b0aea38954cf", "score": "0.601083", "text": "def gera_boleto_automatico\n boleto = nil\n # paga, atrasada, mora, vincenda\n situacao = self.get_situacao\n\n options = {}\n\n if [:vincenda, :mora].include?(situacao) then\n boleto = gera_boleto_vincendo2 options\n end\n\n if situacao == :atrasada then\n boleto = gera_boleto_vencido options\n end\n\n return boleto\nend", "title": "" }, { "docid": "9dc1d1a1854d505fde70ea9ced2e7fde", "score": "0.59750885", "text": "def comissao_desconto_item\n percentual_reducao = 0.150 #percentual de redução da comissão para cada 1% de desconto no item. (parametro).\n comissao_padrao = 6.00 #Percentual de comissão do vendedor por industria.\n desconto_padrao = 22.90 #Percentual de desconto maximo por item permitido.\n comissao = 0.00 #variavel local.\n vlr_comissao = 0.00 #variavel local.\n\n # Exemplo do calculo abaixo: 5.0-((25-23)*0.150)\n\n if self.item_pedidos.size > 0\n self.item_pedidos.each do |item_pedido|\n item_pedido.desconto = 0 unless item_pedido.desconto\n if item_pedido.desconto > 0\n if item_pedido.desconto > desconto_padrao\n comissao = (comissao_padrao - ((item_pedido.desconto - desconto_padrao) * percentual_reducao ))\n else\n comissao = comissao_padrao\n end\n if comissao < 0\n comissao = 0\n else\n vlr_comissao += ( ((item_pedido.valor_venda.to_f * item_pedido.quantidade.to_f) * comissao) / 100 )\n end\n else\n comissao = comissao_padrao\n vlr_comissao += ( ((item_pedido.valor_venda.to_f * item_pedido.quantidade.to_f) * comissao) / 100 )\n end\n end\n if self.valor.nil?\n self.valor = 1\n vlr_comissao = 0\n end\n vlr_comissao = 0 if vlr_comissao.nil?\n if self.valor > 0\n percentual_comissao = ((vlr_comissao.to_f / self.valor.to_f) * 100.to_f).to_f\n else\n percentual_comissao = 0\n end\n else\n 0\n end\n\n end", "title": "" }, { "docid": "a4f3d2daace02d36d8ec5ade14e49ced", "score": "0.59292656", "text": "def por_carbo\n\t\ttotal_car = @alimentos.get_carbo\n\t\ttotal_nutr = @alimentos.get_nutrientes\n\t\tporcentaje_carbo = (total_car * 100) /total_nutr\n\t\treturn porcentaje_carbo\n\tend", "title": "" }, { "docid": "86ea2042d598839a1c78d6c89ffa6ef1", "score": "0.59272313", "text": "def calcule\n mInd = MontantCotisation.new\n mFam = MontantCotisation.new\n mInd.asIndividu(self.famille)\n mFam.asFamille(self.famille)\n familiale = mFam.net() < mInd.net()\n mc = familiale ? mFam : mInd\n self.cotisation_calculee = mc.total()\n self.non_taxable = mc.totalNonTaxable()\n \n # Si c'etait une cotisation familiale et maintenant individuel, on\n # enleve le rabais de pre-inscription\n self.rabais_preinscription = 0 if self.familiale && !familiale\n \n # Je ne reduit pas le rabais de pre-inscription si j'en ai deja un.\n self.rabais_preinscription = mc.rabaisPreInscription if self.rabais_preinscription < mc.rabaisPreInscription\n \n self.familiale = familiale\n\n # Sauver les details de la cotisation pour affichage. Pas utilise par la logique.\n desc = mc.description(self.famille.english? ? :en : :fr)\n self.frais1 = desc[0][1]\n self.frais1_explication = desc[0][0]\n self.frais2 = desc.size > 1 ? desc[1][1] : 0\n self.frais2_explication = desc.size > 1 ? desc[1][0] : ''\n self.frais3 = desc.size > 2 ? desc[2][1] : 0\n self.frais3_explication = desc.size > 2 ? desc[2][0] : ''\n self.frais4 = desc.size > 3 ? desc[3][1] : 0\n self.frais4_explication = desc.size > 3 ? desc[3][0] : ''\n self.frais5 = desc.size > 4 ? desc[4][1] : 0\n self.frais5_explication = desc.size > 4 ? desc[4][0] : ''\n self.frais6 = desc.size > 5 ? desc[5][1] : 0\n self.frais6_explication = desc.size > 5 ? desc[5][0] : ''\n \n save!\n end", "title": "" }, { "docid": "371936c1f83ad8bab17e85029d4df676", "score": "0.59252846", "text": "def neto_actual_sin_ganancia\n salario_actual.neto_del_mes_acum()[:diciembre]\n end", "title": "" }, { "docid": "8b3b374712fa41dc5dafd45ff7a7d790", "score": "0.5887647", "text": "def smore(vesicoprostatic, unpoached_landaulet, alkes_bilbo)\n end", "title": "" }, { "docid": "57f53eae21d90e290bc3c47e8cb85b03", "score": "0.5887563", "text": "def desconta(orcamento)\n if (orcamento.itens.count > 5)\n return orcamento.valor * 0.1\n end\n #desconto = self.proximo\n\n return proximo.desconta(orcamento)\n end", "title": "" }, { "docid": "d83fa84cfee6508c165e682514af09f5", "score": "0.5849801", "text": "def entra_carro\n\t\tunless estado[0]\n\t\t\t@atual += 1\n\t\t\tretorna = \"Um carro estacionou.\"\n\t\telse\n\t\t\tretorna = \"Lotado.\"\n\t\tend\n\t\tputs retorna\n\t\tputs \"Status: #{estado[1]}\"\n\t\tretorna\n\tend", "title": "" }, { "docid": "2e5d1b8db4ee238f946fffb93247c36c", "score": "0.58430415", "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": "886a393e195a9a8a67b8017e90f34eb1", "score": "0.5778952", "text": "def ocupar tropa\n # Checa se existem tropas amigas no local, se sim, mescla as tropas\n concatenada = checar_concatenacao tropa\n\n if concatenada.nil? then\n @tropas.push tropa\n checar_batalhas tropa\n else\n checar_batalhas concatenada\n end\n end", "title": "" }, { "docid": "9cfbf287fe9597433f715557dd5aeb17", "score": "0.576652", "text": "def estado\n\t\tcheio = @atual >= @vagas\n\t\tmensagem = if cheio \n\t\t\t\"Lotado.\" \n\t\telse\n\t\t\t\"Ha #{@vagas - @atual} vagas livres.\"\n\t\tend\n\t\t[cheio, mensagem]\n\tend", "title": "" }, { "docid": "93854ffbad99f83a3b91d1e29a369d2f", "score": "0.574592", "text": "def cuenta_objetivo\n entidad.cuenta(monto.currency,operadora)\n end", "title": "" }, { "docid": "de2eb808e46b817c8e4b1f69209470db", "score": "0.57295865", "text": "def tipo_calc\n #OS CAMPOS DEVEM SER PREENCHIDOS CORRETAMENTE\n if (@a == 0 && (@b == 0 || @c == 0)) || (@b == 0 && @c == 0)\n puts \"Insira os valores para cálculo!\"\n else\n #SE NAO HOUVER HIPOTENUSA, CALCULE\n if @a == 0\n puts \"O valor da hipotenusa é: #{hipotenusa}\"\n\n #SE NAO HOUVER CATETO, CALCULE\n elsif \n puts \"O valor do cateto é: #{cateto}\"\n end\n end\n \n end", "title": "" }, { "docid": "f5bde23d2d6a80addacda6e302d38e5c", "score": "0.57164544", "text": "def encuentra_descripcion\n endpoint = \"species/narrative/#{taxon.nombre_cientifico.limpiar(tipo: 'ssp')}\"\n consulta_api(endpoint)\n\n return if datos[:estatus]\n \n # Busco en sinonimos\n sinonimos = taxon.especies_estatus.sinonimos\n \n if sinonimos.any?\n sinonimos.each do |sinonimo|\n endpoint = \"species/narrative/#{sinonimo.especie.nombre_cientifico.limpiar(tipo: 'ssp')}\"\n consulta_api(endpoint) \n return if datos[:estatus]\n end\n else\n self.datos = { estatus: false, msg: 'No hubo resultados' }\n end\n end", "title": "" }, { "docid": "6f436c53c13c4313ce4c0247e309d38f", "score": "0.5703115", "text": "def efectoTermogeno ()\n \tself.gastoEnergeticoBasal() * 0.10\n \tend", "title": "" }, { "docid": "eff5c955a20c8687d67a83d1896b7804", "score": "0.5678841", "text": "def gastoActividadFisica ()\n case self.nivelActividad\n when \"reposo\" then self.gastoEnergeticoBasal() * 0.0\n when \"ligera\" then self.gastoEnergeticoBasal() * 0.12\n when \"moderada\" then self.gastoEnergeticoBasal() * 0.27\n when \"intensa\" then self.gastoEnergeticoBasal() * 0.54\n end\n end", "title": "" }, { "docid": "e91190a7bb1736fca21459c2aa1a5800", "score": "0.56715924", "text": "def actualiza_catalogocentralizado(archivo)\n # Borra la anterior informacion de IUCN en catalogocentralizado\n #EspecieCatalogo.where(catalogo_id: [25,26,27,28,29,30,31,32,1022,1023]).destroy_all\n\n #datos = {}\n #csv_path = Rails.root.join('public', 'IUCN', archivo)\n #return unless File.exists? csv_path\n\n #CSV.foreach(csv_path, :headers => true) do |row|\n datos.each do |dato| \n #next if SALTA_CASOS.include?(row['observaciones'])\n \n # Caso mas \"simple\" cuando es busqueda exacta\n if row['mensaje'] == 'Búsqueda exacta'\n datos[row['IdCAT válido']] = { 'iucn' => '', 'observaciones' => '', 'iucn_sinonimos' => [], 'nombre valido CAT' => '' } unless datos[row['IdCAT válido']].present?\n datos[row['IdCAT válido']]['nombre valido CAT'] = row['Nombre válido CAT']\n datos[row['IdCAT válido']]['iucn'] = row['Categoría en IUCN']\n\n sinonimos = datos[row['IdCAT válido']]['iucn_sinonimos']\n if sinonimos.any?\n # Hubo alguna categoria de IUCN que coincidio con el sinonimo y valido, caso 2\n if (sinonimos.map{ |s| s[1] } & [row['Categoría en IUCN']]).any?\n mensaje_caso2 = \"En IUCN Red List #{VERSION_IUCN} con categoría #{CATEGORIAS_IUCN[row['Categoría en IUCN']]}, como \"\n mensaje_taxa_caso2 = [] \n\n sinonimos.each do |sinonimo|\n if sinonimo[1] == row['Categoría en IUCN']\n mensaje_taxa_caso2 << sinonimo[0]\n end\n end\n\n datos[row['IdCAT válido']]['observaciones'] = mensaje_caso2 + row['Nombre válido CAT'] + ', ' + mensaje_taxa_caso2.join(', ') + '(ver relaciones de sinonimia).'\n end\n\n # El valido y el sinonimo tienen 2 categorias diferentes, caso 3\n if (sinonimos.map{ |s| s[1] } - [row['Categoría en IUCN']]).any?\n mensaje_caso3 = \"Nombres válido y sinónimo con diferente categoría en IUCN Red List #{VERSION_IUCN}. \"\n mensaje_caso3 += \"#{row['Nombre válido CAT']} con categoría #{CATEGORIAS_IUCN[row['Categoría en IUCN']]}, \"\n mensaje_taxa_caso3 = [] \n\n sinonimos = datos[row['IdCAT válido']]['iucn_sinonimos']\n sinonimos.each do |sinonimo|\n mensaje_taxa_caso3 << \"#{sinonimo[0]} con categoría #{CATEGORIAS_IUCN[sinonimo[1]]}\"\n end\n\n if datos[row['IdCAT válido']]['observaciones'].present?\n datos[row['IdCAT válido']]['observaciones'] += mensaje_caso3 + mensaje_taxa_caso3.join(', ') + '(ver relaciones de sinonimia).'\n else\n datos[row['IdCAT válido']]['observaciones'] = mensaje_caso3 + mensaje_taxa_caso3.join(', ') + '(ver relaciones de sinonimia).'\n end\n \n end\n end\n\n elsif row['mensaje'] == 'Búsqueda exacta y era un sinónimo'\n if datos[row['IdCAT válido']].present?\n datos[row['IdCAT válido']]['iucn_sinonimos'] << [row['Nombre válido CAT'], row['Categoría en IUCN']]\n else\n datos[row['IdCAT válido']] = { 'iucn' => '', 'observaciones' => '', 'iucn_sinonimos' => [], 'nombre valido CAT' => '' }\n datos[row['IdCAT válido']]['iucn_sinonimos'] << [row['Nombre válido CAT'], row['Categoría en IUCN']]\n #datos[row['IdCAT válido']]['nombre valido CAT'] = row['Nombre válido CAT']\n end\n end\n\n end\n end", "title": "" }, { "docid": "9426ed31f7ee453f1f48d8625eba35c9", "score": "0.56713986", "text": "def taxa_tecnologia\n return @g_tecnologia if @status != STATUS_SOB_CERCO && @jogador != nil\n return 0\n end", "title": "" }, { "docid": "2445a11c74536da9dbc6c1599c2ee2e4", "score": "0.5664737", "text": "def consuma_oggetto(id_oggetto, numero)\n return if @active_battler.save_item_bonus >= rand\n consuma_oggetto_attr(id_oggetto, numero)\n end", "title": "" }, { "docid": "871ec6288b069a405aae843577098ab9", "score": "0.5657006", "text": "def oportunidade\n\tend", "title": "" }, { "docid": "41471c519422d52f2212eb9ceeb52bca", "score": "0.5653418", "text": "def sai_carro\n\t\tif @atual > 0\n\t\t\t@atual -= 1\t\n\t\t\tretorna = \"Um carro saiu.\"\n\t\telse\n\t\t\tretorna = \"Nao ha carros para sair.\"\n\t\tend\n\t\tprint retorna + \"\\n\"\n\t\tprint \"Status: #{estado[1]}\\n\"\n\t\tretorna\n\tend", "title": "" }, { "docid": "e7d3e55b3df13260b1414e61d767c314", "score": "0.56469923", "text": "def get_carbo\n\t\tpuntero=@head\n\t\ttotal_carbohidratos=0\n\t\tif(@head!=nil)\n\t\t\twhile(puntero!=nil) do\n\t\t\t\ttotal_carbohidratos += puntero.value.lipidos\n\t\t\t\tif(puntero.nest!=nil)\n\t\t\t\t\tpuntero = puntero.nest\n\t\t\t\telse\n\t\t\t\t\tpuntero=nil\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn total_carbohidratos\n\tend", "title": "" }, { "docid": "2b17320df754d0d42429e4920a12d01a", "score": "0.5645037", "text": "def gera_boletos_iniciais lote_id\n\n lote = Lote.find(lote_id)\n venda = lote.get_venda\n data_venda = venda.data_escritura\n data_venda = data_venda.nil? ? venda.data_contrato : data_venda\n\n #dt = (data_venda + 1.year + 1.month - 1.day).to_s(:db)\n dt = (data_venda + (venda.primeira_parcela_atualizar-1).month + 15.day).to_s(:db)\n\n sql = <<SQL_TYPE\n select *\n from promissorias p\n where p.venda_id = #{venda.id}\n and p.data_vencimento < '#{dt}'\n and p.data_vencimento <> '#{(data_venda).to_s(:db)}'\n order by p.data_vencimento\nSQL_TYPE\n\n flag = true\n a = []\n promissorias = Promissoria.find_by_sql(sql)\n promissorias.each do |p|\n ##\n ## Evitar correcao monetaria para parcelas mensais\n ## CORRIGIR: nao calcula correcao entre dt_venda e dt_primeira_mensal para intermediarias\n if !p.pago? then\n if flag and (p.cod_tipo_parcela == 29) then\n venda.data_escritura = p.data_vencimento\n venda.save\n flag = false\n end\n\n tipo_boleto = 46 #normal\n b = p.gera_boletob tipo_boleto, \"\", \"\"\n a << \"#{p.num} : #{p.data_vencimento} ** valor inicial = #{p.valor_original} * valor boleto = #{b.valor_titulo} *** (#{b.cod_sac})\"\n end\n end\n\n venda.data_escritura = data_venda\n venda.save\n\n return a\n end", "title": "" }, { "docid": "db28e3e159a08f8cf6eda59a8f2f21cd", "score": "0.563935", "text": "def porCarbohidratos\n auxCarbohidratos= 0.0.to_d\n conjuntoAlimentos.size.times do |i|\n auxCarbohidratos+= (conjuntoAlimentos[i].carbohidratos.to_d)* (conjuntoCantidades[i].to_d/1000.0)\n end\n return ((auxCarbohidratos/ conjuntoPorcentaje)* 100)\n end", "title": "" }, { "docid": "82c34bb1b436cbff0da43f64ac8a3f14", "score": "0.5634018", "text": "def cantidad_de_operaciones\n @memoria.contador\n end", "title": "" }, { "docid": "0d4cce377f4ecf2243f2d5569ed43c3e", "score": "0.56330705", "text": "def beneficios\n end", "title": "" }, { "docid": "c512d3086c54cb450c944eacc9c75f27", "score": "0.56291586", "text": "def busca_conta\n\n end", "title": "" }, { "docid": "192bb281dc0288fb51b713a83f41c97d", "score": "0.56265604", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5) + 3\n puts \"Você acertou o montro, o seu dano foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts \"Monstro está morto!\"\n end\n\n unless alvo.esta_vivo?\n puts \"O monstro está morto \\n\\n\"\n self.numero_de_mortos += 1\n end\n\n end", "title": "" }, { "docid": "2dde5f7270721393e518e3b1d6fd3d61", "score": "0.56139016", "text": "def colocar_barco_en(posicion, tipo_barco, direccion)\n \tposiciones_a_ocupar= calcular_posiciones(posicion, tipo_barco.tamanio, direccion)\n validar_posiciones posiciones_a_ocupar\n if posiciones_libres? posiciones_a_ocupar\n posiciones_a_ocupar.map {|p| @posiciones[p]= tipo_barco}\n else\n raise PosicionOcupadaException.new\n end\n end", "title": "" }, { "docid": "5e32c424ca8c76bcafede73f68530e22", "score": "0.56066537", "text": "def impactoAmbiental\n \n \"Para la dieta #{@nombre} las emisiones de gases kgCO2eq son: #{@alimentoTotal.emisiones} y el terreno usado en m2 por año es: #{@alimentoTotal.terreno}\"\n \n end", "title": "" }, { "docid": "f9f42f105b5a84d8e265033da4b0db74", "score": "0.56065255", "text": "def report_statistiques_generales\n @report << 'Statistiques générales'.in_h2\n @report << nombre_ips_differentes\n @report << nombre_de_particuliers\n @report << nombre_de_search_engines\n @report << nombre_de_routes\n @report << duree_totale_des_visites\n @report << duree_totale_des_visites_particuliers\n end", "title": "" }, { "docid": "dcf3d800fcccdcaaaa22f252f03e2c6a", "score": "0.56036186", "text": "def vincitore_mano(carte_giocate)\r\n lbl_best = nil\r\n player_best = nil\r\n carte_giocate.each do |card_gioc|\r\n # card_gioc is an hash with only one key\r\n lbl_curr = card_gioc.keys.first\r\n player_curr = card_gioc[lbl_curr]\r\n unless lbl_best\r\n # first card is the best\r\n lbl_best = lbl_curr\r\n player_best = player_curr\r\n # continue with the next\r\n next\r\n end\r\n # now check with the best card\r\n info_cardhash_best = @deck_information.get_card_info(lbl_best)\r\n info_cardhash_curr = @deck_information.get_card_info(lbl_curr)\r\n if is_briscola?(lbl_curr) && !is_briscola?(lbl_best)\r\n # current wins because is briscola and best not\r\n lbl_best = lbl_curr; player_best = player_curr\r\n elsif !is_briscola?(lbl_curr) && is_briscola?(lbl_best)\r\n # best wins because is briscola and current not, do nothing\r\n else \r\n # cards are both briscola or both not, rank decide when both cards are on the same seed\r\n if info_cardhash_curr[:segno] == info_cardhash_best[:segno]\r\n if info_cardhash_curr[:rank] > info_cardhash_best[:rank]\r\n # current wins because is higher\r\n lbl_best = lbl_curr; player_best = player_curr\r\n else\r\n # best wins because is briscola, do nothing\r\n end\r\n else\r\n # cards are not on the same suit, first win, it mean best\r\n end\r\n end \r\n end\r\n return lbl_best, player_best\r\n end", "title": "" }, { "docid": "dad273570048afe94f285164174754ee", "score": "0.55992776", "text": "def efectoTermogeno ()\n self.gastoEnergeticoBasal() * 0.10\n end", "title": "" }, { "docid": "607c31354585e9b1bc45dfdc55ed4624", "score": "0.55888087", "text": "def estado\n if titular\n \"Vendido\"\n else\n \"Sin vender\"\n end\n end", "title": "" }, { "docid": "b932a4139aecf742257d717a2527d018", "score": "0.558862", "text": "def busca_recursivamente(taxones, hash)\n coincidio_alguno = false\n taxon_coincidente = Especie.none\n nombres = hash['nombre_cientifico'].split(' ')\n h = hash\n\n taxones_coincidentes = taxones.map{|t| asigna_categorias_correspondientes(t)}\n taxones_coincidentes.each do |t| # Iterare cada taxon que resulto parecido para ver cual es el correcto\n t = asigna_categorias_correspondientes(t)\n next unless t.present? # Por si regresa nulo\n\n # Si es la especie lo mando directo a coincidencia\n cat_tax_taxon_cat = I18n.transliterate(t.x_categoria_taxonomica).gsub(' ','_').downcase\n if cat_tax_taxon_cat == 'especie' && nombres.length == 2 && hash['infraespecie'].blank?\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Caso para infraespecies\n variedad = %w(var. var variedad)\n if cat_tax_taxon_cat == 'variedad' && nombres.length == 3 && variedad.include?(hash['categoria'].try(:downcase))\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n subvariedad = %w(subvar. subvar subvariedad)\n if cat_tax_taxon_cat == 'subvariedad' && nombres.length == 3 && subvariedad.include?(hash['categoria'].try(:downcase))\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n forma = %w(f. f forma)\n if cat_tax_taxon_cat == 'forma' && nombres.length == 3 && forma.include?(hash['categoria'].try(:downcase))\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n subforma = %w(subf. subf subforma)\n if cat_tax_taxon_cat == 'subforma' && nombres.length == 3 && subforma.include?(hash['categoria'].try(:downcase))\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Si no coincide ninguna de las infraespecies anteriores, toma subespecie por default\n subespecies = %w(subsp. subsp subespecie ssp. ssp)\n if cat_tax_taxon_cat == 'subespecie' && nombres.length == 3 && (hash['categoria'].blank? || subespecies.include?(hash['categoria'].try(:downcase)))\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Para poner el genero si esque esta vacio con especie\n if cat_tax_taxon_cat == 'genero' && nombres.length == 1 && hash['especie'].blank?\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: (validó hasta género) #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Si no coincidio con ninguno le dejo el unico\n if taxones.length == 1\n return {taxon: t, hash: h, estatus: true, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Comparamos entonces la familia, si vuelve a coincidir seguro existe un error en catalogos\n if t.x_familia == hash['familia'].try(:downcase)\n\n if coincidio_alguno\n return {hash: h, estatus: false, error: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n else\n taxon_coincidente = t\n coincidio_alguno = true\n end\n end\n end #Fin each taxones coincidentes\n\n # Mando el taxon si coincidio alguno\n if coincidio_alguno\n return {taxon: taxon_coincidente, hash: h, estatus: true}\n else # De lo contrario no hubo coincidencias claras\n return {hash: h, estatus: false, error: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n end", "title": "" }, { "docid": "9800f338cb4d6221a61e17075ca3b517", "score": "0.55863756", "text": "def DatiCarico(ciclo,conta_slip,carico)\r\n @conta=conta_slip\r\n @ciclo=ciclo\r\n @riga=@ciclo.riga \r\n @fase1,@fase2,@fase3,@fase4,@fase5,@fase6,@fase7,@fase8,@fase9=nil\r\n @stampaslip=0\r\n @script=\"\"\r\n @carico=carico #Distinguo Tra Carico & Commessa\r\n @tipo_elaborazione=\"Union\"\r\n @riga[:pcas]=0 #---setta dimensione default profondità cassetto\r\n\r\n #gino=STDIN.gets.chomp() #stoppare\r\n #@salvaslip=true #---inizialmente settata su sempre vera #abilitare per gestire salta slip\r\n\r\n #--------------------------------Setta Variabili Di Default x Brema\r\n @attivabrema=false\r\n @bremaL=0\r\n @bremaA=0\r\n @bremaP=0\r\n\r\n #Gestire Controllo Fuori Misura & Very\r\n #in ECAD viene riempita FM & PFM\r\n #in ECAD viene riempita solo PFM quindi faccio riferimento solo a quella \r\n\r\n if @ciclo.tipologia==\"MAGAZZINO\"\r\n if @riga[:stampamagazzino]==true\r\n @stampaslip=1\r\n end \r\n @ciclost=@riga[:magazzino].split(\";\")\r\n elsif @ciclo.tipologia==\"MAGAZZINOFM\"\r\n #@riga[:pfm]=\"FM\"\r\n @stampaslip=1\r\n @ciclost=@riga[:magazzinofm].split(\";\")\r\n elsif @ciclo.tipologia==\"BARRA\" or @ciclo.tipologia==\"BARRAFM\"\r\n #@riga[:pfm]=\"FM\"\r\n @stampaslip=1\r\n @ciclost=@riga[:dabarra].split(\";\")\r\n else #---DA PANNELLO\r\n #@riga[:pfm]=\"FM\"\r\n @stampaslip=1\r\n if @riga[:ciclofisso]==true and @riga[:stampamagazzino]==false\r\n @stampaslip=0\r\n end\r\n @ciclost=@riga[:dapannello].split(\";\") \r\n end \r\n\r\n #----Aggiunta Forzatura Montato 16.10.14 disattivato script montato x velocità\r\n #if @riga[:flag]==\"M\" and (@ciclost.last==\"90\" or @ciclost.last==\"10\" or @ciclost.last==\"5\")\r\n # #@ciclost.pop #elimina ultimo valore array\r\n # @ciclost[-1]=\"1\" #Forza il Montato \r\n #end\r\n #----------Qualsiasi Classe Etichetta Diventa Montato 31.10.14\r\n if @riga[:flag]==\"M\"\r\n ultima_fase=$lista_reparti.detect{|f| f[:codice]==\"#{@ciclost[-1]}\"} #Deterimino L'ultima Fase\r\n if ultima_fase!=nil and ultima_fase.tiporeparto==\"Etichetta\"\r\n @ciclost[-1]=\"1\" #Forza il Montato \r\n end \r\n end\r\n #------------------------------------------------\r\n\r\n @islaccato=@ciclo.islaccato\r\n \r\n @appo_ciclost=@ciclost.dup #memorizzo ciclo prima di passare al recupero fasi (dup copia x valore non per riferimento)\r\n \r\n RecuperaFasi(@ciclost) \r\n #puts @ciclost \t\t\r\n\t\t#puts @fase3.codice\r\n \r\n if @islaccato==true #se laccato forza la stampa delle slip\r\n @stampaslip=1\r\n end \r\n\t\t\r\n\t\t#puts @ciclost #stampa ciclo prima di un elaborazione\r\n \r\n #attenzione arriva 0 o 1 \r\n if @riga[:abilitascript]==true #rielabora la slip con uno script se esistente \r\n PreProcessaSlip(@riga[:script]) \r\n end\r\n \r\n #if @salvaslip==true #serve per gestire alcuni casi limite #abilitare per gestire salta slip\r\n SalvaSlip()\r\n #end\r\n end", "title": "" }, { "docid": "b3e16321ca4a69850ae0729905775955", "score": "0.5581715", "text": "def obec\n cast_obce.try!(:obec) ||\n momc.try!(:obec) ||\n katastralni_uzemi.try!(:obec)\n end", "title": "" }, { "docid": "51ba671bc09476526e77d19d5c0b5f2e", "score": "0.55710566", "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": "078635bd88282a78b6072f38da186f92", "score": "0.5560305", "text": "def puntaje_eje4_p2\n @diagnostico = Diagnostico.find(self.diagnostico_id)\n @escuela = Escuela.find_by_clave(@diagnostico.escuela.clave) if @diagnostico\n @user = User.find_by_login(@escuela.clave) if @escuela\n @consumo = @diagnostico.consumo if @diagnostico.consumo\n\n if @consumo.conocen_lineamientos_grales == \"SI\"\n @eje4_p2 = $consumo_p2 * 100\n else\n @eje4_p2 = 0\n end\n\n return @eje4_p2\nend", "title": "" }, { "docid": "2eb4656f59720e28f42ad908403a2b30", "score": "0.555992", "text": "def odbierz\n\twiadomosci=@jabber.otrzymane_wiadomosci\n\tif !wiadomosci.empty? then\n\t\tputs \"\\nOtrzymane wiadomosci: \"\n\t\twiadomosci.each do |wiadomosc|\n\t\t\tputs \"#{wiadomosc.to}:\\n#{wiadomosc.body}\"\n\t\t\tzapisz_historie(wiadomosc.from.to_s.split('/')[0],\"#{wiadomosc.from.to_s.split('/')[0]}:\\n#{wiadomosc.body}\")\n\t\tend\n\tend\n\tstatusy=@jabber.zmiany_statusow\n\tif !statusy.empty? then\n\t\tputs \"\\nZmiany statusow:\"\n\t\tstatusy.each do |s|\t\t\t\n\t\t\tputs \"Znajomy #{s.from.to_s.split('/')[0]} zmienil status na #{statusParse(s.show)}#{s.status ? \"z opisem \\\"#{s.status}\\\"\" : \"\"}\"\n\t\tend\n\tend\n\tsub=@jabber.prosby_o_subskrypcje\n\tif !sub.empty? then\n\t\tputs \"\\nProsby o subskrypcje:\"\n\t\tsub.each do |s|\n\t\t\tputs \"#{s.from} prosi o subskrypcje\"\n\t\tend\n\tend\n\tputs\n end", "title": "" }, { "docid": "7fc8cb7e9bb5eec2de111ecad5716c57", "score": "0.5558877", "text": "def to_s\n total = 0\n output = @name\n output << \"\\n#{'=' * @name.size}\\n\\n\"\n output << \"Composición nutricional:\\n\"\n output << \"%20s\" % \"\" + \"%-10s\" % \"glúcidos\" + \"%-10s\" % \"proteínas\" + \"%-10s\" % \"lípidos\" + \"%-20s\" % \"valor energético\\n\"\n @vegetales.each{ |x, y| output << \"%-20s\" % x.nombre + \"%-10s\" % x.glucidos + \"%-10s\" % x.proteinas + \"%-10s\" % x.lipidos + \"%-20f\\n\" % (x.val_energ/100*y); total += x.val_energ/100*y}\n @frutas.each{ |x, y| output << \"%-20s\" % x.nombre + \"%-10s\" % x.glucidos + \"%-10s\" % x.proteinas + \"%-10s\" % x.lipidos + \"%-20f\\n\" % (x.val_energ/100*y); total += x.val_energ/100*y}\n @granos.each{ |x, y| output << \"%-20s\" % x.nombre + \"%-10s\" % x.glucidos + \"%-10s\" % x.proteinas + \"%-10s\" % x.lipidos + \"%-20f\\n\" % (x.val_energ/100*y); total += x.val_energ/100*y}\n @proteinas.each{ |x, y| output << \"%-20s\" % x.nombre + \"%-10s\" % x.glucidos + \"%-10s\" % x.proteinas + \"%-10s\" % x.lipidos + \"%-20f\\n\" % (x.val_energ/100*y); total += x.val_energ/100*y}\n @aceites.each{ |x, y| output << \"%-20s\" % x.nombre + \"%-10s\" % x.glucidos + \"%-10s\" % x.proteinas + \"%-10s\" % x.lipidos + \"%-20f\\n\" % (x.val_energ/100*y); total += x.val_energ/100*y}\n output << \"%-41s\" % \"Valor energético total\" + \"%20f\" % total\n output\n end", "title": "" }, { "docid": "76da24ddd3ec926837818630ddd0188a", "score": "0.555113", "text": "def efecto_termogeno\n \n gasto_energetico_basal * 0.10\n \n end", "title": "" }, { "docid": "541946c248554bfefea9b7210f1bbc88", "score": "0.5542242", "text": "def DatiCarico(xriga,ciclo,islaccato,conta_slip)\r\n @conta=conta_slip \r\n @riga=xriga \r\n @fase1,@fase2,@fase3,@fase4,@fase5,@fase6,@fase7,@fase8,@fase9=nil\r\n @stampaslip=0\r\n @script=\"\"\r\n @tipo_elaborazione=\"Logy\"\r\n @riga[:pcas]=0 #---setta dimensione default profondità cassetto\r\n #@salvaslip=true #---inizialmente settata su sempre vera #abilitare per gestire salta slip\r\n\r\n #--------------------------------Setta Variabili Di Default x Brema\r\n @attivabrema=false\r\n @bremaL=0\r\n @bremaA=0\r\n @bremaP=0\r\n\r\n #Gestire Controllo Fuori Misura & Very\r\n #in ECAD viene riempita FM & PFM\r\n #in ECAD viene riempita solo PFM quindi faccio riferimento solo a quella\r\n\r\n if ciclo[0].verifdist==true #----Verifica Controllo Forzato FM (Attenzione Sui Cassetti-Cassettoni verifdist dovrebbe essere false)\r\n if (@riga[:l] != @riga[:pl]) or (@riga[:a] != @riga[:pa]) or (@riga[:p] != @riga[:pp])\r\n @riga[:pfm]=\"FM\"\r\n end\r\n end \r\n\r\n #@riga[:fm].count(\"X\") Conteggia il numero di X nella stringa\r\n #if @riga[:fm]!=\"FM\" and not (@riga[:fm].include? \"X\")==false #Standard (inclusione darebbe true e la condi)\r\n #3cad fm ecad X__\r\n if @riga[:pfm]!=\"FM\" and (@riga[:pfm].include?(\"X\")==false) #Standard (inclusione darebbe true e la condizione deve essere falsa ma vera nell'if)\r\n #puts \"Standard\"\r\n @ciclost=ciclo[0].ciclost.split \r\n if ciclo[0].very.split()[0]==\"1\" #----Verifica Se Stampare La Slip Standard\r\n @stampaslip=1\r\n end \r\n else #FM \r\n #puts \"FM\"\r\n @ciclost=ciclo[0].ciclofm.split\r\n if ciclo[0].very.split()[1]==\"1\" #----Verifica Se Stampare La Slip FM\r\n @stampaslip=1\r\n end\r\n end \r\n\r\n #----Aggiunta Forzatura Montato 16.10.14 disattivato script montato x velocità\r\n #if @riga[:flag]==\"M\" and (@ciclost.last==\"90\" or @ciclost.last==\"10\" or @ciclost.last==\"5\")\r\n # #@ciclost.pop #elimina ultimo valore array\r\n # @ciclost[-1]=\"1\" #Forza il Montato \r\n #end\r\n #----------Qualsiasi Classe Etichetta Diventa Montato 31.10.14\r\n #begin\r\n if @riga[:flag]==\"M\"\r\n ultima_fase=$lista_reparti.detect{|f| f[:codice]==\"#{@ciclost[-1]}\"} #Deterimino L'ultima Fase\r\n if ultima_fase!=nil and ultima_fase.tiporeparto==\"Etichetta\"\r\n @ciclost[-1]=\"1\" #Forza il Montato \r\n end \r\n end\r\n #rescue Exception => msg \r\n # puts \"#{msg} #{@riga[:pcod]} #{@riga[:numero]}\"\r\n #end \r\n #------------------------------------------------\r\n\r\n @islaccato=islaccato\r\n\r\n @appo_ciclost=@ciclost.dup #memorizzo ciclo prima di passare al recupero fasi (dup copia x valore non per riferimento)\r\n \r\n RecuperaFasi(@ciclost)\r\n \r\n #attenzione arriva 0 o 1 \r\n if ciclo[0].abilitascript==true #rielabora la slip con uno script se esistente \r\n PreProcessaSlip(ciclo)\r\n end \r\n\r\n if @islaccato==true #se laccato forza la stampa delle slip\r\n @stampaslip=1\r\n end \r\n \r\n #if @salvaslip==true #serve per gestire alcuni casi limite #abilitare per gestire salta slip\r\n SalvaSlip()\r\n #end\r\n end", "title": "" }, { "docid": "ed11a800d93cdd06a7fae40138506d25", "score": "0.5539867", "text": "def gastoActividadFisica ()\n \tcase self.nivelActividad\n \t\twhen \"reposo\" then self.gastoEnergeticoBasal() * 0.0\n \t\twhen \"ligera\" then self.gastoEnergeticoBasal() * 0.12\n \t\twhen \"moderada\" then self.gastoEnergeticoBasal() * 0.27\n \t\twhen \"intensa\" then self.gastoEnergeticoBasal() * 0.54\n \tend\n \tend", "title": "" }, { "docid": "d39c0f511ad79d23e10dd7ef8a9731f1", "score": "0.55370545", "text": "def vincitore_mano(carte_giocate)\n lbl_best = nil\n player_best = nil\n carte_giocate.each do |card_gioc|\n # card_gioc is an hash with only one key\n lbl_curr = card_gioc.keys.first\n player_curr = card_gioc[lbl_curr]\n unless lbl_best\n # first card is the best\n lbl_best = lbl_curr\n player_best = player_curr\n # continue with the next\n next\n end\n # now check with the best card\n info_cardhash_best = @@deck_info[lbl_best]\n info_cardhash_curr = @@deck_info[lbl_curr]\n if is_briscola?(lbl_curr) && !is_briscola?(lbl_best)\n # current wins because is briscola and best not\n lbl_best = lbl_curr; player_best = player_curr\n elsif !is_briscola?(lbl_curr) && is_briscola?(lbl_best)\n # best wins because is briscola and current not, do nothing\n else \n # cards are both briscola or both not, rank decide when both cards are on the same seed\n if info_cardhash_curr[:segno] == info_cardhash_best[:segno]\n if info_cardhash_curr[:rank] > info_cardhash_best[:rank]\n # current wins because is higher\n lbl_best = lbl_curr; player_best = player_curr\n else\n # best wins because is briscola, do nothing\n end\n else\n # cards are not on the same seed, first win, it mean best\n end\n end \n end\n return lbl_best, player_best\n end", "title": "" }, { "docid": "a7c3ff6e9a70757ad110a0a6920415c1", "score": "0.5529667", "text": "def boruvka\n end", "title": "" }, { "docid": "e8bcb153d37e38adf9416440f672f12d", "score": "0.55277586", "text": "def test_unir_pirata_a_barco\n @barcoSaqueador.agregar(@barbaNegra)\n assert_equal 3, @barcoSaqueador.cantidadTripulantes\n @barcoSaqueable.agregar(@barbaRoja)\n assert_equal 1, @barcoSaqueable.cantidadTripulantes\n end", "title": "" }, { "docid": "c3f6a675571f05335c21c039788d2e5b", "score": "0.5527751", "text": "def vincitore_mano(carte_giocate)\r\n #p carte_giocate\r\n lbl_best = nil\r\n player_best = nil\r\n carte_giocate.each do |card_gioc|\r\n #{:card_lbl => lbl_card, :player_name => player.name}\r\n lbl_curr = card_gioc[:card_lbl]\r\n player_curr = card_gioc[:player_name]\r\n unless lbl_best\r\n # first card is the best\r\n lbl_best = lbl_curr\r\n player_best = player_curr\r\n # continue with the next\r\n next\r\n end\r\n # now check with the best card\r\n info_cardhash_best = @deck_information.get_card_info(lbl_best)\r\n info_cardhash_curr = @deck_information.get_card_info(lbl_curr)\r\n # card best rank decide when both cards are on the same seed\r\n if info_cardhash_curr[:segno] == info_cardhash_best[:segno]\r\n if info_cardhash_curr[:rank] > info_cardhash_best[:rank]\r\n # current wins because is higher\r\n lbl_best = lbl_curr; player_best = player_curr\r\n else\r\n # best wins do nothing\r\n end\r\n else\r\n # cards are not on the same seed, first win, it mean best\r\n end\r\n end\r\n return lbl_best, player_best\r\n end", "title": "" }, { "docid": "c3e1ad1d921fa293b8d3234aa1672592", "score": "0.5527128", "text": "def VCT\n\t\t(self.Proteinas + self.Lipidos + self.Carbohidratos).round(2)\n\t\t\n\t\t\n\tend", "title": "" }, { "docid": "838400803d9d62f70ef46daba42f1bde", "score": "0.5525509", "text": "def calculate_status #(No usado)\n # TODO: Hacer tests que chequeen todos los limites.\n min = Rails.configuration.min_sorbate\n max = Rails.configuration.max_sorbate\n self.status = between?(self.sorbate, min, max) ? \"aprobado\" : \"rechazado\"\n end", "title": "" }, { "docid": "a6f9e6a520e21086b4d7bec1d03c7e8b", "score": "0.5524176", "text": "def bros\n Libro.unscoped.where(\"type = ?\", self.type).order(:titolo)\n end", "title": "" }, { "docid": "b63761e6de00f704603de49512b7b6c5", "score": "0.5520484", "text": "def marcar_como_no_terminada\n self.fecha_completada = nil\n #actualizamos los tiempos de entrega\n self.tiempo_respuesta = 0\n self.tiempo_respuesta_calendario = 0\n end", "title": "" }, { "docid": "bff46e6683bdfc24150da5e7b80b5304", "score": "0.55173373", "text": "def gera_boleto_manual_vincendo\n promissoria = Promissoria.find(params[:id])\n dados = params[:boleto]\n\n dia = dados[\"data_vencimento(3i)\"]\n mes = dados[\"data_vencimento(2i)\"]\n ano = dados[\"data_vencimento(1i)\"]\n data_vencimento = Date.new(ano.to_i, mes.to_i, dia.to_i)\n\n options = {}\n options[:dias_permitido_receber] = dados[\"dias_permitido_receber\"]\n #dias_para_pagar_apos_emissao\n options[:valor] = dados[\"valor\"]\n options[:data_vencimento] = data_vencimento\n options[:tipo_boleto] = :vincendo\n promissoria.gera_boleto options\n @boletos = Boleto.where(\"data_emissao = '#{Time.now.to_s(:db)[0,10]}'\" )\n end", "title": "" }, { "docid": "75cc5dd70c9fc91d5302d488e231da75", "score": "0.55164343", "text": "def status_pengerjaan\n status = \"\"\n if rp.site.eql?('Genteng') \n if ip && ip.cetak_gtg.blank?\n status = \"Instruksi Produksi\"\n elsif ip && ip.cetak_gtg && ip.cetak_gtg.rendam.blank?\n status = \"Cetak Genteng\"\n elsif ip && ip.cetak_gtg && ip.cetak_gtg.rendam && ip.cetak_gtg.rendam.gosok.blank?\n status = \"Rendam\" \n elsif ip && ip.cetak_gtg && ip.cetak_gtg.rendam && ip.cetak_gtg.rendam.gosok && ip.cetak_gtg.rendam.gosok.cat_gtg.blank?\n status = \"Gosok\" \n elsif ip && ip.cetak_gtg && ip.cetak_gtg.rendam && ip.cetak_gtg.rendam.gosok && ip.cetak_gtg.rendam.gosok.cat_gtg\n status = \"Cat Genteng\" \n end\n else\n if ip && ip.cetak_blok.blank?\n status = \"Instruksi Produksi\"\n elsif ip && ip.cetak_blok && ip.cetak_blok.cat_blok.blank?\n status = \"Cetak Blok\"\n elsif ip && ip.cetak_blok && ip.cetak_blok.cat_blok\n status = \"Cat Blok\" \n end\n end\n end", "title": "" }, { "docid": "efb2a3ab65285f6d20e86dd16427db0c", "score": "0.5516074", "text": "def index\n\n if params[:providenca] or params[:fato] or params[:start] or params[:natureza] and params[:end]\n @bos = Bo.all_user(current_user.registry_id).seach_providenca(params[:providenca]).search_bo_year(params[:fato]).search_bo_date(params[:start], params[:end]).seach_nature(params[:nature])\n else\n @bos = Bo.all_user(current_user.registry_id).where(providenca: 'Em Andamento')\n end\n\n printer('bos/shared/bos', 'Relação Bos')\n @natures = Nature.all\n\n end", "title": "" }, { "docid": "14fcb2dacb365865bf319d032003b362", "score": "0.5500022", "text": "def valor_desconto\n self.valor_normal - self.valor \n end", "title": "" }, { "docid": "35c9bafd2d04c48d001811854fb2fad8", "score": "0.54994094", "text": "def per_aule_disponibili\n\t@ore = lista_ore(GIORNOBASE) \t\n \tif params[:laboratorio]=='S' or params[:laboratorio]=='s' \t\t#laboratori\n \t\t@aule = Codificaaula.find(:all, \n \t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ?\",params[:laboratorio], params[:tipolab]], :order => \"codificaaule.fullname\") \n\t\t#creo l'hash completo con tutte le aule (poi sarà modificato togliendo quelle non necessarie))\n\t\t@hsh = crea_hash #hash[giorno][ora]\n\t\t@hsh_prenotazioni = crea_hash #hash[giorno][ora]\n\t \tfor ora in @ore\n\t \t\tfor giorno in ARR_GIORNI\n\t \t\t\t@hsh[giorno][ora.ora_inizio] = Codificaaula.find(:all, \n\t \t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ?\",params[:laboratorio], params[:tipolab]]) \n\t \t\t\t@hsh_prenotazioni[giorno][ora.ora_inizio] = Codificaaula.find(:all,\n\t \t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ?\",params[:laboratorio], params[:tipolab]]) \t\t\t\t\n\t \t\tend\n\t \tend\n\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#aule\n\t\tcase params[:dim]\n\t\t when 'grande' \n\t\t \t@max = GRANDE_MAX \n\t\t \t@min = GRANDE_MIN \n\t\t when 'medio' \n\t\t\t@max = MEDIO_MAX \n\t\t\t@min = MEDIO_MIN \n\t\t when 'piccolo' \n\t\t\t@max = PICCOLO_MAX \n\t\t\t@min = PICCOLO_MIN \n\t\tend\n\t\t\n\t\t@aule = Codificaaula.find(:all, \n\t\t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ? and capacita between ? and ?\",params[:laboratorio], params[:tipolab], @min, @max], :order => \"codificaaule.fullname\") \n\n\t\t#creo l'hash completo con tutte le aule (poi sarà modificato togliendo quelle non necessarie))\n\t\t@hsh = crea_hash #hash[giorno][ora]\n\t\t@hsh_prenotazioni = crea_hash #hash[giorno][ora]\n\t \tfor ora in @ore\n\t \t\tfor giorno in ARR_GIORNI\n\t \t\t\t\t@hsh[giorno][ora.ora_inizio] = Codificaaula.find(:all,\n\t \t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ? and capacita between ? and ?\",params[:laboratorio], params[:tipolab], @min, @max]) \n\t\n\t \t\t\t\t@hsh_prenotazioni[giorno][ora.ora_inizio] = Codificaaula.find(:all,\n\t\t\t\t\t\t\t\t\t:conditions => [\"laboratorio = ? and tipolab = ? and capacita between ? and ?\",params[:laboratorio], params[:tipolab], @min, @max]) \n\t \t\tend\n\t \tend\t\t\n\tend\n\t\n \t#calcolo tutte le soluzioni per pd passato\n \tsoluzioni = Soluzione.find( :all, :conditions => [\"periododidattico_id = ? \",params[:pd]]) \n calcolo_hash(soluzioni, @hsh, 'disponibili')\n\n \t#calcolo tutte le prenotazioni per pd passato \t\n \tpd = Periododidattico.find(params[:pd])\n \tprenotazioni = Prenotazioneaula.find(:all, :conditions => [\"data BETWEEN ? AND ?\", pd.datainizio, pd.datafine])\n calcolo_hash(prenotazioni, @hsh_prenotazioni, 'disponibili') \t\t\t\n end", "title": "" }, { "docid": "f332e71d183dd2a9f9cfc82bfe30536a", "score": "0.5497341", "text": "def cotizados\n cotizaciones = self.pedido_cotizacion_detalles\n cotizados = []\n cotizaciones.each do |c|\n\t cotizados.push(c) if c.pedido_cotizacion.estado == PedidosEstados::COTIZADO && !c.costo_unitario.nil? && c.costo_unitario != 0\n end\n cotizados\n end", "title": "" }, { "docid": "e0004651272b8fc9f3718bf1cb7ffa4c", "score": "0.54945445", "text": "def per_nomecorso\n \t#array dei giorni per ordinare i risultati\n \tgiorni = %w(Lunedi Martedi Mercoledi Giovedi Venerdi Sabato Domenica)\n \n #soluzioni in un dato periodo didattico ordinate per nome del corso, giorno, ora di inizio lezione\n \t@soluzioni = Soluzione.find( :all, \n \t\t\t\t\t\t\t\t :conditions => [\"periododidattico_id = ?\",params[:pd]]).sort_by {|soluzioni| \t\t\t[soluzioni.corso.nome_corso_esteso, (giorni.index soluzioni.codificaorario.giorno), soluzioni.codificaorario.ora_inizio]}\n\n end", "title": "" }, { "docid": "a56ec9b1998d543ad37418f18449ce8d", "score": "0.54927015", "text": "def seleciona_produto\n self.seleciona_perfume\n self.qtd_perfume\n end", "title": "" }, { "docid": "46ebcfc995f536809fab8e5f9cd18a54", "score": "0.5488324", "text": "def cicloProcesamiento\n #-- Caso en el que aun no acaba de procesarse el producto ---\n if @cicloActual > 0\n # Se decrementa el numero de ciclos\n @cicloActual = @cicloActual - 1\n \n #-- Caso en el que los ciclos de procesamiento fueron cumplidos \n else\n # El numero de ciclo era 0, por lo que se reinicia, se obtiene la\n # cantidad de producto manufacturado y se en una variable antes de\n # ser transferido a la siguiente maquina.\n @cicloActual = @ciclosProcesamiento\n @productoHecho = @cantidadMax * (1 - @desecho) \n @estado = \"Espera\"\n end \n end", "title": "" }, { "docid": "4980dd006da6ac207ed3bf7c41fde8f7", "score": "0.54856133", "text": "def aplica_desconto\n desconto = self.desconto\n vlr_tabela = self.valor_tabela\n vlr_venda = (self.valor_tabela - (self.valor_tabela * self.desconto ) /100 )\n self.valor_venda = vlr_venda\n end", "title": "" }, { "docid": "4980dd006da6ac207ed3bf7c41fde8f7", "score": "0.54856133", "text": "def aplica_desconto\n desconto = self.desconto\n vlr_tabela = self.valor_tabela\n vlr_venda = (self.valor_tabela - (self.valor_tabela * self.desconto ) /100 )\n self.valor_venda = vlr_venda\n end", "title": "" }, { "docid": "ee43bb403e13f4403e505d73714dea17", "score": "0.54850054", "text": "def porcentaje_carbohidratos\n\n\t\tacc_carbohidratos = 0\n\n\t\tlista_alimentos.each do |alimento|\n\t\t\tif alimento.instance_of? Alimento\n\t\t\t\tacc_carbohidratos += alimento.carbohidratos\n\t\t\telse\n\t\t\t\traise TypeError, \"Uno de los alimentos de la lista no es de tipo alimento\"\n\t\t\tend\n\t\tend\n\n\t\tpr_carbohidratos = ((acc_carbohidratos/acc_cantidad_alimentos) * 100).round(2)\n\t\tpr_carbohidratos\n\n\tend", "title": "" }, { "docid": "596fa193566568d48043744901922884", "score": "0.54839844", "text": "def aplicar(sueldoEnBruto)\n @sueldoConRetenciones = sueldoEnBruto - (sueldoEnBruto * (@@JUBILACIOn + @@LEY19032 + @@OBRA_SOCIAL))\n @sueldoConRetenciones - self.impuestoGanancias(sueldoEnBruto)\n end", "title": "" }, { "docid": "88b5ff15085f2110113f139ef7a218be", "score": "0.5477565", "text": "def impacto_ambiental_diario\n\t\t@impacto_ambiental_kcal = 0.0\n\t\t@impacto_ambiental_proteina = 0.0\n\n\t\t@comida_hoy.each do |key, value| \n\t\t\tif(value.is_a?(Array))\n\t\t\t\tvalue.each do |alimento|\n\t\t\t\t\tif(alimento.is_a?(Alimento))\n\t\t\t\t\t\t@impacto_ambiental_kcal += alimento.valor_energetico\n\t\t\t\t\t\t@impacto_ambiental_proteina += alimento.proteina\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\n\tend", "title": "" }, { "docid": "389d0c7e69f530ca36e25e757207c109", "score": "0.5476474", "text": "def gasto_energetico_total\n \n gasto_energetico_basal + efecto_termogeno + gasto_actividad_fisica\n \n end", "title": "" }, { "docid": "f4e581053581f821408475a09f1da727", "score": "0.546594", "text": "def to_s\n a = \" \\t\\t\\tPorcion \\t IR \\n\"\n a += \" Valor energetico\\t #{self.valor_energetico_kj} kJ\\t 8.400kJ\\n\"\n a += \" kJ / kcal \\t\\t #{self.valor_energetico_kcal} kcal\\t 2000kcal\\n\"\n a += \" Grasas\\t\\t\\t #{@ngrasas} g.\\t\\t #{self.ingesta_referencia(@ngrasas)}%\\n\"\n a += \" Grasas saturadas\\t #{@ngrasas_s} g.\\t\\t #{self.ingesta_referencia(@ngrasas_s)}%\\n\"\n a += \" Hidratos de carbono\\t #{@hidratos} g.\\t\\t #{self.ingesta_referencia(@hidratos)}%\\n\"\n a += \" Azucares\\t\\t #{@azucares} g.\\t\\t #{self.ingesta_referencia(@azucares)}%\\n\"\n a += \" Proteinas\\t\\t #{@proteinas} g.\\t\\t #{self.ingesta_referencia(@proteinas)}%\\n\"\n a += \" Sal\\t\\t\\t #{@sal} g.\\t\\t #{self.ingesta_referencia(@sal)}%\\n\"\n if @grasas_m\n a += \" Grasas monoinsaturadas\\t #{@grasas_m} g.\\t\\t #{self.ingesta_referencia(@grasas_m)}%\\n\"\n end\n if @grasas_p\n a += \" Grasas polinsaturadas\\t #{@grasas_p} g.\\t\\t #{self.ingesta_referencia(@grasas_p)}%\\n\"\n end\n if @polialcoholes\n a += \" Polialcoholes\\t\\t #{@polialcoholes} g.\\t\\t #{self.ingesta_referencia(@polialcoholes)}%\\n\"\n end\n if @almidon\n a += \" Almidon\\t\\t #{@almidon} g.\\t\\t #{self.ingesta_referencia(@almidon)}%\\n\"\n end\n if @fibra\n a += \" Fibra alimentaria\\t #{@fibra} g.\\t\\t #{self.ingesta_referencia(@fibra)}%\\n\"\n end\n if @vitaminas\n a += \" Vitaminas\\t\\t #{@vitaminas} g.\\t\\t #{self.ingesta_referencia(@vitaminas)}%\\n\"\n end\n if @minerales\n a += \" Minerales\\t\\t #{@minerales} g.\\t\\t #{self.ingesta_referencia(@minerales)}%\\n\"\n end\n end", "title": "" }, { "docid": "de5d189c722f74606ccdce606b2aa444", "score": "0.54624075", "text": "def status\t\n\t\t# a = [\"test1: test,\n\t\t# \ttest2: test2\"]\n\t\t# \tputs a.join(\\n)\n\t\tidentitas_motor = [\"Merk #{@merk}\", \"milik #{@milik}\" , \"tahun #{@tahun}\" , \"type #{@type}\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"kecepatan 60 km/jam\", \" bensin #{@bensin || @bensin_awal} Liter\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"jarak tempuh #{@jarak || @jarak_awal }km\" , \" waktu tempuh #{@jam || @jam_awal} jam\"]\n\t\tputs identitas_motor.join(\"\\n\")\n\tend", "title": "" }, { "docid": "afcd5eea9055f06410f7198d4d5a876b", "score": "0.5461769", "text": "def degustar_uno()\n\t\tif @contador == 0\n\t\t\tif @annos > 35\n\t\t\t\treturn \"El cocinero se ha jubilado y no hay mas platos disponibles\"\n\t\t\telse\n\t\t\t\treturn \"No hay platos disponibles\"\n\t\t\tend\n\t\telse\n\t\t\t@contador -= 1\n\t\t\treturn \"Que delicioso está el plato\"\n\t\tend\n\tend", "title": "" }, { "docid": "14f993b3c42084f797dcb0cbc992ae24", "score": "0.5458467", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5)\n puts \"O dano monstro foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts 'Voce está morto!'\n end\n # puts 'Voce está morto!' unless is_alive?\n end", "title": "" }, { "docid": "95770fe17b4c2fca6971d044306407e4", "score": "0.54566", "text": "def indice_corporal\n if @datos.indice_masa_corporal <= 18.5\n \"Bajo peso\"\n elsif @datos.indice_masa_corporal > 18.5 and @datos.indice_masa_corporal <= 24.9\n \"Peso adecuado\"\n elsif @datos.indice_masa_corporal > 25.0 and @datos.indice_masa_corporal <= 29.9\n \"Sobrepeso\"\n elsif @datos.indice_masa_corporal > 30.0 and @datos.indice_masa_corporal <= 34.9\n \"Obesidad grado 1\"\n elsif @datos.indice_masa_corporal > 35.0 and @datos.indice_masa_corporal <= 39.9\n \"Obesidad grado 2\"\n elsif @datos.indice_masa_corporal > 40\n \"Obesidad grado 3\"\n end\n end", "title": "" }, { "docid": "84a7da7b18f2f8930ce8d2771cd575d1", "score": "0.5455839", "text": "def intestazione\n\t\n\t\tif ragione_sociale && !ragione_sociale.empty?\n\t\tragione_sociale\n\t\telse\n\t\tnome + \" \" + cognome\n\t\tend\n\tend", "title": "" }, { "docid": "8ba2370e796afd67ff15e1509cc44ab9", "score": "0.5450855", "text": "def status_desc\n self.status ? 'ativo' : 'inativo'\n end", "title": "" }, { "docid": "1dfd3ccab6046fc95b9eb95499d913a1", "score": "0.54478496", "text": "def velocidade\n 250\n end", "title": "" }, { "docid": "9d50b2e251268013db66a0aff3c2c82a", "score": "0.5447079", "text": "def fetch_comprobantes(tipo, pto_vta)\n validar_tipo(tipo)\n ultimo = ultimo_cmp(tipo, pto_vta)\n (1..ultimo).each do |numero|\n unless @contribuyente.comprobantes.where(tipo: Comprobante.tipos[tipo], punto_de_venta: pto_vta, numero: numero).exists?\n result = get_cmp_det(tipo, pto_vta, numero)\n comprobante = @contribuyente.comprobantes.new(\n tipo: tipo,\n fecha: Date.strptime(result[:cbte_fch], '%Y%m%d'),\n punto_de_venta: pto_vta,\n numero: numero,\n receptor_doc_tipo: result[:doc_tipo],\n receptor_doc_nro: result[:doc_nro],\n receptor_razon_social: \"-\", # TODO\n\n concepto: result[:concepto].to_i,\n mon_id: result[:mon_id],\n mon_cotiz: result[:mon_cotiz],\n\n creado_por_el_sistema: false,\n fiscal: true,\n\n cae: result[:cod_autorizacion],\n vencimiento_cae: Date.strptime(result[:fch_vto], '%Y%m%d'),\n afip_result: result\n )\n comprobante.items << Item.new(tipo: 6, codigo: '', detalle: 'No gravado', importe: result[:imp_tot_conc])\n comprobante.items << Item.new(tipo: 7, codigo: '', detalle: 'Exento', importe: result[:imp_op_ex])\n if result[:iva] && result[:iva][:alic_iva]\n [result[:iva][:alic_iva]].flatten.each do |iva|\n comprobante.items << Item.new(tipo: Item.tipo_from_afip(iva[:id]), codigo: '', detalle: \"Gravado #{iva[:id]}\", importe: iva[:base_imp])\n end\n end\n comprobante.save!\n end\n end\n end", "title": "" }, { "docid": "c013e0b9797130b2e68766b613ca0dea", "score": "0.5438362", "text": "def asocia_respuesta(info = {})\n if info[:estatus]\n taxon = info[:taxon]\n\n if taxon.estatus == 1 # Si es sinonimo, asocia el nombre_cientifico valido\n estatus = taxon.especies_estatus # Checa si existe alguna sinonimia\n\n if estatus.length == 1 # Encontro el valido y solo es uno, como se esperaba\n begin # Por si ya no existe ese taxon, suele pasar!\n taxon_valido = Especie.find(estatus.first.especie_id2)\n t_val = asigna_categorias_correspondientes(taxon_valido) # Le asociamos los datos\n info[:taxon_valido] = t_val\n rescue\n info[:estatus] = false\n info[:error] = 'No existe el taxón válido en CAT'\n end\n\n else # No existe el valido >.>!\n info[:estatus] = false\n info[:error] = 'No existe el taxón válido en CAT'\n end\n end # End estatus = 1\n end # End info estatus\n\n # Se completa cada seccion del excel\n resumen_hash = resumen(info)\n correcciones_hash = correcciones(info)\n validacion_interna_hash = validacion_interna(info)\n\n # Devuelve toda la asociacion unida y en orden\n info[:hash].merge(resumen_hash).merge(correcciones_hash).merge(validacion_interna_hash)\n end", "title": "" }, { "docid": "ede2eca816636aa29778d92ee2458a81", "score": "0.5436606", "text": "def vincitore_mano(carte_giocate)\r\n \r\n end", "title": "" }, { "docid": "8268a2248cb35bdb4d47ebeca425c38d", "score": "0.5436436", "text": "def calculeCotisation\n self.cotisation = Cotisation.new if self.cotisation.nil?\n self.cotisation.calcule\n self.cotisation.save!\n \n # Mettre a l'etat actif si le montant est > 0.\n self.etat = 'Actif' if self.cotisation.total > 0\n self.save!\n end", "title": "" }, { "docid": "e259b5d48a587747b35cd5ac7e625bb2", "score": "0.54316264", "text": "def gasto_actividad_fisica(cantidad)\n if (cantidad == \"reposo\")\n return 0\n elsif (cantidad == \"ligera\")\n return tmb * 0.12\n elsif (cantidad == \"moderada\")\n return tmb * 0.27\n else\n return tmb * 0.54\n end\n end", "title": "" }, { "docid": "2102e432d2c0fab616d6f9da513896b0", "score": "0.5426395", "text": "def bros\n Libro.unscoped.where(\"settore = ?\", self.settore).order(:titolo)\n end", "title": "" }, { "docid": "d1cd0e5b598c5bcd40cf17a6ed6fc8d3", "score": "0.5423892", "text": "def imcOMS\n case self.imc\n when 0..18.4 then \"Bajo peso\"\n when 18.5..24.9 then \"Adecuado\"\n when 25.0..29.9 then \"Sobrepeso\"\n when 30.0..34.9 then \"Obesidad grado 1\"\n when 35.0..39.9 then \"Obesidad grado 2\"\n else \"Obesidad grado 3\"\n end\n end", "title": "" }, { "docid": "146206aeec3104da0865734df7a52da3", "score": "0.54222065", "text": "def bruto_y_ticket_menos_desc_acum()\n bruto_menos_descuentos = neto_del_mes_acum\n \n if (@aplicar_descuentos_especiales) \n descuentos_especiales = descuentos_especiales_deducibles_acum\n bruto_menos_descuentos = apply_function_each_month {|mes| neto = bruto_menos_descuentos[mes] - descuentos_especiales[mes]\n (neto<0? 0.0: neto)\n }\n end\n bruto_menos_descuentos\n end", "title": "" }, { "docid": "af28f65c7580e9432aa806862c37ae1d", "score": "0.5422172", "text": "def eficiencia_energetica\n (vct / (emisiones[:co2] + emisiones[:terreno])).round(2).to_s\n end", "title": "" }, { "docid": "7ff01b0250dc8eea70ead445de250a43", "score": "0.5419073", "text": "def show\n\n @bairro = Bairro.find_by_sql(\n \"select st_area(b.the_geom)/1000 as area, b.* from bairros_oficial b where id =\"+params[:id]+\" order by b.nome\")\n @ruas = Rua.find_by_sql(\"select r.*, st_length(st_intersection(r.the_geom, b.the_geom)) as parcial, st_length(r.the_geom) as total from logradouros r, bairros_oficial b\n where r.the_geom && b.the_geom and\n st_intersects(r.the_geom, b.the_geom) and\n not id_rua = 0 and\n b.id = \"+params[:id]+\" order by r.nome\")\n\n @educacaos = Educacao.find_by_sql(\"select e.* from educacao_municipal e, bairros_oficial b\n where e.the_geom && b.the_geom and\n st_intersects(e.the_geom, b.the_geom) and\n b.id = \"+params[:id]+\" order by e.nome\")\n\n @saudes = Saude.find_by_sql(\"select e.* from saude_municipal e, bairros_oficial b\n where e.the_geom && b.the_geom and\n st_intersects(e.the_geom, b.the_geom) and\n b.id = \"+params[:id]+\" order by e.descricao\")\n\n @pontosOnibus = PontosOnibus.find_by_sql(\"select e.* from ponto_onibus e, bairros_oficial b\n where e.the_geom && b.the_geom and\n st_intersects(e.the_geom, b.the_geom) and\n b.id = \"+params[:id]+\" order by e.gid\")\n @antenas = AldeiaDigital.find_by_sql(\"select e.* from aldeia_digital_oficial e, bairros_oficial b\n where e.the_geom && b.the_geom and\n st_intersects(e.the_geom, b.the_geom) and\n b.id = \"+params[:id]+\" order by e.gid\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => [@bairro, @ruas, @educacaos, @saudes], :except => :the_geom }\n format.xml { render :xml => [@bairro, @ruas, @educacaos, @saudes] ,:except => :the_geom}\n end\n end", "title": "" }, { "docid": "851570f687238fab1ba0d5496261f86e", "score": "0.54163545", "text": "def to_s\n\t\t \"Nombre del alimento: #{@nombre}\\nKilogramos de CO2: #{@kgco2eq}\\nMetros cuadrados año utilizados: #{@m2anio}\\nCarbohidratos: #{@carbohidratos}\\nLipidos: #{@lipidos}\\nProteinas: #{@proteinas}\\nValor Energético: #{@valor_energetico}cal\"\n\t end", "title": "" }, { "docid": "83d4deb6491d191ff511a41a552ce597", "score": "0.54156977", "text": "def obs_salud\n pvr0 = params[:pvr0] # interventoria_valor_mes\n pvr1 = params[:pvr1] # interventoria_salud\n pvr2 = params[:pvr2] # interventoria_arl\n pvr3 = params[:pvr3] # interventoria_interes_credito\n pvr4 = params[:pvr4] # interventoria_salud_prepagada\n pvr5 = params[:pvr5] # interventoria_dependientes\n pvr6 = params[:pvr6] # interventoria_pension\n pvr7 = params[:pvr7] # interventoria_afc\n pvr8 = params[:pvr8] # interventoria_voluntarias\n subtotal = (pvr1.to_i + pvr2.to_i + pvr3.to_i + pvr4.to_i + pvr5.to_i)\n subtotalr = (pvr6.to_i + pvr7.to_i + pvr8.to_i)\n valortotal = pvr0.to_i - (subtotal + subtotalr) \n #(valormes - salud - arl - pension)\n base384 = (((pvr0.to_i - pvr1.to_i - pvr2.to_i - pvr6.to_i).to_f / is_retefuente384.to_f).to_f).round(2)\n renta = (valortotal * 25)/100.to_i\n base_retefuente = valortotal - renta \n base_uvt = (base_retefuente.to_f/is_baseuvt.to_f).to_f.round(0).to_i\n vlr1 = ((is_restauvt(base_uvt).to_i * is_baseuvtpor(base_uvt)).to_f/100.to_f).to_f\n retefuente383 = (vlr1.to_f * is_retefuente383.to_f).to_f.round(-3).to_i\n base384 = (((pvr0.to_i - pvr1.to_i - pvr2.to_i - pvr6.to_i).to_f / is_retefuente384.to_f).to_f).round(2)\n vlrbase384 = is_base384(base384.to_s)\n retefuente384 = (vlrbase384.to_f * is_retefuente384.to_f).to_f.round(-3).to_i\n if retefuente383.to_f > retefuente384.to_f\n total = pvr0.to_i - retefuente383.to_i\n else\n total = pvr0.to_i - retefuente384.to_i\n end\n\n render :update do |page|\n page[:interventoria_subtotal][:value] = subtotal.to_s\n page[:interventoria_subtotalr][:value] = subtotalr.to_s\n page[:interventoria_subtotalt][:value] = valortotal.to_s\n page[:interventoria_renta][:value] = renta.to_s\n page[:interventoria_base_retefuente][:value] = base_retefuente.to_s\n page[:interventoria_base_uvt][:value] = base_uvt.to_s\n page[:interventoria_retefuente383][:value] = retefuente383.to_s\n page[:interventoria_retefuente384][:value] = retefuente384.to_s\n page[:interventoria_total][:value] = total.to_s\n end\n end", "title": "" }, { "docid": "8ca1ee56ed8a404c2375c3dbf2ee63ff", "score": "0.54150814", "text": "def busca_recursivamente_csv(taxones, linea)\n taxon_coincidente = Especie.none\n nombres = linea.split(' ')\n\n taxones_coincidentes = taxones.map{|t| asigna_categorias_correspondientes(t)}\n taxones_coincidentes.each do |t| # Iterare cada taxon que resulto parecido para ver cual es el correcto\n t = asigna_categorias_correspondientes(t)\n next unless t.present? # Por si regresa nulo\n\n # Si es la especie lo mando directo a coincidencia\n cat_tax_taxon_cat = I18n.transliterate(t.x_categoria_taxonomica).gsub(' ','_').downcase\n if cat_tax_taxon_cat == 'especie' && nombres.length == 2\n return {taxon: t, estatus: true, linea: linea, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n # Si no coincidio con ninguno le dejo el unico\n if taxones.length == 1\n return {taxon: t, estatus: true, linea: linea, info: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end\n\n return {estatus: false, linea: linea, error: \"Posibles coincidencias: #{taxones_coincidentes.map{|t_c| \"#{t_c.x_categoria_taxonomica} #{t_c.nombre_cientifico}\"}.join(', ')}\"}\n end #Fin each taxones coincidentes\n end", "title": "" }, { "docid": "806ee27f7d5927ba46e62c3e3f35de49", "score": "0.5409471", "text": "def ouroboros\n #@user in before filter\n @page_title = _('Ouroboros')\n @page_icon = \"money.png\"\n @enabled = Confline.get_value(\"Ouroboros_Enabled\", @user.owner_id).to_i\n @currencies = Currency.get_active\n @currency = Confline.get_value(\"Ouroboros_Default_Currency\", @user.owner_id)\n @default_amount = Confline.get_value(\"Ouroboros_Default_Amount\", @user.owner_id)\n @min_amount = Confline.get_value(\"Ouroboros_Min_Amount\", @user.owner_id)\n MorLog.my_debug('Ouroboros payment : access', 1)\n MorLog.my_debug(\"Ouroboros payment : user - #{@user.id}\", 1)\n end", "title": "" }, { "docid": "f676ebf1aa495adca00d75d9bd25d1ec", "score": "0.5405273", "text": "def stats\n {\n :name => @name,\n :chewy => @chewy,\n :low_calorie? => self.low_calorie?,\n :main_color => @main_color \n \n } \n end", "title": "" }, { "docid": "81381b7a67b80baa4175ce7d9bc2c06e", "score": "0.54037184", "text": "def tmb\n 10*@peso + ((@altura * 100) * 6.25) - 5 * @edad + 5 + ((1-@sexo) * 166)\n end", "title": "" }, { "docid": "00c6e080a10b269083fae42de8f2f2f8", "score": "0.54031235", "text": "def avisa_campeao_atual conteudo\n puts \"O campeado atual é #{conteudo[0]} com um total de #{conteudo[1]} pontos\"\nend", "title": "" }, { "docid": "b80c53cdd43b01cb1f94a438daf642c0", "score": "0.539915", "text": "def tomarInsumos\n if puedoTomarInsumos? then\n if self.class.included_modules.include?(RecibeCebada)\n $cebada = $cebada - @cantidadCMax\n @cantidadCActual = @cantidadCMax\n elsif self.class.included_modules.include?(RecibeMezcla)\n $mezcla = $mezcla - @cantidadMMax\n @cantidadMActual = @cantidadMMax\n elsif self.class.included_modules.include?(RecibeLupulo)\n $lupulo = $lupulo - @cantidadLMax\n @cantidadLActual = @cantidadLMax\n elsif self.class.included_modules.include?(RecibeLevadura)\n $levadura = $levadura - @cantidadVMax\n @cantidadVActual = @cantidadVMax\n end\n\n @estado = 'llena'\n end\n end", "title": "" }, { "docid": "fa686cdf1942762f7041d1fb7b0aacb0", "score": "0.5396648", "text": "def comofunciona\n\t\t\n\tend", "title": "" }, { "docid": "665957a19ec7b5eed8382a98f4a8e804", "score": "0.5394857", "text": "def valores_por_zona\n asigna_anio\n valor = 0\n\n propiedades = criterio_propiedades.select('valor').where('anio=?', anio)\n valor+= propiedades.tipo_capturas.map(&:valor).inject(:+).to_i\n\n # Para la veda permanente o deportiva\n veda = propiedades.tipo_vedas.map(&:valor).inject(:+).to_i\n valor+= veda\n self.veda_perm_dep = true if veda >= 20\n\n # Para la nom\n nom = propiedades.nom.map(&:valor).inject(:+).to_i\n valor+= nom\n self.en_riesgo = true if nom >= 20\n\n # Para la iucn\n iucn = propiedades.iucn.map(&:valor).inject(:+).to_i\n valor+= iucn\n self.en_riesgo = true if iucn >= 20\n\n # Para la procedencia, si es un caso especial en caso de ser importado\n procedencia_texto = criterio_propiedades.procedencias.first.try(:nombre_propiedad)\n procedencia = propiedades.procedencias.map(&:valor).inject(:+).to_i\n valor+= procedencia\n\n self.importada = true if procedencia >= 20 && procedencia_texto == 'Importado (huella ecológica alta)'\n self.nacional_importada = true if procedencia >= 20 && procedencia_texto == 'Nacional e Importado (huella ecológica alta)'\n\n # Para asignar el campo con_estrella que se asocia a las pesquerias sustentables\n pesquerias = propiedades.pesquerias.map(&:valor).inject(:+).to_i\n\n if pesquerias != 0\n self.con_estrella = 1\n else\n self.con_estrella = 0\n end\n\n self.valor_por_zona = Array.new(6, valor)\n\n # Quiere decir que es importado\n if importada\n self.valor_por_zona << 0\n else\n self.valor_por_zona << 1\n end\n end", "title": "" } ]
34e6ff63307d41ee3bffc73010a62c73
Set authentication creditials in ~/.google_drive/conf.yaml ~/.google_drive/conf.yaml:
[ { "docid": "1c14d1b8397b5e1ae6438170bb6f8f56", "score": "0.55590004", "text": "def configs\n @configs ||= begin\n fn = File.join(Dir.home, \".google_drive\", \"conf.yaml\")\n configs = File.exists?(fn) ? YAML::load(File.open(fn)) : ENV\n end\n end", "title": "" } ]
[ { "docid": "54078d69d0a12062dcdc522b402b08e0", "score": "0.6095458", "text": "def configure_google_client\n @google_client = Google::APIClient.new(@config.application_info)\n @google_client.retries = 2\n @drive = @google_client.discovered_api(\"drive\", API_VERSION)\n authorize\n end", "title": "" }, { "docid": "12f14a63dedab2f59d7e3dd6b2c1ddf0", "score": "0.5960897", "text": "def set_authentication(opts)\n opts = check_params(opts,[:credential_list])\n super(opts)\n end", "title": "" }, { "docid": "7db57ba4ae1d43477433c33b752d4aed", "score": "0.59424806", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n authorizer.get_credentials(user_id)\nend", "title": "" }, { "docid": "1e7e30138f0f3ca284e2c21d23fea6e2", "score": "0.5939306", "text": "def setup()\n client = Google::APIClient.new(:application_name => APPLICATION_NAME,\n :application_version => APPLICATION_VERSION)\n\n file_storage = nil\n begin\n file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)\n rescue URI::InvalidURIError\n File.delete CREDENTIAL_STORE_FILE\n file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)\n end\n if file_storage.authorization.nil?\n client_secrets = Google::APIClient::ClientSecrets.load\n flow = Google::APIClient::InstalledAppFlow.new(\n :client_id => client_secrets.client_id,\n :client_secret => client_secrets.client_secret,\n :scope => ['https://www.googleapis.com/auth/drive']\n )\n client.authorization = flow.authorize(file_storage)\n else\n client.authorization = file_storage.authorization\n end\n\n drive = nil\n if File.exists? CACHED_API_FILE\n File.open(CACHED_API_FILE) do |file|\n drive = Marshal.load(file)\n end\n else\n drive = client.discovered_api('drive', API_VERSION)\n File.open(CACHED_API_FILE, 'w') do |file|\n Marshal.dump(drive, file)\n end\n end\n\n return client, drive\nend", "title": "" }, { "docid": "c9e71b00b354da6a9969d09d005a7e3d", "score": "0.59358853", "text": "def setauth(key)\n $auth = key\nend", "title": "" }, { "docid": "329571681b25e23ba2e1346f508bf1d7", "score": "0.5906887", "text": "def authenticate\n init_client\n uri = @client.authorization.authorization_uri\n code = scrape_web_and_return_code(uri)\n @client.authorization.code = code\n @client.authorization.fetch_access_token!\n @drive = @client.discovered_api('drive', 'v2')\n end", "title": "" }, { "docid": "ff479b3be2b60322448c974585432ddb", "score": "0.5895487", "text": "def authorize(config)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(\"client_secret.json\")\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n credentials = authorizer.get_credentials('default')\n\n return credentials unless credentials.nil?\n\n # User needs to authorize the Google Drive API.\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"You need to authorize access to your Google Drive.\\nOpen the following URL in the browser and enter the resulting code after authorization.\\n#{url}\"\n code = gets\n authorizer.get_and_store_credentials_from_code(user_id: 'default', code: code, base_url: OOB_URI)\n end", "title": "" }, { "docid": "1ac93fd8521f0f3c49bdc78d111ded58", "score": "0.5885783", "text": "def initialize\n gaccount = FileConvert.config['google_service_account']\n gaccount['auth_url'] ||= 'https://www.googleapis.com/auth/drive'\n\n key = load_key gaccount['pkcs12_file_path'], 'notasecret'\n options = APP_OPTIONS.merge(authorization: get_authorization(\n gaccount['email'], gaccount['auth_url'], key\n ))\n\n super(options).tap do |client|\n client.authorization.fetch_access_token!\n @drive = client.discovered_api 'drive', 'v2'\n end\n end", "title": "" }, { "docid": "340cb570de83ec16db57662cf9c60b67", "score": "0.5870593", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new(client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: SCOPE)\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f85fdb6eacf3b9e87266709d2c52d2f3", "score": "0.586522", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n # app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => ENV[\"GOOGLE_CLIENT_ID\"],\n :client_secret => ENV[\"GOOGLE_CLIENT_SECRET\"],\n :scope => SCOPE})\n auth = flow.authorize(storage)\n # puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.5865026", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "f33853dd00c1cca0db828714c19387a1", "score": "0.586445", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "c41b9cb7059914d48884370a35d55987", "score": "0.5839114", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\n end", "title": "" }, { "docid": "c41b9cb7059914d48884370a35d55987", "score": "0.5839114", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\n end", "title": "" }, { "docid": "86b2e48e805749013e947ccb3dcdaa69", "score": "0.5780389", "text": "def authorize\n \t\tFileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n \t\tclient_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n \t\ttoken_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n \t\tauthorizer = Google::Auth::UserAuthorizer.new(\n \t\t\tclient_id, SCOPE, token_store)\n \t\tuser_id = 'default'\n \t\tcredentials = authorizer.get_credentials(user_id)\n \t\tif credentials.nil?\n \t\t\turl = authorizer.get_authorization_url(\n \t\t\t\tbase_url: OOB_URI)\n \t\t\tcode = \"#{ENV['CALAUTHCODE']}\"\n \t\t\tcredentials = authorizer.get_and_store_credentials_from_code(\n \t\t\t\tuser_id: user_id, code: code, base_url: OOB_URI)\n \t\tend\n \t\tcredentials\n \tend", "title": "" }, { "docid": "b44897f6218aef0fcab00cc7068261de", "score": "0.5749751", "text": "def auth_conf\n @auth_conf_content ||= File.read(File.join(fixture_dir, 'auth.conf'))\n end", "title": "" }, { "docid": "fe289ef2e112db74bb5986ad2fc935fc", "score": "0.57438546", "text": "def initialise_api\n service = Google::Apis::DriveV3::DriveService.new\n service.client_options.application_name = 'Research Data York Google Drive Browser'\n client = oauth2client\n client.update!(refresh_token: session[:refresh_token])\n client.fetch_access_token!\n service.authorization = client\n service\n end", "title": "" }, { "docid": "97161993c06e91696d1456521a8cdffe", "score": "0.5734729", "text": "def set_credential(path)\n @credential = if File.directory?(path)\n File.join(path, '.ical2gcal_credential')\n else\n path\n end\n end", "title": "" }, { "docid": "58ea48d0f7b5c74e1c3c8367c09b2e96", "score": "0.56941706", "text": "def set_auth(username, password='')\n @username = username\n @password = password\n end", "title": "" }, { "docid": "c981990fe7b4ba73c8fa6f7d6836648f", "score": "0.565338", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n=begin\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\n=end\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store) # Invalid Grant => Code already redeemed\n #authorizer = Google::Auth::WebUserAuthorizer.new(client_id, SCOPE, token_store, '/oauth2callback')\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id, request)\n if credentials.nil?\n #url = authorizer.get_authorization_url(base_url: OOB_URI, request: request)\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n puts \"credentials: #{credentials.inspect}\"\n credentials\n end", "title": "" }, { "docid": "bbb4cc8541114761e5107c672b169d81", "score": "0.56374615", "text": "def drive_file=(file)\n client = Google::APIClient.new\n client.authorization.client_id = ENV['GOOGLE_CLIENT_ID']\n client.authorization.client_secret = ENV['GOOGLE_CLIENT_SECRET']\n client.authorization.redirect_uri = ENV['REDIRECT_URI']\n client.authorization.scope = \"https://www.googleapis.com/auth/drive\"\n end", "title": "" }, { "docid": "83dd847b50c02db046c87692439d8a6c", "score": "0.5636174", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id,\n SCOPE,\n token_store\n )\n #var @user_id\n # This field is used in creation of bunch of tokens which\n # are stored in credentials/calendar-ruby-quickstart.yaml\n user_id = 'user_web'\n\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI\n )\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "ecaa94274ed5eb0a91c23b3b9f455aff", "score": "0.56358063", "text": "def set_credentials(db_user, db_pass)\n @environments.each do |env| \n @config_doc[env]['username'] = db_user\n @config_doc[env]['password'] = db_pass\n end\n end", "title": "" }, { "docid": "7a77af8b235de3342ef8de6302b52495", "score": "0.56341827", "text": "def preferred_auth_policies=(_arg0); end", "title": "" }, { "docid": "35efdb12f566f14c52a04189dc71dbd2", "score": "0.56295913", "text": "def setup()\n log_file = File.open('drive.log', 'a+')\n log_file.sync = true\n logger = Logger.new(log_file)\n logger.level = Logger::DEBUG\n\n client = Google::APIClient.new(:application_name => 'Ruby Drive sample',\n :application_version => '1.0.0')\n\n # FileStorage stores auth credentials in a file, so they survive multiple runs\n # of the application. This avoids prompting the user for authorization every\n # time the access token expires, by remembering the refresh token.\n # Note: FileStorage is not suitable for multi-user applications.\n file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)\n if file_storage.authorization.nil?\n client_secrets = Google::APIClient::ClientSecrets.load\n # The InstalledAppFlow is a helper class to handle the OAuth 2.0 installed\n # application flow, which ties in with FileStorage to store credentials\n # between runs.\n flow = Google::APIClient::InstalledAppFlow.new(\n :client_id => client_secrets.client_id,\n :client_secret => client_secrets.client_secret,\n :scope => ['https://www.googleapis.com/auth/drive']\n )\n client.authorization = flow.authorize(file_storage)\n else\n client.authorization = file_storage.authorization\n end\n\n drive = nil\n # Load cached discovered API, if it exists. This prevents retrieving the\n # discovery document on every run, saving a round-trip to API servers.\n if File.exists? CACHED_API_FILE\n File.open(CACHED_API_FILE) do |file|\n drive = Marshal.load(file)\n end\n else\n drive = client.discovered_api('drive', API_VERSION)\n File.open(CACHED_API_FILE, 'w') do |file|\n Marshal.dump(drive, file)\n end\n end\n\n return client, drive\nend", "title": "" }, { "docid": "719f5699f0e0434f849df15d2f858e35", "score": "0.56203043", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n # if credentials.nil?\n # url = authorizer.get_authorization_url(base_url: OOB_URI)\n # puts \"Open the following URL in the browser and enter the \" +\n # \"resulting code after authorization\"\n # puts url\n # code = gets\n # credentials = authorizer.get_and_store_credentials_from_code(\n # user_id: user_id, code: code, base_url: OOB_URI)\n # end\n credentials\nend", "title": "" }, { "docid": "caac96f54081e52bc4fe88ca88c163ec", "score": "0.5584683", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n file_store = Google::APIClient::FileStore.new(CREDENTIALS_PATH)\n storage = Google::APIClient::Storage.new(file_store)\n puts \"Calling: auth = storage.authorize\"\n auth = storage.authorize\n\n if auth.nil? || (auth.expired? && auth.refresh_token.nil?)\n puts \"Loading client secrets\"\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new({\n :client_id => app_info.client_id,\n :client_secret => app_info.client_secret,\n :scope => SCOPE})\n puts \"Calling: flow.authorize(storage)\"\n auth = flow.authorize(storage)\n puts \"Credentials saved to #{CREDENTIALS_PATH}\" unless auth.nil?\n end\n auth\nend", "title": "" }, { "docid": "e9c4fd4f5c67118d5f31f64d1b880267", "score": "0.55810523", "text": "def authorize\r\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\r\n\r\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\r\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\r\n authorizer = Google::Auth::UserAuthorizer.new(\r\n client_id, SCOPE, token_store)\r\n user_id = 'default'\r\n credentials = authorizer.get_credentials(user_id)\r\n if credentials.nil?\r\n url = authorizer.get_authorization_url(\r\n base_url: OOB_URI)\r\n puts \"Open the following URL in the browser and enter the \" +\r\n \"resulting code after authorization\"\r\n puts url\r\n code = gets\r\n credentials = authorizer.get_and_store_credentials_from_code(\r\n user_id: user_id, code: code, base_url: OOB_URI)\r\n end\r\n credentials\r\nend", "title": "" }, { "docid": "d0dd0781f6a4b5dc071dfbd95d03ac53", "score": "0.55743617", "text": "def authenticate(*paths)\n set :auth_paths, paths\n end", "title": "" }, { "docid": "4ce5c8a45ab94b7a53509283315a3ce3", "score": "0.55678785", "text": "def login\n system('clear')\n puts 'Authorizing...'.green\n\n @session ||= GoogleDrive.saved_session('config.json')\n @ws ||= @session.spreadsheet_by_key(ENV['SPREADSHEET_KEY']).worksheets[0]\nend", "title": "" }, { "docid": "ee5e139519e7e73327fca16726389d31", "score": "0.55590945", "text": "def setup_drive\n log_file = File.open('drive.log', 'a+')\n log_file.sync = true\n logger = Logger.new(log_file)\n logger.level = Logger::DEBUG\n\n # Create a new API client & load the Google Drive API\n client = Google::APIClient.new(\n :application_name => 'CoverHound Performance Snapshots Manager',\n :application_version => '1.0.0'\n )\n\n # FileStorage stores auth credentials in a file, so they survive multiple runs\n # of the application. This avoids prompting the user for authorization every\n # time the access token expires, by remembering the refresh token.\n # Note: FileStorage is not suitable for multi-user applications.\n file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)\n if file_storage.authorization.nil?\n client_secrets = Google::APIClient::ClientSecrets.load\n # The InstalledAppFlow is a helper class to handle the OAuth 2.0 installed\n # application flow, which ties in with FileStorage to store credentials\n # between runs.\n flow = Google::APIClient::InstalledAppFlow.new(\n :client_id => client_secrets.client_id,\n :client_secret => client_secrets.client_secret,\n :scope => [OAUTH_SCOPE]\n )\n client.authorization = flow.authorize(file_storage)\n else\n client.authorization = file_storage.authorization\n end\n\n drive = nil\n # Load cached discovered API, if it exists. This prevents retrieving the\n # discovery document on every run, saving a round-trip to API servers.\n if File.exists? CACHED_API_FILE\n File.open(CACHED_API_FILE) do |file|\n drive = Marshal.load(file)\n end\n else\n drive = client.discovered_api('drive', API_VERSION)\n File.open(CACHED_API_FILE, 'w') do |file|\n Marshal.dump(drive, file)\n end\n end\n\n return client, drive\nend", "title": "" }, { "docid": "fd8f5b69ec226427a5dc0657ed9b41a3", "score": "0.55582345", "text": "def test_configure_credentials\n\t\tsettings_file = File.join(File.dirname(__FILE__), '../../default_settings.yml')\n\t\t#Notice the wierd way docopt handles it. The -c flag is a repeat flag, each option is then grouped positionally. So for each 'c' specified \n\t\t#c is incremented, and the index of the then the value specified.\n\t\targuments = { '--settings' => \"#{settings_file}\", '--properties' => '{\"title\" : \"PAC Changelog Name Override\" }', '-c' => 2, \n\t\t\t'<user>' => [\"newuser\", \"tracuser\"], \n\t\t\t'<password>' => [\"newpassword\", \"tracpassword\"], \n\t\t\t'<target>' => [\"jira\", \"trac\"] } \n\n\t\tfile_parsed = Core.read_settings_file(arguments)\n\t\tsettings_parsed = Core.generate_settings(arguments, file_parsed)\t\t\n\t\tassert_equal('newuser', settings_parsed[:task_systems][1][:usr])\n\t\tassert_equal('newpassword', settings_parsed[:task_systems][1][:pw])\n\n\t\tassert_equal('tracuser', settings_parsed[:task_systems][2][:usr])\n\t\tassert_equal('tracpassword', settings_parsed[:task_systems][2][:pw])\n\tend", "title": "" }, { "docid": "9e7560ad8364bd30ad47f07f6e42678e", "score": "0.5529269", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, @SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "0adb7af4b89d6fd06175f4ab1742e433", "score": "0.5529057", "text": "def certificate_based_auth_configuration=(value)\n @certificate_based_auth_configuration = value\n end", "title": "" }, { "docid": "fe651a7f8f4c5e21a1891f71d9cccc61", "score": "0.5518217", "text": "def authentication_key_set(enctype, pw)\n state = pw.empty? ? 'no' : ''\n enctype = pw.empty? ? '' : Encryption.symbol_to_cli(enctype)\n set_args_keys(state: state, enctype: enctype, password: pw)\n config_set('ospf_area_vlink', 'authentication_key_set', @set_args)\n end", "title": "" }, { "docid": "e962cc9b6d73d77a3bc5a3dca8ad74eb", "score": "0.55083466", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "f92cfcf2e3c3128e3ad1a5529a675d06", "score": "0.5505652", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "975d8aefc5ecab4eba93d8ec47957c2e", "score": "0.5500292", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "937c6a883bf9f753fc111acbec66ed8a", "score": "0.54995155", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "bdc763c5e727cb396f7bf945805c28a1", "score": "0.54969025", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = \"4/ukRJROfYY-vlgRSidMIqVm3lHOozwtxGjBSFKuVViqQ\"\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "69e32a2a6c67aa6ce884e44137a5a3c9", "score": "0.54959476", "text": "def setup_session\n # We need to refresh our token if expiry time is in the past\n if @account.token_expiry < Time.now.to_i\n update_token\n end\n # Now we login with this token\n @simple_client = SimpleGoogleDrive.new(@account.token)\n @gdrive = GoogleDrive.login_with_oauth(@account.token)\n end", "title": "" }, { "docid": "287fe6750980a1a7a94b215539ab7fcf", "score": "0.54827225", "text": "def credentials!(authid, password)\n self[Gsasl::GSASL_AUTHID] = authid\n self[Gsasl::GSASL_PASSWORD] = password\n end", "title": "" }, { "docid": "9b1727fe2aa098822a445ea636b53512", "score": "0.54815185", "text": "def authorize(interactive)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store, '')\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? && interactive\n url = authorizer.get_authorization_url(base_url: BASE_URI, scope: SCOPE)\n code = ask(\"Open the following URL in the browser and enter the resulting code after authorization\\n#{url}\")\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: BASE_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "6c0de983de42c9afd27bc1e93bc6036a", "score": "0.54661775", "text": "def load_auth_options(config_location = nil) \n config_file = File.open(config_location || File.join(DEFAULT_CONFIG_PATH, DEFAULT_CONFIG_FILE))\n auth_options = YAML.load(config_file).symbolize_keys\n raise MultiInfo::API::Error.new(-9999, 'Missing config params') if auth_options.only(:login, :password, :service_id).size != 3\n auth_options\n end", "title": "" }, { "docid": "8f04b094bd0b425e24d12a20aa34f002", "score": "0.5466148", "text": "def set_configuration\n config = config_file\n @domain = config['opta_domain']\n @auth_token = config['opta_auth_token']\n end", "title": "" }, { "docid": "4564de23ef6121782ce227d732910b9f", "score": "0.5455316", "text": "def authorize\n scope = Google::Apis::DriveV3::AUTH_DRIVE\n client_secrets_path = @google_drive_client_secret_path\n credentials_path = ENV['CREDENTIALS_PATH']\n FileUtils.mkdir_p(File.dirname(credentials_path))\n\n client_id = Google::Auth::ClientId.from_file(client_secrets_path)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: credentials_path)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, scope, token_store)\n user_id = 'default'\n oob_uri = 'urn:ietf:wg:oauth:2.0:oob'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: oob_uri)\n $stderr.print(\"\\n1. Open this page:\\n%s\\n\\n\" % url)\n $stderr.print('2. Enter the authorization code shown in the page: ')\n code = $stdin.gets.chomp\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: oob_uri, scope: scope)\n end\n credentials\n end", "title": "" }, { "docid": "d92d1d3db135c71d08fb95de098c2cd0", "score": "0.5448775", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'wwww'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "0d7e8dec447bb5ada5fea52f1037ea5f", "score": "0.54473734", "text": "def preferred_auth_policies; end", "title": "" }, { "docid": "81ce647d5f3e84a1b5ddbd6de5f6afd7", "score": "0.544209", "text": "def authorize(interactive)\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil? && interactive\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization\\n\" + url\n code = $stdin.readline\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "428ef46eb94280a0e55b88126ee7e614", "score": "0.5440217", "text": "def authorise\n @jsonKeyIo = self.loadCredentialsFile\n gAuthDefaultCreds = @@gAuthDefaultCreds\n serviceAccountCredentials = gAuthDefaultCreds.make_creds(\n {json_key_io: @jsonKeyIo, scope: @scope})\n @service.authorization = serviceAccountCredentials\n if ! @sub.nil?\n # Assign account for impersonation\n @service.authorization.sub = @sub\n end\n @service.authorization.fetch_access_token!\n end", "title": "" }, { "docid": "74549fdd838413ab0d7eae43b7bd0abb", "score": "0.54270947", "text": "def client_options\n {\n client_id: \"453886901491-evvsmmc5ei10tss4nlqab3f72k0ddmlh.apps.googleusercontent.com\",\n client_secret: \"_teiidDLMuEEyKN4JCVddsri\",\n authorization_uri: 'https://accounts.google.com/o/oauth2/auth',\n token_credential_uri: 'https://accounts.google.com/o/oauth2/token',\n scope: SCOPE,\n redirect_uri: OOB_URI\n }\nend", "title": "" }, { "docid": "b9ad70946ff7096c1c6d230f14292cea", "score": "0.5427042", "text": "def auth_settings\n {\n }\n end", "title": "" }, { "docid": "b9ad70946ff7096c1c6d230f14292cea", "score": "0.5427042", "text": "def auth_settings\n {\n }\n end", "title": "" }, { "docid": "b9ad70946ff7096c1c6d230f14292cea", "score": "0.5427042", "text": "def auth_settings\n {\n }\n end", "title": "" }, { "docid": "b9ad70946ff7096c1c6d230f14292cea", "score": "0.5427042", "text": "def auth_settings\n {\n }\n end", "title": "" }, { "docid": "b9ad70946ff7096c1c6d230f14292cea", "score": "0.5427042", "text": "def auth_settings\n {\n }\n end", "title": "" }, { "docid": "a4f4aab2b777751e41d54faf3af9f765", "score": "0.5422545", "text": "def authorize\n secret_path = File.join(@options.profile_path, 'secret')\n Dir.mkdir secret_path unless Dir.exist? secret_path\n\n if @options.clear_auth && File.exist?(@options.token_path)\n FileUtils.rm @options.token_path\n end\n\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new(\n file: @options.token_path\n )\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n\n creds = authorizer.get_credentials user_id\n creds&.refresh!\n creds = authorize_interactive(authorizer) if creds.nil?\n\n creds\n end", "title": "" }, { "docid": "e4715c254b731739d617b3327e687a3a", "score": "0.5418386", "text": "def set_auth(domain, user, passwd)\n uri = to_resource_url(domain)\n @www_auth.set_auth(uri, user, passwd)\n reset_all\n end", "title": "" }, { "docid": "36f09ec0a083aa93572240d998dca8e6", "score": "0.5410299", "text": "def set_credentials\n if options[:credentials]\n check_return_code(\n Lib.memcached_set_sasl_auth_data(@struct, *options[:credentials])\n )\n end\n end", "title": "" }, { "docid": "db5dede04b65c6653835d8e2af61e928", "score": "0.54087204", "text": "def set_credentials(username, password)\n @client.set_auth(@storeuri, username, password)\n end", "title": "" }, { "docid": "7395ad7e94dadba9eb7889f3533e5c20", "score": "0.5395325", "text": "def setup_auth_baton(auth_baton)\n auth_baton[Svn::Core::AUTH_PARAM_CONFIG_DIR] = nil\n auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_USERNAME] = nil\n end", "title": "" }, { "docid": "f2f979dcff1c89834ebaf38de979167d", "score": "0.5385253", "text": "def add_auth_strategy_options(init_options)\n case @auth_strategy\n when :oauth\n init_options[:oauth] = \"on\"\n init_options[:cleartext_password] ||= \"\"\n end\n\n init_options\n end", "title": "" }, { "docid": "ca511378d7977e4fd2a103d5d10ab93d", "score": "0.5383703", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'hendrikusbimawan@gmail.com'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "title": "" }, { "docid": "ff004c8a4d69965ec020808594103c45", "score": "0.5383112", "text": "def set_cf_credentials\n CF.api_url = self.api_url\n CF.api_version = self.api_version\n CF.api_key = self.api_key\n CF.account_name = self.account_name\n end", "title": "" }, { "docid": "cfeac418ad88a53639aba8c9f275d9fe", "score": "0.5380008", "text": "def authorize(auth = {})\n @authentication ||= TicketMaster::Authenticator.new(auth)\n auth = @authentication\n if auth.username.nil? or auth.password.nil? or auth.client_id.nil? or auth.client_secret.nil?\n raise \"Please provide username, password, client id and client secret\"\n end\n CodasetAPI.account = auth.username\n CodasetAPI.authenticate(auth.username, auth.password, auth.client_id, auth.client_secret)\n end", "title": "" }, { "docid": "0241111a26c0e2a099566756765d2412", "score": "0.53616303", "text": "def authorize\n client_id = Google::Auth::ClientId.new(CREDENTIALS_PATH['installed']['client_id'], CREDENTIALS_PATH['installed']['client_secret'])\n # CREDENTIALS_PATH['installed']['client_id'] # Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = \"4/1AfDhmrjKqjOnmdD6-sGTL658hi6uc5qua8ylpFT5Hsow3LsDZk_vPF30HcU\" # gets\n puts gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "10b9cfedbacde3ed7208abfdc5284059", "score": "0.53562504", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(OAUTH_TOKEN_STORAGE_PATH))\n\n file_store = Google::APIClient::FileStore.new(OAUTH_TOKEN_STORAGE_PATH)\n oauth_storage = Google::APIClient::Storage.new(file_store)\n oauth = oauth_storage.authorize\n\n if oauth.nil? || (oauth.expired? && oauth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new(\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: SCOPE\n )\n if oauth = flow.authorize(oauth_storage)\n puts \"Credentials saved to #{OAUTH_TOKEN_STORAGE_PATH}\"\n end\n end\n oauth\nend", "title": "" }, { "docid": "10b9cfedbacde3ed7208abfdc5284059", "score": "0.53562504", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(OAUTH_TOKEN_STORAGE_PATH))\n\n file_store = Google::APIClient::FileStore.new(OAUTH_TOKEN_STORAGE_PATH)\n oauth_storage = Google::APIClient::Storage.new(file_store)\n oauth = oauth_storage.authorize\n\n if oauth.nil? || (oauth.expired? && oauth.refresh_token.nil?)\n app_info = Google::APIClient::ClientSecrets.load(CLIENT_SECRETS_PATH)\n flow = Google::APIClient::InstalledAppFlow.new(\n client_id: app_info.client_id,\n client_secret: app_info.client_secret,\n scope: SCOPE\n )\n if oauth = flow.authorize(oauth_storage)\n puts \"Credentials saved to #{OAUTH_TOKEN_STORAGE_PATH}\"\n end\n end\n oauth\nend", "title": "" }, { "docid": "27fd75c7ca72ef34887cf21f84bc9b2c", "score": "0.53550154", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "title": "" }, { "docid": "d5771731e2d9fd521901339b26772771", "score": "0.53519183", "text": "def set_auth(name, password)\n Utility::check_types({ name=>String, password=>String }) if $DEBUG\n @auth = name + \":\" + password\n nil\n end", "title": "" }, { "docid": "c17b27f164d0d55bc0f7bb3dbdf23cc8", "score": "0.53495115", "text": "def sheets_credentials\n l = '/home/c118/.sheets.'\n # file obtido console.cloud.google.com/apis OAuth 2.0 client IDs\n i = Google::Auth::ClientId.from_file(l + 'json')\n s = Google::Apis::SheetsV4::AUTH_SPREADSHEETS_READONLY\n # file criado aquando new_credentials is executed\n f = Google::Auth::Stores::FileTokenStore.new(file: l + 'yaml')\n z = Google::Auth::UserAuthorizer.new(i, s, f)\n @folhas = Google::Apis::SheetsV4::SheetsService.new\n @folhas.client_options.application_name = 'c118-arquivo'\n @folhas.authorization = z.get_credentials('default') || new_credentials(z, 'urn:ietf:wg:oauth:2.0:oob')\n end", "title": "" }, { "docid": "da07eba3c7b2cba3701199a166924766", "score": "0.5344335", "text": "def initialize\n @credentials = ENV['GOOGLE_DRIVE_OAUTH'] || File.expand_path(\n '~/.google_drive_oauth2.json')\n @client_secrets = ENV['GOOGLE_CLIENT_SECRETS'] || File.expand_path(\n '~/.google_client_secrets.json')\n\n @person = ENV['GOOGLE_OAUTH_PERSON']\n @issuer = ENV['GOOGLE_OAUTH_ISSUER']\n @key_path = ENV['GOOGLE_OAUTH_KEYFILE']\n @private_key = ENV['GOOGLE_OAUTH_PRIVATE_KEY']\n\n # try to read the file,\n # throw errors if not readable or not found\n if @key_path\n @key = Google::APIClient::KeyUtils.load_from_pkcs12(\n @key_path, 'notasecret')\n elsif @private_key\n @key = OpenSSL::PKey::RSA.new(\n @private_key, 'notasecret')\n end\n\n @_files = {}\n @_spreadsheets = {}\n\n do_auth\n end", "title": "" }, { "docid": "bf6d788c5ac3b850d611997fbbc8be13", "score": "0.53419614", "text": "def login\n system('clear')\n puts 'Authorizing...'.green\n\n @session ||= GoogleDrive.saved_session('config.json')\n spreadsheet\nend", "title": "" }, { "docid": "9a9f54cd481e37115abe69d4eee76212", "score": "0.5340183", "text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'bimawansatrianto@gmail.com'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\n end", "title": "" }, { "docid": "10030a962bf5a0a9ef643cf56ca1abdb", "score": "0.53382", "text": "def setup_authentication\n if is_netrc?\n n = Netrc.read\n @acquia_username, @acquia_password = n[\"cloudapi.acquia.com\"]\n end\nend", "title": "" }, { "docid": "b6e8897c92fe246a9f1e367ac6c8be5a", "score": "0.5335976", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "6db0f21e62cad17d8ff24c1b93f65074", "score": "0.5332827", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "6db0f21e62cad17d8ff24c1b93f65074", "score": "0.5332827", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n 'resulting code after authorization:\\n' + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" }, { "docid": "c4b81e16f779e664b1aaeb15d0e8b7de", "score": "0.5327545", "text": "def authorize_ci_for_keys\n token = ENV['CI_USER_TOKEN']\n\n # see macoscope.com/blog/simplify-your-life-with-fastlane-match\n # we're allowing the CI access to the keys repo\n File.open(\"#{ENV['HOME']}/.netrc\", 'a+') do |file|\n file << \"machine github.com\\n login #{token}\"\n end\nend", "title": "" }, { "docid": "683d1e82c7fa9acd1fc3e7d61cf42ef0", "score": "0.5325826", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code( user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend", "title": "" }, { "docid": "3da3d78bb350441f2e140f2647eb9985", "score": "0.5320453", "text": "def set_config\n\t\t$org_git_name = 'leapfrogtechnology'\n\t\t$client.per_page = 100\n\t\t$client.auto_paginate = true\n\tend", "title": "" }, { "docid": "230f61468d2caed495464e29461ac0e7", "score": "0.5317761", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend", "title": "" } ]
3bf90bde7bfd7b89ec3e5191082ddc76
returns a sorted list of candidates by the ballot's stored algorithm option
[ { "docid": "1092faa4d5d26590758b50f2fd280257", "score": "0.57773435", "text": "def winners\n case self.algorithm\n when \"majority\" then majority\n # and so on...\n else\n majority\n end\n end", "title": "" } ]
[ { "docid": "90b5012f0a315d9e8f30507cb5fcb05a", "score": "0.65482605", "text": "def criteria\n (option_pairs + extra_option_pairs).sort\n end", "title": "" }, { "docid": "13f7fdc07d2d565e76b3bcf8e7169eb9", "score": "0.6254119", "text": "def get_candidate_list\n [@@candidates]\n end", "title": "" }, { "docid": "c4d20309976a17b69816d5806976fdcf", "score": "0.62170416", "text": "def possible_candidates\n @possible_candidates ||= (1..@side_size)\n end", "title": "" }, { "docid": "fb521cd9b7b2d971b7fc1f083ca25b41", "score": "0.62118155", "text": "def select_candidates(rule_hash)\n candidates = rule_hash.keys.sort {|x, y| rule_hash[x] <=> rule_hash[y]}[0...beam_width]\n Log.debug \"Going to refine #{candidates.inspect}\"\n return candidates\n end", "title": "" }, { "docid": "659aabf7ffe0f5dea6d05997a410d4ba", "score": "0.6208408", "text": "def optimal_candidate(candidates)\n candidates.max(&method(:compare))\n end", "title": "" }, { "docid": "f230f2b5811a67e05ebcb27b923b7881", "score": "0.6203251", "text": "def sort_by_algo(state_list)\n state_list.sort_by(&:algie_check)\n end", "title": "" }, { "docid": "139fb1638ea443dc57ba76d7a3fe6732", "score": "0.6139845", "text": "def candidates\n end", "title": "" }, { "docid": "8c68c980bd67cd080c5c7b8627a65cb7", "score": "0.6028617", "text": "def sort_all_candidates(candidate_list)\n candidate_list.sort_by { |person|\n [person[:years_of_experience],person[:github_points] ]}.reverse\n end", "title": "" }, { "docid": "d9e57a0852334b288717b6fb8ecb6f21", "score": "0.5996805", "text": "def sort_by_rank\n\t\tsorted = @candidates.sort{ |x,y| y.votes <=> x.votes }\n\t\t@candidates\n\tend", "title": "" }, { "docid": "cad5620c070b30fce08e98b71a60bcf4", "score": "0.59635466", "text": "def combo_comparator(cards)\n return [COMBOS_NAMES[cards[0]], cards[1]] if cards[1].size == 1\n\n best_combo = []\n\n # Since cards have value we just sum values of each combo and compare with each other\n cards[1].each_cons(2) do |c1, c2|\n c1.map(&:value).sum > c2.map(&:value).sum ? best_combo = c1 : best_combo = c2\n end\n\n [COMBOS_NAMES[cards[0]], best_combo]\n end", "title": "" }, { "docid": "d4202e7ce257c4a03ad6321df662121b", "score": "0.5951438", "text": "def get_possible_pools( query, no_limit = false )\n result = []\n pools = SwimmingPoolFinder.new( query, no_limit ? nil : RESULTS_LIMIT ).search()\n result += pools.map{|p| p.decorate }\n # Re-sort the modified array:\n result.sort!{ |pa, pb| pa.get_full_name <=> pb.get_full_name }\n result\n end", "title": "" }, { "docid": "20bdfd751b6a87175e7db1846a08ecac", "score": "0.58987695", "text": "def candidates(options = {})\n opts = {:supported_language_tags => nil, :current => current,\n :type => :common}.merge(options)\n\n if Thread.current[:candidates_caches]\n cache = Thread.current[:candidates_caches][opts.hash]\n return cache if cache\n else\n Thread.current[:candidates_caches] = {} \n end\n Thread.current[:candidates_caches][opts.hash] =\n collect_candidates(opts[:type], opts[:current],\n opts[:supported_language_tags])\n end", "title": "" }, { "docid": "4106d3371d833401b6dfbeac79afc35c", "score": "0.58419514", "text": "def compose_algorithm_list(supported, option, append_all_supported_algorithms = false)\n return supported.dup unless option\n\n list = []\n option = Array(option).compact.uniq\n\n if option.first && option.first.start_with?('+', '-')\n list = supported.dup\n\n appends = option.select { |opt| opt.start_with?('+') }.map { |opt| opt[1..-1] }\n deletions = option.select { |opt| opt.start_with?('-') }.map { |opt| opt[1..-1] }\n\n list.concat(appends)\n\n deletions.each do |opt|\n if opt.include?('*')\n opt_escaped = Regexp.escape(opt)\n algo_re = /\\A#{opt_escaped.gsub('\\*', '[A-Za-z\\d\\-@\\.]*')}\\z/\n list.delete_if { |existing_opt| algo_re.match(existing_opt) }\n else\n list.delete(opt)\n end\n end\n\n list.uniq!\n else\n list = option\n\n if append_all_supported_algorithms\n supported.each { |name| list << name unless list.include?(name) }\n end\n end\n\n unsupported = []\n list.select! do |name|\n is_supported = supported.include?(name)\n unsupported << name unless is_supported\n is_supported\n end\n\n lwarn { %(unsupported algorithm: `#{unsupported}') } unless unsupported.empty?\n\n list\n end", "title": "" }, { "docid": "a6601042f39369ca9a30e9805610c3e5", "score": "0.5836927", "text": "def build_candidates(candidates)\n candidates.to_a.map do |object, preferences|\n candidate(object).tap do |c|\n c.prefer(*preferences.map { |t| target(t) })\n end\n end\n end", "title": "" }, { "docid": "86099823e1dac20f376cec6e9750779b", "score": "0.58311135", "text": "def sort_candidates(candidates)\n candidates.sort_by do |candidate|\n [candidate[:years_of_experience], candidate[:github_points]]\n end.reverse\nend", "title": "" }, { "docid": "c4764b47b0b793e10dd668d6c416c9c6", "score": "0.58149964", "text": "def ordered_by_qualifications(candidates)\n candidates_array = []\n candidates.each do |candidate|\n candidates_array.push(candidate)\n end\n\n pp candidates_array.sort_by {|person| person[:years_of_experience] || person[:github_points]}.reverse\n\nend", "title": "" }, { "docid": "d8d6c654d0cc43838850274a9a0e3215", "score": "0.5786612", "text": "def find_best_merge_candidates\n best_key = nil\n best_similar_cluster = nil\n best_goodness = -1.0/0.0 # Negative infinity\n @similar_clusters_map.each do |key, similar_clusters|\n top_similar_cluster = similar_clusters.first\n if (top_similar_cluster && top_similar_cluster.goodness > best_goodness)\n best_goodness = top_similar_cluster.goodness\n best_key = key\n best_similar_cluster = top_similar_cluster\n end\n end\n best_merge_candidates = []\n if (best_key != nil)\n best_merge_candidates << best_key\n best_merge_candidates << best_similar_cluster.cluster_key\n end\n puts \"Found best merge candidates #{best_merge_candidates}\"\n best_merge_candidates\n end", "title": "" }, { "docid": "79eb60c16bc7a71ae4c55f70c2d9cebe", "score": "0.5766734", "text": "def schulze_ranking\n spath = self.strongest_path\n\n return options.sort do |a,b|\n case\n when spath[[a,b]] < spath[[b,a]]\n 1\n when spath[[a,b]] > spath[[b,a]]\n -1\n else\n 0\n end\n end\n end", "title": "" }, { "docid": "418e4910e7fb50db64342d6cb197f20f", "score": "0.57284445", "text": "def sort_by_qualifications(candidates)\n # sort by years_of_experience\n # then sort by github_points\nend", "title": "" }, { "docid": "77e8b5706b571fffc74cdc44c2be755a", "score": "0.5725353", "text": "def answers_generate candidates\n @ans << candidates.map{ |c|\n h = c.group_by{ |digit| digit.kind_of?(Array) }\n if h[true] # need expand\n (set - h[true][0] - h[false]).permutation(h[true].size).map{ |b|\n c.map{ |digit| digit.kind_of?(Array) ? b.shift : digit }.join\n }\n else\n h[false].join\n end\n }.flatten\n end", "title": "" }, { "docid": "be373c7f435e4c4d74ff32a85a335493", "score": "0.57240325", "text": "def top_facet_options(options, requested_count)\n suggested_options = options.sort.select { |option|\n option.count > 0\n }.take(requested_count)\n applied_options = options.select(&:applied)\n suggested_options.concat(applied_options).uniq.sort.map(&:as_hash)\n end", "title": "" }, { "docid": "f0153700fe3bf1bc3d438f624e301d79", "score": "0.5696803", "text": "def option_list\n @option_list ||= (\n method_list.map do |meth|\n case meth.name\n when /^(.*?)[\\!\\=]$/\n Option.new(meth)\n end\n end.compact.sort\n )\n end", "title": "" }, { "docid": "f0153700fe3bf1bc3d438f624e301d79", "score": "0.5696803", "text": "def option_list\n @option_list ||= (\n method_list.map do |meth|\n case meth.name\n when /^(.*?)[\\!\\=]$/\n Option.new(meth)\n end\n end.compact.sort\n )\n end", "title": "" }, { "docid": "9464f4f4b9d439176a03840c94fd876b", "score": "0.56900495", "text": "def sorted_best_bets\n best_bets.sort_by(&:position)\n end", "title": "" }, { "docid": "0760f8c46bb6230914be7dd2206b5e19", "score": "0.5682406", "text": "def candidates(x,y,puzzle)\n\tif puzzle[x][y] > 0 then Array.new\n\telse (neighbors(x,y,puzzle).to_set ^ (0..9).to_set).to_a end\nend", "title": "" }, { "docid": "b69822a4d523bd580b39afefe6e0573d", "score": "0.564272", "text": "def results_list\n res = competitors.active.to_a\n res.sort!{|a,b| a.sorting_overall_place <=> b.sorting_overall_place}\n end", "title": "" }, { "docid": "0f92a32b2fee53c07137749e1247e891", "score": "0.5624506", "text": "def optimize\n operand.sort_by(operation.directions)\n end", "title": "" }, { "docid": "416632f8f031b81bad6aad8cf7f25135", "score": "0.5621896", "text": "def results_list\n res = competitors.active.to_a\n res.sort! { |a, b| a.sorting_overall_place <=> b.sorting_overall_place }\n end", "title": "" }, { "docid": "40b86bdaacee136f70c6c4e936210b46", "score": "0.56167066", "text": "def suggestion\n @players = Player.find_all_by_id(params[:player_ids])\n suggestions = {}\n approaches = []\n approaches.push(:algo1) # Add new algorithms here.\n approaches.push(:algo2) # These are defined above.\n approaches.each do |algorithm|\n # For each algorithm, run it, passing the players.\n # And then calculate the delta in strengths.\n # Keep these suggestions in a hash.\n team1, team2 = send algorithm, @players\n delta = (team1.strength - team2.strength).abs\n suggestions[delta] = [team1, team2]\n end\n\n # Get the best suggestion. (smallest delta, found by sorting)\n # TODO: present all the suggestions to the user, instead of just 1.\n # TODO: also generate different combinations for each algorithm.\n best = suggestions.keys.sort[0]\n @team1, @team2 = suggestions[best]\n @max = [@team1.players.to_a.count, @team2.players.to_a.count].max - 1\n end", "title": "" }, { "docid": "64f2d44a104cd698955fe419e26a5583", "score": "0.56034863", "text": "def sorted_options\n options = self.option_values.group_by(&:option).to_a\n options.sort_by{|o| o[0][:order_num]}\n end", "title": "" }, { "docid": "ff221f3e9cbc36ed8e37989209b477e2", "score": "0.5589556", "text": "def sort_pool_by_fitness!\n puts \"Sorting Pool\".yellow if @verbosity >=2\n num_instances = @test_count\n sorted_pool = Array.new(2*(num_instances+1)) { [] } # create a (large) 2D array for storing instances\n one_percent = @pool.count/100.0\n number = @pool.count\n OutputTools.print_percentage(0, 100) if @verbosity >= 2\n @pool.each_with_index do |hyp, n|\n fitness = test_for_fitness(hyp)\n sorted_pool[num_instances - fitness] << hyp\n OutputTools.print_percentage(n, number) if (@verbosity >= 2) &&(((n+1)% one_percent).eql?(0))\n end\n puts\n #if sorted_pool[num_instances].count > 0 #We found one!\n # @perfect_hypotheses_found = true\n #end\n @ranked_pool = sorted_pool #gogo gadget garbage collector!\n @pool = sorted_pool.flatten #This does a shallow copy, so we aren't duplicating the pool\n nil\n end", "title": "" }, { "docid": "7f702d39e1eeb47950b803a6650165c7", "score": "0.5570801", "text": "def determine_choices(stats, options)\n final = []\n options.each do |choice|\n choice.each_index do |i|\n if choice[i] < 0\n break if (stats[i] + choice[i]) > 0\n else\n break if (stats[i] - choice[i]) < 0\n end\n if i == 4\n final += [choice[5]]\n break\n end\n end\n end\n final\n end", "title": "" }, { "docid": "07a6fe7699ee168b397c867c73c80042", "score": "0.5568721", "text": "def qualified_candidates(candidates)\n result = []\n candidates.each do |candidate|\n if experienced?(candidate) && (candidate[:github_points] > 100) && (candidate[:age] >= 18) && ruby_python?(candidate) && fresh_application?(candidate)\n result << candidate\n end\n end\n result\nend", "title": "" }, { "docid": "fa631dabda58700f497046dad611fea0", "score": "0.5564306", "text": "def optimize\n operand.operand.sort_by(operation.directions)\n end", "title": "" }, { "docid": "029b6cf060fde091da8cedc20991a86f", "score": "0.5557309", "text": "def qualified_candidates(candidates)\n result = []\n @candidates.each do |candidate|\n if (experienced?(candidate) &&\n has_points?(candidate, 100) &&\n (has_lang?(candidate, \"Ruby\") || has_lang?(candidate, \"Python\")) &&\n applied_within?(candidate, 15) &&\n candidate[:age] >= 18)\n result.push(candidate)\n end\n end\n return result\nend", "title": "" }, { "docid": "cba855f5fdb91a536bbaf0f68017668e", "score": "0.555429", "text": "def sorted_naive_strategy\n set = Set.new\n $users_like_products.each do |u|\n set << [u[1], intersection_size(u[0])] if naive_conditions?(u)\n end\n set.sort_by { |n| n[1] }.reverse.map { |n| n[0] }\n end", "title": "" }, { "docid": "e58ca76c78979f17ce6943e04de81275", "score": "0.5533688", "text": "def list_candidates(num)\n\tlist = (0..num).to_a\t\n\tlist[0], list[1] = nil, nil\n\tlist\nend", "title": "" }, { "docid": "1eeced6741fd57e22759b30d39652294", "score": "0.5532557", "text": "def candidates_by_name\n @candidates_by_name ||= begin\n mapping = {}\n candidates.each do |atty|\n (mapping[atty.name] ||= []) << atty\n end\n mapping\n end\n end", "title": "" }, { "docid": "222328bf632dacce555ea15e0591d86b", "score": "0.55268365", "text": "def get_ballots\n @zk.children(root_vote_path).grep(/^ballot/).tap do |ballots|\n ballots.sort! {|a,b| digit(a) <=> digit(b) }\n end\n end", "title": "" }, { "docid": "349b4d3e354afb3258a1fa9a01ade408", "score": "0.5513256", "text": "def ordered_by_qualifications(candidates)\n candidates.sort_by do |candidate|\n [-candidate[:years_of_experience], -candidate[:github_points]]\n end\n\n\nend", "title": "" }, { "docid": "8fe925227eb3760f33227abdd729f262", "score": "0.5479322", "text": "def optimize\n operand.operand.sort_by { operation.directions }\n end", "title": "" }, { "docid": "df16a7f3d57658caa6b2233e2c1879a3", "score": "0.547858", "text": "def ordered_by_qualifications(candidates)\n result = candidates.sort_by { |candidate| [candidate[:years_of_experience], candidate[:github_points]] }\n return result.reverse\nend", "title": "" }, { "docid": "3794727f330459928cedd9e8a5a17fce", "score": "0.547088", "text": "def prepare_preferred_algorithm( options, algorithm )\n @algorithms[ algorithm ] = @default_algorithms[ algorithm ].dup\n if options[algorithm]\n algos = [ *options[algorithm] ]\n algos.each do |algo|\n unless @algorithms[algorithm].include?(algo)\n raise NotImplementedError,\n \"unsupported algorithm for #{algorithm.inspect}: #{algo}\"\n end\n end\n @algorithms[ algorithm ].unshift( *algos ).uniq!\n end\n end", "title": "" }, { "docid": "dff34f438339dca6b7a31073a6d0c37d", "score": "0.5468102", "text": "def __sort_option__\n { name => operator }\n end", "title": "" }, { "docid": "ff4c87f63f15021657420db7ec766370", "score": "0.54647523", "text": "def candidates(options = {})\n return size if !options || options.empty?\n filter = filter_for_options(options)\n return size unless filter\n entries.select {|entry| filter.call(entry) }\n end", "title": "" }, { "docid": "ac5b2f8add5364aca1550b889ff09dd8", "score": "0.54588324", "text": "def my_top_five_candidates\n\t\treturn self.offre_for_candidates.where(accepted_postule:true)\n\tend", "title": "" }, { "docid": "7d7c913f0f8fa3d601700d20a97f78cc", "score": "0.54278064", "text": "def candidates\n possible_candidates = []\n @neighbour_cells.flatten.each{ |cell|\n possible_candidates << cell.value \n }\n existing_candidates = (1..9).to_a - possible_candidates.uniq\n end", "title": "" }, { "docid": "55f1cc6f773e6752defaa9cfb1849017", "score": "0.54251474", "text": "def rb_combo_creator\n\t\t\trb_combo_array = []\n\t\t\tfor i in 0...@all_players['RB'].count do\n\t\t\t\tfor j in (i+1)...@all_players['RB'].count do\n\t\t\t\t\trb_combo_array << [@all_players['RB'][i], @all_players['RB'][j]]\n\t\t\t\t\tputs \"RB COMBO CREATOR\"\n\t\t\t\tend\n\t\t\tend\n\n\t\t\trb_combo_array.sort_by! do |combo|\n\t\t\t\tcombo[0].best_score + combo[1].best_score\n\t\t\tend\n\n\t\t\treturn rb_combo_array.reverse\n\t\tend", "title": "" }, { "docid": "02eea5ff714c1e939921122b181c1ed5", "score": "0.542505", "text": "def candidate_results_by_coalition_proportional_and_coalition_draw_order\n candidate_results_in_election_order\n .reorder('coalition_proportionals.number desc, candidate_results.coalition_draw_order asc')\n end", "title": "" }, { "docid": "c33fa1c62104b997e33e3e9dc73064a2", "score": "0.54127675", "text": "def pick_job(all_jobs, algorithm = nil)\n # Sort the jobs\n sorted = sort_jobs(all_jobs)\n\n # The default selection is \"top\"\n algorithm = \"top\" if algorithm == nil\n\n # Now we decide how to pick a job\n case algorithm\n when \"top\"\n # Simply print the highest priority job\n print_job sorted[0]\n when \"urgent\"\n # Choose a random job from the 5 highed priority\n x = 5 < sorted.length ? 5 : sorted.length\n print_job sorted[rand(x)]\n when \"random\"\n # Choose a completely random job\n print_job sorted[rand(sorted.length)]\n else \n printf \"%s pick [TOP|HIGH|RAND]\\n\", $0\n exit\n end\nend", "title": "" }, { "docid": "93c747446d569749c9ff9942fc3aa649", "score": "0.54125667", "text": "def find_suggested_listings(options = {})\n Listing.find_suggested_for_collection(self, options)\n end", "title": "" }, { "docid": "64fc2cd28ba39d77ca6c4b92c5bb2bd6", "score": "0.54106045", "text": "def get_sorted_tactics\n return tactics.order(\"priority DESC\")\n end", "title": "" }, { "docid": "b0ee7ae74b7a079f9bfc33e861c71eed", "score": "0.54090357", "text": "def candidates_for(position)\n candidates = Candidate.all.select do |candidate|\n candidate.position == position\n end\nend", "title": "" }, { "docid": "d817cf02ba6871a527dd810bb2c578c8", "score": "0.5406933", "text": "def ordered_by_qualifications(candidates)\n result = candidates.sort_by do |candidate| \n [candidate[:years_of_experience] ,candidate[:github_points]]\n end\n result.reverse\nend", "title": "" }, { "docid": "45d4054c0a30fced874d2d26006ccec0", "score": "0.5402491", "text": "def find_candidate_for_guessing\n\t\tunassigned_cells.sort_by { |cell| \n\t\t\t[cell.available_numbers.size, to_s]\n\t\t}.first\n\tend", "title": "" }, { "docid": "95e1c58cc02c8c0700d389136cd5058c", "score": "0.5401196", "text": "def algorithms\n @algorithms ||= %w{ l-bfgs sgd-l1 bcd rprop rprop+ rprop- auto }.freeze\n end", "title": "" }, { "docid": "3f40f5b880435b6be75202b13f9737b4", "score": "0.5380447", "text": "def qualified_candidates(candidates)\n candidates.select do |candidate|\n experienced?(candidate)\n end.select do |candidate|\n github_points?(candidate)\n end.select do |candidate|\n languages?(candidate)\n end.select do |candidate|\n age?(candidate)\n end.select do |candidate|\n application_date?(candidate)\n end\nend", "title": "" }, { "docid": "d1d21d691c892d615c7f16f2db052698", "score": "0.5379907", "text": "def possibilities(name, constraint)\n name = name.to_s\n constraint = Constraint.parse(constraint)\n\n list = []\n @libraries[name].each do |version, _|\n if constraint.match?(version)\n list << [name, version]\n end\n end\n\n list.sort!{ |a,b| b[1] <=> a[1] }\n end", "title": "" }, { "docid": "2a8f813fb8521efd2a9e7521354dfaf5", "score": "0.5379167", "text": "def sort_votes(list)\n list.sort_by! {|option| option.vote} # Sorts the array by the vote attribute of each item\n list.reverse! # Reverses the array because it naturally sorts ascending order\nend", "title": "" }, { "docid": "ca561377c34ac236ebf4e5ff67fc1247", "score": "0.5375505", "text": "def optimize\n wrap_operand.sort_by(directions)\n end", "title": "" }, { "docid": "eb20410e386f0f86f5c38a85bd15d354", "score": "0.53741926", "text": "def sort_bundles\n @combinations.sort_by { |combination| bundle_summation(combination) }\n end", "title": "" }, { "docid": "edb64921520b05551f61a7bfa58b6daf", "score": "0.537249", "text": "def main\n args = ARGV.getopts(\"i:e:z\")\n if ARGV[0].nil?\n puts \"100-97=3\"\n return\n end\n guess = Guess.from_argv(ARGV[0], args['i'] || \"\", args['e'] || \"\")\n stats = CandidateStats.new(guess)\n candidates = []\n guess.candidates(allow_zero_operands: args['z']).each do |cand|\n puts cand.join\n candidates << cand\n stats.add(cand)\n end\n if candidates.length > 2\n top_n = candidates.max_by(3) {|cand| stats.score(cand)}\n puts\n top_n.each_with_index do |cand, i|\n puts \"#{i+1}. #{cand.join}\"\n end\n end\nend", "title": "" }, { "docid": "aecbe23c6afa0e02b43d901afc5804d5", "score": "0.537106", "text": "def find_optimal_arrangement\n @people.permutation(@people.size).map { |arrangement| compute_cost(arrangement) }.max\n end", "title": "" }, { "docid": "adf3582f6f9bbb4e434c8c4d5eeb2ce4", "score": "0.53604966", "text": "def sort_menu_combo\n @item_search.collect! { |search| search = (search - @meal_combo)} unless @meal_combo.empty?\n end", "title": "" }, { "docid": "7d947a415549ad3c23557f79d8f662be", "score": "0.53567046", "text": "def qualified_candidates(candidates)\n candidates.select do |candidate|\n criteria(candidate)\n end\nend", "title": "" }, { "docid": "7d947a415549ad3c23557f79d8f662be", "score": "0.53567046", "text": "def qualified_candidates(candidates)\n candidates.select do |candidate|\n criteria(candidate)\n end\nend", "title": "" }, { "docid": "2c36531e66af718f479bbacfdfc9d82e", "score": "0.5356608", "text": "def retrieveBestCandidatesInVector()\n if(@candidateHashLocal!=nil)\n @candidateHashLocal.each_pair do |k, v| \n #puts \"Key: #{k}, Value: #{v}\" \n key = \"#{k}\"\n value= \"#{v}\"\n \n if(value.to_i>=@countMatchs)\n insertCandidate(key.to_i)\n end \n end\n end \nend", "title": "" }, { "docid": "34d51b0556103f44467ce2578fc550c7", "score": "0.5350511", "text": "def ordered_by_qualifications(candidates)\n candidates.sort_by {|k| [-k[:years_of_experience], -k[:github_points]]}\nend", "title": "" }, { "docid": "96383bd1ebd9f7d01754551e555eaf0d", "score": "0.5345542", "text": "def which_cards_pick(lbl_card, cards_on_table )\r\n #p lbl_card, cards_on_table\r\n res = []\r\n rank_play_card = @deck_information.get_card_rank(lbl_card)\r\n cards_on_table.each do |card|\r\n rank_curr_table_item = @deck_information.get_card_rank(card)\r\n if rank_curr_table_item == rank_play_card\r\n # match ok beause the same rank\r\n res << [card]\r\n end \r\n end\r\n if rank_play_card >= 2 and rank_play_card <= @combiof_sum_initial\r\n # its possible to sum the rank of cards on the table\r\n #p cards_on_table, rank_play_card\r\n list_combi = combi_of_sum(cards_on_table, rank_play_card)\r\n # append result, all combinations are allowed\r\n list_combi.each{|e| res << e}\r\n if @game_opt[:combi_sum_lesscard] and res.size > 1\r\n # we have a combination restriction. Only the combination with the smaller size\r\n # of cards is allowed\r\n #@log.debug(\"which_cards_pick: Combination is restricted to the min\")\r\n tmp = res.sort{|a,b| a.size <=> b.size}\r\n res = []\r\n size_min = tmp.last.size\r\n tmp.each do |arr|\r\n if arr.size <= size_min\r\n res << arr\r\n size_min = arr.size \r\n else\r\n break\r\n end \r\n end\r\n #p res\r\n end\r\n else\r\n #@log.debug(\"which_cards_pick: card outside the rank(2-#{@combiof_sum_initial})\")\r\n end\r\n #p \"which_cards_pick, Resul:#{res}\"\r\n return res\r\n end", "title": "" }, { "docid": "85b43a0b3807cbf35812b946c77a2eec", "score": "0.5342594", "text": "def find_winners(ballot_count)\n result = unisize\n # not all remaining candidates have the same size\n if (result == nil)\n @list.size.times do |i|\n candidate = @list[i]\n # puts(\"Total ballots: #{ballot_count}, candidate: #{(i+1)}, ballot count: #{candidate.ballots.list.size}\")\n # look for candidate with ballot count more than 50% of the total votes\n if (candidate.ballots.list.size / ballot_count.to_f >= 0.5)\n result = [candidate]\n break\n end\n end\n end\n result\n end", "title": "" }, { "docid": "2635079f6b055b07b2981c8f6228d8b7", "score": "0.5336575", "text": "def rcv(ballots, tie_breakers, eliminations=nil)\n raise BallotError.new('Ballots must be non-empty') if ballots.empty?\n\n # for each candidate, count how many first place votes they got\n first_place_votes = {}\n ballots.each do |ballot|\n next if ballot.empty?\n\n first_place_votes[ballot.first] = 0 if first_place_votes[ballot.first].nil?\n first_place_votes[ballot.first] += 1\n end\n\n # if there's only one candidate left, return that candidate\n raise BallotError.new('No candidates') if first_place_votes.size == 0\n return first_place_votes.keys.first if first_place_votes.size == 1\n\n # figure out which candidates are in last place\n ordered_votes = first_place_votes.sort_by{|_candidate, vote_number| vote_number}\n last_place_candidates = []\n last_place_vote_count = ordered_votes.first.last # ordered_votes.first will give [candidate, vote_count]\n ordered_votes.each do |candidate, vote_count|\n break if vote_count > last_place_vote_count\n last_place_candidates << candidate\n end\n\n # figure out which of the last place candidates to eliminate, based on the tie breakers\n last_place_candidate = last_place_candidates.first\n last_place_candidates.drop(1).each do |candidate| # we drop the first because we don't want to compare against itself\n broken_in_favor_of_candidate = tie_breakers.include? candidate.beats(last_place_candidate)\n broken_against_candidate = tie_breakers.include? candidate.loses_to(last_place_candidate)\n\n # verify that you have enough tie breaking information\n raise TieBreakingError.new(candidate, last_place_candidate) unless broken_in_favor_of_candidate || broken_against_candidate\n raise TieBreakingError.new(candidate, last_place_candidate) if broken_in_favor_of_candidate && broken_against_candidate\n\n last_place_candidate = candidate if broken_against_candidate\n end\n\n # eliminate the candidate in last place\n eliminations << {\n candidate: last_place_candidate,\n votes: last_place_vote_count,\n ordered_votes: ordered_votes\n } unless eliminations.nil?\n cleaned_ballots = ballots.map do |ballot|\n ballot.reject{|candidate| candidate == last_place_candidate }\n end\n\n # recurse on the cleaned ballots\n rcv cleaned_ballots, tie_breakers, eliminations\nend", "title": "" }, { "docid": "83ce83297290bc538a1f791d684885b5", "score": "0.53202987", "text": "def picks_list(name)\n array_of_animals = Animal.where(species: name)\n puts \"Please choose from the available candidates!\"\n array_of_animals.each_with_index do |animal, index|\n puts \"#{index+1}. #{animal.name}\"\n end\n end", "title": "" }, { "docid": "3626c3de6616425d6a62ee8c1716394b", "score": "0.5303894", "text": "def best_combo(cards)\n best_cards = [0, []]\n\n cards[0].each_with_index do |value, index|\n if value == cards[0].max\n best_cards[0] = value\n best_cards[1].push(cards[1][index])\n end\n end\n\n best_cards\n end", "title": "" }, { "docid": "2a8e90e80a046b07b4134961b047eaa3", "score": "0.53025275", "text": "def ordered_by_qualifications(candidates)\n candidates.sort_by { |candidate| [candidate[:years_of_experience], candidate[:github_points]] }.reverse\nend", "title": "" }, { "docid": "0b2b828281f81bd228f10ee00c312147", "score": "0.5299093", "text": "def candidate_list(options={})\n params = Array.new\n demand_keys = %w[zhuanjiafeilv\n candidateexperience_set__start candidateexperience_set__end candidateexperience_set__description\n candidateeducation_set__start candidateeducation_set__end candidateeducation_set__school].to_json\n gql = []\n gql << \"id__gte=#{options[:id_ge]}\" if options[:id_ge]\n gql << \"id__lte=#{options[:id_le]}\" if options[:id_le]\n gql << \"#{options[:id_in].map{|id| \"id=#{id}\" }.join('|')}\" if options[:id_in]\n\n params << \"private_token=#{private_token}\"\n params << \"page=#{options[:page]}\"\n params << \"paginate_by=#{options[:per_page]}\"\n params << \"demandKeys=#{demand_keys}\"\n params << \"gql=#{CGI.escape(gql.join('&'))}\"\n url = \"#{URL}/rest/candidate/list?#{params.join('&')}\"\n response = Api.get(url)\n if response.code == '200'\n res = JSON.parse response.body\n if res['status'] == false\n raise res['message']\n else\n res\n end\n else\n raise \"http code: #{response.code}\"\n end\n end", "title": "" }, { "docid": "36a485d8b7ca45c6904788ef820f13ed", "score": "0.5293234", "text": "def get_candidates node\n\n candidates = []\n\n for i in 0..node.num_nbrs-1\n first_edge = node.edges[i]\n curr_edge = first_edge\n curr_node = node.return_neighbour(self,i)\n pos_to_add_on_node = i\n first = true\n \n while curr_edge != first_edge or first\n first = false\n #if vertex is only degree 2, make it a candidate\n if curr_node != node and curr_node.num_nbrs == 2\n #find the pos of where the edge should be added on curr_node\n pos_to_add_on_nbr = curr_node.edges.index(-curr_edge)\n candidates.push([node.label,pos_to_add_on_node,curr_node.label,pos_to_add_on_nbr])\n end\n\n #move to the next node\n pos = curr_node.next_pos_after_edge(-curr_edge)\n curr_edge = curr_node.edges[pos]\n curr_node = curr_node.return_neighbour(self,pos)\n\n end\n end\n return candidates\n end", "title": "" }, { "docid": "84afbecf115224b3df7ed16a22cf6c74", "score": "0.5289387", "text": "def possible_candidates_for(file)\n @locality\n .candidates_of(file)\n .subtract(file.similar_files.map(&:file))\n end", "title": "" }, { "docid": "d231d4aa727dea54310e9fec8698e9f6", "score": "0.52881384", "text": "def optimal_candidate(candidates, coupon_types)\n candidates.max do |coupons_0, coupons_1|\n total_values = [\n total_value(coupons_0, coupon_types),\n total_value(coupons_1, coupon_types)\n ]\n\n if total_values[0] != total_values[1]\n # If total values of the coupons are different, the coupons of higher value are better.\n total_values[0] <=> total_values[1]\n\n else\n # Otherwise, the coupons of smaller number are better.\n n_of_coupons(coupons_1) <=> n_of_coupons(coupons_0)\n end\n end\n end", "title": "" }, { "docid": "117edcfb2353a7f719cef60057a57c51", "score": "0.5284022", "text": "def getStrategies\n\t\tchances_of_forager = 0\n\t\tchances_of_warrior = 0\n\t\tchances_of_builder = 0\n\n\t\tfor i in 0...@num_of_anthills\n\t\t\tstrategy = []\n\n\t\t\tcase rand(4)\n\t\t\twhen 0 #Greedy\n\t\t\t\tchances_of_forager = 50\n\t\t\t\tchances_of_warrior = 25\n\t\t\t\tchances_of_builder = 25\n\t\t\twhen 1 #Aggresive\n\t\t\t\tchances_of_forager = 25\n\t\t\t\tchances_of_warrior = 50\n\t\t\t\tchances_of_builder = 25\n\t\t\twhen 2 #Constructive\n\t\t\t\tchances_of_forager = 25\n\t\t\t\tchances_of_warrior = 25\n\t\t\t\tchances_of_builder = 50\n\t\t\twhen 3 #Balanced\n\t\t\t\tchances_of_forager = 34\n\t\t\t\tchances_of_warrior = 33\n\t\t\t\tchances_of_builder = 33\n\t\t\tend\n\n\t\t\tfor i in 0...@size\n\t\t\t\ttype1 = rand(chances_of_builder)\n\t\t\t\ttype2 = rand(chances_of_warrior)\n\t\t\t\ttype3 = rand(chances_of_forager)\n\t\t\t\ttypes = []\n\t\t\t\ttypes << type1\n\t\t\t\ttypes << type2\n\t\t\t\ttypes << type3\n\t\t\t\tmax = type1\n\t\t\t\tmax_index = 0\n\t\t\t\tfor i in 0...types.length\n\t\t\t\t\tif(max <= types[i])\n\t\t\t\t\t\tmax = types[i]\n\t\t\t\t\t\tmax_index = i\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tcase max_index\n\t\t\t\twhen 0\n\t\t\t\t\tstrategy << \"builder\"\n\t\t\t\twhen 1\n\t\t\t\t\tstrategy << \"warrior\"\n\t\t\t\twhen 2\n\t\t\t\t\tstrategy << \"forager\"\n\t\t\t\tend\n\t\t\tend\n\t\t\t@strategies << strategy\n\t\tend\n\tend", "title": "" }, { "docid": "df7c6fce9407b2af02f55eb70db932e2", "score": "0.5272166", "text": "def ordered_by_qualifications(candidates)\n candidates.sort_by {|candidate| [candidate[:years_of_experience], candidate[:github_points]] }.reverse\nend", "title": "" }, { "docid": "2f3d09653cd5c15bb3faedab9fce7c1e", "score": "0.52702284", "text": "def ordered_by_qualifications(candidates)\n candidates.sort_by{|candidate| [candidate[:years_of_experience], candidate[:github_points]]}.reverse\nend", "title": "" }, { "docid": "58d1bdc1e3e755a3ebfe1870777e6ed4", "score": "0.5269874", "text": "def choose_best_responder_group(selections)\n current_minimum = 999\n current_count = 999\n result = nil\n selections.each do |x|\n cap = total_capacity_from_array(x)\n num = x.size\n result << x if cap == current_minimum || num == current_count\n next if cap >= current_minimum || num >= current_minimum\n result = x\n current_minimum = cap\n current_count = num\n end\n\n result\n end", "title": "" }, { "docid": "ad52a9d4854323b3fad53351beee61fd", "score": "0.52685726", "text": "def generate_candidates_select(target, param)\n if param[:forced_select]\n # index is specified by condition\n offset = param[:forced_select]\n param.delete :forced_select\n if target[\"value\"][offset]\n result = generate_candidates(target[\"value\"][offset], param)\n else\n # regexp such as /^(?:b|(a))(?(1)1)$/ match \"b\"!\n result = []\n end\n else\n # success if there is at least one result\n offsets = (0 ... target[\"value\"].size).to_a\n \n # shuffle if element size more than 1\n offsets = TstShuffle(offsets) if offsets.size > 1\n\n result = nil\n if param[:atomic]\n param.delete :atomic\n # if atomic, assure proceeding results not appeared\n offsets.each do | offset |\n result = []\n (0...offset).each do | prev |\n la_result = generate_candidates(target[\"value\"][prev], param)\n result.push Regextest::Back::Element.new({cmd: :CMD_NOT_LOOK_AHEAD, result: la_result})\n end\n result.push generate_candidates(target[\"value\"][offset], param)\n break if(!result.find{|elem| !elem })\n end\n elsif negative_type = param[:negative]\n # if negative, assure all results not appeared\n result = []\n offsets.each do | offset |\n la_result = generate_candidates(target[\"value\"][offset], param)\n la_result.each do | elem |\n if elem.command == :CMD_NOT_LOOK_AHEAD\n result.push elem\n else\n result.push Regextest::Back::Element.new({cmd: negative_type, result: la_result})\n end\n end\n end\n param.delete :negative\n else\n offsets.each do | offset |\n result = generate_candidates(target[\"value\"][offset], param)\n break if(result)\n end\n end\n end\n result\n end", "title": "" }, { "docid": "af2028a15f799ab8a7280e22367b43b3", "score": "0.5266391", "text": "def best_distance_attempts\n best_attempts_for_each_competitor = competitors.map(&:max_successful_distance_attempt).compact\n\n best_attempts_for_each_competitor.sort { |a, b| b.distance <=> a.distance }\n end", "title": "" }, { "docid": "85a8c6e03d94b71ee6822b573b602ce3", "score": "0.52622515", "text": "def bron_kerbosch compsub, candidates, nots, level\n return if level == $stop_level and $debug\n print \"level#{level} \" if $debug\n for i in (0..level) \n print \" \"\n end if $debug\n print \"BronKerbosch (#{compsub.inspect}, #{candidates.inspect}, #{nots.inspect})\" if $debug \n if candidates.empty? and nots.empty? then\n $maximal_cliques[compsub.first] = compsub\n print \" : output #{compsub.inspect}\\n\"\n return\n end\n print \"\\n\" if $debug\n pivot = (candidates.union nots).first\n puts \"choosing pivot #{pivot}\" if $debug\n pivot_candidates = Set.new(candidates)\n pivot_candidates.subtract $adj_map[pivot]\n puts \"pivot candidate set #{pivot_candidates.inspect}\" if $debug\n while !pivot_candidates.empty?\n v = pivot_candidates.first\n new_compsub = SortedSet.new(compsub).add v\n new_candidates = SortedSet.new(candidates).intersection neighbor(v)\n new_nots = SortedSet.new(nots).intersection neighbor(v)\n bron_kerbosch new_compsub, new_candidates, new_nots, level+1\n pivot_candidates = pivot_candidates.delete v\n candidates = candidates.delete v\n nots = nots.add v\n end\nend", "title": "" }, { "docid": "74611ad701ebda9817826eb8661a97f9", "score": "0.5260011", "text": "def candidate_results_in_election_order\n candidates_in_election_order.select(\n 'alliance_proportionals.number AS alliance_proportional,\n electoral_alliances.shorten AS electoral_alliance_shorten,\n candidate_results.elected AS elected,\n\n candidate_draws.identifier AS candidate_draw_identifier,\n candidate_draws.affects_elected_candidates AS candidate_draw_affects_elected,\n alliance_draws.identifier AS alliance_draw_identifier,\n alliance_draws.affects_elected_candidates AS alliance_draw_affects_elected,\n coalition_draws.identifier AS coalition_draw_identifier,\n coalition_draws.affects_elected_candidates AS coalition_draw_affects_elected,\n\n candidate_results.vote_sum_cache AS vote_sum').joins(\n 'INNER JOIN electoral_alliances ON candidates.electoral_alliance_id = electoral_alliances.id').joins(\n 'LEFT OUTER JOIN candidate_draws ON candidate_results.candidate_draw_id = candidate_draws.id').joins(\n 'LEFT OUTER JOIN alliance_draws ON candidate_results.alliance_draw_id = alliance_draws.id').joins(\n 'LEFT OUTER JOIN coalition_draws ON candidate_results.coalition_draw_id = coalition_draws.id').joins(\n 'INNER JOIN alliance_proportionals ON candidates.id = alliance_proportionals.candidate_id').where(\n ['alliance_proportionals.result_id = ? AND candidate_results.result_id = ?', self.id, self.id])\n end", "title": "" }, { "docid": "e96e28342b4ecef919557ccaca05208b", "score": "0.52584445", "text": "def sorted_choices\n # self.choices.sort_by { |choice| 1 / choice_percentage(choice.id) }\n end", "title": "" }, { "docid": "4730d15da25924189a57f4d55088e446", "score": "0.5255845", "text": "def collect_comrades server\n\t\tcomrade_suggestions = {}\n\t\tcomrade_suggestions.default =\t0\t\n candidates = server.users\n\n\t\tcandidates.each do |u|\n\t\t\tif u != self and !self.has_friend?(u)\tand !self.wait_for?(u) and !u.wait_for?(self)\n\t\t\t\tcomrade_suggestions[u.id] += 20 * u.common_friends_with(self).count\n\t\t\t\tcomrade_suggestions[u.id] += 10 * u.common_events_with(self).count\n\t\t\t\tcomrade_suggestions[u.id] += 10 * u.common_guilds_with(self).count\n\t\t\tend\n\t\tend\n\n # sort by score\n\t\tcomrade_suggestions.sort{|a,b| b[1] <=> a[1]}[0..(COMRADE_SUGGESTION_SET_SIZE - 1)].map{|info| info[0]}\n\t\t\t\t\t\n\tend", "title": "" }, { "docid": "55986cc4cd9a38b945e907e59c2d7236", "score": "0.5252151", "text": "def find_task_possibilities(meth)\n len = meth.to_s.length\n possibilities = all_tasks.merge(map).keys.select { |n| meth == n[0, len] }.sort\n unique_possibilities = possibilities.map { |k| map[k] || k }.uniq\n\n if possibilities.include?(meth)\n [meth]\n elsif unique_possibilities.size == 1\n unique_possibilities\n else\n possibilities\n end\n end", "title": "" }, { "docid": "617b91570b8530e223cfa6a5e2edb047", "score": "0.52517486", "text": "def top_resorts\n Resort.all.joins(:preference)\n .map { |resort| [resort, preference.score(resort.preference)] } # [[#<Resort....>, 67], [......]\n .sort_by { |pair| - pair[1] } # Sorting DESC\n .first(3)\n\n # [ { resort: resort, score: 54 }, {....}, ......] suggestion\n end", "title": "" }, { "docid": "2341f595312fd27e0aad63b08119b4d4", "score": "0.525084", "text": "def candidates\n @counts.values.flatten\n end", "title": "" }, { "docid": "00f4f4592b734a06d4d220ef2af810e3", "score": "0.52491516", "text": "def whatFlavors(cost, money)\n sorted = cost.sort\n ia = 0\n ib = sorted.length - 1\n while (ia<ib) do\n sum = sorted[ia]+sorted[ib] \n if sum == money\n break;\n elsif sum > money\n ib-=1\n else\n ia+=1\n end\n end\n c1 = sorted[ia]\n c2 = sorted[ib]\n f1 = 1+cost.index(c1)\n f2 = 1+cost.index(c2)\n if f2==f1\n f2 = 1+cost.rindex(c2)\n end\n ff = [f1, f2].sort\n puts \"#{ff[0]} #{ff[1]}\"\nend", "title": "" }, { "docid": "6e09e9d3eb8f68af5b1289bbb87d38ed", "score": "0.5245744", "text": "def candidate_list(data)\n print \"\\nWe have #{ data.length } election candidates: \"\n print data[0].upcase\n (1...data.length).each do |num|\n print \", #{ (data[num]).upcase }\"\n end\nend", "title": "" }, { "docid": "61456c130fc9eb26be50d59a5452d15d", "score": "0.5245621", "text": "def neediest_buckets\n multipliers = self.needed_multipliers( self._select_all, @wanted_distribution ).to_a\n multipliers.sort! { |a, b| b[1] <=> a[1] } # Sort on multiplier descending\n multipliers.map{ |bucket_name, multiplier| bucket_name }\n end", "title": "" }, { "docid": "653472c2c25c8d63583ba69b75ad5344", "score": "0.5237545", "text": "def sort_options\n options = []\n options << [_(\"Due Date\"), \"1\"]\n options << [_(\"Age\"), \"2\"]\n options << [_(\"Name\"), \"3\"]\n options << [_(\"Recent\"), \"4\"]\n\n return options\n end", "title": "" }, { "docid": "b5bf2b6c9feeff7c3b8604cb13e05985", "score": "0.5233778", "text": "def prepare_preferred_algorithms!\n options[:compression] = %w[zlib@openssh.com zlib] if options[:compression] == true\n\n ALGORITHMS.each do |algorithm, supported|\n algorithms[algorithm] = compose_algorithm_list(\n supported, options[algorithm] || DEFAULT_ALGORITHMS[algorithm],\n options[:append_all_supported_algorithms]\n )\n end\n\n # for convention, make sure our list has the same keys as the server\n # list\n\n algorithms[:encryption_client ] = algorithms[:encryption_server ] = algorithms[:encryption]\n algorithms[:hmac_client ] = algorithms[:hmac_server ] = algorithms[:hmac]\n algorithms[:compression_client] = algorithms[:compression_server] = algorithms[:compression]\n algorithms[:language_client ] = algorithms[:language_server ] = algorithms[:language]\n\n if !options.key?(:host_key)\n # make sure the host keys are specified in preference order, where any\n # existing known key for the host has preference.\n\n existing_keys = session.host_keys\n host_keys = existing_keys.flat_map { |key| key.respond_to?(:ssh_types) ? key.ssh_types : [key.ssh_type] }.uniq\n algorithms[:host_key].each do |name|\n host_keys << name unless host_keys.include?(name)\n end\n algorithms[:host_key] = host_keys\n end\n end", "title": "" }, { "docid": "d6b31900ca28c2c1d34db1abed762f38", "score": "0.5232678", "text": "def candidates_all(needles)\n needles.product(haystack)\n end", "title": "" }, { "docid": "af0a05d67942601c3a98af378c7e0c5b", "score": "0.5221537", "text": "def specific_endorsed_candidates\n endorsed_users = self.endorsements.map { |endorsement| endorsement }\n endorsed_candidates = endorsed_users.map { |endorsement| endorsement.candidate }\n endorsed_candidate_users = endorsed_candidates.compact.map { |candidate| candidate.user }\n #sorts candidates according to organization score (should be candidate score)\n endorsed_candidate_users_sorted = endorsed_candidate_users.sort_by {|user| user.cand_score}\n endorsed_users_twitter = endorsed_candidate_users_sorted.reverse.map { |user| user.twitteruser }\n # cut_off_twitteruser_array = endorsed_users_twitter[0..10]\n end", "title": "" }, { "docid": "e7b3553674d741fbed442eb42a051437", "score": "0.522047", "text": "def lilysHomework(source)\n ascending = source.sort\n descending = ascending.reverse\n ascending_swaps = count_swaps(source, ascending)\n descending_swaps = count_swaps(source, descending)\n return [ascending_swaps, descending_swaps].min\nend", "title": "" }, { "docid": "2404f195c85a68bd9c6508e8e52d7672", "score": "0.5217354", "text": "def populateCandidates()\n\t\t@grid.each do |index|\n\t\t\tindex.candidates.clear\n\t\t\tif (index.value == 0)\n\t\t\t\t(1..9).each do |num|\n\t\t\t\t\tif (isValid(num, index))\n\t\t\t\t\t\tindex.candidates.push(num)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" } ]
8e534b096e14d5d86235096a8f659e5c
GET /searches/new GET /searches/new.json
[ { "docid": "29ea0e67059ede4c25fd96c97b1344d5", "score": "0.76099944", "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": "2c0c4962838ebbffbf8f7b8cedffff08", "score": "0.75569516", "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": "7b689672fb051affca32a268fdcb4736", "score": "0.7552319", "text": "def new\n\tuuid = SecureRandom.uuid\n\t@new_url = searches_url + \"/\" + uuid # creates http://localhost/search/123-34552-adsfrjha-234\n\tresponse.set_header(\"Location\", @new_url)\n respond_to do |format|\n format.html { render :new, status: 201 }\n format.json { render :new, status: 201 }\n format.jsonld { render :new, formats: :json, status: 201 }\n end\n\t\n end", "title": "" }, { "docid": "af531c2277016dc41927996594ae593c", "score": "0.74446416", "text": "def new\n @search_set = SearchSet.new\n @searches = Search.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_set }\n end\n end", "title": "" }, { "docid": "115344877e090dc1d1324b2b538959e8", "score": "0.7411551", "text": "def new\n @newsearch = current_user.searches.new\n end", "title": "" }, { "docid": "879e406a073c35e9f0b6fd16efbe20a7", "score": "0.7394912", "text": "def new\n @search = Search.new\n respond_to do |format|\n format.html \n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "060f89614c353af6cbc2af8c6dea3cb4", "score": "0.7386479", "text": "def new\n @searching = Searching.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @searching }\n end\n end", "title": "" }, { "docid": "ddab68c6e9de50e194bb6fd6051c8bf2", "score": "0.73800236", "text": "def new\n @search = Search.new\n @providers = search_providers\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "670166a3deb74ea73911e452cb734106", "score": "0.735172", "text": "def new\n @site_search = SiteSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site_search }\n end\n end", "title": "" }, { "docid": "6feb8a10b9bdc88e5cc1fb5fc805d904", "score": "0.7226506", "text": "def new\n @visit_search = VisitSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit_search }\n end\n end", "title": "" }, { "docid": "f0d5eb11a98098d0a090d48c19e06f6a", "score": "0.70886517", "text": "def new\n @searchre = Searchre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @searchre }\n end\n end", "title": "" }, { "docid": "0a47a454d682a81543e69557a8a894fa", "score": "0.7073455", "text": "def new\n gon.root = true\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": "1ab6a4deaa98d0865b15e3a001c82c86", "score": "0.70642316", "text": "def new\n @search_string = SearchString.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_string }\n end\n end", "title": "" }, { "docid": "a409d8b6557bbf39f92adbc14a4ddf4c", "score": "0.7003686", "text": "def new\n @search_phrase = SearchPhrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_phrase }\n end\n end", "title": "" }, { "docid": "95f7439e37f1d29cbe63f18716c6d0ba", "score": "0.6975897", "text": "def new\n @search_history = SearchHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_history }\n end\n end", "title": "" }, { "docid": "f5f90f0ad38161bd8750bee85a080a51", "score": "0.69567055", "text": "def new\n @search_item = SearchItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_item }\n end\n end", "title": "" }, { "docid": "fcdd2132828ec2c8ef010e1c90344b88", "score": "0.6945641", "text": "def new\n @search_type = SearchType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_type }\n end\n end", "title": "" }, { "docid": "608487fb53afc130f5272d98c78f411e", "score": "0.6944819", "text": "def new\n @found = Found.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @found }\n end\n end", "title": "" }, { "docid": "ed670414c9b3391eb3c9e21d801d89b2", "score": "0.69359547", "text": "def new\n @search_key = SearchKey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_key }\n end\n end", "title": "" }, { "docid": "69b3c3e0bf409e3e2a9a950830da9a23", "score": "0.69305176", "text": "def new\n @search_history = SearchHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @search_history }\n end\n end", "title": "" }, { "docid": "858ca71f464108cea91d3bbcc3bc84e2", "score": "0.6862112", "text": "def new\n @searchresult = Searchresult.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @searchresult }\n end\n end", "title": "" }, { "docid": "ed38a061a41a96ee6afed33f8da7bc5b", "score": "0.6822619", "text": "def new\n @tire_search = TireSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tire_search }\n end\n end", "title": "" }, { "docid": "9b90649da6573606d2c60d38a1dc1015", "score": "0.6804682", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @search }\n end\n end", "title": "" }, { "docid": "57ddd16fb3b5ce42e426fbd4226c8429", "score": "0.6791027", "text": "def new\n @saved_search = SavedSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @saved_search }\n end\n end", "title": "" }, { "docid": "546ebb2046d3c5631244b61b3805adff", "score": "0.6790226", "text": "def new\n crawler = Crawler.new\n if params[:search_query] == \"\"\n @fresh_names = crawler.query_google\n elsif !params[:search_query].nil?\n @fresh_names = crawler.query_suggestions(params[:search_query])\n else\n @fresh_names = []\n end\n render json: @fresh_names\n end", "title": "" }, { "docid": "9beca04340a6898650130f43608d4548", "score": "0.6775704", "text": "def new\n @save_search = SaveSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n #format.json { render json: @save_search }\n end\n end", "title": "" }, { "docid": "1da74d610690ae1b4b9629628f6e65a6", "score": "0.6664631", "text": "def new\n add_breadcrumb :new\n @query = Query.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query }\n end\n end", "title": "" }, { "docid": "f83d34948448a4d1d899abc942126a0a", "score": "0.66139853", "text": "def new\n @search_bin = SearchBin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @search_bin }\n end\n end", "title": "" }, { "docid": "bcff8483a80ab458412e430abe33bd0b", "score": "0.660489", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, :notice => 'Search was successfully created.' }\n format.json { render :json => @search, :status => :created, :location => @search }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @search.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8d612f52a2d89d0c4692b8f06e26438", "score": "0.6590411", "text": "def new\n @motor_search = Motor::Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @motor_search }\n end\n end", "title": "" }, { "docid": "66df7973fc915243a099ff058eba283b", "score": "0.6587502", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68247f5fc8032dd6d29388f961c5794b", "score": "0.6584584", "text": "def new\n @search = Search.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @search }\n end\n end", "title": "" }, { "docid": "981a35ba595e60554f317bda91de6456", "score": "0.6571225", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search}\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "958067c56f4a8f9fa25e6a91bfa655fb", "score": "0.6557778", "text": "def new\n @t_search = TSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @t_search }\n end\n end", "title": "" }, { "docid": "93850d9db01142c00de91a3a72bc621a", "score": "0.65482706", "text": "def new\n @collection = Collection.new\n @books = Book.search(params[:q])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "title": "" }, { "docid": "1b9cc4be434db7813a92a500568c86d8", "score": "0.6539823", "text": "def new\n @search_concept = SearchConcept.new(:parent_id => params[:parent_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_concept }\n end\n end", "title": "" }, { "docid": "af721cd8c85837f4f863c7a5cc8f73ae", "score": "0.6536236", "text": "def new\n @searchonproject = Searchonproject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @searchonproject }\n end\n end", "title": "" }, { "docid": "2dffef85e1b18b784304671583084fa1", "score": "0.65276", "text": "def create_saved_search(query)\n post(\"/saved_searches/create\", :query => query)\n end", "title": "" }, { "docid": "40d0bd4ec4ef54f5b295f784023af48a", "score": "0.6521648", "text": "def new\n @gene_search = GeneSearch.new(name: Time.now.strftime('%d/%m/%Y-%H:%M:%S'))\n respond_with(@gene_search)\n end", "title": "" }, { "docid": "f9a275856246f9e556225e8b41b69470", "score": "0.651782", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n# format.xml { render :xml => @search }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.65174544", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "65451527b8116532fb6131406790c1e0", "score": "0.65147734", "text": "def create\n SearchesForm.new(search_params).save\n\n respond_to do |format|\n format.html { redirect_to after_write_path }\n format.json { render :show, status: :created, location: @search }\n end\n end", "title": "" }, { "docid": "4e1ff2457ae100a5f46525440bdb2b90", "score": "0.6503195", "text": "def new\n @search = Search.new\n @puns = [[\"I used to be so cool.\",\"Runaway Fridge\"],\n [\"Quick, or you'll never catch me!\",\"Runaway Fridge\"],\n [\"Buy someone a fridge for Christmas and watch their face light up when they open it!\",\n \"Runaway Fridge\"],\n [\"Facebook is like a fridge. When you're bored, you keep opening and closing it every few minutes to see if there's anything good in it.\",\n \"Runaway Fridge\"],\n [\"The Arctic Monkeys are hiding inside me.\",\"Runaway Indie Fridge\"],\n [\"Try as you might, but you can't catch me.\",\"Runaway Fridge\"]]\n\n #respond_to do |format|\n # \n # format.html \n # format.json { render json: @search }\n # end\n end", "title": "" }, { "docid": "a463d933e9db7ef7b4af190c72f6d781", "score": "0.65027934", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a463d933e9db7ef7b4af190c72f6d781", "score": "0.65027934", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a463d933e9db7ef7b4af190c72f6d781", "score": "0.65027934", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a463d933e9db7ef7b4af190c72f6d781", "score": "0.65027934", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ae3fd74d14ca4b0f7c3fbc9db569462", "score": "0.64975214", "text": "def new\n @product_search = ProductSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @product_search }\n end\n end", "title": "" }, { "docid": "b6a3c44f6e617bbb08ceba356fa99bb8", "score": "0.64972955", "text": "def new\n @search = Search.create\n @search.text = params[:q] || 'random'\n @search.save\n redirect_to search_path(@search.id)\n end", "title": "" }, { "docid": "a77b51a793af96352b5c23e1bffa04d5", "score": "0.6496847", "text": "def new\n if current_user\n @new_seach = Search.find_or_create_by(input: params[:auto], user_id: current_user.id)\n respond_to do |format|\n format.html {redirect_to :root}\n format.js {}\n end\n else\n respond_to do |format|\n format.html {redirect_to :root}\n format.js {} \n end\n end\n end", "title": "" }, { "docid": "6be325d7f27b9b97d7c53940fdf199b6", "score": "0.6493081", "text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to new_search_path(:pane => 'pane3', :search_id => @search.id) }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2604d157da5e13e7830b16d8dda2d32", "score": "0.6485286", "text": "def new\n @query = Query.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query }\n end\n end", "title": "" }, { "docid": "d2604d157da5e13e7830b16d8dda2d32", "score": "0.6485286", "text": "def new\n @query = Query.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query }\n end\n end", "title": "" }, { "docid": "d34018779c77d6fd090d194c045ffc41", "score": "0.6471425", "text": "def create\n @search = Search.new(search_params)\n @providers = search_providers\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d35780f340868c9ec26f8a5c52c8d44", "score": "0.64651924", "text": "def new\n @book_search_history = BookSearchHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_search_history }\n end\n end", "title": "" }, { "docid": "acf226bb2dfd5f1d3ce45920caffc8d6", "score": "0.6463563", "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": "35debba1344a67bffd4f636e0b1d11d2", "score": "0.6459633", "text": "def new\n @query = Query.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @query }\n end\n end", "title": "" }, { "docid": "35debba1344a67bffd4f636e0b1d11d2", "score": "0.6459633", "text": "def new\n @query = Query.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @query }\n end\n end", "title": "" }, { "docid": "eac825de279fcaef6f1fcf42aa90921a", "score": "0.64577407", "text": "def new\n @search_index = SearchIndex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @search_index }\n end\n end", "title": "" }, { "docid": "6e96224bc1815a44b7b765e244270f3f", "score": "0.6457683", "text": "def new\n @search = Search.new\n @location = request.location.city\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search }\n end\n end", "title": "" }, { "docid": "6891bf422fd10fc2310c72b49d6de18d", "score": "0.6457075", "text": "def new\n @finding = Finding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finding }\n end\n end", "title": "" }, { "docid": "6891bf422fd10fc2310c72b49d6de18d", "score": "0.6457075", "text": "def new\n @finding = Finding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finding }\n end\n end", "title": "" }, { "docid": "49b4ab7e5ba7d2468422c06d358e8f61", "score": "0.64560306", "text": "def new\n #need a hack to check if you have an older query\n if session[:last_query]\n @query = Query.new(session[:last_query])\n session[:last_query] = nil\n else\n @query = Query.new\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query }\n end\n end", "title": "" }, { "docid": "f35e4882e1e2e9f0954ccfb0c7fab50f", "score": "0.6453121", "text": "def create\n @search = Search.new(searches_params)\n\n if @search.save\n render :show\n end\n end", "title": "" }, { "docid": "3a4a89dc5abbf61e24c226a0d302db21", "score": "0.6451068", "text": "def new\n @lost_found = LostFound.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lost_found }\n end\n end", "title": "" }, { "docid": "80d6e3a1099ca74e1baa14c2bd21bf90", "score": "0.64464766", "text": "def new\n @find = Find.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @find }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6436722", "text": "def new\n json_404\n end", "title": "" }, { "docid": "5e89a1271635941bc56baefbdca33340", "score": "0.6427631", "text": "def new\n @opsearch = Opsearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @opsearch }\n end\n end", "title": "" }, { "docid": "922eefbb3ab06385c06b9c148346f1cf", "score": "0.64111716", "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": "f9d0ca6e2929be7fd5cf2f61ae7c5a97", "score": "0.6408602", "text": "def new\n @yt_search_result = YtSearchResult.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @yt_search_result }\n end\n end", "title": "" }, { "docid": "77bb1e69a926bef73888ba0e173857ed", "score": "0.63818234", "text": "def create\n Search.create\n @search = Search.new(search_params)\n respond_to do |format|\n if @search.save\n @results = search(@search.term, @search.location)\n if @results == nil\n format.html { render :new, notice: 'No options available with particular request' }\n format.json { redirect_to :new, notice: 'No options available with particular request' }\n else\n format.html { redirect_to @search, notice: '' }\n format.json { render :show, status: :created, location: @search }\n end\n else\n format.html { render :new }\n format.json { redirect_to :new, notice: 'No options available with particular request' }\n end\n end\n end", "title": "" }, { "docid": "69fcecb5d5eaaf40ec8b2cedc3a2ca4c", "score": "0.63760597", "text": "def create_search(params = {})\n post(\"/searches\", params)\n end", "title": "" }, { "docid": "9946eb048935a214116da7de3bc8c421", "score": "0.6340055", "text": "def new\n @keyword = Keyword.new\n @title = 'New Keyword'\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "dc9f3f5e24341821e6ab0a3314825857", "score": "0.6320872", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @index }\n end\n end", "title": "" }, { "docid": "999fdd60e4ac29099dd03f3dc5e2d955", "score": "0.6319913", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n #format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.html { redirect_to @search }\n format.json { render action: 'edit', status: :created, location: @search }\n else\n format.html { render action: 'new' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "412fab05da8fd9b5d70c8aff4c07d53d", "score": "0.63147724", "text": "def new\n @term = @glossary.terms.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "e435899818133a7d4acbdb0d16226879", "score": "0.63091755", "text": "def new\n @hot_search = HotSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hot_search }\n end\n end", "title": "" }, { "docid": "198a213650ceb7acfa7c03a5cbfc60ed", "score": "0.6306801", "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": "198a213650ceb7acfa7c03a5cbfc60ed", "score": "0.6306801", "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": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752e546225fce80c52162a689183684f", "score": "0.63031805", "text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f38cb9c0a2a006828574913e9e95185a", "score": "0.6299587", "text": "def new\n # recipes = BigOvenService.search_recipes\n # render json: recipes\n \n # BigOvenService.get_recipe(params[:id])\n \n # @ingredients = Ingredient.all\n # render json: @ingredients\n # render json: BigOvenService.search_recipes(params[:term])\n end", "title": "" }, { "docid": "67c69fa2293cfbd2aa811b9dcfcd7451", "score": "0.6298261", "text": "def new\n @save_query = SaveQuery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @save_query }\n end\n end", "title": "" }, { "docid": "5da16b2c91298b65822f602999d1754d", "score": "0.6291385", "text": "def new_stories\n get('/newstories.json')\n end", "title": "" }, { "docid": "7e18cbde0e46533965cba94ad7988312", "score": "0.6290264", "text": "def new\n if params[:model] && params[:query]\n _model = params[:model].capitalize.constantize\n if _model.searchable?\n res = _model.search do\n if params[:qfields]\n _fields = params[:qfields].split\n keywords params[:query] do\n fields(*_fields)\n end\n else\n keywords params[:query]\n end\n \n paginate :page => 1, :per_page => params[:num] || 10\n end\n \n render :json => result_to_render(res)\n else\n render :status => :bad_request, :json => {:message => \"#{_model.to_s} not searchable\"}\n end\n else\n render :status => :bad_request, :text => 'Missing model or query or both parameters'\n end\n end", "title": "" } ]
430f02ad0cb8f2337ca8d3c4b4a1db67
GET /flaws/1 GET /flaws/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1ff028f3b572cba2d44b5fdb28d5c87b", "score": "0.68988436", "text": "def show\n @flaw = Flaw.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flaw }\n end\n end", "title": "" }, { "docid": "e41530510645b300f61ee53dc399c825", "score": "0.66920906", "text": "def index\n @flaws = Flaw.order(\"date DESC, created_at DESC\").page( params[:page] ).per(10)\n \n @flaw = Flaw.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @flaws }\n end\n end", "title": "" }, { "docid": "9ec843055c82cf6842259a4a8d626080", "score": "0.66241246", "text": "def flights\n trip = Trip.where('id = ?', params[:id]).take\n if !trip.nil\n respond_with( trip.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "title": "" }, { "docid": "f39e0c9cc796d9e66c382d84ec69297a", "score": "0.6588951", "text": "def index\n @flights = Flight.all\n render json: @flights\n end", "title": "" }, { "docid": "32b359c1e88a70d212eeb598b69121be", "score": "0.64847237", "text": "def show\n @flight = Flight.find(params[:id])\n render json: @flight\n end", "title": "" }, { "docid": "76fae392847ff2f1aa59ca2adfb00071", "score": "0.63231975", "text": "def index\n @filials = Filial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @filials }\n end\n end", "title": "" }, { "docid": "e5adb0a8d4baae4e86cc55d1ea90fc2d", "score": "0.62906295", "text": "def show\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flight }\n end\n end", "title": "" }, { "docid": "e5adb0a8d4baae4e86cc55d1ea90fc2d", "score": "0.62905246", "text": "def show\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flight }\n end\n end", "title": "" }, { "docid": "644c8626c7f7b3430ed99d7d5f0429f0", "score": "0.6284665", "text": "def show\n @foam = Foam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foam }\n end\n end", "title": "" }, { "docid": "0be002f370fe9217e9aa92b5e8625c15", "score": "0.6266196", "text": "def index\n @fretes = Frete.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fretes }\n end\n end", "title": "" }, { "docid": "b41d35e5000d6133607ac2804dd24a46", "score": "0.62216806", "text": "def index\n @flaws = Flaw.all\n end", "title": "" }, { "docid": "1eea555a8392c70467daad0ab9aa85c4", "score": "0.6210435", "text": "def index\n\t\t@flights = Flight.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @flights }\n\t\tend\n\tend", "title": "" }, { "docid": "4a5717abd1740ef5706d67c4a6542c05", "score": "0.6186577", "text": "def index\n @factions = Faction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @factions }\n end\n end", "title": "" }, { "docid": "3dc1a030f843d0003652e899ef44ac95", "score": "0.6159909", "text": "def show\n begin\n @fucker = Fucker.find(params[:id])\n respond_to do |format|\n format.json { render json: @fucker }\n end\n rescue => err\n $log.warn(err)\n respond_to do |format|\n format.json { render json: err, status: :internal_server_error }\n end\n end\n end", "title": "" }, { "docid": "659a86aa36275cdf6a469d78d86146a3", "score": "0.6158057", "text": "def show\n @foil = Foil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foil }\n end\n end", "title": "" }, { "docid": "0de35831f7d677c5b200daa818ca23f9", "score": "0.6115625", "text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end", "title": "" }, { "docid": "f4ccc57eacafde3fe5ee9a74e61ce69e", "score": "0.6102044", "text": "def show\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fortune }\n end\n end", "title": "" }, { "docid": "389d28c5b88088cc8fb84612bd827576", "score": "0.6096304", "text": "def show\n\t\t@flight = Flight.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @flight }\n\t\tend\n\tend", "title": "" }, { "docid": "2ea137c123f44a6dabe8da128f10c671", "score": "0.60583514", "text": "def index\n weathers = Weather.all\n render json: weathers, status: 200\n end", "title": "" }, { "docid": "cda03cc31dd3a80a1f2de42a9a8fcab9", "score": "0.6054249", "text": "def index\n\t @fares = Fare.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @fares }\n\t end\n\tend", "title": "" }, { "docid": "581e6d84718c049621389d637cc7fa66", "score": "0.60247135", "text": "def show\n @favorite_flyer = FavoriteFlyer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favorite_flyer }\n end\n end", "title": "" }, { "docid": "59b5ab2b8f7040389c99185a978c3dda", "score": "0.60069144", "text": "def index\n @lights = Light.all\n\n render json: @lights\n end", "title": "" }, { "docid": "fb368db7b687452d242f7c6be113e630", "score": "0.6003764", "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": "6da163daab8ed87f894acfc356fb4572", "score": "0.60029304", "text": "def flights(params={})\n perform_get('/flights.xml', params)\n end", "title": "" }, { "docid": "85886e3e514e7c17f88f11f44b0dbe70", "score": "0.6000404", "text": "def show\n @fred = Fred.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fred }\n end\n end", "title": "" }, { "docid": "9070fd68a2dd1f7a4d58b48cfecfc4d9", "score": "0.5992447", "text": "def index\n render json: @fiestas\n end", "title": "" }, { "docid": "d8594fbe597973afc90a416d3a68f7ea", "score": "0.5980857", "text": "def show\n @filial = Filial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @filial }\n end\n end", "title": "" }, { "docid": "9bbefe899b6d5bb26032ddbb3d2cdfa3", "score": "0.59770715", "text": "def flights\n result = Search.search_flights(params)\n if result\n # The search gave us something so we can return it\n render json: result\n else\n # Something went wrong, return a 500 error with no body\n render status: 500, json: nil\n end\n end", "title": "" }, { "docid": "e157caa55aae98ebd6e668a5db54ac16", "score": "0.5959159", "text": "def index\n @foodhampers = Foodhamper.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foodhampers }\n end\n end", "title": "" }, { "docid": "e8ba3f7c63122a350fa822c388f7764e", "score": "0.59590954", "text": "def show\n @faction = Faction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @faction }\n end\n end", "title": "" }, { "docid": "aac1dd06dee995d1540ad5467fc482b2", "score": "0.59514266", "text": "def show\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end", "title": "" }, { "docid": "bdd979994b764bfed5dfeb5dd5d15450", "score": "0.5944616", "text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funerals }\n end\n end", "title": "" }, { "docid": "0a1d0ac4d25875d8fc731c4a715fc360", "score": "0.5936971", "text": "def index\n @spoofers = Spoofer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spoofers }\n end\n end", "title": "" }, { "docid": "16fb6b46fab03c4b75697f65a91b5b34", "score": "0.59220856", "text": "def show\n @flsa_result = FlsaResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flsa_result }\n end\n end", "title": "" }, { "docid": "10966254d0a21635dea1be19c0605abc", "score": "0.5918774", "text": "def show\n @foiltype = Foiltype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foiltype }\n end\n end", "title": "" }, { "docid": "dc7fc4c05f5786ff4f7a473ad61676db", "score": "0.58876485", "text": "def show\n @fluxomatricula = Fluxomatricula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fluxomatricula }\n end\n end", "title": "" }, { "docid": "39ad35749e8082dcb68b3aa0d8be4566", "score": "0.5882653", "text": "def index\n @dev_folios = DevFolio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dev_folios }\n end\n end", "title": "" }, { "docid": "9d0dd0078d6c6c3439e339de67a5cd25", "score": "0.5869424", "text": "def lws_api_get(path)\n options = {headers: solr_headers}\n response = HTTParty.get(\"#{FlareConfig.lws_api_url}#{path}\", options)\n Rails.logger.info(\"RESPONSE CODE: #{response.code}\")\n if response.code == 200\n result = JSON.parse(response.body)\n else\n nil\n end\n end", "title": "" }, { "docid": "ddfdcaf3bce01272174b5a08926c3e7e", "score": "0.5857444", "text": "def show\n # @foaf = Foaf.find(:id)\n respond_to do |format|\n format.html { render layout: false }#text: convert_one_to_rdf(@foaf, :html) }\n format.ttl { render text: convert_one_to_rdf(@foaf, :ttl) }\n format.rj { render text: convert_one_to_rdf(@foaf, :json) }\n format.nt { render text: convert_one_to_rdf(@foaf, :ntriples) }\n format.rdf { render text: convert_one_to_rdf(@foaf, :rdf) }\n format.jsonld { render text: convert_one_to_rdf(@foaf, :jsonld) }\n end\n end", "title": "" }, { "docid": "dd5a521d960e3460371f73b43329d3b3", "score": "0.5855923", "text": "def index\n @api_v1_todos = Todo.all\n render json: @api_v1_todos\n end", "title": "" }, { "docid": "54315f4db223c2e140a07359096733f2", "score": "0.58526176", "text": "def index\n @features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end", "title": "" }, { "docid": "41181acd6ccbd64922de62440ac4c039", "score": "0.5847775", "text": "def index\n @foams = Foam.order(\"lower(name) ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foams }\n end\n end", "title": "" }, { "docid": "12f88d72e996f542cd1110d6bf3981d8", "score": "0.58423805", "text": "def index\n @flights = Flight.all\n\n respond_to do |format|\n format.html \n format.json { render json: @flights, :include => [:airplane, :reservations, :users, :seats] }\n end\n end", "title": "" }, { "docid": "a9f161414b0751917a588c85cdc1d877", "score": "0.5829065", "text": "def film_api(url)\n film_response = RestClient.get(url)\n film_hash = JSON.parse(film_response)\nend", "title": "" }, { "docid": "c180f2d4adba01e5290f1e75bbadf22c", "score": "0.5826856", "text": "def show\n @futbolada = Futbolada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @futbolada }\n end\n end", "title": "" }, { "docid": "56bee4bfaea388dab2d32e3dcc9bfa41", "score": "0.5824977", "text": "def show\n @foodhamper = Foodhamper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foodhamper }\n end\n end", "title": "" }, { "docid": "53d8f66056b401bf533988d967eea6ef", "score": "0.5823526", "text": "def favorite_foods\n get(\"/user/#{@user_id}/foods/log/favorite.json\")\n end", "title": "" }, { "docid": "ba93c3fdeabe9e6d65cbd05e29148149", "score": "0.58212495", "text": "def index\n @flashlights = Flashlight.all\n end", "title": "" }, { "docid": "cd2367b4d59a8f984e25507754ed676d", "score": "0.5811822", "text": "def show\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farm }\n end\n end", "title": "" }, { "docid": "9a3c1e2e6ccad29e8ac70b01516e6a4b", "score": "0.5810623", "text": "def index\n @fundamental_guilds = Fundamental::Guild.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_guilds }\n end\n end", "title": "" }, { "docid": "cc762e801e3552e046799128553afee1", "score": "0.5810174", "text": "def lws_api_get(path)\n # See also catalog_controller for use of ENV['LWS_...']\n url ||= ENV['LWS_API_URL']\n url ||= \"#{ENV['LWS_CORE_URL']}/api\" if ENV['LWS_CORE_URL']\n \n # http://localhost:8888/api/collections\n resp = Net::HTTP.get_response(URI.parse(\"#{url || 'http://127.0.0.1:8888/api'}#{path}\"))\n result = JSON.parse(resp.body)\n end", "title": "" }, { "docid": "8f9bf6331d542e86aabeb64956867cd8", "score": "0.58089334", "text": "def show\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golfer }\n end\n end", "title": "" }, { "docid": "16dd2e70c37db979ea2d8e3ae7de68ab", "score": "0.5808389", "text": "def index\n @futboladas = Futbolada.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @futboladas }\n end\n end", "title": "" }, { "docid": "71a6d11712221b186dae659947830e64", "score": "0.58008933", "text": "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end", "title": "" }, { "docid": "518b5dc87a7166e879919aec0c4840c2", "score": "0.58007056", "text": "def show\n @scaff = Scaff.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scaff }\n end\n end", "title": "" }, { "docid": "5d8e303467680de3f76125a4fa988b9f", "score": "0.57971436", "text": "def show\n @flights = Flight.find(params[:id])\n \n respond_to do |format|\n format.html \n format.json { render json: @flights, :include => :airplane} \n end\n end", "title": "" }, { "docid": "cc0c673e8a87a133061d32f32a843eee", "score": "0.5793447", "text": "def show\n @kf_status = Kf::Status.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_status }\n end\n end", "title": "" }, { "docid": "b359ff21da38d2b496d8de57a18bb9d5", "score": "0.5793426", "text": "def show\n @frete = Frete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frete }\n end\n end", "title": "" }, { "docid": "2d7c1fc7ab28832c6239028111bd8af7", "score": "0.57928765", "text": "def index\n @foafs = Foaf.all\n # if all else fails, make RDF then\n # rapper -o dot -i turtle me.ttl | dot -Tsvg -o me.svg\n respond_to do |format|\n format.html #{ render text: convert_one_to_rdf(@foaf, :html) }\n format.ttl { render text: convert_many_to_rdf(@foafs, :ttl) }\n format.rj { render text: convert_many_to_rdf(@foafs, :json) }\n format.nt { render text: convert_many_to_rdf(@foafs, :ntriples) }\n format.rdf { render text: convert_many_to_rdf(@foafs, :rdf) }\n format.jsonld { render text: convert_many_to_rdf(@foafs, :jsonld) }\n end\n end", "title": "" }, { "docid": "520c3312534507da5d1311fb70eb0e77", "score": "0.57812655", "text": "def show\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taf }\n end\n end", "title": "" }, { "docid": "ca8adb11a43e7cfc19a6d7c1b0b6e958", "score": "0.57810104", "text": "def show\n @dataload_ftp = DataloadFtp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataload_ftp }\n end\n end", "title": "" }, { "docid": "4a12fd0a204711e3f55c5676318d058c", "score": "0.5780565", "text": "def index\n @ftypes = Ftype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ftypes }\n end\n end", "title": "" }, { "docid": "19daa41f4c3bd02ce2d231929e5cbe78", "score": "0.57785445", "text": "def show\n @fulcliente = Fulcliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fulcliente }\n end\n end", "title": "" }, { "docid": "76c7e37c80232cf6cfce725a3dd2986e", "score": "0.5777912", "text": "def show\n\n respond_to do |format|\n format.html { # show.html.erb\n @flyer_info = FlyerInfo.find(params[:id])\n }\n format.json {\n render json: getflyer(params[:id])\n }\n end\n\n end", "title": "" }, { "docid": "0328f87e23315a99ab5b1ec5e3a0d751", "score": "0.5775234", "text": "def index\n @foros = Foro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foros }\n end\n end", "title": "" }, { "docid": "9c26d710a25b97cfd0ad05fcc821c9c6", "score": "0.5774445", "text": "def show\n @fishing_method = FishingMethod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fishing_method }\n end\n end", "title": "" }, { "docid": "3ad6a5770f00879ce356dcc78673513d", "score": "0.57686317", "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": "d8d4d4fef7308700e632075f5d3fc76e", "score": "0.57637274", "text": "def index\n @housing_features = HousingFeature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @housing_features }\n end\n end", "title": "" }, { "docid": "e1747d03966bd47c6a07da304f073c62", "score": "0.5751556", "text": "def show\n @flat_happening = FlatHappening.find(params[:id])\n\n render json: @flat_happening\n end", "title": "" }, { "docid": "c683cc0518901dac224c875c133776a6", "score": "0.5750459", "text": "def show\n #show all kind categories\n @categories = Category.where(:category_id => params[:id])\n @freds = Fred.where(:category_id => params[:id]).order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "fb3a34c09b0fca2cd6e6dd78cc8d1e8b", "score": "0.5737469", "text": "def show\n @favourite_food = FavouriteFood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favourite_food }\n end\n end", "title": "" }, { "docid": "0d03ec54c55376768467f1cb59b4fa77", "score": "0.5737212", "text": "def show\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "df4ab5851494b704e284899fc576c837", "score": "0.57348305", "text": "def show\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end", "title": "" }, { "docid": "0304e27d76f34cdab30d139f6f30eb01", "score": "0.57346636", "text": "def index\n @cfos = Cfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cfos }\n end\n end", "title": "" }, { "docid": "21ec62b145b846fb79ccb3fe133cfdf4", "score": "0.5732369", "text": "def show\n\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end", "title": "" }, { "docid": "1fd41ee290c6b57ee75ba3adabde4295", "score": "0.5730183", "text": "def show\n @fish_type = FishType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fish_type }\n end\n end", "title": "" }, { "docid": "b7fbcdc7f3ff76d41d411fc6693ece08", "score": "0.57270443", "text": "def show\n @forest = Forest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @forest }\n end\n end", "title": "" }, { "docid": "1b84323af632f75c1ea4567aada552d0", "score": "0.57261276", "text": "def index\n @funs = Fun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @funs }\n end\n end", "title": "" }, { "docid": "4153522aaaaa4f2f801612b5683fa26d", "score": "0.57242846", "text": "def index\n @fights = Fight.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fights.to_json( :include => { :field_initial => { :only => [:name] }, :field_actual => { :only => [:name] }, :category => { :only => [:name] }, :competitor_blue => { :only => [:last_name, :lot_number] }, :competitor_red => { :only => [:last_name, :lot_number] }, :competitor_winner => { :only => [:last_name, :lot_number] }, :previous_fight_blue => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } }, :previous_fight_red => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } } } ) }\n end\n end", "title": "" }, { "docid": "230ff0a4adf6e32c009832ae7c2e14ac", "score": "0.57227653", "text": "def show\n @favourite_listing = get_favourite_listing(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favourite_listing }\n end\n end", "title": "" }, { "docid": "eaaea33adfbc18397619416013e9cf7d", "score": "0.57186633", "text": "def show\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spoofer }\n end\n end", "title": "" }, { "docid": "c04f23e1de2a97e66552c3387a01410a", "score": "0.57173705", "text": "def index\n head 404\n # @api_v1_followers = Api::V1::Follower.all\n\n # render json: @api_v1_followers\n end", "title": "" }, { "docid": "11064a2e6428e301ebf9ad6a868d8481", "score": "0.5714929", "text": "def show\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature }\n end\n end", "title": "" }, { "docid": "8d22a475d7494e00394dcc7b24723214", "score": "0.57137346", "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": "278edeee4a3deb93bcd3aa0b31affac1", "score": "0.5711749", "text": "def show\n @butterfly = Butterfly.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @butterfly }\n end\n end", "title": "" }, { "docid": "5d6ff0b14686bfeda8f95c2321418bcd", "score": "0.5705599", "text": "def index \n fans = Fan.all \n render json: fans \n end", "title": "" }, { "docid": "52fd9899b2b435ad617733465f6d45c6", "score": "0.56930447", "text": "def show\n @foodlog = Foodlog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @foodlog }\n end\n end", "title": "" }, { "docid": "5928468f0bf087b503a022f1608ca11d", "score": "0.568673", "text": "def index\n @funds = Fund.all\n\n render json: @funds\n end", "title": "" }, { "docid": "c4a5fac8ea55251d67b26c2bfd9aa157", "score": "0.5682675", "text": "def show\n @webling = Webling.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @webling }\n end\n end", "title": "" }, { "docid": "c6f18bb3540dcc26722032149e93aed5", "score": "0.56660855", "text": "def index\n @flights = Flight.all\n end", "title": "" }, { "docid": "c6f18bb3540dcc26722032149e93aed5", "score": "0.56660855", "text": "def index\n @flights = Flight.all\n end", "title": "" }, { "docid": "0bcb417ff81b2eb2d4fd2a071b0b161d", "score": "0.566598", "text": "def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end", "title": "" }, { "docid": "d9bce976d79bd9c5a1a543bc0f3481ef", "score": "0.56638104", "text": "def index # USER ACTION: LIST ALL FLATS\n end", "title": "" }, { "docid": "eafb611e834a77202f159fc133a348bd", "score": "0.5653453", "text": "def show\n begin\n @dev_folio = DevFolio.find(params[:id])\n rescue\n @dev_folio = DevFolio.where(label: params[:id]).first()\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dev_folio }\n end\n end", "title": "" }, { "docid": "d51571d32ef1a03ad70dcfe192551676", "score": "0.5650032", "text": "def index\n @frais_hebergements = FraisHebergement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_hebergements }\n end\n end", "title": "" }, { "docid": "d9f9a60cb27b73d9d62932be97bffd31", "score": "0.5645067", "text": "def get_movies_from_api\n all_films = RestClient.get('http://www.swapi.co/api/films/')\n film_hash = JSON.parse(all_films) \nend", "title": "" }, { "docid": "bf3a5c717209ac6419ccbfecfceae497", "score": "0.56374973", "text": "def show\n @staffer = Staffer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @staffer }\n end\n end", "title": "" }, { "docid": "a307721b9d8d32b9f7c7a346573d6a44", "score": "0.5633401", "text": "def show\n @fav = Fav.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fav }\n end\n end", "title": "" }, { "docid": "bfdc2462c3c7c30ef630682ed352fbeb", "score": "0.5630832", "text": "def show\n @layers = Layer.where(:soil_id => params[:id])\n respond_to do |format|\n\t redirect_to @layers\n format.json { render json: @layers }\n end\n end", "title": "" }, { "docid": "ad4b721b5e35f3529ae0d0c9608d28a5", "score": "0.5630391", "text": "def index\n @flights = Flight.all\n\n end", "title": "" }, { "docid": "ffb8f1d76420f851eb5ce293a8e5ce99", "score": "0.562877", "text": "def show\n @webhook = Webhook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @webhook }\n end\n end", "title": "" } ]
478b971639d261d9f00e30f61ae1e743
Used to generate a random string of 10(subject to change) characters and format the plaintext, ciphertext and comment in a way so that the server understands the structure of the string.
[ { "docid": "931176f7da79ad5c29d90f34f0b125ba", "score": "0.69841814", "text": "def rand_string(client)\n str = \"\"\n\n # Generates a random english word of length 4-6 alphabets\n while str.length < 4 or str.length > 6\n str = 1.word\n end\n\n # Asking for cipher from EaaS\n client.puts \"\\n************************************************\\n\"\n client.puts \"Your random string is - #{str}\"\n client.puts \"Enter your ciphertext -\"\n cipher = client.gets.chomp\n\n # Taking comment input\n client.puts \"Enter a comment -\"\n comment = client.gets.chomp\n\n # Generation of hash to return\n return_obj = {};\n return_obj['type'] = \"cipher\"\n return_obj['plain'] = str\n return_obj['cipher'] = cipher\n return_obj['comment'] = comment\n\n return return_obj\n end", "title": "" } ]
[ { "docid": "8661c39deb3d774e5d5c9c71ce7e128b", "score": "0.6752723", "text": "def generate_string\n (0...6).map{(65+rand(26)).chr}.join\n end", "title": "" }, { "docid": "46506b3cd015016c8eed0be278cc20ec", "score": "0.6677226", "text": "def random_string\n letters = [['!','\"','$','&',';','@'],\n ('a'..'z').to_a,\n ('A'..'Z').to_a,\n ('0'..'9').to_a].flatten\n (1..16).map { |i| letters[ rand(letters.length) ] }.join\n end", "title": "" }, { "docid": "d16ec3120395ca4dd9ad2e2757f6e451", "score": "0.6530472", "text": "def random_string(size=25)\n (1..size).collect { (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }.join\n end", "title": "" }, { "docid": "38b872d70c9f464dcb081f998e2cee86", "score": "0.6525547", "text": "def qt_monkey_random_text \n return '\"generated: \" << (\"random\" * rand(5)) << ( \"text\" * rand(5))' \n end", "title": "" }, { "docid": "4e4beda6986deca3d7922aa69c485849", "score": "0.64983344", "text": "def random_string\n (0...8).map { (65 + rand(26)).chr }.join\n end", "title": "" }, { "docid": "ee2f59a8ed77bb8c125a08332608e205", "score": "0.6457843", "text": "def get_random_message()\n\t\topening = [ \"Developer Portfolio\",\n \t\t\"My Rails 4 Portfolio\",\n \t\t\"Hello World\" ]\n\n\t\tmiddle = [ \"Built from the Rails Tutorial\",\n \t\t\"Rails Apps Are Great\",\n \t\t\"Rails Twitter clone App\" ]\n\n\t\tending = [ \"Contact us if you need help.\",\n \t\t\"We are here to server you. \",\n \t\t\"Call us if you need to 412-555-1212.\"]\n\n\t\t\"#{opening[rand(3)]}\"\n\n\tend", "title": "" }, { "docid": "06415080eb8e4e7e5d0dca8ea5d6dcf7", "score": "0.64568794", "text": "def ran_str_maker\r\n length = 10\r\n ran_str = rand(36**length).to_s(36)\r\n return ran_str\r\nend", "title": "" }, { "docid": "563768b144266c56a57c978debe29295", "score": "0.6444561", "text": "def qt_monkey_random_text\n return '\"generated: \" << (\"random\" * rand(5)) << ( \"text\" * rand(5))'\n end", "title": "" }, { "docid": "79ddd65e42bf870a40d6926fceeb5128", "score": "0.6394616", "text": "def generate_password\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z @ # $ & ! }\n (0...6).map{ charset.to_a[rand(charset.size)] }.join\n end", "title": "" }, { "docid": "e1fe9a5f7359a0b6a27cc565f66c2b3e", "score": "0.63930243", "text": "def get_text(random, alphabet = 'abcdefghijklmnopqrstuvwxyz', character_count = 6)\n if character_count < 1 || character_count > 16\n raise \"Character count of #{character_count} is outside the range of 1-16\"\n end\n\n input = \"#{@secret}#{random}\"\n\n if alphabet != 'abcdefghijklmnopqrstuvwxyz' || character_count != 6\n input << \":#{alphabet}:#{character_count}\"\n end\n\n bytes = Digest::MD5.hexdigest(input).slice(0..(2*character_count - 1)).scan(/../)\n text = ''\n\n bytes.each { |byte| text << alphabet[byte.hex % alphabet.size].chr }\n\n text\n end", "title": "" }, { "docid": "bbc8be1b1cab42d4066e3a6a56ec956e", "score": "0.6392264", "text": "def rand_text(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text(length, bad)\n end\n end", "title": "" }, { "docid": "5fa77e6f10009572283931d7392062f0", "score": "0.63918924", "text": "def randomString\r\n\t(0...8).map{(65+rand(26)).chr}.join\r\nend", "title": "" }, { "docid": "689d995e90f06104ae5221f30a1b32a1", "score": "0.6388229", "text": "def to_s\n return \"This is a random text generator!\"\n end", "title": "" }, { "docid": "6dbd869b5a250d799dbc6afecd04b812", "score": "0.63502043", "text": "def random_string\n (0...100).map { (\"a\"..\"z\").to_a[rand(26)] }.join\n end", "title": "" }, { "docid": "6dbd869b5a250d799dbc6afecd04b812", "score": "0.63502043", "text": "def random_string\n (0...100).map { (\"a\"..\"z\").to_a[rand(26)] }.join\n end", "title": "" }, { "docid": "9b309378b7f38961742943ec412bb979", "score": "0.6348574", "text": "def randstr\n\trand(36 ** 8).to_s(36)\nend", "title": "" }, { "docid": "b98e9d156710d7f5fcb5fd19a92fa296", "score": "0.63297623", "text": "def generate_string(size)\n charset = [('a'..'z'),('A'..'Z'),(0..9)].map { |i| i.to_a }.flatten\n return (0...size).map{ charset[rand(charset.length)] }.join\n end", "title": "" }, { "docid": "d6a8039c217645d06cc21d2e00f26947", "score": "0.63156897", "text": "def random_string\n\t# generate a bucket of chars for randomization\n\tbucket = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten\n\t # pick random chars from the bucket and return a 255 char string\n\treturn (0...255).map{ bucket[rand(bucket.length)] }.join\nend", "title": "" }, { "docid": "09b25a1e472d0843c9e45aa962f68faa", "score": "0.63151956", "text": "def encrypted_string\n blocks = initial_string.chars.each_slice(16).map(&:join)\n\n nonce = SecureRandom.random_bytes(8)\n counter = [0] * 8\n counter_bytes = counter.pack('C*')\n encryption = nonce + counter_bytes\n\n blocks.each do |block|\n cipher_block = block ^ encrypt_block(nonce + counter_bytes)\n encryption << cipher_block\n counter[-1] += 1\n counter_bytes = counter.pack('C*')\n end\n\n encryption\n end", "title": "" }, { "docid": "467cb95cafd7248a1fa460bda1b9f504", "score": "0.62956727", "text": "def randStr()\n str = \"\"\n 5.times { str << (65 + rand(26)).chr }\n return str\nend", "title": "" }, { "docid": "7f130878de8ce250f823a5b1e41a6fbd", "score": "0.629295", "text": "def generateRandomString ()\n return SecureRandom.hex(4)\nend", "title": "" }, { "docid": "d08687ad26174ea3b39a47c50b952f89", "score": "0.62895435", "text": "def rand_text_alphanumeric(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text_alphanumeric(length, bad)\n end\n end", "title": "" }, { "docid": "8ead50254927a64faaa74734d3cf8da2", "score": "0.6266742", "text": "def generate(len = 5)\n @str = ''\n \n len.times do\n i = rand(@@CHARS.size)\n @str += @@CHARS[i]\n end\n \n @str\n end", "title": "" }, { "docid": "884f092ef19ca9b81aaff6cbdb0fbc7f", "score": "0.62455076", "text": "def random_str()\n p (0...5).map { (65 + rand(26)).chr }.join\nend", "title": "" }, { "docid": "a4079510ff2768a13a39f3bedbba7dfc", "score": "0.6228343", "text": "def generate_secure_token_string\n SecureRandom.urlsafe_base64(25).tr('lIO0', 'sxyz')\n end", "title": "" }, { "docid": "8eab1c6ec1ecb971fabdb07185dc11e7", "score": "0.62277764", "text": "def random_nick() (0..8).map { rand(65..90).chr }.join'' end", "title": "" }, { "docid": "5ca0466fba3772bd6b4b6132644a687d", "score": "0.6221181", "text": "def random_string(len=8)\n (0...len).map{65.+(rand(25)).chr}.join\n end", "title": "" }, { "docid": "3474fc03142278e65bf9ef477bac1297", "score": "0.6202241", "text": "def generate_random_string(size = 64)\r\n charset = [('a'..'z'),('A'..'Z'),('0'..'9')].map{|i| i.to_a}.flatten; \r\n (0...size).map{ charset.to_a[rand(charset.size)] }.join\r\nend", "title": "" }, { "docid": "4adb69417f15dbe833770bb23cbe09b4", "score": "0.61980903", "text": "def get_random_string\r\n length=30\r\n source=(\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (0..9).to_a + [\"_\",\"-\"]\r\n key=\"\"\r\n length.times{ key += source[rand(source.size)].to_s }\r\n return key\r\nend", "title": "" }, { "docid": "356704e06e9b24c7e24fb7bae3c31d71", "score": "0.619766", "text": "def generate_random_id\n len = 8\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n newpass = \"\"\n 1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }\n return newpass\n end", "title": "" }, { "docid": "1719cc3ed9e5659c086586215fbca351", "score": "0.61944884", "text": "def randomString\n o = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten \n string = (1..ROOM_NAME_LENGTH).map{ o[rand(o.length)] }.join\n end", "title": "" }, { "docid": "0c3029aa6a2a18b1ef07d6a7a1346fb7", "score": "0.6194005", "text": "def rand_string(length = 10)\n\t\trand(36**length).to_s(36)\n\tend", "title": "" }, { "docid": "849e3ab01cd1d8402d4882f2c15d599b", "score": "0.6172446", "text": "def random_string(length); random_bytes(length / 2).unpack(\"H*\")[0] end", "title": "" }, { "docid": "277ac9ab2ffa1ef20b3c88a0b9c8570f", "score": "0.616832", "text": "def randHashtag()\n (0...10).map{ ('a'..'z').to_a[rand(26)] }.join\nend", "title": "" }, { "docid": "6715bf3fb88b11df0c963e71a258a75b", "score": "0.6146879", "text": "def mk_sender\n [\"-- \", \"Med kærlig hilsen, \", \"Med venlig hilsen, \", \"MVH, \", \"Hilsen \"].sample + \"Nikolaj Lepka\\n\" +\n \"Telefon: 25 14 66 83\\n\" +\n \"Email: slench102@gmail.com\\n\" +\n \"Github: https://github.com/ElectricCoffee\\n\" +\n \"Twitter: https://twitter.com/Electric_Coffee\\n\\n\"\n end", "title": "" }, { "docid": "ce56195ecfb2df593244ab6b2b748af1", "score": "0.61360747", "text": "def make_up_password\n\to = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map { |i| i.to_a }.flatten\n\tpass = (0...12).map { o[rand(o.length)] }.join + \"@\"\n\tputs \"Using #{pass} for password\\n\"\n\treturn pass\nend", "title": "" }, { "docid": "9dd1862aefedef61e43538dc90f20059", "score": "0.6135294", "text": "def random_string size \n (0..size).map { ('a'..'z').to_a[rand(26)] }.join\n end", "title": "" }, { "docid": "bdb94e4fdaa3e16ea5fe6f35df2bbaf0", "score": "0.6121313", "text": "def random_id\n \"#{('a'..'z').to_a.sample}-#{SecureRandom.alphanumeric(6)}\"\n end", "title": "" }, { "docid": "4bce962f1945384b5a458579b8f9f9ee", "score": "0.6109409", "text": "def rand_string(length = 10)\r\n rand(36**length).to_s(36)\r\n end", "title": "" }, { "docid": "fafdca0c23616b2b7cbb47a3f06e928d", "score": "0.6103698", "text": "def generate_email\n o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n email = (0...15).map{ o[rand(o.length)] }.join << \"@\" << (0...10).map{ o[rand(o.length)] }.join << \".com\"\n end", "title": "" }, { "docid": "b6c27ddaaaa2b98379ade4720686924c", "score": "0.61007893", "text": "def random_token\n 32.times.map{ rand(36).to_s(36) }.join # 32 alphanumeric characters\n end", "title": "" }, { "docid": "8f3b10ba55d54ae0278564dfdbced07a", "score": "0.60976166", "text": "def generate_password\n [*('a'..'z'), *('A'..'Z'), *('0'..'9')].sample(8).join\n end", "title": "" }, { "docid": "278fe0652ab2bbbe458c611be27643b4", "score": "0.6088232", "text": "def generate_random_string(length=8)\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n string = ''\n length.times { string << chars[rand(chars.size)] }\n return string\nend", "title": "" }, { "docid": "b3c535c792cbb46b20253c3ac4a3d386", "score": "0.6075442", "text": "def random_string2(str_length=4)\n chars = 'abcdef0123456789'\n password = ''\n str_length.times { password << chars[rand(chars.length)] }\n password\nend", "title": "" }, { "docid": "5764d5a56f9e92d7a0ed10d4fc7520fa", "score": "0.6072728", "text": "def generate_password( len = 6 )\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z a c d e g h j k m n p q r v w x y z }\n (0...len).map{ charset.to_a[rand(charset.size)] }.join\nend", "title": "" }, { "docid": "136db0e0f4b44183f55aecf52afacbc9", "score": "0.60516864", "text": "def rand_string(length = 10)\n rand(36**length).to_s(36)\n end", "title": "" }, { "docid": "a709b03488270994763eed3a0765e11c", "score": "0.60306245", "text": "def generate_random_email\n # random_number = rand(1000000 .. 9000000)\n random_number = Time.now.getlocal.to_s.delete \"- :\"\n \"ruslan.yagudin+#{random_number}@flixster-inc.com\"\nend", "title": "" }, { "docid": "9070b4fe0f52acc7f3150bc44d0dc330", "score": "0.59961295", "text": "def random_key\n (0...10).map { ('a'..'z').to_a[rand(26)] }.join\n end", "title": "" }, { "docid": "6291abdb5b1a468fbd859bc73fd2a1e7", "score": "0.5991157", "text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "title": "" }, { "docid": "654270bd92f8fff6642164fd8ad2b3fd", "score": "0.5984619", "text": "def generate_id\n Digest::MD5.hexdigest(text)\n end", "title": "" }, { "docid": "b3a3525222ce8df3929b0c8f35ba1e97", "score": "0.59742486", "text": "def create_password(length)\n chars = ('a' .. 'z').to_a + ('1' .. '9').to_a + '%$?@!'.split(//)\n Array.new(length, '').collect { chars[rand(chars.size)] }.join\nend", "title": "" }, { "docid": "bbae3ea1f277300ea6b721f6a44d1e48", "score": "0.59680843", "text": "def generate_new_password\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'\n password = ''\n 10.times { password << chars[rand(chars.size)] }\n self.update_attributes(:encrypted_password => User.encrypt(password, self.salt))\n UserMailer.deliver_forgot_password_mail(self, password)\n password\n end", "title": "" }, { "docid": "f549b5857b8b09127bc5cf583531858b", "score": "0.5954548", "text": "def generate\n @password = (1..@length).map { (33 + rand(89)).chr }.join \n check_password_contents\n @password\n end", "title": "" }, { "docid": "99c67402bfc72b650d351f3bf8e0a209", "score": "0.59516317", "text": "def random_password(size=10)\n random_string(size, :chars, 'ABCDEFGHJKLMNPQRSTUVWXYabcdefghkmnpqrstuvwxyz23456789#%^&$*i-_+=')\n end", "title": "" }, { "docid": "186058dc30303d956a88c91a94d9b05a", "score": "0.594944", "text": "def generate_sid\n \"%0#{@default_options[:sidbits] / 4}x\" %\n rand(2**@default_options[:sidbits] - 1)\n end", "title": "" }, { "docid": "3cb8a1db0cca39ddf62b70d0cae0be01", "score": "0.5942259", "text": "def func6\n str = ''\n for i in (0..4) do\n str += (65+rand(26)).chr\n end\n return str\nend", "title": "" }, { "docid": "01a5448c149266d790d77ba51c64af75", "score": "0.593976", "text": "def rand_token length=36\r\n\ttoken = ''\r\n\tlength.times do\r\n\t\ttoken += (random(0, 2)==1) ? (random(0,10).to_s) : (rand_let())\r\n\tend\r\n\ttoken\r\nend", "title": "" }, { "docid": "f579e0c10c797542c9930a72844203ea", "score": "0.5928312", "text": "def generate_order_code\n\t\t\tsize = 5\n\t\t\tcharset = %w{0 1 2 3 4 6 7 9 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\t\t\tself.code = \"DH\" + Time.now.strftime(\"%Y\").last(2) + (0...size).map{ charset.to_a[rand(charset.size)] }.join\n\t\tend", "title": "" }, { "docid": "d4214b6fb0ffed020177c60f35def5f7", "score": "0.59252053", "text": "def _my_mkpass()\n mymkpass = ''\n 9.to_i.times{ mymkpass << (65 + rand(25)).chr }\n return mymkpass\nend", "title": "" }, { "docid": "81cc8115f730925ca1fc9c1827c8703e", "score": "0.59170496", "text": "def generate_invite_code(size = 10)\n charset = %w[2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z]\n (0...size).map { charset.to_a[rand(charset.size)] }.join\n end", "title": "" }, { "docid": "26a94fd1721da754927bb8f49a548cc9", "score": "0.591311", "text": "def randstr\n (0...50).map{ ('a'..'z').to_a[rand(26)] }.join\nend", "title": "" }, { "docid": "8776a6c2a661907991b9eeabb7571424", "score": "0.5912686", "text": "def random_big_string offset = rand(1..500)\n generate_string(25000 + offset)\n end", "title": "" }, { "docid": "e24cab09e49f1bf7148915437c9221e8", "score": "0.59095085", "text": "def random_alias\n 12.times.map { (SecureRandom.random_number(26) + 97).chr }.join\n end", "title": "" }, { "docid": "3cb7f2a3b13cf091092acc4cfab5b19d", "score": "0.59074473", "text": "def random_lcc\n \"#{random_letters(1).capitalize}#{random_num_string(pick_range(1..3))}.#{random_letters(pick_range(1..3)).capitalize}#{random_num_string(pick_range(1..3))}\"\n end", "title": "" }, { "docid": "3cb7f2a3b13cf091092acc4cfab5b19d", "score": "0.59074473", "text": "def random_lcc\n \"#{random_letters(1).capitalize}#{random_num_string(pick_range(1..3))}.#{random_letters(pick_range(1..3)).capitalize}#{random_num_string(pick_range(1..3))}\"\n end", "title": "" }, { "docid": "0cca005b112dd884704e6a454602d604", "score": "0.5895798", "text": "def pseudo_random_chars(length=6)\n (0...length).map{(65 + rand(25)).chr}.join\n end", "title": "" }, { "docid": "df4225217931efd1ec43524818ec0ea8", "score": "0.5892482", "text": "def random_csharp\n @reply_csharp_text.sample\n end", "title": "" }, { "docid": "3a97ec4859be25f73046c91221318ec3", "score": "0.58834225", "text": "def fuzz_str()\n\t\treturn Rex::Text.rand_text_alphanumeric(rand(1024))\n\tend", "title": "" }, { "docid": "91a45ef2f5e0288e7116197b4899f46c", "score": "0.5879307", "text": "def generate_password\n password = [('a'..'z'), ('A'..'Z'),(0..9)].map { |i| i.to_a }.flatten\n (8...32).map { password[rand(password.length)] }.join\n end", "title": "" }, { "docid": "8cd724eceeba159338aaab55beb7a195", "score": "0.58755547", "text": "def randc cnt\n r = ''\n while cnt>0\n r << KEYCHAR[(rand KEYCHAR.length).to_i]\n cnt-=1\n end\n r\n end", "title": "" }, { "docid": "4a51eae1b6e0c294e04bfeabc7913d9b", "score": "0.58746934", "text": "def rand_text_hex(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length, '0')\n else\n Rex::Text.rand_text_hex(length, bad)\n end\n end", "title": "" }, { "docid": "567a82982a80feaad50d8822c8511095", "score": "0.5866061", "text": "def random_string(len)\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n str = \"\"\n 1.upto(len) { |i| str << chars[rand(chars.size-1)] }\n str\n end", "title": "" }, { "docid": "e501ffb449a05b432ac05830d2c59cc8", "score": "0.58599424", "text": "def random_string(length)\n rand(36**length).to_s(36)\n end", "title": "" }, { "docid": "2e6832b0b7b8f050d74e9aa68113ba23", "score": "0.58524275", "text": "def friendly_token\n SecureRandom.base64(32).tr('+/=lIO0', 'pqrsxyz')\n end", "title": "" }, { "docid": "6198a2c7b1741427770e87091c28c757", "score": "0.583972", "text": "def rand_text_debug(length, char = 'A')\n char * (length.kind_of?(Range) ? length.first : length)\n end", "title": "" }, { "docid": "b551b135c7f52a24516ff0b413bef34c", "score": "0.5822754", "text": "def random_statement(r)\n\tcase r.rand(6).to_i\n\twhen 0\n\t\treturn \" :D\"\n\twhen 1\n\t\treturn \" Yawn. I'm tired...\"\n\twhen 2\n\t\t#Dice because it was randomly generated\n\t\treturn \" 🎲🎲🎲\"\n\twhen 3\n\t\treturn \" D:\"\n\twhen 4\n\t\treturn \" Hm.\"\n\telse\n\t\treturn \" ~_~\"\n\tend\nend", "title": "" }, { "docid": "82e883dea1acce762b420de112e3a00d", "score": "0.5819998", "text": "def random_name\n (1..3).map {\"\" << rand(26) + 65}.to_s\n end", "title": "" }, { "docid": "a900a5b90c00d3efc598e8500ab4337d", "score": "0.5818784", "text": "def create_acct()\n\tiin = [40,41,42,43,44,45,51,52,53,54,55]\n\tacct = iin[rand(9)].to_s\n\n\twhile acct.length < 16\n\t\tacct = acct.concat(\"#{rand(9).to_s}\")\n\tend\n\tcvv = rand(899)+100\n\t\"#{acct}/#{cvv.to_s}\"\nend", "title": "" }, { "docid": "44b4c5b2e08d326e3d0e1cfc8502b995", "score": "0.581855", "text": "def random_string(len)\n (0...len).map{ ('a'..'z').to_a[rand(26)] }.join\nend", "title": "" }, { "docid": "b6f51efbab19e355d4babfbbbeb0079d", "score": "0.5817222", "text": "def random_alphanumeric\n (1..10).collect { ALPHANUMERIC[rand(ALPHANUMERIC.size)] }.join\n end", "title": "" }, { "docid": "31fcb7e043c7643a612be4ec8698ed20", "score": "0.58124346", "text": "def random_name\n letters = ('AA'..'ZZ').to_a.sample()\n digits = ('000'..'999').to_a.sample()\n letters + digits\n end", "title": "" }, { "docid": "2bc223bc4036136b5b67d2dbd641cf30", "score": "0.58039826", "text": "def random_string(length)\n random_chars(length).join\n end", "title": "" }, { "docid": "14ec459d70808b938aa9ed31fd15b7fa", "score": "0.5798564", "text": "def random_name\n SecureRandom.hex(20)\n end", "title": "" }, { "docid": "64c46dd5d7217df7face149d82968294", "score": "0.5794361", "text": "def rand_text_alpha(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text_alpha(length, bad)\n end\n end", "title": "" }, { "docid": "9b0ab657bf7e67265a5fd073c000e73b", "score": "0.5770591", "text": "def random_string(len)\n rand_max = RAND_CHARS.size\n ret = \"\" \n len.times{ ret << RAND_CHARS[rand(rand_max)] }\n ret \n end", "title": "" }, { "docid": "031fc749db49014cf490b99c61949395", "score": "0.57667255", "text": "def get_random_string(length=8)\n string = \"\"\n chars = (\"a\"..\"z\").to_a\n length.times do\n string << chars[rand(chars.length-1)]\n end\n return string\n end", "title": "" }, { "docid": "805b8feb4c0c04b25ce574bc168de020", "score": "0.5760537", "text": "def generate_mac \n (\"%02x\"%(rand(64)*4|2))+(0..4).inject(\"\"){|s,x|s+\":%02x\"%rand(256)}\n end", "title": "" }, { "docid": "538de0295b3dedf644e01a6565f81e6d", "score": "0.5759527", "text": "def random_chars(length = 64)\n return rand(36**length).to_s(36)\nend", "title": "" }, { "docid": "5b71f828dc17c3261eb81c5ce6586dd3", "score": "0.57530725", "text": "def generate_string(options = {})\n \"##{comment}\\n\"\n end", "title": "" }, { "docid": "6526941c931cf6bd70fec701e8a28c5b", "score": "0.5747675", "text": "def random_string(length=nil)\n length = Random.rand(32) if length.nil?\n (0...length).map { random_character }.join('')\nend", "title": "" }, { "docid": "d47101ec3ba2ad716ceb46b3b939672c", "score": "0.57458454", "text": "def random_password\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n password = ''\n #40.times { |i| password << chars[rand(chars.size-1)] }\n 15.times { |i| password << chars[rand(chars.size-1)] }\n self.password = password\n self.password_confirmation = password\n self.pwd = password\n self\n end", "title": "" }, { "docid": "c6a69ef8ec22165c49def47c7e8b2f44", "score": "0.5745604", "text": "def uuid\n chars = ('a'..'z').to_a + (1..9).to_a\n p \"#{chars.sample(8).join}-#{chars.sample(4).join}-#{chars.sample(4).join}-#{chars.sample(4).join}-#{chars.sample(12).join}\" \n \nend", "title": "" }, { "docid": "c97d551cc46bf11f50af6ed92527f12e", "score": "0.5743489", "text": "def generate_and_send_new_password\n new_password = \"\"\n chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#,.;:?%&\".split(//)\n (0..8).each do |i|\n new_password += chars.at(rand(chars.length))\n end\n self.update_attributes(:password => new_password)\n save!\n AdminMailer.password_reset(self, new_password).deliver\n new_password\n end", "title": "" }, { "docid": "a93804452ab8adbf2910189342324838", "score": "0.57401145", "text": "def rand_text_english(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text_english(length, bad)\n end\n end", "title": "" }, { "docid": "a6319704d91c9b597c696eb0f96c600c", "score": "0.57366705", "text": "def random_string(length = 30)\n o = [('0'..'9'), ('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten\n (1..length).map { o[rand(o.length)] }.join\n end", "title": "" }, { "docid": "e1dbd12f5072699957cc275f629b9ce3", "score": "0.5733989", "text": "def random_string(len)\n # first, we make a bunch of random characters in an array\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n newpass = \"\"\n # then we grab a random element of that array, and add it onto our newpass\n 1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }\n return newpass\n end", "title": "" }, { "docid": "91b76e00981a803e4a66cb4b2929e307", "score": "0.5728667", "text": "def plain\n data = \"Early bird gets the worm. But cookie taste better than worm. So me sleep in. - Cookie Monster\"\n end", "title": "" }, { "docid": "50d3b9cf66523fb62d8ee931c2c11c06", "score": "0.57206583", "text": "def RandomString(len)\n rand_max = RAND_CHARS.size\n ret = \"\" \n len.times{ ret << RAND_CHARS[rand(rand_max)] }\n ret \n end", "title": "" }, { "docid": "302e344c769e4b2b4fd19c508b01d883", "score": "0.57185113", "text": "def make_uuid()\n uuid = \"\"\n 8.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n 3.times do\n 4.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n end\n 12.times { uuid << rand(16).to_s(16) }\n \n uuid\nend", "title": "" }, { "docid": "14253273cc09c0fad39b4964e20cfcfb", "score": "0.57122654", "text": "def create\n concept = (0..3).map { ('A'..'Z').to_a[rand(26)] }.join\n puts concept\n return concept\n end", "title": "" } ]
96a4be6b069eabe39343585eecd66285
Method to update the quantity of an item input: Parameters would the list, item and quantity. steps: Find the list, find the item that matches it, and update quantity. output: Return the key with the updated value.
[ { "docid": "ee396317cc4851865a528a6050b7bdf6", "score": "0.8052701", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n return list\nend", "title": "" } ]
[ { "docid": "221771ca658316b3a3948c1780d40253", "score": "0.86224234", "text": "def update_item_quantity(list, item, quantity)\n# steps: replace the old quantity with the new quantity given in the input\n\tlist[item] = quantity\n# output: hash with updated vlues for given item\n\tlist\nend", "title": "" }, { "docid": "5265bed4f58c8f58733f9a0372c70b7a", "score": "0.8370087", "text": "def change_qty(list, item, qty)# input: Hash, Item to be updated, number to change the quantity to\r\n list[item] = qty # steps: Identify input with element in hash and update quantity\r\n #print_list(list)#for testing\r\n return list # output: Updated hash\r\nend", "title": "" }, { "docid": "1691f5383a27e88f9e455f00e216e633", "score": "0.8369713", "text": "def update_quantity(items_list, item, quantity)\r\n\tif items_list.key?(item)\r\n\t\titems_list[item] = quantity\r\n\tend\r\nend", "title": "" }, { "docid": "d04efefe01537af5a22d27bd4d31f93f", "score": "0.8328258", "text": "def update(item, quantity, list)\n\tif list.include? item.to_sym\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\tlist\nend", "title": "" }, { "docid": "12512adda5958dc2a50a870df6b6c7ed", "score": "0.83226264", "text": "def update_quantity(item, quantity)\n\tNew_list[item] = quantity\nend", "title": "" }, { "docid": "e2b1fb39923285fa4fa03c923a835a14", "score": "0.8299348", "text": "def update_item_quantity!(list, item, quantity=0)\n# steps: list and then index into the item name = quantity\n add_item!(list, item, quantity) \n# output:\nend", "title": "" }, { "docid": "48a7e9fd6d7f6be04cd4c0fdf8c60778", "score": "0.82984436", "text": "def change_quantity(updated_list, item, quantity)\n updated_list.each do |i, q|\n if updated_list.has_key?(item)\n updated_list[item] = quantity\n else\n puts \"This list does not have that item.\"\n break\n end\n end\nend", "title": "" }, { "docid": "abade1233d3af39ea873c88fc09dedce", "score": "0.8291184", "text": "def update_quantity(list, item, quantity) \n# input: list, item, new quantity\n \n add_grocery_item(list, item, quantity)\n# steps: update hash key with new value\n# output: updated hash with new quantity\nend", "title": "" }, { "docid": "dd08a39d02eea0e83a2b26ed6828e544", "score": "0.8286805", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "title": "" }, { "docid": "6098260544d6250b4facfc27eb1adf6a", "score": "0.8273643", "text": "def update_quantity(list, updated_item, quantity=1)\n\tlist[updated_item] = quantity\nend", "title": "" }, { "docid": "e18eb217df61df99f9b0a08c0da20d7a", "score": "0.82590365", "text": "def update_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "title": "" }, { "docid": "c62291669b48c0cd9b778b534db50ae0", "score": "0.8254804", "text": "def update_item(item, list, quantity)\n if list.has_key?(item)\n list[item] = quantity\n return list\n else\n return list\n end\nend", "title": "" }, { "docid": "40c3b2291790a1790830ea4e67989f21", "score": "0.8253198", "text": "def update_item(list,item,quantity)\n list[item] = quantity\n end", "title": "" }, { "docid": "aec7500b37fe2fe0588a6675531dbc90", "score": "0.8249719", "text": "def update_quantity(new_list, item, x)\n# steps: find item name and update its quantity\n new_list.each { |k, v| new_list[item] = x }\n p new_list\nend", "title": "" }, { "docid": "302970bfdc10e25a6327018558f91054", "score": "0.8249588", "text": "def update_quantity(g_list, item, qty)\n\t# search item in hash\n\tif g_list.include?(item)\n\t\t# update quantity associated with it\n\t\tg_list[item] = qty\n\t# else, if not found, print \"Sorry, item not found.\"\n\telse\n\t\tputs \"Sorry, item not found.\"\n\tend\n\t# output: updated hash list\n\treturn g_list\nend", "title": "" }, { "docid": "6750de39b0398b75e2c4ac73e443aedb", "score": "0.82467765", "text": "def update_quantity(new_item, existing_list, quantity)\n\texisting_list[new_item] = quantity\n\texisting_list\n\t\nend", "title": "" }, { "docid": "24b3bb356df252a995b57d0cb8730f15", "score": "0.82391495", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "24b3bb356df252a995b57d0cb8730f15", "score": "0.82391495", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "16a2d39317f46d6c613bca5a1ea863cd", "score": "0.82382137", "text": "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "3462eb649b1bea040ca4b138a8ee0181", "score": "0.82231355", "text": "def update_item(item, quantity, list)\n list.each do\n if list.has_key?(item)\n list[item] = quantity\n else \n puts \"List does not contain that item.\"\n break\n end\n end\nend", "title": "" }, { "docid": "87da3e1a8db8c7027be1956a78250296", "score": "0.8216714", "text": "def update(list, item, quantity)\n list[item] = quantity\n list\n end", "title": "" }, { "docid": "c9522b3b82b6897d3b72430112ad6b15", "score": "0.8212286", "text": "def update_quantity(item, qty, list)\n\tlist[item] = qty\n\tlist\nend", "title": "" }, { "docid": "b0bd9feb49983e190235fe10868017cf", "score": "0.8211635", "text": "def update_quantity(list, item, qty)\n if list.include?(item)\n list[item] = qty\n else\n p \"Error: Item not found\"\n end\n list\nend", "title": "" }, { "docid": "a37aa95f1a5b46a39df259eee705d0fa", "score": "0.82108426", "text": "def update_quantity(list, existing_item, new_quantity)\n list[existing_item] = new_quantity\n list\nend", "title": "" }, { "docid": "9c13f4c1965ffebb29eee31bf5b1dc9a", "score": "0.82100785", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "9c13f4c1965ffebb29eee31bf5b1dc9a", "score": "0.82100785", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "9c13f4c1965ffebb29eee31bf5b1dc9a", "score": "0.82100785", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "111323c9b2d693cc064b4120225beb40", "score": "0.8209429", "text": "def updating_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "f775211ace8f6549a07d17b3943f5700", "score": "0.82059747", "text": "def change_quantity(updated_list, item, quantity)\r\n\tupdated_list.each do |i, q|\r\n\t\tif updated_list.has_key?(item)\r\n\t\t\tupdated_list[item] = quantity\r\n\t\telse\r\n\t\t\tputs \"This list does not have that item.\"\r\n\t\t\tbreak\r\n\t\tend\r\n\tend\r\n\r\nend", "title": "" }, { "docid": "b4df478e5c446a1636cd73d0117581d4", "score": "0.82044387", "text": "def update_item(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "0a398fe8d4d32825615e1ae45251f713", "score": "0.8192877", "text": "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "d8b30e8e161b5aabc18e69255acb373e", "score": "0.8191657", "text": "def update_quantity(item, quantity, list)\n list[item] = quantity\nend", "title": "" }, { "docid": "aad791fb5cd6cc47d1c8e8c03c0ff565", "score": "0.8185832", "text": "def update_item( list, item, quantity )\n list[item] = quantity\nend", "title": "" }, { "docid": "4367dadb578395750a47e9444fdc3711", "score": "0.8183013", "text": "def update_item(list, item, quantity)\n if list.has_key?(item)\n list[item] = quantity\n else\n puts \"Item not found.\"\n end\n return list\nend", "title": "" }, { "docid": "2e59021cfee2d9c92dee52003fd9f896", "score": "0.8182372", "text": "def update_item(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "2e59021cfee2d9c92dee52003fd9f896", "score": "0.8182372", "text": "def update_item(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "2e59021cfee2d9c92dee52003fd9f896", "score": "0.8182372", "text": "def update_item(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "2e59021cfee2d9c92dee52003fd9f896", "score": "0.8182372", "text": "def update_item(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "d22b098e56e3e5ba2a7a1d7e8ef663ce", "score": "0.81687754", "text": "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tlist\r\nend", "title": "" }, { "docid": "1644e5ff40e023cdaf59f54def2c2ee6", "score": "0.816723", "text": "def update_quantity(list, item, quantity)\n if quantity == 0\n remove_item(list, item)\n else\n list[item] = quantity\n end\nend", "title": "" }, { "docid": "373688fde913ee7fd550e9a74b458c32", "score": "0.8167219", "text": "def quantityupdate(newlist, item, quantity)\n newlist.has_key?(item)\n newlist[item] = quantity\n return newlist\nend", "title": "" }, { "docid": "a96e6223cb13b91ecb6ddd9b52ca9060", "score": "0.815636", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "27e03011b117c213ed4d03d37f0daaad", "score": "0.81527025", "text": "def update_quantity(list, item, quantity)\r\n if list.has_key?(item)\r\n list[item] = quantity\r\n else\r\n puts \"No Item Found\"\r\n end\r\n list\r\nend", "title": "" }, { "docid": "d2cf8d73296a640e8d8fd0fb96e2058c", "score": "0.81474906", "text": "def item_quantity(list, item_to_update, quantity)\n list[item_to_update] = quantity \nend", "title": "" }, { "docid": "13862e036ff3875c897ccd1504298710", "score": "0.8146175", "text": "def update_quantity(list, item, updated_quantity=1)\r\n\tlist[item] = updated_quantity\r\n\tlist\r\nend", "title": "" }, { "docid": "b3ed144eb086997406ca8eeda6d7a94d", "score": "0.8138384", "text": "def update_quantity(list, item, new_quantity)\n list[item] = new_quantity\n list\nend", "title": "" }, { "docid": "c5c55086fd9194e3407199fb141f0d60", "score": "0.813711", "text": "def update(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "title": "" }, { "docid": "c4cf2daf804c0977de37164b8f63cdb8", "score": "0.81332994", "text": "def update_quantity(list, item, quantity)\r\n list[item] = quantity\r\n list\r\nend", "title": "" }, { "docid": "2023808ae21e8f30921a2c0767ddd77a", "score": "0.8133236", "text": "def update_quantity(list, item, quantity)\n if list.include?(item)\n list[item] = quantity\n end\n list\nend", "title": "" }, { "docid": "72ea8f125911ce3e41338d8541e0da33", "score": "0.81328994", "text": "def update_list(hash, item, quantity)\r\n# input: hash, item name and new quantity\r\n# steps:\r\n\t#check to see if item exists\r\n\t# Change the value of the corresponding item key to new quantity\r\n\tif hash.has_key?(item)\r\n\t\thash[item] = quantity\r\n\telse puts \"ERROR: item does not exist\"\r\n\tend\t\r\n# output: hash with updated quantity\r\n\thash\r\nend", "title": "" }, { "docid": "b244a26f44f4ed81334567ea3e5b81b6", "score": "0.81282693", "text": "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\nend", "title": "" }, { "docid": "4d0ccd2a58fdc34d36e7efad8e30afb0", "score": "0.81272", "text": "def update_quantity(list, item, quantity)\r\n list[item] = quantity\r\nend", "title": "" }, { "docid": "d977ba947f3b07d8db9aeee09c61a2f2", "score": "0.8113929", "text": "def update_quantity(list, item, quantity)\n if list.include?(item)\n list[item] = quantity\n end \n list\nend", "title": "" }, { "docid": "87c994afa0a90c80808e8b046151fc62", "score": "0.81107825", "text": "def update_item(which_list, item_to_update, quantity_to_update)\r\n which_list[item_to_update] = quantity_to_update\r\n which_list\r\nend", "title": "" }, { "docid": "54c88655bd38680c38468a170bac39ce", "score": "0.8110257", "text": "def update_quantity(list, item_name, new_quantity)\r\n if list.has_key?(item_name)\r\n list[item_name] = new_quantity\r\n else\r\n puts \"Item not found\"\r\n end\r\n\r\n list\r\nend", "title": "" }, { "docid": "c16688774d22774043711df07be946db", "score": "0.80917674", "text": "def update_quantity(item, new_quantity, list)\n\tlist[item] = new_quantity\n\tp list\nend", "title": "" }, { "docid": "7649a37dfaf16f0a198911cc69b1e9ce", "score": "0.8089261", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "title": "" }, { "docid": "7649a37dfaf16f0a198911cc69b1e9ce", "score": "0.8089261", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "title": "" }, { "docid": "6f460a34da2b7b93afe92f076ce20803", "score": "0.80832624", "text": "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n print_list(list)\nend", "title": "" }, { "docid": "53a7362e731258eab3f4bce203e19753", "score": "0.80763096", "text": "def update_quantity(list, item, quantity)\n list.each { |key ,value| list[key]= quantity if key == item }\nend", "title": "" }, { "docid": "ce3a63df1e42fd90803668f12b166932", "score": "0.80739605", "text": "def update_quantity(item_name, quantity, hash_list)\n hash_list[item_name] = quantity\nend", "title": "" }, { "docid": "95e4497a539496fc708119ebb6345b1a", "score": "0.8064403", "text": "def update_quantity(list, item, quantity)\r\n list[item] = quantity\r\nend", "title": "" }, { "docid": "d6356505088faca21d480bb2f7ce6412", "score": "0.80539745", "text": "def update_item(list, item_name, quantity)\n list[item_name] = quantity\nend", "title": "" }, { "docid": "901dae892b275ced08615ad6a95c0d94", "score": "0.80531746", "text": "def update_quantity(list, item_name, quantity)\n list[item_name] = quantity\nend", "title": "" }, { "docid": "a68bbc7128414c74485325af6778f485", "score": "0.8049238", "text": "def update (list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "32ce0da4c5fceec14a8680681fd0eb37", "score": "0.80445", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "7b0afa71f2b5e7177a1062e5840fa89d", "score": "0.8043628", "text": "def update_quantity(list, item, new_quantity)\n if list.include?(item)\n list[item] = new_quantity\n else\n puts \"#{item} does not exist, did you mean to add it?\"\n end\n list\nend", "title": "" }, { "docid": "896f7e684ee4a3b8cecb2f9536b32a5c", "score": "0.80423665", "text": "def update_quantity(item, new_quant, list)\n\tlist.each do |item_in_list, old_quant|\n\t\tif item_in_list == item\n\t\t\tlist[item_in_list] = new_quant\n\t\tend\n\tend\nend", "title": "" }, { "docid": "936af90ae0b8bb6f14696620d7e2cf2d", "score": "0.80396616", "text": "def update_quantity (list, item, quantity)\r\n\tlist[item] = quantity\r\n list\r\nend", "title": "" }, { "docid": "34e5c28cedb4beb721c98a0859920ca1", "score": "0.80317485", "text": "def update_quantity(hash_list, item_name, quantity)\n\thash_list[item_name] = quantity \nend", "title": "" }, { "docid": "3b03bc77019d4c3917d7560f964ef569", "score": "0.8027597", "text": "def update_quantity(list, item_name, quantity)\n\tif list.include?(item_name)\n\t\tlist[item_name] = quantity\n\tend\n\tlist\nend", "title": "" }, { "docid": "a796abd82730a9934aa4a20d8737bb5e", "score": "0.8026986", "text": "def update_quantity(list, item, quantity)\r\nlist[item] = quantity\r\nlist\r\nend", "title": "" }, { "docid": "b01d9b1ec0ce8861913e98c66d756c7f", "score": "0.80264646", "text": "def update_item(list, item, quantity)\n# input: list, item and quantity to be updated to\n# steps:\n # update quantity\n list[item] = quantity\n # print success \"your cart has been updated!\"\n p \"Your cart has been updated!\"\n list\n# output: updated list with new quantity\nend", "title": "" }, { "docid": "023cc4a6da0b98dde8a9fd8346add9d5", "score": "0.80251676", "text": "def update_quantity(item, quantity, list)\n list[item] = quantity\n return list\nend", "title": "" }, { "docid": "3db35d55a82bf5bb2c16599abb912189", "score": "0.80205256", "text": "def update_quantity(item,original_list,quantity)\n\toriginal_list[item] = quantity\nend", "title": "" }, { "docid": "5eee3561f688e4d6b5e7a6466d0e41c8", "score": "0.80150336", "text": "def update_quantity(list, item, quantity)\r\n #method to update quantity\r\n #can also add items\r\n list[item] = quantity\r\nend", "title": "" }, { "docid": "2797a75bc65451e0075c70dd30e4afe1", "score": "0.7995584", "text": "def update_quantity(list_name, item, quantity)\n add_item_and_quantity(list_name, item, quantity)\nend", "title": "" }, { "docid": "08ec5fa0746b63b3f5b7b594dd34c0c8", "score": "0.7994314", "text": "def update_item(list, item_name, quantity=1)\n\tlist[item_name] = quantity\n\tlist\nend", "title": "" }, { "docid": "14e8c011e7f11b9742a97f115d05d9ae", "score": "0.79910874", "text": "def update_quantity(list,item,quantity)\nlist[item] = quantity\n list\nend", "title": "" }, { "docid": "8f043cf10191cbe3b4fe0ddc1573b2e4", "score": "0.79893315", "text": "def update_quantity(list, item, quantity)\n list.store(item, quantity)\nend", "title": "" }, { "docid": "286f32e8bf7a0222d2b643d1ba04bf02", "score": "0.7986336", "text": "def change_qty(list, item, qty)\n if list.has_key?(item) == false\n puts \"Item not found\"\n else\n qty.to_i\n list[item] = qty\n end\n list\nend", "title": "" }, { "docid": "0ab0a32c5068b4732a386eceba457d22", "score": "0.7984936", "text": "def update(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "54e05d7bb5ca844fa8b1572cd81ec8a2", "score": "0.79833263", "text": "def update_quantity(list1, item, quantity)\n\tlist1[item] = quantity\nend", "title": "" }, { "docid": "2cff758a209d55ca23204a251d881611", "score": "0.7977553", "text": "def update_qty(list, item_to_update, new_qty)\n # if list.has_key? item_to_update\n # list[item_to_update] = new_qty\n # end\n list[item_to_update] = new_qty if list.has_key? item_to_update\n list\nend", "title": "" }, { "docid": "e66783f948212412bf77c8045184849a", "score": "0.7969996", "text": "def quantity_updater(existing_list, key, quantity)\n\texisting_list[key] = quantity\n\texisting_list\nend", "title": "" }, { "docid": "545109b8cb9a7a49f5710391e84e5e3a", "score": "0.79643065", "text": "def update_quantity(list, item_name, quantity)\n list[item_name] = quantity.to_i\n list\nend", "title": "" }, { "docid": "2a3717842bfa33a7bcb8e6f50c8df8ce", "score": "0.7962037", "text": "def update_item(list_name, item_name, quantity)\n list_name[item_name] = quantity if list_name.has_key?(item_name)\nend", "title": "" }, { "docid": "582b5bdd1c0744ba114d8351bcd111fe", "score": "0.7956308", "text": "def update_quantity_number(list_hash, item, new_quantity)\n\n\tif new_quantity >= 0 \n\t\tlist_hash[item] = new_quantity\n\tend\n\n\treturn list_hash\n\nend", "title": "" }, { "docid": "c058a43b4ba39c5480a3a0be6b2388d8", "score": "0.7953718", "text": "def update_item_quantity(list, item, quantity)\r\n list[item] = quantity\r\n print_list(list)\r\nend", "title": "" }, { "docid": "a810e6c711ca2880a0eee6146a7e4d69", "score": "0.7945616", "text": "def update_item(list, item, quantity)\n# input:list, item, quantity\n# steps: type the hash in brackets the item and set it equal to the quantity\n list[item] = quantity\n p list\n# output: the grocery list with the updated quantity amount\nend", "title": "" }, { "docid": "43f63b0774480ba0dbd376751f36e19c", "score": "0.7940932", "text": "def update_item(item, list, default_quantity)\r\n list[item] = default_quantity\r\nend", "title": "" }, { "docid": "acd7b60ba97d3cfebd7624fcc7d7bf5e", "score": "0.7938694", "text": "def update_quantity(item, new_quantity, list)\nlist[item] = new_quantity\nlist\nend", "title": "" }, { "docid": "968c8b51450c1264ab9c5e4b37f06988", "score": "0.7936798", "text": "def update_quantity(list, item, desired_quantity) \n if list.include?(item) == true\n list[item] = desired_quantity\n end \n return list \nend", "title": "" }, { "docid": "8b98a8d0de084dde753ae460507bb411", "score": "0.7934028", "text": "def update_quantity(list, item_name, quantity)\r\n if list[item_name]\r\n list[item_name] = quantity\r\n else\r\n puts \"invalid input; item not on list.\"\r\n end\r\n return list\r\nend", "title": "" }, { "docid": "6bd150bd947ddfbd717daef47deee866", "score": "0.7931497", "text": "def update_quantity(item, quantity, list)\n\n list[item] = quantity\n\n return list\n\nend", "title": "" }, { "docid": "52e0b050ff4d6cf130f61ca9a5945591", "score": "0.7910375", "text": "def update (list, item, qty)\r\n #overwrites value (qty) for the key (item)\r\n list[item] = qty\r\nend", "title": "" }, { "docid": "a22fb849d74aacaec73bca5fad6a4ea1", "score": "0.79101217", "text": "def update_item_quantity(hash_list , item_name , item_quantity)\n hash_list[item_name] = item_quantity\n hash_list\nend", "title": "" }, { "docid": "ab647f83bd51a05dea6e7e0a4de4397b", "score": "0.79082614", "text": "def item_quantity(list, item, quantity)\n\tlist[item] = quantity\n\t#puts \"This is the output of updating the quantity of an item:\"\n\t#p list\nend", "title": "" }, { "docid": "89811e52c1f61df112a8e81669260955", "score": "0.79061496", "text": "def update_quantity(list, item, quantity)\r\n\tadd_to_list(list, item, quantity)\r\n\r\n\treturn list\r\nend", "title": "" } ]
16a941879adec00162f06959f6bbb9cd
GET /boms GET /boms.json
[ { "docid": "02cfebf346b2a5dbfe084cff852e33a4", "score": "0.7240905", "text": "def index\n @service_call = ServiceCall.find(params[:service_call_id])\n @boms = @service_call.boms\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boms }\n end\n end", "title": "" } ]
[ { "docid": "13718f401591c7259c2f76c2aa61002e", "score": "0.6696254", "text": "def index\n @tool_boms = ToolBom.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tool_boms }\n format.xml { render xml: @tool_boms }\n end\n end", "title": "" }, { "docid": "38c9d378752c22e097d9b3db226dfaeb", "score": "0.6451325", "text": "def show\n @bom = Bom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bom }\n end\n end", "title": "" }, { "docid": "38c9d378752c22e097d9b3db226dfaeb", "score": "0.6451325", "text": "def show\n @bom = Bom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bom }\n end\n end", "title": "" }, { "docid": "38c9d378752c22e097d9b3db226dfaeb", "score": "0.6451325", "text": "def show\n @bom = Bom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bom }\n end\n end", "title": "" }, { "docid": "674b572127b1855ef3252684646bc7f9", "score": "0.6379526", "text": "def get_blasts()\n exec_get(\"#{@base_path}/api/v2/customers/blasts.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "f7f8d2c8859a8e08d00f8c345c8c4234", "score": "0.6197354", "text": "def index\n @baosong_bs = BaosongB.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baosong_bs }\n end\n end", "title": "" }, { "docid": "88457abe5e3c128ef504a42e586cda41", "score": "0.61955005", "text": "def index\n @part_boms = PartBom.all\n end", "title": "" }, { "docid": "690c891b283e1642f8e842d84428ff8e", "score": "0.61896515", "text": "def index\n @assembly_boms = AssemblyBom.all\n end", "title": "" }, { "docid": "e27729d4ea768b422214fdf952e2065f", "score": "0.6177308", "text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end", "title": "" }, { "docid": "35002c9dd1dd2f098a05261320d3427a", "score": "0.61760145", "text": "def getbattery\r\n\r\n if params[:building].present?\r\n\r\n @batteries = Building.find(params[:building]).batteries\r\n else\r\n @batteries = Battery.all\r\n end\r\n\r\n render json: @batteries\r\n end", "title": "" }, { "docid": "ddc034b58d152ff4ed0ce2cfa51a6a50", "score": "0.6096145", "text": "def get(path)\n response = kolkrabbi_client.get do |request|\n request.url path\n request.headers[\"Content-Type\"] = \"application/json\"\n request.headers[\"Authorization\"] = \"Bearer #{client.heroku.token}\"\n end\n\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "93d7b36794b96380caa881cc274f58ea", "score": "0.6061973", "text": "def show\n render json: MangaBookshelf.find_shelves(params[:id])\n end", "title": "" }, { "docid": "783289b2c2a34edb4bdbc5d790460fe3", "score": "0.6051859", "text": "def index\n @boatlog_managers = BoatlogManager.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boatlog_managers }\n end\n end", "title": "" }, { "docid": "0310f9c8dc4fb2f7e20be2ad9ca5b5fc", "score": "0.6046895", "text": "def get_battery_by_building\n puts \"get battery by building\"\n @battery = Battery.where(building_id: params[:building_id])\n respond_to do |format|\n format.json { render :json => @battery }\n end\n end", "title": "" }, { "docid": "77d726c8dc37df49383c7e6c4fd2ea74", "score": "0.6036614", "text": "def index\n @rubygems = Rubygem.order(:name).includes(:releases, :follows)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rubygems }\n end\n end", "title": "" }, { "docid": "55842559e0bc8f3609d5c2284355d8f0", "score": "0.60241544", "text": "def index\n @gitgems = Gitgem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gitgems }\n end\n end", "title": "" }, { "docid": "b51465ff66e814a6dc465e2c86dd85bf", "score": "0.5991845", "text": "def index\n @combos = Combo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @combos }\n end\n end", "title": "" }, { "docid": "c422dff24ca1700d3917a28d00b77cc8", "score": "0.59828347", "text": "def index\n @bundles = current_user.bundles.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bundles }\n end\n end", "title": "" }, { "docid": "f840db96bca96bd965864ad95688805c", "score": "0.5958636", "text": "def get_blasts(service_id = nil)\n exec_get(\"#{@base_path}/api/v2/vendors/blasts.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "61bc3948ed991bb9dddd1d8035760c2d", "score": "0.59441495", "text": "def getbooksjson\n\n @customer = Customer.find(params[:id]) \n @order = @customer.order\n @orderitems = Orderitem.find_all_by_order_id(@order)\n @book = Book.find_all_by_id(@orderitems)\n\n render :json => @book \n\t\n end", "title": "" }, { "docid": "7efd24b192528b9be31da68f5427942b", "score": "0.5896529", "text": "def index\n\n #@bundles = Bundle.paginate(page: params[:page], :per_page => 10)\n #@bundles = Bundle.paginate(page: params[:page]).order('id')\n\n @bundles = Bundle.order('id').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bundles }\n end\n end", "title": "" }, { "docid": "e71c56759d4436ce140d03940aaf63aa", "score": "0.587058", "text": "def index\n @horesases = Horesase.all\n @horesase_boys = Kaminari.paginate_array(JSON.parse(fetch_meigens)).page(params[:page]).per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @horesases }\n end\n end", "title": "" }, { "docid": "ba93fc134bb78fbafcf48f3a2a954e09", "score": "0.58671725", "text": "def index\n @blocs = Bloc.all(sort: :position)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blocs }\n end\n end", "title": "" }, { "docid": "5d23e6ba44c948134c618e3d28f4c341", "score": "0.5858406", "text": "def index\n @buses = Bus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @buses }\n end\n end", "title": "" }, { "docid": "89dc3b117bc719b8f695fa52670150f2", "score": "0.5851054", "text": "def index\n @budgets = Budget.all\n render json: @budgets\n end", "title": "" }, { "docid": "aadeae2626a7e71ee85d652f75c6520b", "score": "0.58204603", "text": "def index\n @boats = Boat.all\n render :json => @boats.as_json\n end", "title": "" }, { "docid": "04057cade18699307ba9506e9ae3ed6a", "score": "0.58187836", "text": "def new\n @bom = Bom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bom }\n end\n end", "title": "" }, { "docid": "f835dd603ce08f39a89a1350066b11a9", "score": "0.58043236", "text": "def index\n @orgaos = Orgao.all\n\n render json: @orgaos\n end", "title": "" }, { "docid": "60ef110708bffae3e6fd3fc3bf6ee5af", "score": "0.57532793", "text": "def index\n @bamboos = Bamboo.all\n end", "title": "" }, { "docid": "7e299498bb1812b84c3eb26c28c43c91", "score": "0.57480824", "text": "def index\n @packages = Package.all\n render json: @packages\n end", "title": "" }, { "docid": "4e3ef8428f68918f9216edd55ae2f5d1", "score": "0.57407486", "text": "def getBeacons\n\t\t@room = Room.where(:name => params[:name]).take\n\t\t@beacons = @room.beacon.all\n\t\trender json: @beacons\n\tend", "title": "" }, { "docid": "e89fe2bb7ef439a1897ab67f7cb45bfd", "score": "0.5734928", "text": "def inbloom_get(path)\n inbloom_api_uri = Pathname.new('https://api.sandbox.slcedu.org/api/rest/v1/')\n get(inbloom_api_uri.join(path).to_s)\n end", "title": "" }, { "docid": "adc5cdb2a39eff5b1e760296fc56682b", "score": "0.5723667", "text": "def get_battery\n if params[:building].present?\n @batteries = Building.find(params[:building]).batteries\n else\n @batteries = Building.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {batteries: @batteries}\n }\n end\n end\n end", "title": "" }, { "docid": "c917b45aa1f87ec70286c7cc83e47442", "score": "0.5719891", "text": "def index\n @blurbs = Blurb.all.sort_by{|b| b.name}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blurbs }\n end\n end", "title": "" }, { "docid": "9d61531f4b872efd53e180dde311b4d4", "score": "0.5715459", "text": "def index\n @bills = Bill.all.to_a\n render json: @bills\n end", "title": "" }, { "docid": "06152abafb9cacedc8285e2797756ee5", "score": "0.57147413", "text": "def index\n @capsuls = Capsul.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @capsuls }\n end\n end", "title": "" }, { "docid": "e2f026226c247c84bb64b2c9ebccfe32", "score": "0.5712999", "text": "def show\n @baoming = Baoming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baoming }\n end\n end", "title": "" }, { "docid": "57e16091eeef53233d7d6c5a0144bf89", "score": "0.57103264", "text": "def index\n @burger_places = BurgerPlace.all\n\n render json: @burger_places\n end", "title": "" }, { "docid": "e58d2ba1d511385a8329a03b36ee92a2", "score": "0.57062286", "text": "def get_battery\n if params[:building].present?\n @batteries = Building.find(params[:building]).batteries\n else\n @batteries = Building.all\n end\n # to tell if the request is sent via ajax\n if request.xhr?\n respond_to do |f|\n f.json {\n render json: {batteries: @batteries}\n }\n end\n end\n end", "title": "" }, { "docid": "7518c1d170f958e0dcca08d3ed92152d", "score": "0.5694964", "text": "def index\n # @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@buildings, mode: :compat) }\n end\n end", "title": "" }, { "docid": "3aad1d2a8549652ed6fcd210be323e0e", "score": "0.56887484", "text": "def index\n @bosses = Boss.all\n end", "title": "" }, { "docid": "534a1856f3aa21ae397edc113946d46c", "score": "0.56863827", "text": "def json_index_bundles\n\n @bundles = Bundle.where(\"active = 'y'\").order(:id)\n respond_to do |format|\n format.json { render json: @bundles.as_json()\n\n }\n end\n\n end", "title": "" }, { "docid": "fe60c8394e21347279d541fcaf8983ce", "score": "0.5681263", "text": "def index\n @jems = Jem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jems }\n end\n end", "title": "" }, { "docid": "4aa4b3e8e456b918c2d80456002c8ed3", "score": "0.56745714", "text": "def index\n @bouties_use = Bouty.find_all_by_bouty_type(\"use\");\n @bouties_read = Bouty.find_all_by_bouty_type(\"read\");\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bouties }\n end\n end", "title": "" }, { "docid": "81e326dca5f6ca4839b94be3fc1cdc3c", "score": "0.5674174", "text": "def index\n @bolsos = Bolso.all\n end", "title": "" }, { "docid": "a03cae52846ce579e17ab0981c48d165", "score": "0.5673105", "text": "def index\n @bids = Bid.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bids }\n end\n end", "title": "" }, { "docid": "1c5e0fd76903ea9588f0458426ca7f99", "score": "0.56713295", "text": "def index\n# @boms = Bom.all\n @boms_grid = initialize_grid(Bom.joins(:product).joins(:subproduct).all,\n\t\t:include => [:product, :subproduct] ,:order => 'products.name'\n\t\t)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boms }\n end\n end", "title": "" }, { "docid": "48c489529d51d189c04ffe18186ebd41", "score": "0.56647813", "text": "def index\n @batterycharges = current_user.company.batterycharges\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batterycharges }\n end\n end", "title": "" }, { "docid": "4b0a210f00949a8317ae0e3e2c01b2b2", "score": "0.5659491", "text": "def show\n @boatlog_manager = BoatlogManager.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @boatlog_manager }\n end\n end", "title": "" }, { "docid": "3222ece6d00ae80f4e17ecf1523d58cf", "score": "0.56587595", "text": "def index\n @orders = Order.all\n\n render json: @orders, status: :found\n end", "title": "" }, { "docid": "e40dd7d44d791cdcb81c68d191af2aa5", "score": "0.56583977", "text": "def index\n @thong_bao_lop_hocs = @lop_mon_hoc.thong_bao_lop_hocs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @thong_bao_lop_hocs }\n end\n end", "title": "" }, { "docid": "8c43d3faa277b2f216892828997a347a", "score": "0.5655146", "text": "def index\n @businesses = Business.all\n render json: @businesses\n end", "title": "" }, { "docid": "73c2958da08e6723ae4d35eb7dba9798", "score": "0.5653605", "text": "def index\n @hobbies = Hobby.all\n render json: @hobbies\n end", "title": "" }, { "docid": "7b3904cb4c7d1de71b8ac751744f0a12", "score": "0.5645668", "text": "def index\n @freelaws = Freelaw.ordered_roots\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @freelaws }\n end\n end", "title": "" }, { "docid": "7e4343abaf36e23c9f20df39c8cef898", "score": "0.56453514", "text": "def index\n @biblebooks = Biblebook.all\n\n respond_to do |format|\n format.html\n format.json{ render json: @biblebooks, root: false}\n end\n end", "title": "" }, { "docid": "15504d217eb372847f7231cf132095a7", "score": "0.5643783", "text": "def index\n render json: @bowties\n end", "title": "" }, { "docid": "ab8590ab563198c25858433721fde2a5", "score": "0.5643086", "text": "def index\n @branches = @pharmacy.branches\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @branches }\n end\n end", "title": "" }, { "docid": "045586d174e99895098dcde446023082", "score": "0.5640115", "text": "def index\n @bills = Bill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bills }\n end\n end", "title": "" }, { "docid": "dab6535a20fad279267db3eb5c82bc70", "score": "0.56371623", "text": "def index\n @baptism_items = BaptismItem.all\n @baptism_items = BaptismItem.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baptism_items }\n end\n end", "title": "" }, { "docid": "6a608f6fe1b42a575bf1b976f39ebf03", "score": "0.56339824", "text": "def index\n @mobibuses = Mobibus.all\n render :json => @mobibuses\n end", "title": "" }, { "docid": "38f85f02c51226f6a4fc50fe99c07393", "score": "0.563384", "text": "def index\n @moments = Moment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @moments }\n end\n end", "title": "" }, { "docid": "38f85f02c51226f6a4fc50fe99c07393", "score": "0.563384", "text": "def index\n @moments = Moment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @moments }\n end\n end", "title": "" }, { "docid": "88e2c5b8b3f79933f279179d1fe85d5c", "score": "0.563307", "text": "def gems(user_handle = nil)\n response = user_handle ? get(\"/api/v1/owners/#{user_handle}/gems.json\") : get('/api/v1/gems.json')\n JSON.parse(response)\n end", "title": "" }, { "docid": "383d72aa9131c526921e76ec5c605bc6", "score": "0.56301636", "text": "def index\n @bldg_permits = BldgPermit.all\n\n render json: @bldg_permits\n end", "title": "" }, { "docid": "8643b6868fd001e7c855c0ebd0f9350c", "score": "0.56204504", "text": "def index\n @vendors = Vendor.all\n render json: @vendors\n end", "title": "" }, { "docid": "5060346cd6b0184c94d35d8c6d0bdaee", "score": "0.5613737", "text": "def index\n \tbrands = get_all_brand_names\n \tbrand_model = get_brand_model_map\n \tyears = model_years\n\n \trender :json => {:brands => brands, :brand_model => brand_model,\n \t\t\t\t\t :years => years} \n end", "title": "" }, { "docid": "2695f265ee3aac4aed7f07bde49fab5a", "score": "0.56128836", "text": "def index\n @branches = Api::V1::Branch.all\n\n render json: @branches\n end", "title": "" }, { "docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7", "score": "0.56093436", "text": "def orders\n client.get \"orders\"\n end", "title": "" }, { "docid": "e53faa80d9855021f3852cb124bb4a5f", "score": "0.5608472", "text": "def index\n @blerts = Blert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blerts }\n end\n end", "title": "" }, { "docid": "9506ffc114b76251bf2ab5a123ad5ffe", "score": "0.56068164", "text": "def assets(query = {})\n self.class.get(\"/assets.json\", :query => query)\n end", "title": "" }, { "docid": "4a96bad2424136bffb535a5ee4349b7f", "score": "0.5602623", "text": "def index\n @osoby = Osoba.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @osoby }\n end\n end", "title": "" }, { "docid": "8d1ef2da5292c3256ba89a84e433be2c", "score": "0.55956566", "text": "def index\n @merchants = Merchant.all\n\n render json: @merchants\n end", "title": "" }, { "docid": "56d8e050f755029f23bb4e8fd94a48bc", "score": "0.55898577", "text": "def show\n @jg_bsb = JgBsb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jg_bsb }\n end\n end", "title": "" }, { "docid": "6b6620f8689b7940fceba617d6f98a81", "score": "0.5585393", "text": "def index\n @climbers = Climber.all\n\n render json: @climbers\n end", "title": "" }, { "docid": "115852341a55bf320c9eb0445300472d", "score": "0.558516", "text": "def index\n @itemmodos = Itemmodo.all\n\n render json: @itemmodos\n end", "title": "" }, { "docid": "10368f1fab6e5388b0d01a954a837bea", "score": "0.5582584", "text": "def index\n @charisma_mods = CharismaMod.all\n\n render json: @charisma_mods\n end", "title": "" }, { "docid": "dd55037152408bc156d779899d49326a", "score": "0.5581215", "text": "def index\n @auctions = Auction.where(status:\"live\")\n\n render json: @auctions\n end", "title": "" }, { "docid": "009f912fb2dc29c2106a140ec2f1571a", "score": "0.55794096", "text": "def index\n @gadgets = Gadget.where(owner: params[:owner])\n render json: @gadgets\n end", "title": "" }, { "docid": "230f8122251fd32cb4fa8f8f1213f7b4", "score": "0.557782", "text": "def index\n @poems = Poem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poems }\n end\n end", "title": "" }, { "docid": "e5e40f510578bbb2b673cc9b130d920a", "score": "0.5566594", "text": "def index\n @line_up_booms = LineUpBoom.all\n end", "title": "" }, { "docid": "ef72ed62f5ffe4fb80132c0f17b555d0", "score": "0.5565896", "text": "def index\n @wisdom_mods = WisdomMod.all\n\n render json: @wisdom_mods\n end", "title": "" }, { "docid": "d46c84a94306396dc17e06c86b67556b", "score": "0.556577", "text": "def index\n @baobiaos = Baobiao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baobiaos }\n end\n end", "title": "" }, { "docid": "e8ef4dc2a64d47de3c76cd06a0444045", "score": "0.55626684", "text": "def manifesto\n @bookquotes = Bookquote.all\n\n respond_to do |format|\n format.html # manifesto.html.erb\n format.json { render json: @bookquotes }\n end\n end", "title": "" }, { "docid": "3a919ac68982cbb829a72d1f3cb31453", "score": "0.5559577", "text": "def index\n @orders = Order.all\n render json: @orders, status: :ok\n end", "title": "" }, { "docid": "7861bc5ff2bec61e9df8a613ff1407dd", "score": "0.5558465", "text": "def index\n @building = building\n @rooms = building.rooms\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end", "title": "" }, { "docid": "cc393579651dccb7de4abb1791f91bb0", "score": "0.5558304", "text": "def index\n @bills = Bill.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @bills }\n end\n end", "title": "" }, { "docid": "d60fe54e6e038282d7228474d441613d", "score": "0.5554682", "text": "def index\n @checkouts = Checkout.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkouts }\n end\n end", "title": "" }, { "docid": "ad6e84d2770c52185f713787885b15fc", "score": "0.55525416", "text": "def index\n @sunburn_systems = SunburnSystem.order(:id).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sunburn_systems }\n end\n end", "title": "" }, { "docid": "4a0f08bf750fc524a53d56e7e7bb8e08", "score": "0.5551921", "text": "def index\n @licenses = License.active.includes(:client).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @licenses }\n end\n end", "title": "" }, { "docid": "0f62106875f14f6a9bbd6eccf3b11405", "score": "0.5538123", "text": "def index\n @orders = Order.all\n\n render json: @orders\n end", "title": "" }, { "docid": "6a14b670b143939c42e757e6230d2374", "score": "0.5533571", "text": "def index\n @api_wmall_malls = Api::Wmall::Mall.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_wmall_malls }\n end\n end", "title": "" }, { "docid": "45d40d4eb7c605b195ee60f1fcb2b6ab", "score": "0.55311114", "text": "def index\n @orders = Order.all\n render json: @orders\n end", "title": "" }, { "docid": "27dae798c337e79c49ba1580960e9566", "score": "0.55291075", "text": "def index\n @babies = Baby.find_all_by_parent_id(session[:parent_id])\n\n respond_to do |format|\n format.html \n format.json { render json: @babies }\n end\n end", "title": "" }, { "docid": "4beee687bf73c5bbfc00fd4b8b2889c4", "score": "0.5529101", "text": "def index\n @badges = Badge.find(:all, :conditions => [\"organization_id = ? \" , @organization ])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orgadmin_badges }\n end\n end", "title": "" }, { "docid": "4855751339d977bcc932d1d7e44dee99", "score": "0.5529061", "text": "def index\n if current_enterprise\n @bills = Bill.where(\"enterprise_id = ? and sys_type = ?\", current_enterprise.id, @sys_type).page(params[:page]).order(\"updated_at DESC\")\n else\n @bills = Enterprise.new.bills.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end", "title": "" }, { "docid": "f89751be9c95c4af1d2e1cae4c4ab3c5", "score": "0.552201", "text": "def test_get_all_brands\n get 'brands.json'\n data = JSON.parse last_response.body\n assert(0 != data.length)\n end", "title": "" }, { "docid": "74e4593543bb10c3f664467f676f4ab4", "score": "0.5521451", "text": "def index\n @checkout_stat_has_manifestations = CheckoutStatHasManifestation.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @checkout_stat_has_manifestations }\n end\n end", "title": "" }, { "docid": "442d432c17dc9866ffb6e7437c23b06d", "score": "0.55204356", "text": "def index\n @assets = Asset.all\n\n render json: @assets\n end", "title": "" }, { "docid": "d5681504dae41cde538307a739a3d910", "score": "0.5518835", "text": "def index\r\n @waterbottles = Waterbottle.order(\"volume DESC\").all\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @waterbottles }\r\n end\r\n end", "title": "" }, { "docid": "32e283a990f7c45d92d68affd2344f34", "score": "0.5517021", "text": "def index\n @bmps = Bmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bmps }\n end\n end", "title": "" } ]
0aa238356bc8aabdb4e7f2163d003e9a
PATCH/PUT /promotions/1 PATCH/PUT /promotions/1.json
[ { "docid": "bdec049f94d8dac02c77e01bbeef025d", "score": "0.53886193", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Oferta foi atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "dd4437688d187b36af64fe44f4e4458c", "score": "0.61319804", "text": "def update\n @promocion = Promocion.find(params[:id])\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, notice: 'Promocion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd156f5b4a9345af7bf456178cad1d62", "score": "0.6086889", "text": "def update\n params[:promoter][:password] = Digest::MD5.hexdigest(params[:promoter][:password])\t\n @promoter = Promoter.find(params[:id])\n\n respond_to do |format|\n if @promoter.update_attributes(params[:promoter])\n format.html { redirect_to @promoter, :notice => 'Promoter was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @promoter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77218a4c18401d62ef7bd749417be77e", "score": "0.6076714", "text": "def refresh_promotions!\n @promotions = _promotions\n end", "title": "" }, { "docid": "dc7e3e1b2c0d1a411717b74b852d1adc", "score": "0.5925523", "text": "def update\n respond_to do |format|\n if @proverb.update(proverb_params)\n format.html { redirect_to admin_proverb_path(@proverb), notice: 'Proverb was successfully updated.' }\n format.json { render :show, status: :ok, location: @proverb }\n else\n format.html { render :edit }\n format.json { render json: @proverb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f278e6478b19bba70bd7f528f240112", "score": "0.59240764", "text": "def update\n @promocion = Promocion.find(params[:id])\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, notice: 'Promocion actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fff28b9db3580b3fdc2b2ade6d853c3b", "score": "0.58970696", "text": "def update\n @promotion = Promotion.find(params[:id])\n\n if @promotion.update(promotion_params)\n head :no_content\n else\n render json: @promotion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "af95507b759ebce4d53f3d60de3d3491", "score": "0.5896225", "text": "def update\n respond_to do |format|\n if @promote.update(promote_params)\n format.html { redirect_to @promote, notice: 'Promote was successfully updated.' }\n format.json { render :show, status: :ok, location: @promote }\n else\n format.html { render :edit }\n format.json { render json: @promote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b75b547ed7a063097c1ce68ace30530", "score": "0.5871823", "text": "def update\n respond_to do |format|\n if @promotor.update(promotor_params)\n format.html { redirect_to @promotor, notice: 'Promotor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @promotor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd46d595f5f1cb51a4cbe9b3a8281b24", "score": "0.5798313", "text": "def promotions(options={})\n response = connection.get do |req|\n req.url \"promotions\", options\n end\n return_error_or_body(response)\n end", "title": "" }, { "docid": "2b5d45d90cdd23e8aa69a236db3913da", "score": "0.5755694", "text": "def proppatch\n return NotFound unless resource.exist?\n return BadRequest unless doc = request.document\n\n resource.lock_check if resource.supports_locking?\n properties = {}\n doc.xpath(\"/#{request.ns}propertyupdate\").children.each do |element|\n action = element.name\n if action == 'set' || action == 'remove'\n properties[action] ||= []\n if prp = element.children.detect{|e|e.name == 'prop'}\n prp.children.each do |elm|\n next if elm.name == 'text'\n properties[action] << { element: to_element_hash(elm), value: elm.text }\n end\n end\n end\n end\n\n r = XmlResponse.new(response, resource.namespaces)\n r.multistatus do |xml|\n xml << Ox::Raw.new(resource.properties_xml_with_depth(properties))\n end\n MultiStatus\n end", "title": "" }, { "docid": "03cf2c9b91ff3d93509664e5934ec7ed", "score": "0.57233566", "text": "def update\n\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n if @propose.update_attributes(params[:propose])\n format.html { redirect_to @propose, :notice => 'Propose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @propose.errors, :status => :unprocessable_entity }\n end\n end\n\n\n end", "title": "" }, { "docid": "32dae653d4b65bb2d20be8b46f0e00a4", "score": "0.57159775", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to promotions_path, notice: '혜택이 수정되었습니다.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "904075503da9ce8a26e22fcd45967197", "score": "0.57155573", "text": "def update\n respond_to do |format|\n if @motogp.update(motogp_params)\n format.html { redirect_to :action=>'index', notice: 'Motogp was successfully updated.' }\n format.json { render :index, status: :ok, location: @motogp }\n else\n format.html { render :edit }\n format.json { render json: @motogp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02ae2ddf5ccded4600a0cdafb55e3b63", "score": "0.57094824", "text": "def update\n @progect = Progect.find(params[:id])\n\n respond_to do |format|\n if @progect.update_attributes(params[:progect])\n format.html { redirect_to @progect, :notice => 'Progect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @progect.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f422aa567c38eb8209d91c1ce4de6ef6", "score": "0.57072884", "text": "def update\n admin_only\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'La promotion a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cf3f4325cdbebac5ed04b9133f5f211", "score": "0.57030195", "text": "def update\n @equipo_promocion = EquipoPromocion.find(params[:id])\n\n respond_to do |format|\n if @equipo_promocion.update_attributes(params[:equipo_promocion])\n format.html { redirect_to @equipo_promocion, notice: 'Equipo promocion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @equipo_promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72a18610fb65f2a2a415e3ba1c3d4072", "score": "0.56937176", "text": "def update\n respond_to do |format|\n if @proto_pom2.update(proto_pom2_params)\n format.html { redirect_to @proto_pom2, notice: 'Proto pom2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proto_pom2.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.567095", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.567095", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "2a01e90417484fbd3fce43fc147e05ef", "score": "0.5657459", "text": "def update\n respond_to do |format|\n if @pomotion.update(pomotion_params)\n format.html { redirect_to @pomotion, notice: 'Pomotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @pomotion }\n else\n format.html { render :edit }\n format.json { render json: @pomotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d4d34edee7238b529c4cfa205f6064f", "score": "0.5654691", "text": "def update\n respond_to do |format|\n if @prodotto.update(prodotto_params)\n format.html { redirect_to @prodotto, notice: \"Prodotto was successfully updated.\" }\n format.json { render :show, status: :ok, location: @prodotto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @prodotto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a16d6b35382fa44776a8c54d3fc65416", "score": "0.56378686", "text": "def update\n respond_to do |format|\n if @prodotto.update(prodotto_params)\n format.html { redirect_to @prodotto, notice: 'Prodotto was successfully updated.' }\n format.json { render :show, status: :ok, location: @prodotto }\n else\n format.html { render :edit }\n format.json { render json: @prodotto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "661083a540c2217cde3e6fcdfd8c03ac", "score": "0.5626225", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06c9489fed5a81c05d9eee2dacb5b8ee", "score": "0.56097203", "text": "def update\n if @propietario.update(propietario_params)\n render json: @propietario\n else\n render json: @propietario.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "05a871e893ef6a299f72f280f9b99348", "score": "0.55971664", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to comentarios_promotion_path, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cdc084dfab829ba75979f895d3e281c", "score": "0.5595731", "text": "def update\n respond_to do |format|\n if @provision.update(provision_params)\n format.html { redirect_to @provision, notice: 'Provision was successfully updated.' }\n format.json { render :show, status: :ok, location: @provision }\n else\n format.html { render :edit }\n format.json { render json: @provision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ec40f5499ec22f8282cb7c786e723b7", "score": "0.5593559", "text": "def update\n respond_to do |format|\n if @promocao.update(promocao_params)\n format.html { redirect_to [:admin, @promocao], notice: 'Promocao was successfully updated.' }\n format.json { render :show, status: :ok, location: [:admin, @promocao] }\n else\n format.html { render :edit }\n format.json { render json: @promocao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2df519f5f3e4e97f5d15ef1cce8d418", "score": "0.55762976", "text": "def update\n vote_id = params.require(:id)\n vote_params = params.require(:vote).\n permit(vote_proposal_options_attributes: [:id, :_destroy])\n if vote_params.blank?\n vote_params = params.require(:vote).permit(vote_proposal_option_ids: [])\n end\n \n id = vote_params[:vote_proposal_option_ids][0]\n\n # Detect does not hit database.\n vote = current_or_guest_user.votes.detect {|vote| vote.id == vote_id.to_i }\n proposal = vote.vote_proposal\n option = proposal.vote_proposal_options.detect {|opt| opt.id == id.to_i }\n\n begin \n current_or_guest_user.vote proposal, option\n status = \"ok\"\n rescue ArgumentError\n status = \"invalid\"\n end\n\n proposal.publish\n\n respond_to do |format|\n format.html {\n redirect_back(fallback_location: vote_proposal_path(proposal))\n }\n format.json {\n if status == \"ok\"\n data = proposal.find_counter_cache_record(option)\n else\n data = {invalid: status}\n end\n render json: data\n }\n end\n end", "title": "" }, { "docid": "f5ceb33225a2fafd45222b31a28831a3", "score": "0.55678886", "text": "def update\n respond_to do |format|\n if @pon.update(pon_params)\n format.html { redirect_to @pon, notice: 'Pon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e943a2b876172b879f7a3cf3a030bc4", "score": "0.55541575", "text": "def update\n ps = motif_params\n if @motif.owner.nil? && ps[:owner_id].blank?\n ps.merge!(owner: current_user)\n end\n @motif.parent = Motif.find motif_params[:parent_id]\n if @motif.update(ps)\n render json: @motif, :include => INCLUDE_ALL\n else\n render json: @motif.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "66f5b340dd50d4ee1b87a0fe10221c53", "score": "0.5547577", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66f5b340dd50d4ee1b87a0fe10221c53", "score": "0.5547577", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "534d4edd0f9d8430c0bfc613c85bc331", "score": "0.55455446", "text": "def update\n respond_to do |format|\n if @promo_request.update(promo_request_params)\n format.html { redirect_to @promo_request, notice: 'Promo request was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo_request }\n else\n format.html { render :edit }\n format.json { render json: @promo_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72fc5816a138dcdfc4c9c50fbf3eb49c", "score": "0.5540703", "text": "def update\n respond_to do |format|\n if @products_promotion.update(products_promotion_params)\n format.html { redirect_to @products_promotion, notice: 'Products promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @products_promotion }\n else\n format.html { render :edit }\n format.json { render json: @products_promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.5533555", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "fc5706a639565f81335039f8de984213", "score": "0.5527673", "text": "def update\n @po = Po.find(params[:id])\n #authorize! :update, @po\n\n @po.update_attributes pick(params, :approved, :confirmed)\n respond_with @po\n end", "title": "" }, { "docid": "de1f03bb93e7340d96a30567b6030e15", "score": "0.5527672", "text": "def update\n respond_to do |format|\n if @propety.update(propety_params)\n format.html { redirect_to @propety, notice: 'Propety was successfully updated.' }\n format.json { render :show, status: :ok, location: @propety }\n else\n format.html { render :edit }\n format.json { render json: @propety.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42bb02bc3cc719b42f6e52a371eb4bf4", "score": "0.5517424", "text": "def update\n if @promoter.update(promoter_params)\n redirect_to @promoter, notice: 'EPS exitosamente actualizada.'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "bacc4790a81a4a9877671c215a332036", "score": "0.5495841", "text": "def update\n respond_to do |format|\n if @pon.update(pon_params)\n format.html { redirect_to @pon, notice: 'Pon was successfully updated.' }\n format.json { render :show, status: :ok, location: @pon }\n else\n format.html { render :edit }\n format.json { render json: @pon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c6331db926ab1898fc3f3c35dbb7f8e", "score": "0.54951173", "text": "def update\n respond_to do |format|\n if @ppomppu.update(ppomppu_params)\n format.html { redirect_to @ppomppu, notice: 'Ppomppu was successfully updated.' }\n format.json { render :show, status: :ok, location: @ppomppu }\n else\n format.html { render :edit }\n format.json { render json: @ppomppu.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fbeee160145283b95f27e24f6ad5e89", "score": "0.5486532", "text": "def update\n @protagnist = Protagnist.find(params[:id])\n\n respond_to do |format|\n if @protagnist.update_attributes(params[:protagnist])\n format.html { redirect_to @protagnist, notice: 'Protagnist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @protagnist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcdc1b9e714209d08d5025ee75bfc0f7", "score": "0.5476689", "text": "def update\n @prospy = Prospy.find(params[:id])\n\n respond_to do |format|\n if @prospy.update_attributes(params[:prospy])\n format.html { redirect_to @prospy, notice: 'Prospy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prospy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7184e2bf041da2afa5a0f9f819e9b2ec", "score": "0.5469101", "text": "def update\n respond_to do |format|\n if @opcion.update(opcion_params)\n format.html { redirect_to @opcion, notice: 'Opcion was successfully updated.' }\n format.json { render :show, status: :ok, location: api_v1_pregunta_opcion_url(@opcion.pregunta_id,@opcion) }\n else\n format.html { render :edit }\n format.json { render json: @opcion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc511edc54a16adc1c06e1add0ace030", "score": "0.5457234", "text": "def update\n @proposition = Proposition.find(params[:id])\n\n respond_to do |format|\n if @proposition.update_attributes(params[:proposition])\n format.html { redirect_to @proposition, notice: 'Proposition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4d7235b1effaebd6551d9769a87cdc0", "score": "0.5455732", "text": "def update\n respond_to do |format|\n if @provisioning.update(provisioning_params)\n format.html { redirect_to @provisioning, notice: 'Provisioning was successfully updated.' }\n format.json { render :show, status: :ok, location: @provisioning }\n else\n format.html { render :edit }\n format.json { render json: @provisioning.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4d7235b1effaebd6551d9769a87cdc0", "score": "0.5455732", "text": "def update\n respond_to do |format|\n if @provisioning.update(provisioning_params)\n format.html { redirect_to @provisioning, notice: 'Provisioning was successfully updated.' }\n format.json { render :show, status: :ok, location: @provisioning }\n else\n format.html { render :edit }\n format.json { render json: @provisioning.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3763a48efe4fca3ac06f3eeec050b7ab", "score": "0.54501927", "text": "def update\n begin\n remember_event\n if params['id'].blank?\n @promoter = Promoter.create(params['promoter'])\n else\n @promoter = Promoter.update(params['id'], params['promoter'])\n end\n if @promoter.errors.empty?\n if @event\n redirect_to(:action => :show, :id => @promoter.id, :event_id => @event.id)\n else\n redirect_to(:action => :show, :id => @promoter.id)\n end\n else\n render(:template => 'admin/promoters/show')\n end\n rescue Exception => e\n logger.error(e)\n flash['warn'] = e.message\n render(:template => 'admin/promoters/show')\n end\n end", "title": "" }, { "docid": "72dd57c454cc539dfa55a035b0ab76ba", "score": "0.54457164", "text": "def update\n\n puts \"update params\"\n p promo_params\n \n respond_to do |format|\n if @promo.update(promo_params)\n format.html { redirect_to '/admin', notice: 'Promo was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo }\n else\n format.html { render :edit }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9018f39f4762996307900c697fc3709", "score": "0.5442937", "text": "def update\n respond_to do |format|\n if @prodotti.update(prodotti_params)\n format.html { redirect_to @prodotti, notice: \"Prodotti was successfully updated.\" }\n format.json { render :show, status: :ok, location: @prodotti }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @prodotti.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f7c16b9e14f1352bb07fd27f83679a7", "score": "0.5439353", "text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end", "title": "" }, { "docid": "01543b0e11a76574699128d65976ce6d", "score": "0.54383665", "text": "def update\n params[:users] ||= {}\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content } #don't send back :ok, it borks the front-end as it includes a single space which makes the json reply invalid and throws an error\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c771050f538a2127869c0ebe464413a8", "score": "0.5428838", "text": "def update\n p = provision_request_params\n\n Rails.logger.info 'PR UPDATE'\n Rails.logger.info \"old status #{@provision_request.status}, new status #{p[:status]}\"\n\n p[:status] = p[:status].to_i\n if @provision_request.status != p[:status]\n Rails.logger.info \"UPDATE STATUS TRUE\"\n update_status = true\n else\n Rails.logger.info \"UPDATE STATUS FALSE\"\n end\n\n respond_to do |format|\n if @provision_request.update(p)\n if update_status\n case p[:status]\n when 1\n Rails.logger.info \"...accepting\"\n\n @provision_request.accept!\n flash_message 'success', 'Provision request was successfully accepted.'\n when 2\n Rails.logger.info \"...denying\"\n\n @provision_request.devices.update_all(provisioned: false)\n @provision_request.deny!\n flash_message 'warning', 'Provision request was successfully denied.'\n else\n Rails.logger.info \"...ELSE\"\n end\n end\n\n# PublishDevicesJob.perform_later(@provision_request.network)\n\n flash_message 'success', 'Provision request was successfully updated.'\n\n format.html { redirect_to @provision_request }\n format.json { render :show, status: :ok, location: @provision_request }\n else\n format.html { render :edit }\n format.json { render json: @provision_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "265dd8a826c12c4ddc3ba3dc2d5b2f6e", "score": "0.5425175", "text": "def update\n @prospecto = Prospecto.find(params[:id])\n\n respond_to do |format|\n if @prospecto.update_attributes(params[:prospecto])\n\n format.html { redirect_to @prospecto, notice: \"Prospecto was successfully updated. #{undo_link}\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dea4b95a5021408b4fc4801cd497967c", "score": "0.54246837", "text": "def update\n respond_to do |format|\n if @proposition.update(proposition_params)\n format.html { redirect_to @proposition, notice: 'Proposition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proposition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4709b9d52dca3cebf5ce04a2d61fce6", "score": "0.5424172", "text": "def update\n @prodotto = Prodotto.find(params[:id])\n\n respond_to do |format|\n if @prodotto.update_attributes(params[:prodotto])\n format.html { redirect_to @prodotto, notice: 'Prodotto aggiornato con successo.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prodotto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7858128532921e53ab0f1a3faae0a890", "score": "0.54232097", "text": "def update\n respond_to do |format|\n if @proce.update(proce_params)\n format.html { redirect_to @proce, notice: 'Proce was successfully updated.' }\n format.json { render :show, status: :ok, location: @proce }\n else\n format.html { render :edit }\n format.json { render json: @proce.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c9148461a415a91a17aeb38f8f801ba", "score": "0.5412527", "text": "def update\n @user = current_user\n owner_id = product_params[ :owner_id ]\n if not (owner_id && (owner_id.to_i > 0))\n # To not choose box once again.\n @box_id = product_params[ :box_id ]\n respond_to do |format|\n format.html { redirect_to edit_product_path( @product.id ), notice: 'ERROR: It is necessary to provide a person in charge explicitly!!!' }\n format.json { head :no_content }\n end\n return\n end\n\n # Set box id and exactly in this order.\n product_params[ :box_id ] ||= @product.box_id\n\n respond_to do |format|\n if @product.update(product_params)\n @product.set_status( product_params[ :status ] )\n log( \"Product is updated: \" + @product.serial_number, @user )\n \n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52826de0b018ea9b1090ee339e877073", "score": "0.5404737", "text": "def update\n respond_to do |format|\n if @promocao.update(promocao_params)\n upsell_produto_save\n format.html { redirect_to edit_produto_upsell_promocao_path(@produto, @upsell, @promocao), notice: 'Promocao was successfully updated.' }\n format.json { render :show, status: :ok, location: @promocao }\n else\n format.html { render :edit }\n format.json { render json: @promocao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "816b5a19d64c76763e3ac51fa241d843", "score": "0.54040474", "text": "def update\n params[:users] ||= {}\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n #format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.html { redirect_to :action => :index }\n format.json { head :no_content } #don't send back :ok, it borks the front-end as it includes a single space which makes the json reply invalid and throws an error\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7df20bebcbf066aa468401bea532e08f", "score": "0.5400522", "text": "def update(json)\n command = json.delete(:command).tr('-', '_')\n if json.empty?\n send command\n else\n send command, **json\n end\n end", "title": "" }, { "docid": "6ffa70431ea74af116f55d773f4a9f1b", "score": "0.5394969", "text": "def update\n respond_to do |format|\n if @proyectominero3.update(proyectominero3_params)\n format.html { redirect_to @proyectominero3, notice: 'Proyectominero3 was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectominero3 }\n else\n format.html { render :edit }\n format.json { render json: @proyectominero3.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b852338b5c18fd44cbfc6d870d7961e7", "score": "0.5391529", "text": "def update\n respond_to do |format|\n if @productos_json.update(productos_json_params)\n format.html { redirect_to @productos_json, notice: 'Productos json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @productos_json.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cdb9f4fce69a71db53e84fb3f88930f", "score": "0.53915143", "text": "def update\n respond_to do |format|\n if @popo.update(popo_params)\n format.html { redirect_to @popo, notice: 'Popo was successfully updated.' }\n format.json { render :show, status: :ok, location: @popo }\n else\n format.html { render :edit }\n format.json { render json: @popo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee87d88625571b4f30d1c9345a977bc2", "score": "0.538903", "text": "def update\n @procon = Procon.find(params[:id])\n\n respond_to do |format|\n if @procon.update_attributes(params[:procon])\n format.html { redirect_to @procon, notice: 'Procon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @procon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bf5cc0e63d154378c233d794d0dcd54", "score": "0.5388392", "text": "def update\n @admin_promo = Admin::Promo.find(params[:id])\n\n respond_to do |format|\n if @admin_promo.update_attributes(params[:admin_promo])\n format.html { redirect_to @admin_promo, notice: 'Promo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf5dc88c402f11ce799cecb04855ed1e", "score": "0.53812534", "text": "def update\n @proitem = Proitem.find(params[:id])\n\n respond_to do |format|\n if @proitem.update_attributes(params[:proitem])\n format.html { redirect_to @proitem, notice: 'Proitem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proitem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85f533646c09e2d1b1d8ab4a7b4e4c6e", "score": "0.5380866", "text": "def patch_object(path, id, info, attributes_to_delete = nil)\n info = info.merge(meta: { attributes: Util.arglist(attributes_to_delete) }) if attributes_to_delete\n json_parse_reply(*json_patch(@target, \"#{path}/#{URI.encode(id)}\", info, @auth_header))\n end", "title": "" }, { "docid": "ce8ac6b4852c1c8d3bd9a1e6486dbac9", "score": "0.5379313", "text": "def update\n respond_to do |format|\n if @progre.update(progre_params)\n format.html { redirect_to @progre, notice: 'Progre was successfully updated.' }\n format.json { render :show, status: :ok, location: @progre }\n else\n format.html { render :edit }\n format.json { render json: @progre.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9de6c81dd9c26117b815f82321b881eb", "score": "0.5372994", "text": "def _proposal_update(new_prop, params)\n # replaced with Attributes \n end", "title": "" }, { "docid": "c2faee14f129a64c6a0d74a61d8a56ec", "score": "0.53570473", "text": "def update\n respond_to do |format|\n if @part_promotion.update(part_promotion_params)\n format.html { redirect_to @part_promotion, notice: 'Part promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @part_promotion }\n else\n format.html { render :edit }\n format.json { render json: @part_promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5adfab8b284d5fbe4bcdc307687d2aa3", "score": "0.5346066", "text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2a28e0a86e9ef7aa4d17264a49ccc61c", "score": "0.53424585", "text": "def index\n @promotions = @shop.promotions\n\n respond_to do |format|\n format.html\n format.json { render json: @promotions }\n end\n end", "title": "" }, { "docid": "d8a477f2db2330ecade920280c0b11ad", "score": "0.5342352", "text": "def update\n \n respond_to do |format|\n if @potion.update(potion_params)\n if params[\"ingredients\"] && params[\"ingredients\"].size > 0\n \n Potion.destroy_recipes(@potion.id)\n Potion.save_ingredients(params[\"ingredients\"], @potion.id)\n \n costs = Potion.compute_production_costs(params[\"ingredients\"])\n @potion.production_cost = costs\n @potion.save\n end\n format.html { redirect_to @potion, notice: 'Potion was successfully updated.' }\n format.json { render :show, status: :ok, location: @potion }\n else\n format.html { render :edit }\n format.json { render json: @potion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1170cb17b6c1636fba434865ca4b5538", "score": "0.53304434", "text": "def update\n respond_to do |format|\n if @innappropiate_request.update(innappropiate_request_params)\n format.html { redirect_to @innappropiate_request, notice: 'Innappropiate request was successfully updated.' }\n format.json { render :show, status: :ok, location: @innappropiate_request }\n else\n format.html { render :edit }\n format.json { render json: @innappropiate_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99eefbf4a53804ad5fa0ca4e80b7a831", "score": "0.5330159", "text": "def update\n respond_to do |format|\n if @pagos_promocion.update(pagos_promocion_params)\n format.html { redirect_to @pagos_promocion, notice: 'Pagos promocion was successfully updated.' }\n format.json { render :show, status: :ok, location: @pagos_promocion }\n else\n format.html { render :edit }\n format.json { render json: @pagos_promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea416b077fa0aa7e84ec3fe2ef9c3772", "score": "0.53289014", "text": "def put\n request_method('PUT')\n end", "title": "" }, { "docid": "aec4301c3a20244d6acf678623bde7ac", "score": "0.53283304", "text": "def update\n respond_to do |format|\n if @product_promotion.update(product_promotion_params)\n format.html { redirect_to([:admin, @product_promotion.promotion], notice: 'Product/promotion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @product_promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "277af8c22a7a74c4958352540b864aa3", "score": "0.5327858", "text": "def update\n respond_to do |format|\n if @pvprovision.update(pvprovision_params)\n format.html { redirect_to @pvprovision, notice: 'Pvprovision was successfully updated.' }\n format.json { render :show, status: :ok, location: @pvprovision }\n else\n format.html { render :edit }\n format.json { render json: @pvprovision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63596076de1486a40310bf7749f06b4", "score": "0.5325898", "text": "def update\n respond_to do |format|\n if @producao.update(producao_params)\n format.html { redirect_to @producao, notice: 'Producao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @producao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63596076de1486a40310bf7749f06b4", "score": "0.5325898", "text": "def update\n respond_to do |format|\n if @producao.update(producao_params)\n format.html { redirect_to @producao, notice: 'Producao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @producao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26b251ce3e7335f7ea21418c0d5628c1", "score": "0.53233314", "text": "def update\n respond_to do |format|\n if @prochy.update(prochy_params)\n format.html { redirect_to prochies_path, notice: 'Запись успешно обновлена.' }\n format.json { render :show, status: :ok, location: prochies_path }\n else\n format.html { render :edit }\n format.json { render json: @prochy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efbb570fe69a4ee4066c1fab1b4e40a0", "score": "0.5322298", "text": "def update\n respond_to do |format|\n if @pro.update(pro_params)\n format.html { redirect_to @pro, notice: 'Pro was successfully updated.' }\n format.json { render :show, status: :ok, location: @pro }\n else\n format.html { render :edit }\n format.json { render json: @pro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fd8e8eb12ad6ad2382424397a178ae6", "score": "0.53196555", "text": "def update\n respond_to do |format|\n if @multivote.update(multivote_params)\n format.html { redirect_to myasset_multivote_url(@multivote), notice: 'Multivote was successfully updated.' }\n format.json { render :show, status: :ok, location: @multivote }\n else\n format.html { render :edit }\n format.json { render json: @multivote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4e78426f3dfc0f50886e221800f9072", "score": "0.5309384", "text": "def update\n respond_to do |format|\n if @protesto.update(protesto_params)\n format.html { redirect_to @protesto, notice: 'Protesto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @protesto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e644e29e8b66783fe732db11b0ba6ec", "score": "0.5304612", "text": "def update\n @pom = Pom.find(params[:id])\n\n respond_to do |format|\n if @pom.update_attributes(params[:pom])\n format.html { redirect_to @pom, notice: 'Pom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pom.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47da3e7dea808face234a7010502a608", "score": "0.5302808", "text": "def update\n respond_to do |format|\n if @promo.update(promo_params)\n format.html { redirect_to @promo, notice: 'Promo was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo }\n else\n format.html { render :edit }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "067fea5081fae82f07a93ae7ef473444", "score": "0.52942896", "text": "def update\n @producent = Producent.find(params[:id])\n @producent.update_attributes(params[:producent])\n respond_with(@producent)\n end", "title": "" }, { "docid": "4295bf3904403ed5de10c0adc8ffea3c", "score": "0.5292674", "text": "def prop_patch(prop_patch)\n @properties = prop_patch.mutations\n prop_patch.remaining_result_code = 200\n end", "title": "" }, { "docid": "cd75eb71c5b4284f793eb23360712dda", "score": "0.5289788", "text": "def update\n respond_to do |format|\n if @pending_toot.update(pending_toot_params)\n format.html { redirect_to @pending_toot, notice: 'Pending toot was successfully updated.' }\n format.json { render :show, status: :ok, location: @pending_toot }\n else\n format.html { render :edit }\n format.json { render json: @pending_toot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62c2ba539b5194dc798b4f253f7c6ebf", "score": "0.52838516", "text": "def update\n @motive.user_updated_id = current_user.id\n respond_to do |format|\n if @motive.update(motive_params)\n format.html { redirect_to motives_path, notice: I18n.t('motives.controller.update') }\n format.json { render :show, status: :ok, location: @motive }\n else\n format.html { render :edit }\n format.json { render json: @motive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32061c3702dd0a68052b53577be4628b", "score": "0.5276692", "text": "def update\n respond_to do |format|\n if @provenance.update(provenance_params)\n format.html { redirect_to @provenance, notice: 'Provenance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @provenance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4ac6b04312402439cf79e75e468c696", "score": "0.5272599", "text": "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @prop_general = @producto.prop_generals.find(params[:id])\n respond_to do |format|\n if @prop_general.update(prop_general_params)\n format.html { redirect_to empresa_producto_prop_generals_path, notice: 'Prop general was successfully updated.' }\n format.json { render :show, status: :ok, location: @prop_general }\n else\n format.html { render :edit }\n format.json { render json: @prop_general.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c1a09a9d20ee815b5c9f998eda70b44", "score": "0.526695", "text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end", "title": "" }, { "docid": "97ab2b27fe58e15d84f1a75f6b60b30a", "score": "0.5266915", "text": "def update\n respond_to do |format|\n if @promotion_action.update(promotion_action_params)\n format.html { redirect_to promotion_path(@promotion), notice: 'Promotion action was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion_action }\n else\n format.html { render :edit }\n format.json { render json: @promotion_action.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6606fe2a54e816a24177fba301eedf64", "score": "0.5266871", "text": "def patch(path, params = nil, headers = nil)\n process(:patch, path, params, headers)\n end", "title": "" }, { "docid": "6606fe2a54e816a24177fba301eedf64", "score": "0.5266871", "text": "def patch(path, params = nil, headers = nil)\n process(:patch, path, params, headers)\n end", "title": "" }, { "docid": "6b55a3fc592d34aa6f316ac90710eeed", "score": "0.526441", "text": "def update\n respond_to do |format|\n if @pb.update(pb_params)\n format.html { redirect_to @pb, notice: 'PB was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb00a3563eaffaaada4729c325726f03", "score": "0.52595025", "text": "def update\n respond_to do |format|\n if @provimento.update(provimento_params)\n format.html { redirect_to @provimento, notice: 'Provimento was successfully updated.' }\n format.json { render :show, status: :ok, location: @provimento }\n else\n format.html { render :edit }\n format.json { render json: @provimento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9449f336e10fe9115f52e759957ef639", "score": "0.5258515", "text": "def edit\n if params['promoter_id'].present? && current_person.administrator?\n @event.promoter = Person.find(params['promoter_id'])\n end\n end", "title": "" }, { "docid": "a7a459881723babfe5c49cf8dfe9f85d", "score": "0.52563375", "text": "def update\n respond_to do |format|\n if @possome.update(possome_params)\n format.html { redirect_to @possome, notice: 'Possome was successfully updated.' }\n format.json { render :show, status: :ok, location: @possome }\n else\n format.html { render :edit }\n format.json { render json: @possome.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
b003d45d31b3894bd0c9162f1de97409
Sets the countriesOrRegionsOfOrigin property value. The country/region of origin for the given actor or threat associated with this intelligenceProfile.
[ { "docid": "fec310e0d487988929af11eb23a2f91b", "score": "0.75085485", "text": "def countries_or_regions_of_origin=(value)\n @countries_or_regions_of_origin = value\n end", "title": "" } ]
[ { "docid": "74315e55f741a6b04e5ec0224d194cda", "score": "0.5981905", "text": "def countries_or_regions_of_origin\n return @countries_or_regions_of_origin\n end", "title": "" }, { "docid": "e818f27767b7bc035369099508d624d3", "score": "0.58241886", "text": "def country_or_region=(value)\n @country_or_region = value\n end", "title": "" }, { "docid": "c1aedc46ca4cb82c500a23f3badb3c96", "score": "0.5470189", "text": "def set_origin_addresses(origin_addresses_data)\n @origin_addresses = CompanyApi::Response::Entity::OriginAddresses.new(origin_addresses_data)\n end", "title": "" }, { "docid": "18700b8d01d4fafac9c814208345eeb6", "score": "0.5306817", "text": "def country_code_of_origin=(country_code_of_origin)\n if !country_code_of_origin.nil? && country_code_of_origin.to_s.length > 2\n fail ArgumentError, 'invalid value for \"country_code_of_origin\", the character length must be smaller than or equal to 2.'\n end\n\n @country_code_of_origin = country_code_of_origin\n end", "title": "" }, { "docid": "48214e4f5c5328fe8948ab7b75b9a550", "score": "0.52815896", "text": "def set_country\n self.country = self.region.country if self.region && self.region.country\n end", "title": "" }, { "docid": "242c83738d876ba2a646547f017e2e27", "score": "0.5174948", "text": "def set_Origin(value)\n set_input(\"Origin\", value)\n end", "title": "" }, { "docid": "242c83738d876ba2a646547f017e2e27", "score": "0.5174948", "text": "def set_Origin(value)\n set_input(\"Origin\", value)\n end", "title": "" }, { "docid": "f381c6bbd495f58f4e8eb26db3a5a0ba", "score": "0.5110739", "text": "def setOrigin(origin)\n @origin = origin\n end", "title": "" }, { "docid": "b42dc4cbb5d545cc317824b7c758deeb", "score": "0.5036231", "text": "def countries_blocked_for_minors=(value)\n @countries_blocked_for_minors = value\n end", "title": "" }, { "docid": "1bd7676359e3252b89837371b0fda85b", "score": "0.49198455", "text": "def origins=( *args )\n update_state_collection( '@origins', *args )\n end", "title": "" }, { "docid": "a897195545436ea12c6e7c6ee746ae6a", "score": "0.48288932", "text": "def set_origin\n @origin = Origin.find(params[:id])\n end", "title": "" }, { "docid": "cc27a32b03b2c72b4b048e5dd4543f94", "score": "0.47419006", "text": "def set_origin\n @origin = Origin.find(params[:id])\n end", "title": "" }, { "docid": "6ba3c2ca5c8025dfc8b08dcb262a2c43", "score": "0.47059613", "text": "def origin=(value)\n @origin = value\n end", "title": "" }, { "docid": "c94b1ddb6adf1e73cf644bdea34579b8", "score": "0.46664196", "text": "def load_origin\n @locations = []\n if params[:id]\n @origin = GeoKit::Geocoders::MultiGeocoder.geocode(Location.unescape(params[:id]))\n else\n if logged_in?\n @origin = current_user.person.geo_location\n else\n @origin = GeoKit::Geocoders::MultiGeocoder.geocode(Utility.country_code)\n end\n end\n end", "title": "" }, { "docid": "f7e9d15792f81ed5ffa937430cfa3139", "score": "0.46465403", "text": "def set(locales = nil, regions = nil)\n @Locales = locales unless locales.nil?\n @Regions = regions unless regions.nil?\n self\n end", "title": "" }, { "docid": "f7e9d15792f81ed5ffa937430cfa3139", "score": "0.46465403", "text": "def set(locales = nil, regions = nil)\n @Locales = locales unless locales.nil?\n @Regions = regions unless regions.nil?\n self\n end", "title": "" }, { "docid": "5881421be1d9d417ced6f679c930a61f", "score": "0.45659477", "text": "def set_region_country\n @region_country = RegionCountry.find(params[:id])\n end", "title": "" }, { "docid": "ec501ff5e616b9a9b18c187b82004b87", "score": "0.45641807", "text": "def set_country_region\n @country_region = CountryRegion.find(params[:id])\n end", "title": "" }, { "docid": "7dc400388e8c4f54e398bc5f0aed6618", "score": "0.45597208", "text": "def set_actor_country\n @actor_country = ActorCountry.find(params[:id])\n end", "title": "" }, { "docid": "50cda1af089ae8224bb1cb94868cd0d9", "score": "0.45554915", "text": "def set_originator\n @originator = Originator.find(params[:id])\n end", "title": "" }, { "docid": "10b808b7e6c8ce29f50f7c8364cb0c9f", "score": "0.45244306", "text": "def set_origin\n origin = session[:origin] || 'boulder-colorado'\n params[:origin] = origin if params[:origin].blank?\n end", "title": "" }, { "docid": "bfe261341ad7f23babced8d4fc70c799", "score": "0.4500007", "text": "def set_situations_arrivals_country\n @situations_arrivals_country = SituationsArrivalsCountry.find(params[:id])\n end", "title": "" }, { "docid": "5012d49900310434a70a3402a20a070d", "score": "0.44897336", "text": "def county_and_country_coordinators?\n (merge_roles & COUNTY_COUNTRY_COORDINATORS).empty?\n end", "title": "" }, { "docid": "7be53feac5c9d7c9b2ea0499cd8604cf", "score": "0.4484417", "text": "def affects?(country)\n (country.regions & restricted_regions).any?\n end", "title": "" }, { "docid": "2fc1d9adaf0359f5748b597cf0e793db", "score": "0.443446", "text": "def origin\n origins && origins.length == 1 && origins[0] || nil\n end", "title": "" }, { "docid": "d1f36ef86c72d29d526b8f5ee6b13d28", "score": "0.44258946", "text": "def set_cors_headers\n if request.headers[\"HTTP_ORIGIN\"]\n # better way check origin\n # if request.headers[\"HTTP_ORIGIN\"] && /^https?:\\/\\/(.*)\\.some\\.site\\.com$/i.match(request.headers[\"HTTP_ORIGIN\"])\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '86400'\n headers['Access-Control-Allow-Credentials'] = 'true'\n end\n end", "title": "" }, { "docid": "f1cb0065b3a7ed593344fea3d5ff2aca", "score": "0.4413402", "text": "def set_OriginAirport(value)\n set_input(\"OriginAirport\", value)\n end", "title": "" }, { "docid": "f5e25628dd9042cad64b3ba34a04faed", "score": "0.43770844", "text": "def set_cors(allowed_methods, allowed_origins)\n @bucket_cors.put(\n cors_configuration: {\n cors_rules: [\n {\n allowed_methods: allowed_methods,\n allowed_origins: allowed_origins,\n allowed_headers: %w[*],\n max_age_seconds: 3600\n }\n ]\n }\n )\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't set CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end", "title": "" }, { "docid": "1654f56ee2f0c91b9b453b089a1b8d2c", "score": "0.43736678", "text": "def set_node_country(node_city, country)\n @nodes[node_city].country = country\n end", "title": "" }, { "docid": "044396050b7fe9f0ffa60cccec8ae6fc", "score": "0.43426222", "text": "def regions=(regions)\n if !regions.nil? && regions.to_s.length > 1000\n fail ArgumentError, 'invalid value for \"regions\", the character length must be smaller than or equal to 1000.'\n end\n\n @regions = regions\n end", "title": "" }, { "docid": "2d720a6e41bdde72c2a847e5720cbecf", "score": "0.43414846", "text": "def set_originator\n @originator = Originator.find(params[:id])\n end", "title": "" }, { "docid": "8f2418d5ab263e18941a812e34f15ff9", "score": "0.43341896", "text": "def load_regions\n\t\t\tregions = Locations::Regions.const_get(ENV['CURRENT_CITY'])\n\t\tend", "title": "" }, { "docid": "e564c3e812de29d8bf76f425950c4d6b", "score": "0.43233365", "text": "def set_node_region(node_city, region)\n @nodes[node_city].region = region\n end", "title": "" }, { "docid": "001dd7e62785d180d329bb9ae109ee6b", "score": "0.4301244", "text": "def whitelisted_filters_for_countries\n country_slugs = @params[:countries] || []\n @regions.each do |region|\n country_slugs = country_slugs.concat(region[:countries])\n end\n if country_slugs.empty?\n []\n else\n Country.where(slug: country_slugs)\n end\n end", "title": "" }, { "docid": "2b6e5a9f3e3b0082b92843b0f1ab585f", "score": "0.4268836", "text": "def set_Region(value)\n set_input(\"Region\", value)\n end", "title": "" }, { "docid": "b65a5f5831977b4d8af307396cb141cc", "score": "0.42665583", "text": "def origin_names\n origins ? origins.map(&:to_sym) : nil\n end", "title": "" }, { "docid": "02a9ae5db35eef35a9de7487ad6ad654", "score": "0.42650515", "text": "def set_user_region\n @user_region = UserRegion.find(params[:id])\n end", "title": "" }, { "docid": "91a66fa32385138fa93b88bb27d8e2cc", "score": "0.42511782", "text": "def set_Region(value)\n set_input(\"Region\", value)\n end", "title": "" }, { "docid": "ae2decfc7b8efd8a6f90ecbd525ad53d", "score": "0.42440858", "text": "def set_join_region_to_place\n @join_region_to_place = JoinRegionToPlace.find(params[:id])\n end", "title": "" }, { "docid": "725af6f8d8369a597b476d17287495ca", "score": "0.4219727", "text": "def update!(**args)\n @allowed_regions = args[:allowed_regions] if args.key?(:allowed_regions)\n end", "title": "" }, { "docid": "747582eb6ea3ea3d9733edb34075132e", "score": "0.41943958", "text": "def set_join_region_to_place\n @join_region_to_place = JoinRegionToPlace.find(params[:id])\n end", "title": "" }, { "docid": "8fe9c7b8dd380a8fc0e962286dcb9d61", "score": "0.41836268", "text": "def setFrameOrigin( origin )\n @frame.origin = origin\n end", "title": "" }, { "docid": "cd0c1ad02b46e90e867cb107c3bef5a6", "score": "0.41809893", "text": "def origin=(origin)\n validator = EnumAttributeValidator.new('String', [\"plan\", \"add_on\", \"ondemand\", \"additional_cost\", \"credit\", \"discount\", \"setup_fee\"])\n unless validator.valid?(origin)\n fail ArgumentError, \"invalid value for 'origin', must be one of #{validator.allowable_values}.\"\n end\n @origin = origin\n end", "title": "" }, { "docid": "4ef95d1c998ee9e316cab13e0f159d38", "score": "0.41761026", "text": "def set_RegionCode(value)\n set_input(\"RegionCode\", value)\n end", "title": "" }, { "docid": "4ef95d1c998ee9e316cab13e0f159d38", "score": "0.41761026", "text": "def set_RegionCode(value)\n set_input(\"RegionCode\", value)\n end", "title": "" }, { "docid": "4ef95d1c998ee9e316cab13e0f159d38", "score": "0.41761026", "text": "def set_RegionCode(value)\n set_input(\"RegionCode\", value)\n end", "title": "" }, { "docid": "ef6ba7ac0aa5545b9b1c9e262006a0d2", "score": "0.41740665", "text": "def set(locales = nil, regions = nil, types = nil)\n @Locales = locales unless locales.nil?\n @Regions = regions unless regions.nil?\n @Types = types unless types.nil?\n self\n end", "title": "" }, { "docid": "ab5b555169a6555356d6f67f6c26a964", "score": "0.41457188", "text": "def set_OriginZipCode(value)\n set_input(\"OriginZipCode\", value)\n end", "title": "" }, { "docid": "3d680caa5c11e2704367b081f866e2f9", "score": "0.4133402", "text": "def origin=(v)\n @origin = v ? URI.parse(v) : nil\n end", "title": "" }, { "docid": "2620a3458cec6ceb36c87ec48882c7dc", "score": "0.41298512", "text": "def set_origin_type\n @origin_type = OriginType.find(params[:id])\n end", "title": "" }, { "docid": "f054d2cf6b695980605df6dea096069e", "score": "0.4119731", "text": "def picture_origin(id, *origin)\n origin = origin[0] if origin.length == 1\n pictures[id].origin = origin\n end", "title": "" }, { "docid": "6ec9b15727d35cdb6c4bfccac1bbbeec", "score": "0.41185376", "text": "def country_or_region\n return @country_or_region\n end", "title": "" }, { "docid": "db0eb24393a2272dd02dd312d7d058aa", "score": "0.41143993", "text": "def country=(value)\n\t\t\t@country = value\n\t\tend", "title": "" }, { "docid": "dee73b6a11c707651df3befb39278f68", "score": "0.4087659", "text": "def remove_county_or_country_roles\n merge_roles.reject { |role|\n COUNTY_COUNTRY_COORDINATORS.include? role\n }\n end", "title": "" }, { "docid": "3cc884e7eec0b2626fb71af260da8787", "score": "0.40794617", "text": "def country_zones(country_code)\n code = country_code.to_s.upcase\n @country_zones[code] ||= load_country_zones(code)\n end", "title": "" }, { "docid": "8987331caa8ee17db06679b813989c28", "score": "0.40681937", "text": "def allowed_request_origins=(_arg0); end", "title": "" }, { "docid": "8a930672b32bf737d01fdc864c1f1bda", "score": "0.40591064", "text": "def region=(value)\n @region = value\n end", "title": "" }, { "docid": "737ed6e80da5963b03148c8d3dfa98dc", "score": "0.4058663", "text": "def select_origin(country, city)\n get_elem_and_click(:xpath, \"//input[@placeholder='Departure airport']\")\n select_country(country)\n get_elem_and_click(:xpath, \"//*[contains(text(), '#{city}')]\")\n end", "title": "" }, { "docid": "24613c8fb09c6fcb3f18bda49bcfa37b", "score": "0.40510675", "text": "def set_region_name\n @region_name = RegionName.includes( :country_name ).find( params[ :id ])\n end", "title": "" }, { "docid": "4aab1f173f257755ab3ef4072f44031f", "score": "0.40446746", "text": "def set_world_region\n @world_region = WorldRegion.find(params[:id])\n end", "title": "" }, { "docid": "bbdd71d62692197c293197d3dfa39a99", "score": "0.40274552", "text": "def countries\n @countries ||= Fotolia::Countries.new(self)\n end", "title": "" }, { "docid": "d5a670916335027e1a037dca6a7b4d59", "score": "0.4026022", "text": "def set_regional\n @regional = Regional.find(params[:id])\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.39856857", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.39856857", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.39856857", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.39856857", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.39856857", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "c4c138d99bd7b70e35223272846cc2b3", "score": "0.39850792", "text": "def cors_set_access_control_headers\n log_origin_access # TODO: Disable logging for GoLive. Log only requests for api-clients #41\n headers['Access-Control-Allow-Origin'] = allowed_client_origins\n headers['Access-Control-Allow-Methods'] = allowed_client_methods\n headers['Access-Control-Allow-Headers'] = allowed_headers\n headers['Access-Control-Max-Age'] = allowed_max_age\n end", "title": "" }, { "docid": "37a98eabcaa16b4f1069ca24e21a2bae", "score": "0.39709428", "text": "def picture_origin(id, *origin)\n origin = origin[0] if origin.length == 1\n pictures[id].origin = origin\n end", "title": "" }, { "docid": "b1c4f2805346f22fd6a3004baed3eab4", "score": "0.39645165", "text": "def set_node_timezone(node_city, timezone)\n @nodes[node_city].timezone = timezone\n end", "title": "" }, { "docid": "431a939126dc2c347b89dbe584901376", "score": "0.39556894", "text": "def set_country_for_partner_admin country\n contact_chg_country_select.select country\n end", "title": "" }, { "docid": "872436ce05a54ab51f96eb7a05b37928", "score": "0.39388934", "text": "def set_countrys_movie\n @countrys_movie = CountrysMovie.find(params[:id])\n end", "title": "" }, { "docid": "504a1c26d20c7603fb44aae39570477a", "score": "0.39293113", "text": "def restricted_countries\n # TODO check permission modifiers that prevent coups\n\n countries.select do |country|\n defcon.affects?(country)\n end\n end", "title": "" }, { "docid": "e6df1d7c7e44889d8dda1cabb11efb51", "score": "0.3926107", "text": "def set(regions = nil, type = nil)\n @Regions = regions unless regions.nil?\n @Type = type.to_sym if type\n self\n end", "title": "" }, { "docid": "7363c9fb4a8656e468209deb2999d409", "score": "0.3925721", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "756cb6b4094efc26051a92aa5d279d15", "score": "0.39174205", "text": "def set_cities_user\n @cities_user = CitiesUser.find(params[:id])\n end", "title": "" }, { "docid": "7cb791e6eac4829634967e9fa679ce5b", "score": "0.39015064", "text": "def countries\n @countries = Spree::Country.where(name: Spree::Config[:default_address_country])\n zone = Spree::Zone.find_by(name: Spree::Config[:address_zone_name]) if Spree::Config[:address_zone_name]\n @countries = zone.countries.order(:name) if zone.present?\n end", "title": "" }, { "docid": "7ecdaa38cffb54ea333af5ac094637cd", "score": "0.38978255", "text": "def added_cors\n (@local.cors || []) - @aws.cors.rules\n end", "title": "" }, { "docid": "8725ee71c71e54f934103938cf3f778a", "score": "0.38919565", "text": "def set_object_origin(content, value)\n content.oy = value\n end", "title": "" }, { "docid": "7ce3773e361727137667b171aa4ba43f", "score": "0.3881575", "text": "def origin=(value)\n raise UnsupportedOperationError\n end", "title": "" }, { "docid": "1b3554acb764c0353096465015e592c2", "score": "0.38802838", "text": "def countries\n countries = YAML.load_file(Rails.root.join('data', 'locale_countries.yml'))\n countries.select! { |_, flag| File.exist? Rails.root.join('app', 'assets', 'images', 'country-flags', \"#{flag.downcase}.png\") }\n # apply potential region values too\n Dir.glob(Rails.root.join('app', 'assets', 'images', 'country-flags', '*.png')).each do |file|\n base = File.basename(file, '.png')\n next if base.starts_with?('_')\n countries[base.upcase] = base\n end\n\n countries.each { |key, flag| countries[key] = view_context.image_path(\"country-flags/#{flag.downcase}.png\") }\n\n render json: countries.to_json\n end", "title": "" }, { "docid": "d6b51e64e9cf7d3da91a03b340482b73", "score": "0.387811", "text": "def set_object_origin(obj, value)\n obj.oy = value\n end", "title": "" }, { "docid": "fc71110c44bac63592baf487df64bb59", "score": "0.38738263", "text": "def on_behalf_requestors=(value)\n @on_behalf_requestors = value\n end", "title": "" }, { "docid": "5916fa788ce4b51d1ef2ceab479e8f4b", "score": "0.38735297", "text": "def set_default_country\n\t # get the country from the user profile -- that's the most logical match\n\t @profile = current_user.profile\n\t \n\t if @profile.country != \"\" then\t \n\t\t @customer.country = @profile.country\n\t else\n\t\t # if that's not available (country unknown) get it from browser variables\n\t\t set_country_from_http_accept_language\n\t end\n\t \n end", "title": "" }, { "docid": "6ec5cbe5a0673240c8d3f35bda04d440", "score": "0.38711", "text": "def coordinators_allowed\n 2\n end", "title": "" }, { "docid": "cd5925e2cdd0015576adafd9f357c14b", "score": "0.38667324", "text": "def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n\tend", "title": "" }, { "docid": "4facf621ec650e5f1ad7ef4191633760", "score": "0.38654086", "text": "def set_continents(taxonomies_fragement)\n taxonomies_fragement.each { |taxonomy|\n continent = build_tree(taxonomy)\n @continents << continent\n }\n end", "title": "" }, { "docid": "81c4120f6f588d6d01b524ee9c79d513", "score": "0.38649604", "text": "def set_country_continent\n @country_continent = CountryContinent.find(params[:id])\n end", "title": "" }, { "docid": "9e06fa37e0ac7a68323c4c72e1b3e6da", "score": "0.38646072", "text": "def set_regional\n @regional = Regional.find(params[:id])\n end", "title": "" }, { "docid": "3cbddef44fd94d44f227fa46c71bdc08", "score": "0.3855917", "text": "def update_region player\n\t\tif !@conf.regions\n\t\t\treturn\n\t\tend\n\t\t# TODO: Consider switching from event driven to time driven for less server impact.\n\t\tpt = BukkitUtil.toVector(player.getLocation)\n\t\t\n\t\trm = @wg.getRegionManager(player.getWorld)\n\t\tset = rm.getApplicableRegions(pt).iterator\n\t\tplayer_data = @players[player]\n\t\tin_region = false\n\t\twhile set.hasNext\n\t\t\telem = set.next\n\t\t\tregion = @conf.regions[elem.getId]\n\t\t\tif region\n\t\t\t\tin_region = true\n\t\t\t\t# Player entered/switched region.\n\t\t\t\tif region.id!=player_data.region\n\t\t\t\t\tif player_data.region==\"\"\n\t\t\t\t\t\tinfo \"#{player.getDisplayName} has entered region: #{region.id}.\"\n\t\t\t\t\t\tplayer.sendMessage(\"You have entered region: #{region.id}.\")\n\t\t\t\t\telsif\n\t\t\t\t\t\tinfo \"#{player.getDisplayName} has left region: #{player_data.region}; to enter region: #{region.id}.\"\n\t\t\t\t\t\tplayer.sendMessage \"You have left region #{player_data.region}; to enter region: #{region.id}.\"\n\t\t\t\t\tend\n\t\t\t\t\tplayer_data.region = region.id\n\t\t\t\t\tregion_mode = GameMode::SURVIVAL\n\t\t\t\t\tif region.creative\n\t\t\t\t\t\tregion_mode = GameMode::CREATIVE\n\t\t\t\t\tend\n\t\t\t\t\tmode = player.getGameMode\n\t\t\t\t\tif region_mode != mode\n\t\t\t\t\t\tset_gamemode player, region_mode\n\t\t\t\t\tend\n\t\t\t\t\tplayer_data.set_texture_pack region.texture_pack\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t# Player left region.\n\t\tif !in_region && player_data.region!=\"\"\n\t\t\tinfo \"#{player.getDisplayName} has left region: #{player_data.region}.\"\n\t\t\tplayer.sendMessage(\"You have left region: #{player_data.region}.\")\n\t\t\tplayer_data.region = \"\"\n\t\t\tdefault_mode = GameMode::SURVIVAL\n\t\t\tif @conf.default_creative\n \t\tdefault_mode = GameMode::CREATIVE\n \t\tend\n\t\t\tif default_mode != player.getGameMode\n\t\t\t\tset_gamemode player, default_mode\n\t\t\tend\n\t\t\tplayer_data.set_texture_pack @conf.default_texture_pack\n\t\tend\n\tend", "title": "" }, { "docid": "f37c93efd2affc613e9ea4dbe60cd20a", "score": "0.38411027", "text": "def set_object_origin(content, value)\n content.ox = value\n end", "title": "" }, { "docid": "246d73a04a5ce80ae4c05a246e7cad4f", "score": "0.38353226", "text": "def set_city\n end", "title": "" }, { "docid": "53a81797be47270f713dc5cf4261a0af", "score": "0.3834622", "text": "def setOwners(owners)\r\n\t\t\t\t\t@owners = owners\r\n\t\t\t\tend", "title": "" }, { "docid": "6413b79f9175bcd745b5118e86c61c46", "score": "0.38334128", "text": "def set_country\n @country = Country.find(params[:id])\n authorize @country\n end", "title": "" }, { "docid": "03c07814c9efbf45462f803e2a1aac9f", "score": "0.38298783", "text": "def countries_blocked_for_minors\n return @countries_blocked_for_minors\n end", "title": "" }, { "docid": "d0f352a40bc59d41813620cc57267c52", "score": "0.38249066", "text": "def setLoadIframes(iframes)\n unless /(?i)^(all|same-origin|none)$/.match(iframes)\n raise Error.new(Pdfcrowd.create_invalid_value_message(iframes, \"setLoadIframes\", \"html-to-image\", \"Allowed values are all, same-origin, none.\", \"set_load_iframes\"), 470);\n end\n \n @fields['load_iframes'] = iframes\n self\n end", "title": "" }, { "docid": "2f8c7c10ffba91378a2af00a19acbd3a", "score": "0.38204423", "text": "def set_regions\n return (\n [\n 'Horizontal Region',\n 'Vertical Region',\n 'Horizontal Region',\n 'Vertical Region',\n 'Horizontal Region'\n ]\n )\n end", "title": "" }, { "docid": "da44fd9e25936c9385b872dbdfe79a7e", "score": "0.38180852", "text": "def country=(args)\n @country = if args.is_a? ::Blackbird::Retoure::Country\n args\n else\n ::Blackbird::Retoure::Country.new(args)\n end\n end", "title": "" }, { "docid": "b24ba413c1f30a58ec9d028e19d4947d", "score": "0.38097867", "text": "def store_countries\n Countries::Data.get_data\n @regions = Countries::Country.create_region_list\n end", "title": "" }, { "docid": "a04fe56715b111add3503ceae05b2b7e", "score": "0.38063002", "text": "def set_region\n @region = Region.find(params[:region_id])\n end", "title": "" } ]
915241b21a60aea6e50d7906c3811df2
GET /guitars/new GET /guitars/new.json
[ { "docid": "da0a4edc9d359599357af6b51eb5f2cf", "score": "0.7062547", "text": "def new\n @guitar = Guitar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guitar }\n end\n end", "title": "" } ]
[ { "docid": "bc22eecd6553d45ab4d71d437ec1c2fb", "score": "0.74747163", "text": "def new\n @goat = Goat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goat }\n end\n end", "title": "" }, { "docid": "4408e3830f6553b051fde3c3089c68ab", "score": "0.7405393", "text": "def new\n @galaxy = Galaxy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @galaxy }\n end\n end", "title": "" }, { "docid": "a2539d8f225c05f1e073f5036dd39fa0", "score": "0.7290995", "text": "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "title": "" }, { "docid": "8711d9621207be635347eb88912bd17f", "score": "0.72021633", "text": "def new\n @gen = Gen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gen }\n end\n end", "title": "" }, { "docid": "9ddb50df36ca85059a36fd79839de398", "score": "0.7191766", "text": "def new\n @gpath = Gpath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpath }\n end\n end", "title": "" }, { "docid": "7756654be46293658c707587c0f4e603", "score": "0.71884954", "text": "def new\n @lugar = Lugar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lugar }\n end\n end", "title": "" }, { "docid": "4063fa5f070167510d5c36a14ee0b4c5", "score": "0.7160118", "text": "def new\n @girltype = Girltype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @girltype }\n end\n end", "title": "" }, { "docid": "b5812c86d40192cdd5a823108ae76982", "score": "0.714779", "text": "def new\n @gitem = Gitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitem }\n end\n end", "title": "" }, { "docid": "3ae38fdecce9be306dc52c30004f14e1", "score": "0.7113955", "text": "def new\n @guille = Guille.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guille }\n end\n end", "title": "" }, { "docid": "59c2b317e75badc472a053e7756a386a", "score": "0.710468", "text": "def new\n @gist = Gist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gist }\n end\n end", "title": "" }, { "docid": "9b7ff55dcd07556de5a4b6f74d7d8b19", "score": "0.71012044", "text": "def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end", "title": "" }, { "docid": "040f06f7b6bea1eb8531334828976960", "score": "0.7074973", "text": "def new\n @genotype = Genotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genotype }\n end\n end", "title": "" }, { "docid": "02f27b9b7abf1f5b43f2c093ff9c0aa0", "score": "0.70649356", "text": "def new\n @boat = Boat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @boat}\n end\n end", "title": "" }, { "docid": "cbb98b9c9f7126e0d85206f8cb8dcd8c", "score": "0.70636886", "text": "def new\n @gl = Gl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gl }\n end\n end", "title": "" }, { "docid": "1664ad03be960fd4fad11b817761039a", "score": "0.70541227", "text": "def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end", "title": "" }, { "docid": "53c79513c0786eb3663dba66b50fdf8c", "score": "0.70240986", "text": "def new\n @go_slim = GoSlim.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @go_slim }\n end\n end", "title": "" }, { "docid": "9a90fa794dcce8b64ed8f0ee8b2bc12a", "score": "0.7006272", "text": "def new\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @galaxies_lenticular_galaxy }\n end\n end", "title": "" }, { "docid": "a359bf438c1f738875b5c7233571c5b7", "score": "0.7006154", "text": "def new\n @good = Good.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @good }\n end\n end", "title": "" }, { "docid": "32592d03d4c631984b5b7f6c996ac001", "score": "0.69999033", "text": "def new\n @hoge = Hoge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hoge }\n end\n end", "title": "" }, { "docid": "f6b400b5c946dfcc1157a5816da03146", "score": "0.69979906", "text": "def new\n @gid2name = Gid2name.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gid2name }\n end\n end", "title": "" }, { "docid": "8809cfa91b24f11c60d06bb902c802c7", "score": "0.6989076", "text": "def new\n @galeria = Galeria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @galeria }\n end\n end", "title": "" }, { "docid": "437b13b58bb15d0b44d371d42403e5ed", "score": "0.6983044", "text": "def new\n @lot = Lot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lot }\n end\n end", "title": "" }, { "docid": "bcdd1c02916c1460c740f958565b02fe", "score": "0.69825464", "text": "def new\n @distro = Distro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distro }\n end\n end", "title": "" }, { "docid": "bcdd1c02916c1460c740f958565b02fe", "score": "0.69825464", "text": "def new\n @distro = Distro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distro }\n end\n end", "title": "" }, { "docid": "cdbdaecd47e012e8788daee669371253", "score": "0.6975262", "text": "def new\n @goody = Goody.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goody }\n end\n end", "title": "" }, { "docid": "ff45ee8802d2eb864f2937b6e9d52ffe", "score": "0.6973853", "text": "def new\n @gasto = Gasto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gasto }\n end\n end", "title": "" }, { "docid": "d6bd53d1111450c48b1ae5dd6f19ae68", "score": "0.69730514", "text": "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end", "title": "" }, { "docid": "7bd558262df1692a642406feaec44576", "score": "0.69721216", "text": "def new\n @ginasio = Ginasio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ginasio }\n end\n end", "title": "" }, { "docid": "5b0def352e18d29af8976f5f6a55d1d8", "score": "0.6961028", "text": "def new\n @have = Have.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @have }\n end\n end", "title": "" }, { "docid": "396755cbaf53a40939ccddc758c8d5c0", "score": "0.69583863", "text": "def new\n @generation = Generation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generation }\n end\n end", "title": "" }, { "docid": "cf568cb8e02f8a5ae89c6820d9050d3b", "score": "0.69477075", "text": "def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @village }\n end\n end", "title": "" }, { "docid": "968603684bc7d4d285df34fc4ac2dad1", "score": "0.69361955", "text": "def new\n @gitto = Gitto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitto }\n end\n end", "title": "" }, { "docid": "8e40def3334e9cd3bc7195020643f7a3", "score": "0.6935556", "text": "def new\n @grm = Grm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grm }\n end\n end", "title": "" }, { "docid": "47ece879e92464381ccd40e07ed30e78", "score": "0.69327265", "text": "def new\n @glass = Glass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @glass }\n end\n end", "title": "" }, { "docid": "605b7b781a343c274f59784b4262763e", "score": "0.6930535", "text": "def new\n @grupa = Grupa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupa }\n end\n end", "title": "" }, { "docid": "e6377e0102e5624e4719a78f8da45492", "score": "0.6925999", "text": "def new\n @pot = Pot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pot }\n end\n end", "title": "" }, { "docid": "04ddc9bca51e766c4ead29bdb953861c", "score": "0.69254166", "text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "title": "" }, { "docid": "04ddc9bca51e766c4ead29bdb953861c", "score": "0.69254166", "text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "title": "" }, { "docid": "04ddc9bca51e766c4ead29bdb953861c", "score": "0.69254166", "text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "title": "" }, { "docid": "d751548fe2a26944a15060ac29172a03", "score": "0.69181454", "text": "def new\n @ninja = Ninja.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ninja }\n end\n end", "title": "" }, { "docid": "709afcedaaa2603e8a38b9968c7ade05", "score": "0.69144136", "text": "def new\n @tags_of_novel = TagsOfNovel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tags_of_novel }\n end\n end", "title": "" }, { "docid": "48df2a3af5ddf7f864902d46a25afe50", "score": "0.69039273", "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": "e7d6d7bfa3084f20a83df23f07affa18", "score": "0.6893338", "text": "def new\n @gymnasium = Gymnasium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gymnasium }\n end\n end", "title": "" }, { "docid": "ec382b45f7188eb432c1e885526109ea", "score": "0.6885284", "text": "def new\n @green = Green.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @green }\n end\n end", "title": "" }, { "docid": "f111ca39b18acf2773307c1413450be1", "score": "0.68825614", "text": "def new\n @stuff = Stuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stuff }\n end\n end", "title": "" }, { "docid": "b73721fe1b741f807e4487f5dd49e9be", "score": "0.688061", "text": "def new\n @garbage = Garbage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @garbage }\n end\n end", "title": "" }, { "docid": "0c28634af556d56428bdf0e4ff5ce224", "score": "0.6877568", "text": "def new\n @barrack = Barrack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @barrack }\n end\n end", "title": "" }, { "docid": "c0f2215417ff5459a99cf19268baaa03", "score": "0.6875401", "text": "def new\n @golfer = Golfer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @golfer }\n end\n end", "title": "" }, { "docid": "75141bb167bcc0603715e2e43ef5d77f", "score": "0.687232", "text": "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "title": "" }, { "docid": "75141bb167bcc0603715e2e43ef5d77f", "score": "0.687232", "text": "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "title": "" }, { "docid": "62b2637fdb4508daf7e970d4956c6941", "score": "0.68665266", "text": "def new\n @registry = Registry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registry }\n end\n end", "title": "" }, { "docid": "f2cb261ff522a20c073d6a4884961450", "score": "0.6866192", "text": "def new\n @generator = Generator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generator }\n end\n end", "title": "" }, { "docid": "a55aeeb404075ba279b37d00c22fb05e", "score": "0.6864368", "text": "def new\n @needed_good = NeededGood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @needed_good }\n end\n end", "title": "" }, { "docid": "4a0c77ce53563e34f223ab8f8c9acd98", "score": "0.6858322", "text": "def new\n @colegio = Colegio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegio }\n end\n end", "title": "" }, { "docid": "35f4a87dfad90a6932cd1bf35f8559cb", "score": "0.68581104", "text": "def new\n @bagtype = Bagtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bagtype }\n end\n end", "title": "" }, { "docid": "4a79af84e361fc21ca730d3b688d9fa8", "score": "0.68493736", "text": "def new\n @fridge = Fridge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fridge }\n end\n end", "title": "" }, { "docid": "c8135b58e8168c71f670ae02908030ab", "score": "0.6849165", "text": "def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end", "title": "" }, { "docid": "c8135b58e8168c71f670ae02908030ab", "score": "0.6849165", "text": "def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cat }\n end\n end", "title": "" }, { "docid": "d8ea39dde06ba20b6cef9fc8ea031748", "score": "0.68490434", "text": "def new\n @hasil = Hasil.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hasil }\n end\n end", "title": "" }, { "docid": "ab93e5b2b97a7f7c4b739ad52ba6781e", "score": "0.6846902", "text": "def new\n @popularty = Popularty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @popularty }\n end\n end", "title": "" }, { "docid": "a632c86da6cc68ac5f3aa968221eef1c", "score": "0.68467265", "text": "def new\n @pushup = Pushup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pushup }\n end\n end", "title": "" }, { "docid": "dba396ec2b2f481deb8df610140ac413", "score": "0.6845051", "text": "def new\n @kind = Kind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kind }\n end\n end", "title": "" }, { "docid": "7c6553d70f7230be1c26246d193dc09d", "score": "0.6843822", "text": "def new\n @grm_grappt = GrmGrappt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grm_grappt }\n end\n end", "title": "" }, { "docid": "20a23bba59d0a9ed4e7d6f6fd305218a", "score": "0.6839234", "text": "def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end", "title": "" }, { "docid": "61d72e737dd06660fd9647a83d080745", "score": "0.6835912", "text": "def new\n @potluck = Potluck.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @potluck }\n end\n end", "title": "" }, { "docid": "4ec8361355a34b30fb28a165224e1e66", "score": "0.683457", "text": "def new\n @shot = Shot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shot }\n end\n end", "title": "" }, { "docid": "a280f190534af42f004b894899d0ee13", "score": "0.6832361", "text": "def new\n @gage = Gage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gage }\n end\n end", "title": "" }, { "docid": "06595f5ab60d0236c58d64ab2f913bef", "score": "0.6819555", "text": "def new\n @moose = Moose.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @moose }\n end\n end", "title": "" }, { "docid": "8636dc9ee0d8588206c5f9177c03f7e8", "score": "0.68170327", "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": "9f92f68fda3936271b52805033304385", "score": "0.68068296", "text": "def new\n @drug = Drug.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drug }\n end\n end", "title": "" }, { "docid": "e6888164a64b1195ad713e837c870c5d", "score": "0.68038636", "text": "def new\n @phile = Phile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phile }\n end\n end", "title": "" }, { "docid": "d26846c37cf8967b5376bdd110ecda78", "score": "0.6803141", "text": "def new\n @barrio = Barrio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @barrio }\n end\n end", "title": "" }, { "docid": "c94d0153f2b2109488ae93a7dad51edb", "score": "0.68029016", "text": "def new\n @gauge = Gauge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gauge }\n end\n end", "title": "" }, { "docid": "0dca6571599da967933c5c8802b6414f", "score": "0.6801625", "text": "def new\n @tagging = Tagging.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tagging }\n end\n end", "title": "" }, { "docid": "a91d575ad4eccad6d7205ac57cd8c93c", "score": "0.6795593", "text": "def new\n @v_goal = VGoal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @v_goal }\n end\n end", "title": "" }, { "docid": "e4d83253031320daee2c3de97a909e81", "score": "0.67925465", "text": "def new\n @rock = Rock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rock }\n end\n end", "title": "" }, { "docid": "d2154730a9a308eb37cd0397b05bd74f", "score": "0.67867595", "text": "def new\n @genu = Genu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genu }\n end\n end", "title": "" }, { "docid": "f85450d1b5ec75af26ef667bfcf330c6", "score": "0.6784352", "text": "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @badge }\n end\n end", "title": "" }, { "docid": "5444a59dece822bdfeac9db3a2f3a631", "score": "0.6780853", "text": "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end", "title": "" }, { "docid": "09d9f63143f3f7b19ff30d622452b203", "score": "0.6774383", "text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lore }\n end\n end", "title": "" }, { "docid": "922ba38a4f44ffd7be3bdf33fb227f86", "score": "0.67736286", "text": "def new\n @cool = Cool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cool }\n end\n end", "title": "" }, { "docid": "0ce5f32cdc37e7ac6a7e11a7e2210b1e", "score": "0.67727125", "text": "def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monkey }\n end\n end", "title": "" }, { "docid": "e58854487583dea64fb924e674d8da91", "score": "0.67714477", "text": "def new\n @global_goal = GlobalGoal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @global_goal }\n end\n end", "title": "" }, { "docid": "2a08420dc259be5e3dc8f252b8e3895c", "score": "0.6767705", "text": "def new\n @harvest_trello = HarvestTrello.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @harvest_trello }\n end\n end", "title": "" }, { "docid": "bf5daa88b58db21b54452966885177ab", "score": "0.67674255", "text": "def new\n @guardianship = Guardianship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guardianship }\n end\n end", "title": "" }, { "docid": "65f90386102ce4296de0863a35a5a88f", "score": "0.67671096", "text": "def new\n\tadd_breadcrumb \"Nuevo libro\", :new_libro_path\n @libro = Libro.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @libro }\n end\n end", "title": "" }, { "docid": "09db796f4d6a08c2a9d9fac7265fda1a", "score": "0.675992", "text": "def new\n @carpool = Carpool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carpool }\n end\n end", "title": "" }, { "docid": "eb8ed8d2e8397e7eb2f17ea7c2e8d34d", "score": "0.675209", "text": "def new\n @tag = Tag.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end", "title": "" }, { "docid": "f21b93a37ec98093c29dce4e86e8236d", "score": "0.6749921", "text": "def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end", "title": "" }, { "docid": "61c3fc70a43f7124ba97ed09aa1d5860", "score": "0.67440754", "text": "def new\n @agronomiaquimica = Agronomiaquimica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end", "title": "" }, { "docid": "ba71cb6ae12f224bac3d1b3f559e7ce5", "score": "0.67432225", "text": "def new\n @badge = Badge.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge }\n end\n end", "title": "" }, { "docid": "026ca323563fea23dee4d3bb1af40c56", "score": "0.67431223", "text": "def new\n @gastracker = Gastracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gastracker }\n end\n end", "title": "" }, { "docid": "d9b5273fa01b88dd5eaeafbbf8fc3a9d", "score": "0.67390853", "text": "def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "b0b39c21a38fb69395ec844c42d5ef31", "score": "0.67386913", "text": "def new\n @lost = Lost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lost }\n end\n end", "title": "" }, { "docid": "21178c4eb38d80049a1cac509bb534e8", "score": "0.6736754", "text": "def new\n @brag = Brag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brag }\n end\n end", "title": "" }, { "docid": "d8fb9b786bb8d23b266231ea1a95ebc3", "score": "0.67359203", "text": "def new\n @pony = Pony.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pony }\n end\n end", "title": "" }, { "docid": "a0e2ab5caff455f814653f3c01c8736c", "score": "0.67349887", "text": "def new\n @grm_dog = GrmDog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grm_dog }\n end\n end", "title": "" }, { "docid": "9744a0a315778c64df7368cfb7aeb79f", "score": "0.67337316", "text": "def new\n @gl_type = GlType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gl_type }\n end\n end", "title": "" }, { "docid": "d56451e24766e5c2b07147c5bfe06dd7", "score": "0.67330676", "text": "def new\n @groep = Groep.new\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groep }\n end\n end", "title": "" }, { "docid": "f35a669cca06e4e94384eed6e425f534", "score": "0.67329085", "text": "def new\n @gmap = Gmap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gmap }\n end\n end", "title": "" } ]
a68ed71de50f93ecfa4720c53912aada
GET /profiles/1/details GET /profiles/1/details.json
[ { "docid": "63894c99acb1bece83e2737f2a09f793", "score": "0.8176399", "text": "def details\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # details.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" } ]
[ { "docid": "df80b4b54a03a4d7744ec7250bc7cbaf", "score": "0.7442225", "text": "def show\n profile = Profile.find(params[:id])\n render status: 200, json: profile\n end", "title": "" }, { "docid": "dc273f093330dd96f39a3662aa9b1834", "score": "0.73369", "text": "def show\n @profile = @user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.72906005", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.72906005", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "3aa7eca8c2020b9c13a5836c5f485590", "score": "0.72906005", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "edf831eb90806ffc330f6df9b56ab490", "score": "0.7229452", "text": "def get_user_detail\n user_id = params[:id]\n user = User.find(user_id)\n\n render json: UserSerializer.new(user).profile_detail_hash\n end", "title": "" }, { "docid": "c56d3d69785c5f90d7b33b80b3e99d3b", "score": "0.7137735", "text": "def show\n @profile = current_user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "56593ad992d9b911fd2f4b0d8ba02d60", "score": "0.71172136", "text": "def show\n @profile = Profile.find(params[:id])\n render json: @profile.to_json(include_hash)\n end", "title": "" }, { "docid": "8e53086823477018b48af02ec24be133", "score": "0.70782024", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "bb9f4b662b99d1171cc11ef3a5b2bfc4", "score": "0.706143", "text": "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "0c6b67f636d28bce3c2af60c83f243a8", "score": "0.699471", "text": "def show\n @profile = current_user.profile\n\n # ToDo: error message if no profile is found for user\n\n puts 'Got profile='\n pp @profile\n \n\n puts 'got other_names='\n pp @profile.other_names\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n end\n \n end", "title": "" }, { "docid": "8796b04531642fc7b8301ead681c7c1a", "score": "0.6968601", "text": "def show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end", "title": "" }, { "docid": "4165079f97aca1e36f1c5137a33d6e13", "score": "0.69612867", "text": "def show\n @providers = @profile.providers_data\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @profile }\n end\n end", "title": "" }, { "docid": "0cfefc576042f59f991f8fedc371324c", "score": "0.6916999", "text": "def show\n @private_profile = PrivateProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @private_profile }\n end\n end", "title": "" }, { "docid": "92a433ca2bb9cb8c26a39de81207b70a", "score": "0.6856557", "text": "def index\n @profile_details = ProfileDetail.all\n end", "title": "" }, { "docid": "511954bf7c6dd76207a0a3a64eaa9989", "score": "0.6833374", "text": "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "title": "" }, { "docid": "22b7f3879d492501ed9406182f585cb5", "score": "0.68257934", "text": "def show\n @pay_profile = PayProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pay_profile }\n end\n end", "title": "" }, { "docid": "872124ef74f66bb8aa0eed2be50b39fd", "score": "0.68217707", "text": "def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "872124ef74f66bb8aa0eed2be50b39fd", "score": "0.68217707", "text": "def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "c36b320acd80f214f48cb6060397acf2", "score": "0.6805765", "text": "def get_default_profile \n get(\"/profiles.json/default\")\nend", "title": "" }, { "docid": "bcc45ab4d5ff39a1e5970d9124548ea8", "score": "0.680255", "text": "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "title": "" }, { "docid": "bfd1981003819e2d3c6ba4d9d17e874b", "score": "0.67727923", "text": "def show\n @profiles = @grab.profiles\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "b1c9f49b9a1304f6aeea88e82b89a0de", "score": "0.67410386", "text": "def show\n @profile = Profile.find(params[:id])\n end", "title": "" }, { "docid": "9a35a31804e3f006d946a07040497f57", "score": "0.67406416", "text": "def show\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile_attribute }\n format.json { render :json => @profile_attribute }\n end\n end", "title": "" }, { "docid": "fd71ac4cea4e79920cfddda087510471", "score": "0.6740032", "text": "def show\n @university_profile = UniversityProfile.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university_profile }\n end\n end", "title": "" }, { "docid": "659fc8311af674397e7396d03de1172d", "score": "0.67079", "text": "def show\n @monitor_profile = MonitorProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monitor_profile }\n end\n end", "title": "" }, { "docid": "d67366451d1c17f488e3cf688c25030a", "score": "0.6704775", "text": "def show\n\t\t# begin\n\t\t\tprofile = Profile.find(params[:id])\n\t @conversation = current_profile.find_conversation(profile)\n\t respond_to do |format|\n\t format.html {render \"profiles/#{profile._type.underscore}_show\"}\n\t format.json { render :json => @profile }\n\t end\n\t\t# rescue => error\n\t\t# \trender \"profiles/not_found\"\n\t\t# \tputs error.message\n\t\t# end\n end", "title": "" }, { "docid": "1d69451c13b723683059360baa7a1690", "score": "0.6702773", "text": "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "title": "" }, { "docid": "3f0b778356a3e90f0930bb22f46dc973", "score": "0.6695592", "text": "def show\n p params\n p \"just herer for checking\"\n #@profile = Profile.find(params[:id])\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "81573634b2a7ee533e948efca8f6a6ce", "score": "0.66773623", "text": "def show\n @monitor_profile = MonitorProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @monitor_profile }\n end\n end", "title": "" }, { "docid": "04ec1b0455f74684647f1985d803e699", "score": "0.666096", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_profile }\n end\n end", "title": "" }, { "docid": "0a7fec33ed32c2619d28b1099418f7ee", "score": "0.66451436", "text": "def index\n @profiledetails = Profiledetail.all\n end", "title": "" }, { "docid": "78f6bec9a17165c54dba2459450ec4f6", "score": "0.6636218", "text": "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "title": "" }, { "docid": "2a5b0397234d5e97999d971bc3dfb886", "score": "0.6630114", "text": "def profile\n p @user.as_json\n render json: @user.as_json\n end", "title": "" }, { "docid": "3e3ad3d47139f45531cc4d9d3f6899f1", "score": "0.6581688", "text": "def show\n @profile = @user.profile\n end", "title": "" }, { "docid": "df66e2ec89fa1576b002433dbbff13c1", "score": "0.65788084", "text": "def show\n @recurring_profile = RecurringProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recurring_profile }\n end\n end", "title": "" }, { "docid": "d3c6934ca5574988120353d8b069bd82", "score": "0.65688413", "text": "def show_current\n user = current_user\n profile = Profile.find_by user_id: user.id\n\n render json: profile\n end", "title": "" }, { "docid": "5e3f7963f7ba40c85098d38dd1f6408b", "score": "0.6540603", "text": "def show\n @personal_info = current_user.personal_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end", "title": "" }, { "docid": "d9554751c2163ad4aa366b880fd8de0f", "score": "0.6530983", "text": "def profile\n render_json 0,\"ok\",current_member.as_profile\n end", "title": "" }, { "docid": "47cc0ea4d6d0010232c20770a5f2e119", "score": "0.6528074", "text": "def show\n\n\n @params = params\n # signed_request = params[:signed_request] \n # @signed_request = decode_data(signed_request)\n \n @profile = Profile.find(params[:id])\n @pieces = @profile.user.pieces.order(\"created_at DESC\").page(params[:page]).per(6)\n \n respond_to do |format|\n if @profile\n format.html # show.html.erb\n format.json { render json: vanity_url_path(@profile) }\n else\n format.html { redirect_to root_url }\n format.json { render json: vanity_url_path(@profile).errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8875c1f143559ccc34bd73ed1009d08", "score": "0.6525371", "text": "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "title": "" }, { "docid": "f6c08489cbc91587b1ec1d44b39c8c85", "score": "0.65062994", "text": "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "title": "" }, { "docid": "51aa777d99b3b637de3179b379bceab6", "score": "0.650546", "text": "def show\n @profile = Profile.find_by_user_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile.to_json(:include => [:faculty, :course]) }\n end\n end", "title": "" }, { "docid": "c88e5e0aa4632a4826507b7cdba98a9b", "score": "0.6494746", "text": "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "title": "" }, { "docid": "211bc9c65712f9d3176660987f0f9478", "score": "0.6486225", "text": "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "title": "" }, { "docid": "7ee5ba2cbfec32eca27441b37e68be6e", "score": "0.6474415", "text": "def index\n @profiles = current_user.profiles\n end", "title": "" }, { "docid": "7ee5ba2cbfec32eca27441b37e68be6e", "score": "0.6474415", "text": "def index\n @profiles = current_user.profiles\n end", "title": "" }, { "docid": "04439225ea790ad51500844bc7dd642b", "score": "0.6457347", "text": "def show_cidprofile_full\n puts 'got signed request from an OAuth consumer:'\n pp current_token\n pp current_client_application\n \n @profile = Profile.find_by_cid(params[:cid])\n puts 'found profile by cid=' + params[:cid]\n \n puts 'Showing all profile info:'\n pp @profile\n respond_to do |format|\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n end \n \n end", "title": "" }, { "docid": "d59019d6144b11d9421c9e15ceaf478f", "score": "0.6446039", "text": "def show\n @personal_info = @user.personal_info\n @user = current_user.id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end", "title": "" }, { "docid": "a9822430d634013edac6da32c34f40c9", "score": "0.64449984", "text": "def profile_detail_params\n params[:profile_detail]\n end", "title": "" }, { "docid": "b2f1544ea2d80bc49bc4a1cb33a7c72f", "score": "0.64375156", "text": "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "title": "" }, { "docid": "13810d9c70856076edeb90951ce04821", "score": "0.6436446", "text": "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "title": "" }, { "docid": "5e1bd7e90d998703a496daace0ab2619", "score": "0.6429332", "text": "def show\n @travel_agent_profile = TravelAgentProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel_agent_profile }\n end\n end", "title": "" }, { "docid": "62ef20ec77fb9608d5f5fb8aa00e96aa", "score": "0.6427724", "text": "def show\n @person_info = PersonInfo.find(params[:id])\n\n render json: @person_info\n end", "title": "" }, { "docid": "b3571a84e2be85499c0c9acb0a22b8e6", "score": "0.6423028", "text": "def profile\n if object = send(:\"current_#{resource_name}\")\n self.resource = resource_class.to_adapter.get!(object.to_key)\n respond_with self.resource\n else\n render json: '', status: 404\n end\n end", "title": "" }, { "docid": "b5e51c99b0c69716d7fcbd529264ce2a", "score": "0.6422513", "text": "def profile; Profile.get(self.profile_id); end", "title": "" }, { "docid": "18e1c2b94b1edaff62031d33ed9a9582", "score": "0.64209235", "text": "def show\n @member = Member.find(params[:id], :include=>:profiles)\n\n @user_profiles = @member.profiles.map{|p|{p.network_id=>p.url}}\n @pro_networks = Network.with_urls(@user_profiles, :pro)\n @perso_networks = Network.with_urls(@user_profiles, :perso)\n\n end", "title": "" }, { "docid": "454f214aa20861e95b87738f5b60799d", "score": "0.64194745", "text": "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "title": "" }, { "docid": "b9ced6e4b6c0ba072d12250d60817ace", "score": "0.64188564", "text": "def show\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "title": "" }, { "docid": "b9ced6e4b6c0ba072d12250d60817ace", "score": "0.64188564", "text": "def show\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "title": "" }, { "docid": "202ef9d77dc5d6d91037b443cb6a2f34", "score": "0.6403742", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "" }, { "docid": "93cb1cce6db832698e16b6708a103642", "score": "0.63873744", "text": "def index\n @profiles = Profile.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "title": "" }, { "docid": "b0de8527953dcca1ef894a2711cfe52e", "score": "0.6387279", "text": "def show\n if current_user.try(:admin?)\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n else\n redirect_to :permission_error\n end\n end", "title": "" }, { "docid": "8d3e61b8da2ed225099b80ae078f8773", "score": "0.6382297", "text": "def show\n @organization_profile = OrganizationProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @organization_profile }\n end\n end", "title": "" }, { "docid": "241a4e5bd5c4fc8ce2a849d1071cf5f3", "score": "0.6380388", "text": "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "title": "" }, { "docid": "06dbacef529983a073a5684fcbdf885e", "score": "0.63741314", "text": "def index\n @profiles = Profile.all\n @profile = Profile.find_by_id(params[:profile_id])\n end", "title": "" }, { "docid": "ac9e7d09b52a6143faf51b8114acd5f6", "score": "0.63737684", "text": "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "title": "" }, { "docid": "2a85b94fa6e875dc137d6c87a396e934", "score": "0.6373102", "text": "def show\n response = OpenStruct.new({\n 'id': @current_user.account_uuid,\n 'type': 'mvi_models_mvi_profiles',\n 'gender': @current_user.gender_mpi,\n 'birth_date': @current_user.birth_date_mpi\n })\n handle_errors!(response)\n\n render json: response, serializer: PersonalInformationSerializer\n end", "title": "" }, { "docid": "98d709d726d247392365cc711347b6dc", "score": "0.6361384", "text": "def show\n @stripe_client_id = ENV['CLIENT_ID']\n respond_with(@profile)\n end", "title": "" }, { "docid": "6cf07538ffcc26760f456968026576d4", "score": "0.63558847", "text": "def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end", "title": "" }, { "docid": "5d565c5bfbf4789a781ff07310f1960e", "score": "0.6354324", "text": "def show\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @detail }\n end\n end", "title": "" }, { "docid": "83f287f0041d4c82f2048bc518a0cace", "score": "0.6352972", "text": "def professional_info\n respond_with_entity(api.get('/api/v1/profile/professional_info'),\n NexaasID::Entities::Profile::ProfessionalInfo)\n end", "title": "" }, { "docid": "71050fc47e2136f5708a636f7427d667", "score": "0.63415515", "text": "def show\n render json: @skill_user_profile\n end", "title": "" }, { "docid": "ab27664dfbdb1bef30a912b1ce965374", "score": "0.6333825", "text": "def profile\n\n end", "title": "" }, { "docid": "06bf365c180627ed1da083e8caceb20b", "score": "0.63279456", "text": "def show\n \tif(params[:id])\n \t\t @profile = Profile.find(params[:id])\n \telse\n \t\t@profile = Profile.find_by_user_id(current_user.id)\n \tend\n # authorize! :show, @profile\n\n add_breadcrumb @profile.first_name + \" \" + @profile.last_name, \"\"\n \n @recentposts = Post.where('user_id = ?', @profile.user.id).order('id desc')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "73878f0990eada9001d672c46fbd2b49", "score": "0.63245976", "text": "def index\n @profile_personal_details = ProfilePersonalDetail.all\n end", "title": "" }, { "docid": "e00bb669ce47ac055c9daf9b4b0e6774", "score": "0.6322917", "text": "def show\t\t\n\t\t# response to the JSON\n\t\trender json: { success: true, response: @profile.as_json },:status=>200\t \n\tend", "title": "" }, { "docid": "970bcb884300d05c20ae28705d0e11bf", "score": "0.630638", "text": "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "title": "" }, { "docid": "970bcb884300d05c20ae28705d0e11bf", "score": "0.630638", "text": "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "title": "" }, { "docid": "11de03766ddd6459b6450bd728dc5590", "score": "0.6286809", "text": "def show\n\n\t\t@current_profile = Profile.get_profile params[:id], \"asdf\"\n\n\t\tpretty_render \"api/public_user\"\t\n\n\tend", "title": "" }, { "docid": "e5b3e5b5dcb5d5670cf41654e179fcf0", "score": "0.6283043", "text": "def index\n @profiles = Profile.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @profiles }\n end\n end", "title": "" }, { "docid": "2ab3fa2b445f33d73de743f3de7f5715", "score": "0.62763095", "text": "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "title": "" }, { "docid": "b90cc5bdce4d8c3287094e92ce8642f6", "score": "0.62733644", "text": "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "title": "" }, { "docid": "b001e4b19dc009f4392787e772870241", "score": "0.62697226", "text": "def new\n # @profile = Profile.new\n\n\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "6fc9aaf190aab1f9852753d7f312e3d3", "score": "0.6260028", "text": "def show\n \n begin\n @profile = Profile.find(params[:id])\n @user=@profile.user\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attemp to access an invaild profile #{params[:id]}\"\n redirect_to root_url,:notice=>\"Invaild profile\"\nelse\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @profile }\n end\n end\n end", "title": "" }, { "docid": "fc366c04f7c8012122f75d9720432bda", "score": "0.62530285", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @profile.to_xml }\n end\n end", "title": "" }, { "docid": "1ac64b28384d853d355ea6437f036537", "score": "0.62504333", "text": "def show\n @ProfileType = ProfileType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @ProfileType }\n end\n end", "title": "" }, { "docid": "c45318c5eb51878aaac431e35b627f62", "score": "0.6247408", "text": "def profile\n @user = UserService.getUserById(params[:id])\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "a375ebf3530b0a78a5648c135955dd68", "score": "0.62431765", "text": "def new\n @profile = Profile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" } ]
d0c2c58d38a881cd2d589945ca029daf
GET /digitals/1 GET /digitals/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e58235c55bfcf1c72b0c8938167af97a", "score": "0.63353705", "text": "def index\n render json: Dig.all\n end", "title": "" }, { "docid": "09ef210237a107e7697e34f996516626", "score": "0.62062985", "text": "def show\n @historial_oct = HistorialOct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_oct }\n end\n end", "title": "" }, { "docid": "3f5ccd45b26457d0f04d85fa846749c5", "score": "0.6022886", "text": "def show\n @hospital_derivation = HospitalDerivation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hospital_derivation }\n end\n end", "title": "" }, { "docid": "4dee075ad9ea134ecdf9fca2709a493c", "score": "0.6014613", "text": "def index\n @product_digitals = ProductDigital.all\n end", "title": "" }, { "docid": "26cf742e9a166aa84f122c043a333450", "score": "0.59821993", "text": "def show\n @numerical = Numerical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @numerical }\n end\n end", "title": "" }, { "docid": "114d6bb330c321c387cfba3e80e48b04", "score": "0.5958043", "text": "def show\n @numerator = Numerator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @numerator }\n end\n end", "title": "" }, { "docid": "08ba44a70599deb6c8ffb9f77e1433b8", "score": "0.5891141", "text": "def index\n @deals = @business.deals \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deals }\n end\n end", "title": "" }, { "docid": "eb0a2c40f5816b4ed9cdfe5dcc705d1c", "score": "0.5779759", "text": "def show\n @daily_diet = DailyDiet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_diet }\n end\n end", "title": "" }, { "docid": "93f2c2bfe5582696113c0096cd9d4cc8", "score": "0.5779125", "text": "def show\n @diary_entry = DiaryEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diary_entry }\n end\n end", "title": "" }, { "docid": "1301edf87907b0db510485696e17c311", "score": "0.57617396", "text": "def show\n @numerical_datum = NumericalDatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @numerical_datum }\n end\n end", "title": "" }, { "docid": "3f700d94e5b1aa23e0b63bd2e234f662", "score": "0.5738524", "text": "def show\n @diary = Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diary }\n end\n end", "title": "" }, { "docid": "5fbfee520ff24c3ae34e181a233e98b4", "score": "0.572929", "text": "def show\n budget = Budget.find(params[:id])\n render :json => budget\n end", "title": "" }, { "docid": "5e8956246646132769a7e5be2f8c7617", "score": "0.57171273", "text": "def index\n @digitals = Digital.all\n @projects = Project.all\n end", "title": "" }, { "docid": "a530c32130711e9051e93bdd69ea77ea", "score": "0.5709433", "text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend", "title": "" }, { "docid": "a530c32130711e9051e93bdd69ea77ea", "score": "0.5709433", "text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend", "title": "" }, { "docid": "ac7c3712d4f581d4f9203a60fdbdd8f9", "score": "0.5698985", "text": "def show\n @historial_odc = HistorialOdc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_odc }\n end\n end", "title": "" }, { "docid": "b54880a66909e09f06a6679f92359c12", "score": "0.56817174", "text": "def show\n @diet = Diet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diet }\n end\n end", "title": "" }, { "docid": "44ad1673936e6897fc5a843b9ee555c1", "score": "0.56563497", "text": "def show\n @digital_datum = DigitalDatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @digital_datum }\n end\n end", "title": "" }, { "docid": "39c349a8a511b95756f91294ff5e51c9", "score": "0.5655112", "text": "def index\n @rentals = Rental.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rentals }\n end\n end", "title": "" }, { "docid": "678fe4d11296e7536799bec567192df1", "score": "0.5649546", "text": "def show\n @icd = Icd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @icd }\n end\n end", "title": "" }, { "docid": "25f540a469bd0a28660e0daa38f60b44", "score": "0.56467664", "text": "def show\n @rental = Rental.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rental }\n end\n end", "title": "" }, { "docid": "b6a66ee054346177cf81355d8e3a0023", "score": "0.5611366", "text": "def show\n @residencial = Residencial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @residencial }\n end\n end", "title": "" }, { "docid": "864c6367ac42b5dd2889bfef6c4f9817", "score": "0.5586904", "text": "def index\n @pals = Pal.all\n\n render json: @pals\n end", "title": "" }, { "docid": "601cab4f9a0a1bc8454b62e97851cfbd", "score": "0.55859274", "text": "def show\n @ledger = Ledger.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ledger }\n end\n end", "title": "" }, { "docid": "8305383e5359a04a9d6136c0b0b65cb1", "score": "0.55850214", "text": "def show\n @crystal = Crystal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crystal }\n end\n end", "title": "" }, { "docid": "4f3537e5703d229fbf41ac8b37d02d0e", "score": "0.5581372", "text": "def show\n @diet_plan = DietPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diet_plan }\n end\n end", "title": "" }, { "docid": "c8d6b2e05f4f1ab0b56a6d8072d1fae1", "score": "0.5580625", "text": "def show\n @disc = Disc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disc }\n end\n end", "title": "" }, { "docid": "9724c237cb9075c32f24decd102a9ee2", "score": "0.55676615", "text": "def index\r\n @daily_deals = DailyDeal.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @daily_deals }\r\n end\r\n end", "title": "" }, { "docid": "eef5425b8f823dd0bc93bbbe1442a4c1", "score": "0.55602664", "text": "def show\n @generaljournal = Generaljournal.find(params[:id])\n @journalentries = JournalEntry.find_all_by_generaljournal_id(@generaljournal.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generaljournal }\n end\n end", "title": "" }, { "docid": "e0b084e0474c0877289c1a6e6ae0a574", "score": "0.5559874", "text": "def new\n @historial_oct = HistorialOct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_oct }\n end\n end", "title": "" }, { "docid": "d8b1d442b8b2ff391936b65127ebc3d1", "score": "0.55507135", "text": "def index\n @corals = Coral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corals }\n end\n end", "title": "" }, { "docid": "e9470dea650ae44f64be99b795632b46", "score": "0.5548131", "text": "def show\n @denuncia = Denuncia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia }\n end\n end", "title": "" }, { "docid": "80cd20868d60abeb4b2331bc131dd055", "score": "0.55448025", "text": "def show\n @rond = Rond.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rond }\n end\n end", "title": "" }, { "docid": "8c4e64689486ddba90a68fa961c933be", "score": "0.5543935", "text": "def show\n @drumy = Drumy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drumy }\n end\n end", "title": "" }, { "docid": "2889a9dd52c2dfd77a37d0e356fc14cc", "score": "0.5537364", "text": "def show\n @rent = Rent.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "d624481046d7fd4333430f53c054aca2", "score": "0.5524884", "text": "def show\n @special_number = SpecialNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @special_number }\n end\n end", "title": "" }, { "docid": "8776ca185139840dde37967f5d8b56c3", "score": "0.5520678", "text": "def show\n @extraction = Extraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extraction }\n end\n end", "title": "" }, { "docid": "6284b5c96453ccc52c8d1b01c7a2f4ad", "score": "0.55175745", "text": "def show\n @dueno = Dueno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dueno }\n end\n end", "title": "" }, { "docid": "68f454aa50431e9b2568fea72e20aca6", "score": "0.5515644", "text": "def show\n @abreviation = Abreviation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @abreviation }\n end\n end", "title": "" }, { "docid": "bdac290e81a489856df168c13b1e88d6", "score": "0.5514347", "text": "def show\n\n render json: @climber\n end", "title": "" }, { "docid": "381be87eb01faf33e9f505e5a2b46c05", "score": "0.55106497", "text": "def show\n @doll = Doll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doll }\n end\n end", "title": "" }, { "docid": "8df543a4fb9afe313cac32e6061d8302", "score": "0.55105066", "text": "def show\r\n @approbation_dissertation = ApprobationDissertation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @approbation_dissertation }\r\n end\r\n end", "title": "" }, { "docid": "b0b93ed43d488416e6e9bd71c10ad9ce", "score": "0.5506421", "text": "def show\n @diner = Diner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diner }\n end\n end", "title": "" }, { "docid": "4e62ad6b6e4f57944c809535b097c872", "score": "0.54973173", "text": "def init_digitisation(json)\n dig_json = json ? json['digitisation'] : nil\n dig_ld = nil\n self.digitisation = if dig_json || dig_ld\n Digitisation.new(json: dig_json, ld: dig_ld)\n end\n end", "title": "" }, { "docid": "23fd73fb84e417102cd47c8c79a3a07e", "score": "0.5492367", "text": "def show\n @automount = Automount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @automount }\n end\n end", "title": "" }, { "docid": "c141ff64ca213fbd95d85eaa22fec2a0", "score": "0.54914784", "text": "def show\n @postal = Postal.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @postal }\n end\n end", "title": "" }, { "docid": "3029977b1e5e0d84394f039de5276131", "score": "0.548995", "text": "def index\n @deals = Deal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deals }\n end\n end", "title": "" }, { "docid": "45ab45b7e0f84ab4e235000a8623f19f", "score": "0.5489717", "text": "def show\n @nationality = Nationality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nationality }\n end\n end", "title": "" }, { "docid": "6e91fd3f22d8fd2cc36c586968f9f3ec", "score": "0.54893214", "text": "def index\n @meals = Meal.all\n render json: @meals, status: 200\n end", "title": "" }, { "docid": "c8af809cd2f56d180458a8ae3e9f28c6", "score": "0.5484663", "text": "def show\n goal = UserGoalsAll.where(\"goal_id = #{params[:id]}\").first\n render json: {\n funded_amount: goal.contr_amount / goal.goal_target * 100,\n goal_name: goal.goal_name,\n contrib: goal.contr_amount,\n goal_id: goal.goal_id\n }\n end", "title": "" }, { "docid": "dd7dc22c862e2446f411a25cb290ec54", "score": "0.54821944", "text": "def show\n @radial = Radial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @radial }\n end\n end", "title": "" }, { "docid": "454fa3bd318f8015409c34f2d5aa6690", "score": "0.5479684", "text": "def show\r\n @dissertation = Dissertation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @dissertation }\r\n end\r\n end", "title": "" }, { "docid": "658e469a710a59fc0924ae6fb6733514", "score": "0.5478684", "text": "def show\n @door = Door.find(params[:id])\n @entrance = @door.entrance\n @cage = @entrance.cage\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @door }\n end\n end", "title": "" }, { "docid": "723792c92a990ced6e71439e3eec90c4", "score": "0.5476964", "text": "def show\n @dailyinterest = Dailyinterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dailyinterest }\n end\n end", "title": "" }, { "docid": "6cc2be40675fd581b6ad4c0e51e16008", "score": "0.5467427", "text": "def index\n @meals = Meal.all\n\n render json: @meals\n end", "title": "" }, { "docid": "d1213359088a480903d5b3cbf772bfba", "score": "0.5466257", "text": "def show\n @salon = Salon.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @salon }\n end\n end", "title": "" }, { "docid": "6103cbc6f30b3c328ab423872f20e58f", "score": "0.54653573", "text": "def show\n @vital = Vital.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vital }\n end\n end", "title": "" }, { "docid": "c0edc50d5fe77573c87670e5a4be563d", "score": "0.5457383", "text": "def person_deals(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit, :status, :sort\n end\n request(:get, \"persons/#{id}/deals\", params)\n end", "title": "" }, { "docid": "0897bdb76c7708c747da599fc71cdaa6", "score": "0.5453304", "text": "def show\n @corporation_debit = CorporationDebit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corporation_debit }\n end\n end", "title": "" }, { "docid": "0271e953529b654f2d23d12a59c89023", "score": "0.544995", "text": "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "0271e953529b654f2d23d12a59c89023", "score": "0.544995", "text": "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "13a7ff6097ab9f593f1a318180d67734", "score": "0.54491466", "text": "def fetch\n\t\tbegin\n\t\t\toutput current_session.user.client.rentals.find(params[:id])\n\t\trescue Exception => exception\n\t\t\terror exception.message, :not_found\n\t\tend\n\tend", "title": "" }, { "docid": "a2d66062abaaf74d000cdb1eb48cb72e", "score": "0.5447698", "text": "def index\n @digoms = Digom.all\n end", "title": "" }, { "docid": "93374f0de7b6ae3ac11712dd154f84d5", "score": "0.5445822", "text": "def index\n @planos_discagens = PlanoDiscagem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planos_discagens }\n end\n end", "title": "" }, { "docid": "afb77ab8917609b207ec97c6d9b4bd18", "score": "0.54446363", "text": "def show\n @nail = Nail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nail }\n end\n end", "title": "" }, { "docid": "8a1292e31528ed104777cc6579b7920d", "score": "0.5442799", "text": "def api_infraction\n render json: {\n infractions: Infraction.all\n }\n end", "title": "" }, { "docid": "69d0fbe5dc55c07867aed2c5db59b8a6", "score": "0.54388994", "text": "def show\n @accounting_entry = AccountingEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @accounting_entry }\n end\n end", "title": "" }, { "docid": "09ec1570be6cc6a982bd9db917bf06f5", "score": "0.5436049", "text": "def show\r\n @dissertation_represent = DissertationRepresent.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @dissertation_represent }\r\n end\r\n end", "title": "" }, { "docid": "96b2d03d213c7bd21353d244aae3f7a4", "score": "0.54350984", "text": "def show\n @dnagrade = Dnagrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @dnagrade }\n end\n end", "title": "" }, { "docid": "27ea58942ef744964ec02b5fe2f6da2d", "score": "0.54329973", "text": "def show\n @residential = Residential.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @residential }\n end\n end", "title": "" }, { "docid": "215482c5a70cab50f7ddd41e213fb5f7", "score": "0.54231423", "text": "def show\n @dentist = Dentist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dentist }\n end\n end", "title": "" }, { "docid": "9d8eaf1129d12732e19f81cb3dec9ac4", "score": "0.5422024", "text": "def index\n @brain_candies = BrainCandy.includes(:difficulty_level).all\n\n respond_to do |format|\n format.html # index.html.erb.erb\n format.json { render json: @brain_candies }\n end\n end", "title": "" }, { "docid": "96b5ac008b6205fdc4eb602d411327bd", "score": "0.5421664", "text": "def show\n uri = URI('https://api.ridemetro.org/data/CalculateItineraryByPoints')\n\n query = URI.encode_www_form({\n # Request parameters\n 'lat1' => '',\n 'lon1' => '',\n 'lat2' => '',\n 'lon2' => '',\n 'startTime' => `datetime'#{Time.now.utc.iso8601}'`,\n '$format' => 'JSON',\n '$orderby' => 'EndTime',\n '$expand' => 'Legs'\n })\n\n if uri.query && uri.query.length > 0\n uri.query += '&' + query\n else\n uri.query = query\n end\n\n request = Net::HTTP::Get.new(uri.request_uri)\n # Request headers\n request['Ocp-Apim-Subscription-Key'] = '6741c2454ce544309f5020fbd7b6e4ca'\n # Request body\n request.body = \"{body}\"\n\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n http.request(request)\n end\n\n puts \"response.body:\", response.body\n puts \"you made a get request I think?? (to #show or /itineraries/1?\"\n render json: response.body\n\n end", "title": "" }, { "docid": "b2e3bb4a15f8e7bd41c36b8747eb5bdf", "score": "0.5420884", "text": "def show\n @patronage = Patronage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patronage }\n end\n end", "title": "" }, { "docid": "b2e3bb4a15f8e7bd41c36b8747eb5bdf", "score": "0.5420884", "text": "def show\n @patronage = Patronage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patronage }\n end\n end", "title": "" }, { "docid": "3a2895aa4780f8a14f1a4d959dfb5366", "score": "0.541957", "text": "def show\n @debt_paper = DebtPaper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @debt_paper }\n end\n end", "title": "" }, { "docid": "a48a18e1ff15391be6100b39e0596c43", "score": "0.541845", "text": "def show\n @abonent_debit = AbonentDebit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @abonent_debit }\n end\n end", "title": "" }, { "docid": "b6403cc5a0d4e34a899466102bc53bd6", "score": "0.5417794", "text": "def initialize\n\t\tdeals = RestClient.get \"https://api.pipelinedeals.com/api/v3/deals.json?api_key=#{KEY}\"\n\t @json = JSON.parse(deals)\n\tend", "title": "" }, { "docid": "6b21f3593d879b000bd1fc90c5312096", "score": "0.541401", "text": "def show\n @indicator = Indicator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicator }\n end\n end", "title": "" }, { "docid": "abb8afe9ec7940a14ea8b3489c6060b2", "score": "0.5410147", "text": "def get_deck\n # get games with at 6 comics\n decks = Deck.where (\"num_comics = 6\")\n respond_to do |format|\n format.json { render :json => decks.sample.id }\n end\n end", "title": "" }, { "docid": "8a2cc7e05ac1d0694520dd5043a879da", "score": "0.5407322", "text": "def index\n @nerds = Nerd.all\n render json: @nerds\n end", "title": "" }, { "docid": "aef8e10ca94195c76c6bca23f2e34390", "score": "0.5401576", "text": "def show\n @subcellular_fraction = SubcellularFraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subcellular_fraction }\n end\n end", "title": "" }, { "docid": "1a0cf845b6a83523e3056fa35303b4ec", "score": "0.5397574", "text": "def show\n @weekly_diet = WeeklyDiet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekly_diet }\n end\n end", "title": "" }, { "docid": "766893882dcb1fc137cd2b2c92b1ce74", "score": "0.53905827", "text": "def show\n @nerd = Nerd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nerd }\n end\n end", "title": "" }, { "docid": "47aeb2c71e55446d0a3b75ac09831054", "score": "0.5390126", "text": "def index\n @denuncias = Denuncia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @denuncias }\n end\n end", "title": "" }, { "docid": "32d4abbe43504dd2f01edf5b400205f5", "score": "0.53847086", "text": "def show\n @military_discount = MilitaryDiscount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @military_discount }\n end\n end", "title": "" }, { "docid": "b5d6b9e6da1b588e52541668062a5da4", "score": "0.5384414", "text": "def show\n rent = Rent.find(params[:id])\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rent.to_json)}, status: 201\n end", "title": "" }, { "docid": "dd41625cca32f7b6942a7eaf5f62eb1e", "score": "0.5383008", "text": "def show\n @digit_recognizer = DigitRecognizer.find(params[:id])\n end", "title": "" }, { "docid": "28d33b6e879913f67c6a5e78017d20f3", "score": "0.5382244", "text": "def index\n @commission_rates = CommissionRate.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commission_rates }\n end\n end", "title": "" }, { "docid": "bb40aa54f7156719578cb7a2ca5b05ae", "score": "0.53816825", "text": "def index\n @fundamental_artifact_initiations = Fundamental::ArtifactInitiation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_artifact_initiations }\n end\n end", "title": "" }, { "docid": "cac9d69f3dc35e9f36041ef777bb68e3", "score": "0.53805894", "text": "def show\n @candy = Candy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @candy }\n end\n end", "title": "" }, { "docid": "6d63c0460f49f2912e6cefa07615f2e2", "score": "0.5378776", "text": "def show\n @legal_doucument = LegalDoucument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @legal_doucument }\n end\n end", "title": "" }, { "docid": "f371cd1b54cfc14e2714b376e901bef6", "score": "0.53773683", "text": "def show\n @rental = Rental.find_by(id: params[:id])\n if @rental\n render json: {success: true, status: 200, object: @rental}\n else\n render json: {success: false, status: 404, message: \"Not Found\"}\n end\n end", "title": "" }, { "docid": "8202ee3ab11b43ad34fc465d7ff57c95", "score": "0.5376573", "text": "def show\n @trial_day = TrialDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trial_day }\n end\n end", "title": "" }, { "docid": "4980e142a19e0231f13090f08f9c83b7", "score": "0.53737235", "text": "def show\n @doctor = Doctor.find(params[:id])\n\n render json: @doctor\n end", "title": "" }, { "docid": "cbfb54da099a9d168cdeaffda1290940", "score": "0.5373626", "text": "def show\n @hospital = Hospital.find(params[:id])\n\n logger.info @hospital\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hospital }\n end\n end", "title": "" }, { "docid": "21c0e2c424be0497ce9e2c68a7d5111e", "score": "0.53706825", "text": "def show\n @porte_animal = PorteAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @porte_animal }\n end\n end", "title": "" }, { "docid": "0bc1bae9a1327621c2cbf49ad9983679", "score": "0.5368019", "text": "def index\n @diets = Diet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diets }\n end\n end", "title": "" }, { "docid": "0c4fb36a24dba516476420c845058881", "score": "0.5367519", "text": "def index\n @meals = @user.meals\n\n @meal = Meal.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end", "title": "" }, { "docid": "90710549917f424c5730b88236e100b0", "score": "0.5367517", "text": "def show\n @pnic = Pnic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pnic }\n end\n end", "title": "" }, { "docid": "fd785afa7bf428915197ff6cd07dba99", "score": "0.53666466", "text": "def show\n @coral = Coral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coral }\n end\n end", "title": "" } ]
b8219b083fa64160304bba15a41ccc13
TODO: add real connection check
[ { "docid": "35a500006a116d4a9614049ecb0c0e14", "score": "0.0", "text": "def still_connected?\n true\n end", "title": "" } ]
[ { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.7415868", "text": "def connection; end", "title": "" }, { "docid": "130ed8b0a01f4968ab981328698f1c78", "score": "0.72673774", "text": "def raw_connection; end", "title": "" }, { "docid": "b57857e5399b86ce8049911b0f361ca9", "score": "0.71464264", "text": "def connection_status_handshake; end", "title": "" }, { "docid": "83e7af5652383cc8f908a44d3353b7ce", "score": "0.70909697", "text": "def connected?; connection_state == :connected end", "title": "" }, { "docid": "d7898547f312cc17b3bda0f546c77137", "score": "0.7084335", "text": "def connection_status_server; end", "title": "" }, { "docid": "fb78f9635b98c2b02302e52368e96760", "score": "0.6997589", "text": "def connected?; end", "title": "" }, { "docid": "fb78f9635b98c2b02302e52368e96760", "score": "0.6997589", "text": "def connected?; end", "title": "" }, { "docid": "fb78f9635b98c2b02302e52368e96760", "score": "0.6997589", "text": "def connected?; end", "title": "" }, { "docid": "4ddcd757af817417deb5c4de94477811", "score": "0.6976323", "text": "def connection_status_done; end", "title": "" }, { "docid": "eb55794ecc0a78ccdfb8e907016b5f57", "score": "0.69616127", "text": "def new_connection; end", "title": "" }, { "docid": "57534f5e860df8fd9fa37c1dc7e87bf5", "score": "0.6877962", "text": "def remote_connections; end", "title": "" }, { "docid": "3dbc514ae06713c891aef16434e04db3", "score": "0.68600357", "text": "def connect!; end", "title": "" }, { "docid": "3dbc514ae06713c891aef16434e04db3", "score": "0.68600357", "text": "def connect!; end", "title": "" }, { "docid": "25eff075345dc4bd58972405f001c211", "score": "0.6824974", "text": "def connect; end", "title": "" }, { "docid": "ad21efe30c678e65d5a0eb2a5e13800a", "score": "0.6781479", "text": "def test_connection\n end", "title": "" }, { "docid": "74321f24c6914d2992e24eb270c4d824", "score": "0.67085314", "text": "def wait_connection; end", "title": "" }, { "docid": "74321f24c6914d2992e24eb270c4d824", "score": "0.67085314", "text": "def wait_connection; end", "title": "" }, { "docid": "9fcfe57f47b2ae5932b25788cdbe5948", "score": "0.66907597", "text": "def connection_status_client_status; end", "title": "" }, { "docid": "e546a75efe2b718ad33f25e80c1f9dd2", "score": "0.66308135", "text": "def connected?\r\n !@conn.nil?\r\n end", "title": "" }, { "docid": "72b2fe8314437a40bcadd2ea077e1e8d", "score": "0.6622647", "text": "def establish_connection\n end", "title": "" }, { "docid": "c19503c45ac752395854a1269add9454", "score": "0.6605827", "text": "def socket?() end", "title": "" }, { "docid": "0cab974cedfd71b448f4ee5fb2582863", "score": "0.66025835", "text": "def conn?\n conn != nil\n end", "title": "" }, { "docid": "b853e4702d2ba1991ff110c606644244", "score": "0.6556323", "text": "def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFile at #{@host}\")\n end\n end", "title": "" }, { "docid": "a55978ec438ba68f51b0678a213ba147", "score": "0.65415865", "text": "def close_connection; end", "title": "" }, { "docid": "1842d81b93111cc2bbd8892b3466d3a8", "score": "0.6536164", "text": "def connection_status_crypt_response; end", "title": "" }, { "docid": "40e79931064a5e9fa5d67324e9c63893", "score": "0.6519295", "text": "def connection_type; end", "title": "" }, { "docid": "ae2983d5f3b66b9b7e278f1eeb890b76", "score": "0.6509622", "text": "def verify_connection!(uri); end", "title": "" }, { "docid": "2a8894f9f87985e52a8e20c730416237", "score": "0.6506904", "text": "def connect(*) end", "title": "" }, { "docid": "5d8ce4cef1475ddaa4839d86fab75cbf", "score": "0.6485082", "text": "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "title": "" }, { "docid": "5d8ce4cef1475ddaa4839d86fab75cbf", "score": "0.6485082", "text": "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.6480778", "text": "def socket; end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.6480778", "text": "def socket; end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.6480778", "text": "def socket; end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.6480778", "text": "def socket; end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.6480778", "text": "def socket; end", "title": "" }, { "docid": "06246bb91c802bec78bf9e2f7f263e06", "score": "0.64768255", "text": "def connect_reset_safe\n\t\tbegin\n\t\t\tconnect\n\t\trescue Rex::ConnectionRefused\n\t\t\treturn :refused\n\t\tend\n\t\treturn :connected\n\tend", "title": "" }, { "docid": "2dbf3c7317864923aa9b0a0c5f27d8e1", "score": "0.6464001", "text": "def connect\n end", "title": "" }, { "docid": "ec0ea99d7243d82241fe8f351b6b49f7", "score": "0.6463808", "text": "def connect\n\tend", "title": "" }, { "docid": "eb284eb0b6aada0b63e1e20d3e298396", "score": "0.6463269", "text": "def test_conn_1p_0000\n assert @conn.open?\n end", "title": "" }, { "docid": "8642d02f57921f7b68e2e62e9f1a5d69", "score": "0.6413412", "text": "def connection_valid?\n if status.untested? or (changed? and (changes.keys & @@status_fields).empty?)\n begin\n test_connection\n status.success!\n rescue => e\n error_str = map_connection_exception_to_error(e)\n status.fail!(error_str)\n end\n end\n status.success?\n end", "title": "" }, { "docid": "bd0295dea993d1d161d5a723ed112895", "score": "0.6412783", "text": "def connection_status_crypt_wait_response; end", "title": "" }, { "docid": "9c40ef9413bfaa6a42425b7d5d7c2500", "score": "0.6408369", "text": "def cork_socket(socket); end", "title": "" }, { "docid": "7d78bd61ed33b0bec288dcd1d7bbddfd", "score": "0.6401156", "text": "def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/process/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFlow at #{@host}\")\n end\n end", "title": "" }, { "docid": "24006f110aa689d8047feba33e9d12d4", "score": "0.63965076", "text": "def connection(env); end", "title": "" }, { "docid": "594da9052ba74a959745963471a3faa8", "score": "0.6389386", "text": "def reconnect\n end", "title": "" }, { "docid": "11bc66ce3de8a83a16336124c7500bf3", "score": "0.63698065", "text": "def pre_connect\n\t\t\ttrue\n\t\tend", "title": "" }, { "docid": "c6b4fa35abcd793f100c30dbccd62fd4", "score": "0.6368117", "text": "def connection_status_crypt_request; end", "title": "" }, { "docid": "69a2d1bb19229a71789cfa46de1c726e", "score": "0.6366654", "text": "def connection_closed\n end", "title": "" }, { "docid": "ffdf4b41ec930e17399060950add76ab", "score": "0.6357425", "text": "def test_connection\n synchronize{|conn|}\n true\n end", "title": "" }, { "docid": "ef298b6c227a1d455f8ffa8363c86b8a", "score": "0.6352048", "text": "def connect!\n end", "title": "" }, { "docid": "a13f1977ea4febbb532e4e1717a7919a", "score": "0.6336802", "text": "def connection_status_mcnet_login; end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "701ca5c1ccc5bcaf99d51292288ad75c", "score": "0.63331145", "text": "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "title": "" }, { "docid": "f96fb9d3124be273eae93a8814b6911a", "score": "0.63192594", "text": "def test_connection_open?\n assert_equal true , @conn.open?\n @conn.disconnect\n assert_equal false, @conn.open?\n end", "title": "" }, { "docid": "8a0ec1b5c9bbb3172edb862e506a63a4", "score": "0.6318567", "text": "def pre_connect\n\t\t# false\n\t\ttrue\n\tend", "title": "" }, { "docid": "05ddf1a4a5a3601a5de717f1b27a217b", "score": "0.6311787", "text": "def connection_status_mcnet_request; end", "title": "" }, { "docid": "ae910a5a9687662d940f2bc0bf59a03c", "score": "0.63027835", "text": "def check_connection(ip)\n if File.exists?(\"ssl/client.crt\") &&\n File.exists?(\"ssl/client.key\") &&\n File.exists?(\"ssl/root.crt\")\n postgres_ssl_connection(ip)\n else\n postgres_plain_connection(ip)\n end\nend", "title": "" }, { "docid": "0931423a3e49aae3b78e896d79988484", "score": "0.6295389", "text": "def stage_over_connection?\n\t\tfalse\n\tend", "title": "" }, { "docid": "c4b2d92903289fb97fd626bcb165cb99", "score": "0.629275", "text": "def connect\n connection.connect\n nil\n end", "title": "" }, { "docid": "b62eccaa322f6de03a2cfef512d18f2d", "score": "0.6292037", "text": "def connection_completed\n\tend", "title": "" }, { "docid": "4a5dd8bc77906768851dbcd3e9aef8a1", "score": "0.62877077", "text": "def check_connection( conn )\n\tbegin\n\t\tconn.exec( \"SELECT 1\" )\n\trescue PG::Error => err\n\t\t$stderr.puts \"%p while testing connection: %s\" % [ err.class, err.message ]\n\t\tconn.reset\n\tend\nend", "title": "" }, { "docid": "e44ea6d314cb733478eda38b0c693ef1", "score": "0.6286479", "text": "def socket; @socket; end", "title": "" }, { "docid": "cd29d3d0f066c0911b000bc9689f279f", "score": "0.6276265", "text": "def configure_connection\n end", "title": "" }, { "docid": "8d5b07101c3f9a635a62ff0f43fbbaa6", "score": "0.62753004", "text": "def connected?\n @connection.present?\n end", "title": "" }, { "docid": "909f4d826051bf918c94c819f3c089a5", "score": "0.6274013", "text": "def disconnected?; connection_state == :disconnected end", "title": "" }, { "docid": "83599b92e416331b1a12c68aa40123a4", "score": "0.62604326", "text": "def connection_valid?\n begin\n result = client.call(:fe_dummy).body[:fe_dummy_response][:fe_dummy_result]\n @observations << \"app_server: #{result[:app_server]}, db_server: #{result[:db_server]}, auth_server: #{result[:auth_server]}\"\n result[:app_server] == \"OK\" and result[:db_server] == \"OK\" and result[:auth_server] == \"OK\"\n rescue => e\n @errors << e.message\n @backtrace = e.backtrace\n false\n end\n end", "title": "" }, { "docid": "91ef1281caf6f1dfccc762e4e9554964", "score": "0.6259482", "text": "def test_connection\n @connection.bind\n last_operation_result\n end", "title": "" }, { "docid": "91ef1281caf6f1dfccc762e4e9554964", "score": "0.6259482", "text": "def test_connection\n @connection.bind\n last_operation_result\n end", "title": "" }, { "docid": "2097d6b9b13078b98c10d17ed5168334", "score": "0.6258472", "text": "def configure_connection\n end", "title": "" }, { "docid": "955a2146b44bffcfe6aff89aaff4005d", "score": "0.62553287", "text": "def connection\n raise NotImplementedError, \"Implement #{__callee__} in #{self.class.to_s}\"\n end", "title": "" }, { "docid": "62960ebfe678070317b975fd6245aa2d", "score": "0.6254602", "text": "def connected?\n\t\t@conn.connected?\n\tend", "title": "" }, { "docid": "e17199e7407c309876dded1bfb13253f", "score": "0.62296593", "text": "def client_connected\n end", "title": "" }, { "docid": "23b4ca953f9a3ef80c4c5d4bf04bec40", "score": "0.6228505", "text": "def valid_connection?\n @connection && @connection.valid?\n end", "title": "" }, { "docid": "8482582270ad21ced151a3fce712cbf3", "score": "0.62141985", "text": "def connection_status_client_setting; end", "title": "" }, { "docid": "80ccb357bfeee4eb820ff48335b9f449", "score": "0.62136424", "text": "def connected?\n start_ssh {|ssh| } # do nothing\n rescue *CONNECTION_EXCEPTIONS => ex\n @connection_error = ex\n return false\n else\n return true\n end", "title": "" }, { "docid": "aaaf44ab567042cfabd8fca0d8770d7f", "score": "0.6207874", "text": "def legacy_reconect\n\t\tputs \"Reconectando...\"\n\t\tif @arry_ips.length == 0\n\t\t\t@arry_ips = Connections::SERVER_IP\n\t\telsif @arry_ips.length != Connections::SERVER_IP.length && @ip_integrity != \"m\"\n\t\t\t@arry_ips = Connections::SERVER_IP\n\t\tend\n\t\tre_reconect = false\n\t\t@server.close\n\t\tloop do\n\t\t\t@ip_pos += 1\n\t\t\t@ip_pos = 0 if @ip_pos >= @arry_ips.length\n\t\t\tbegin\n\t\t\t\t@server = TCPSocket.new(@arry_ips[@ip_pos], Connections::SERVER_PORT)\n\t\t\t\tre_reconect = false\n\t\t\trescue Errno::ECONNREFUSED => e\n\t\t\t\tre_reconect = true\n\t\t\t\tsleep(1)\n\t\t\tend\n\t\t\tbreak unless re_reconect \n\t\tend\n\t\tputs \"Reconectado!\"\n\tend", "title": "" }, { "docid": "868451e36102fb4a96b3992ffa901a70", "score": "0.6205056", "text": "def ignore_disconnect; end", "title": "" }, { "docid": "f8944d1e3f58cf7e6580f2bcf09449f9", "score": "0.62035406", "text": "def connect_timeout; end", "title": "" }, { "docid": "f8944d1e3f58cf7e6580f2bcf09449f9", "score": "0.62035406", "text": "def connect_timeout; end", "title": "" }, { "docid": "f561e860fb33148b9e689e2642e6f248", "score": "0.61874884", "text": "def connected?\n !@connections.empty?\n end", "title": "" }, { "docid": "74ca0b350e56f313f54119a3d507b5b6", "score": "0.617106", "text": "def connection_established(*args)\n\tend", "title": "" }, { "docid": "d7b33973ae9f5b23b2162dea35373729", "score": "0.6169244", "text": "def valid_connection?(conn)\n conn.servers.length\n true\n rescue Excon::Errors::Forbidden, Excon::Errors::Unauthorized\n false\n end", "title": "" }, { "docid": "ac2a89810975643c05fdbf07616c7f3e", "score": "0.61691064", "text": "def reexecute_connections?\n return true\n end", "title": "" }, { "docid": "5abe780ff6e12184ad24b6a093c1549c", "score": "0.6168836", "text": "def connection_class; end", "title": "" }, { "docid": "f9c0a3a7a3b8f42b3d2bf6f3bd97480a", "score": "0.61674494", "text": "def verify!\n reconnect! unless active?\n end", "title": "" }, { "docid": "19c6a0e59ec644132fd6f729ffe1af73", "score": "0.61654764", "text": "def connect?\n connect != false\n end", "title": "" }, { "docid": "3e3fdcc1b3b8554213b25469f2fa3b2b", "score": "0.6162618", "text": "def connection\n @connection ||= make_connection\n end", "title": "" }, { "docid": "d2b7ef0a5a2cdbd3cebbce862d3281a5", "score": "0.6155707", "text": "def checkCxn(conn)\n res = conn.request(:method=>:get,:path=>\"/wapi/v1.0/network\")\n if(res.status != 200)\n raise res.body\n end\nend", "title": "" }, { "docid": "486ed6ca137b9e91d72526046d871fb0", "score": "0.6151679", "text": "def connected?\n @connection && !@connection.expired?\n end", "title": "" }, { "docid": "301b9bce82e881e356860b35ae68d1d5", "score": "0.6141761", "text": "def conn\n\t\treturn @conn ||= self.connect\n\tend", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "dce9b59fe29d2b85b24ede9dd58621f9", "score": "0.0", "text": "def update!(**args)\n @gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "37ae8a386fde14c02d7021605aa72f45", "score": "0.67403597", "text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "47bbd8b88b35da987fc3775b82211e56", "score": "0.6618882", "text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "c3b6fccdeb696de5e9dbc38a9486b742", "score": "0.65386343", "text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "title": "" }, { "docid": "bb403006cc5423d9b1820fe684a7c5a5", "score": "0.65178275", "text": "def update\n # TODO: implement update\n end", "title": "" }, { "docid": "1ee90e4f66e82aec13076a98b288a2d1", "score": "0.6394807", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "3f85752da065340d4ca70ce879a3b23d", "score": "0.63328", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6319025", "text": "def update\n \n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.6283673", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.62639254", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "29c22ae2290ffca9b9682a5f20f48103", "score": "0.62410724", "text": "def update_resource object, attributes\n object.update attributes\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.62152076", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210263", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "85a79fb5c3cc199e689344861658b09b", "score": "0.62021106", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.62017816", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "549a7eef6c18558dea47a8e8d72df295", "score": "0.62017", "text": "def update\n @objects.map(&:update);\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "b76d372399abbb21b748df3ae7b06470", "score": "0.6159277", "text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "title": "" }, { "docid": "01219537b43bd1cf8341e0f00e27d4c8", "score": "0.6156169", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "f3dea89f306804c3f2aa813c06584d06", "score": "0.6125433", "text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "44756fd86dd095556580199f7e78936f", "score": "0.61241156", "text": "def modified_properties=(value)\n @modified_properties = value\n end", "title": "" }, { "docid": "593de84fa9950baa68153e4fa9b6e17c", "score": "0.6121413", "text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "title": "" }, { "docid": "ea25adea5b43c27e6c84f27ad88c3d9f", "score": "0.6110477", "text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "title": "" }, { "docid": "147138a710a0ff53e9288ae66341894f", "score": "0.6105694", "text": "def update\n\t\t\n\t\tend", "title": "" }, { "docid": "7b1d2242b1a6bd8d3cad29be97783a80", "score": "0.61016303", "text": "def set_props(props)\n @props.merge!(props)\n end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.60845226", "text": "def update() end", "title": "" }, { "docid": "231370ed2400d22825eba2b5b69e7a67", "score": "0.6084427", "text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "86ff97cc222b987bff78c1152a1c8ee1", "score": "0.6065455", "text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "title": "" }, { "docid": "0f6ea4c54f9bc18020c08410f67289cd", "score": "0.6059506", "text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "title": "" }, { "docid": "453da6bb915596261c5b82f2d17cabf8", "score": "0.6054869", "text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051708", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051708", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "874639781ed80ae451fbdd6ebbef2218", "score": "0.60413384", "text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "title": "" }, { "docid": "d175f5bedd91a8daf191cad42b04dc0c", "score": "0.6030853", "text": "def update_attributes(attrs)\n super({})\n end", "title": "" }, { "docid": "b8d1a7cd8f443ee5f30b5085aadff479", "score": "0.6022535", "text": "def update\n @dirty = true\n end", "title": "" }, { "docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee", "score": "0.6015561", "text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "title": "" }, { "docid": "71750bae7e3d6bdde2b60ec30e70949a", "score": "0.59932375", "text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "title": "" }, { "docid": "73fe9bc31bfeeab4d84483e2fa65cbbb", "score": "0.59898263", "text": "def update\n super\n end", "title": "" }, { "docid": "a98ac99e6e5115383e9148202286ff9e", "score": "0.5976479", "text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "fb14f35e7fab31199053a7b87ef451a4", "score": "0.5973787", "text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "title": "" }, { "docid": "6441b3fa93c3dfd974c66a975adb9d9c", "score": "0.59678394", "text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "title": "" }, { "docid": "51a59f953548d1eff10532bdffdd8df9", "score": "0.5963291", "text": "def properties=(value)\n @properties = value\n end", "title": "" }, { "docid": "e7a3d5504fcc6e382b06845ede0d5fd8", "score": "0.5962048", "text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "title": "" }, { "docid": "c7a2880c3da02b3708afc43c48d37f2e", "score": "0.5961157", "text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1", "score": "0.59500545", "text": "def update ; end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.59443134", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.59443134", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59424853", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59424853", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "879f1214e030bb2d9e43a0aedb1bc3ea", "score": "0.593523", "text": "def update_with(attributes)\n assign_attributes(attributes)\n end", "title": "" }, { "docid": "10b1cb39dbb1f67820e37bb6d2632986", "score": "0.5926413", "text": "def update\n # don't need to update; hash is shared\n end", "title": "" }, { "docid": "51982942bd4f09be3f7adc59da4cf104", "score": "0.5924831", "text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "title": "" }, { "docid": "f0dd489c52fa73b1c3846fa43727c29e", "score": "0.592427", "text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.59233046", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.59233046", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "32ed734ad4f899f0ee9ec74a760ca1d0", "score": "0.5921224", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "900f4c147e0916b2e9270373fb83c7e2", "score": "0.59144294", "text": "def update_attributes attributes\n @attributes.merge! attributes\n end", "title": "" }, { "docid": "f63de190ae582620103d96f60d684114", "score": "0.59142506", "text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "title": "" }, { "docid": "512d9095b05a696270730ee09c640773", "score": "0.58887535", "text": "def update\r\n end", "title": "" }, { "docid": "5b1f6d40d29f0afb908434d0a6404ac8", "score": "0.58854496", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "efcb8c985b9e7911a606a9149b4ab171", "score": "0.5883008", "text": "def update\n raise NotImplemented\n end", "title": "" }, { "docid": "65f67197ac4544cbebca350d889922ee", "score": "0.58792305", "text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5876954", "text": "def update_values\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5876954", "text": "def update_values\n end", "title": "" }, { "docid": "10e162e857be9c47150e8eccd327cad9", "score": "0.58744955", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "389ac4585e8143f353e2535499a23085", "score": "0.5857968", "text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "title": "" }, { "docid": "c202a823016f05ee2fc4aade77320497", "score": "0.5845542", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "dc268f568dcb7aca1d3905736d2477af", "score": "0.5841629", "text": "def update attributes, collection #:nodoc:\n 0\n end", "title": "" }, { "docid": "9763ac25d7fdf4b4f35a971609f70b04", "score": "0.58363605", "text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "title": "" }, { "docid": "541550458a4c8f94afeb6b10c0cb2293", "score": "0.5829255", "text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "title": "" }, { "docid": "49a282f2ce0c099a5ced60524a492b4f", "score": "0.582919", "text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "title": "" }, { "docid": "f6c4eafa4f48a0c81157fb03ff350901", "score": "0.5822138", "text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "title": "" }, { "docid": "524a6a969929f9af4bad05dbd9c8f935", "score": "0.58208305", "text": "def update\n set_deltatime\n set_last_update_at\n end", "title": "" } ]
eba105131bdfa6d7d4b1f6b641f696b6
public method for clicking specific items based on locale method requires the following:
[ { "docid": "a551c368655a0c0655aad5b23a95efe2", "score": "0.6413149", "text": "def localized_click(partner, loc_click)\r\n Log.debug \"#{LANG[partner.partner_info.parent][partner.partner_info.type][loc_click]}\"\r\n navigate_to_link(\"#{LANG[partner.partner_info.parent][partner.partner_info.type][loc_click]}\")\r\n end", "title": "" } ]
[ { "docid": "dd47ebb39f8bc751ab47ed6c926f9013", "score": "0.6774807", "text": "def localized_click(partner, loc_click)\n navigate_to_link(\"#{LANG[partner.company_info.country][partner.partner_info.type][loc_click]}\")\t;end", "title": "" }, { "docid": "9f61189774a70a90e64172c5ab83e519", "score": "0.66033465", "text": "def navigate_to_item_en\n navigate_to @@item_url + \"?uselang=en\"\n end", "title": "" }, { "docid": "712e8052fadf7054978fcd43da0db24f", "score": "0.64480054", "text": "def clicar_menu(item)\n click_link item\n end", "title": "" }, { "docid": "5580b933c0a125dbc973bfca5df62d1a", "score": "0.6265679", "text": "def menu_item(name, locator)\r\n define_method(\"click_#{name}\") do\r\n adapter.menu_item(locator).click\r\n end\r\n alias_method \"#{name}\", \"click_#{name}\"\r\n end", "title": "" }, { "docid": "cc9f9d03c9ac267c0baee6da8ec31bbf", "score": "0.61178005", "text": "def uhook_find_menu_items\n ::Menu.find(params[:menu_id]).menu_items.locale(current_locale, :all)\n end", "title": "" }, { "docid": "0603c7881f1171df777c39d233493e99", "score": "0.59376", "text": "def click_dialog_item(itemName)\n get_dialog_list.each do |item|\n if item.text == itemName\n item.click\n break\n end\n end\n end", "title": "" }, { "docid": "5aeadb722696b7f7e159c22a90088b81", "score": "0.5933892", "text": "def click_order(order)\r\n click \"link=#{order}\", :wait_for => :page\r\n get_value(\"itemDesc\") == order\r\n end", "title": "" }, { "docid": "5add36c21046645163bc5e74bb48c00c", "score": "0.59152734", "text": "def press_list_item(locator)\n list = locator[:list] ? locator[:list] : 0\n performAction 'press_list_item', locator[:index] + 1, list if locator[:index]\n performAction 'click_on_text', locator[:text] if locator[:text]\n end", "title": "" }, { "docid": "67a9898dcaf39eca7031e80fe9f2aca2", "score": "0.58423924", "text": "def select_item(what)\n get_item(what).click\n end", "title": "" }, { "docid": "abf8bcaf6f4ca01517cb1b6e2b280f8b", "score": "0.5811341", "text": "def menu_link_in_language(id, lang, fallback=false)\n linked_item = find_item(id, lang)\n \n if linked_item\n if @item == linked_item then\n \"<li class='active'><a>#{label_of linked_item}</a></li>\"\n else\n \"<li><a href='#{relative_path_to linked_item}'>#{label_of linked_item}#{if fallback then \" <i>(#{lang})</i>\" end}</a></li>\"\n end\n else\n nil\n end\nend", "title": "" }, { "docid": "dcc26ddf7f08f3def32ccb25206dd400", "score": "0.5800237", "text": "def navigate_click(classname, location)\n btn = find(classname)\n page.assert_current_path(\"/#{locale}/app/#{location}\")\n end", "title": "" }, { "docid": "b3b7915cd4f65dc07f3645247d6b8c6c", "score": "0.5794902", "text": "def navigate_click(classname, location)\n page.assert_selector(classname)\n find(classname).click\n page.assert_current_path(\"/#{locale}/app/#{location}\")\n end", "title": "" }, { "docid": "bfce7c40e03d05e8407b76352c560b53", "score": "0.5758446", "text": "def verifyAndClickSecondLanguage(secondLanguage)\n\n secondlanguage1 = @chromedriver2.find_element(:link, secondLanguage)\n secondlanguage1.click\n\n end", "title": "" }, { "docid": "d8067dec849067c119e4f848ebb1b1c3", "score": "0.57558626", "text": "def select_menu_unidades\n click_link 'Unidades'\n end", "title": "" }, { "docid": "11051a3b64a29d779e5ca290defca0fa", "score": "0.57428634", "text": "def menu_item(item)\n begin\n @driver.find_element(:id, 'menu' + item).displayed?\n rescue Selenium::WebDriver::Error::NoSuchElementError\n @driver.find_element(:link_text, item.split.map(&:capitalize).join(' '))\n end\n end", "title": "" }, { "docid": "97621f0eec6ba6029a6963f701cccad2", "score": "0.5718233", "text": "def select_menu_item *path\n target = navigate_menu(*path)\n target.perform :press\n target\n end", "title": "" }, { "docid": "8bf647c4019262bd2929ce143fb4adac", "score": "0.566654", "text": "def menu_item(name, locator)\r\n define_method(\"#{name}\") do\r\n adapter.menu_item(locator).select\r\n end\r\n end", "title": "" }, { "docid": "b366f9b831fa940d98dcf96490d04904", "score": "0.5656374", "text": "def click_all(text)\n begin\n self.click_link text\n rescue\n self.press_button text\n end\n end", "title": "" }, { "docid": "d780c53fb532e0ae00a01bff408fe1b9", "score": "0.5643643", "text": "def press_menu\n driver.pressQuickMenuItem(text, false);\n end", "title": "" }, { "docid": "d22a9ba7de8ada3de276efe6ac888a42", "score": "0.56429094", "text": "def open_specx_drawer_item(item_name)\n self.find_elements(:css, '.list-group-item .item-title').select{|x| x.attribute('innerHTML').to_s.strip! == item_name}.first.click\n end", "title": "" }, { "docid": "4ee5ae8ada47448ec954cce4f4873d37", "score": "0.56164473", "text": "def acessarItem1\n item_1_title_link.click()\n end", "title": "" }, { "docid": "f16d1e5ea66d8d1187081cd51c0da659", "score": "0.55908597", "text": "def click_checkbox_item(itemName)\n click_dialog_item(itemName)\n end", "title": "" }, { "docid": "333e8fbf98bc8558777c2e9f5bdcd561", "score": "0.555172", "text": "def back_link_in_language(id, lang, fallback=false)\n linked_item = find_item(id, lang)\n \n if linked_item\n if @item == linked_item then\n \"<li class='active'><a><span class='glyphicon glyphicon-circle-arrow-left'></span> #{_(:back)}</a></li>\"\n else\n \"<li><a href='#{relative_path_to linked_item}'><span class='glyphicon glyphicon-circle-arrow-left'></span> #{_(:back)}#{if fallback then \" <i>(#{lang})</i>\" end}</a></li>\"\n end\n else\n nil\n end\nend", "title": "" }, { "docid": "2dd3ff94f46c3aa8133bd9bd72eb9cce", "score": "0.55054545", "text": "def click_menu choices, initial = nil\n command = ['wmii9menu']\n\n if initial\n command << '-i'\n\n unless choices.include? initial\n initial = \"<<#{initial}>>:\"\n command << initial\n end\n\n command << initial\n end\n\n command.concat choices\n\n choice = `#{command.shelljoin}`.chomp\n choice unless choice.empty?\n end", "title": "" }, { "docid": "01a07612075f11683fd1f554fde8e787", "score": "0.54960686", "text": "def click_menu choices, initial=nil\n command = ['wmii9menu']\n\n if initial\n command << '-i'\n\n unless choices.include? initial\n initial = \"<<#{initial}>>:\"\n command << initial\n end\n\n command << initial\n end\n\n command.concat choices\n\n choice = `#{command.shelljoin}`.chomp\n choice unless choice.empty?\n end", "title": "" }, { "docid": "502de09482d81153142732fa4253080f", "score": "0.54866695", "text": "def select_organizational_unit(item)\n find(:xpath, \".//*[@id='hierarchyId_ui']/div/ul/li/a[starts-with(text(), '#{item}')]\").click\n end", "title": "" }, { "docid": "f971d9239c32f4146dde8a1961642a72", "score": "0.54725665", "text": "def menu_item(*args, i18n: nil, text: nil, policy: nil, policy_action: nil, **named_args)\n return nil unless policy.nil? || policy(policy).try((policy_action || :any?))\n url = url_for(*args)\n i18n ||= ['menu', url.gsub(%r{/+}, '.')].join('.')\n text ||= t(i18n)\n text = text[:index] if text.is_a? Hash\n classes = ['nav-link']\n # The current page only...\n classes << 'is-current' if url == url_for\n # Any \"subpage\"\n classes << 'is-active' if url_for.start_with?(url)\n\n tag.li(class: 'nav-item') do\n link_to text, *args, **named_args, class: classes.join(' ')\n end\n end", "title": "" }, { "docid": "bc0d7d47b112752259ee3a6ede544762", "score": "0.54510427", "text": "def navigate_click(element, location)\n @ember_helper.ember_transition_click(element)\n page.assert_current_path(\"/#{@locale}/app/#{location}\")\n end", "title": "" }, { "docid": "f55365e63f1b29ac60683936ba6f706e", "score": "0.54417676", "text": "def nav_menu_item(menu_label, &block)\n\n icon = case menu_label\n when 'announcement' ; \"<i class='icon-book'></i>\"\n when 'user' ; \"<i class='icon-user'></i>\"\n when 'comment' ; \"<i class='icon-comment'></i>\"\n end \n\n menu_label = t(\"activerecord.models.#{menu_label}.other\")\n content_tag(:li, :class => 'dropdown') do \n link_to(\"#{icon} #{menu_label} <b class='caret'></b>\".html_safe, '#', :class => 'dropdown-toggle', :data => { :toggle => 'dropdown' }) +\n content_tag(:ul, :class => 'dropdown-menu') do \n block.call\n end\n end\n end", "title": "" }, { "docid": "e49004b59d6ccb3a2ac0bff105da2dcd", "score": "0.5430198", "text": "def main_menu_item(text, url: nil, icon: nil)\n link_to url, 'data-toggle': 'collapse', class: 'd-flex w-100 p-3 position-relative align-items-center' do\n if icon.ends_with?('.svg')\n svg_icon(name: icon, classes: 'mr-2', width: ICON_SIZE, height: ICON_SIZE) +\n content_tag(:span, \" #{text}\", class: 'text') +\n svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))\n else\n content_tag(:span, nil, class: \"icon icon-#{icon} mr-2\") +\n content_tag(:span, \" #{text}\", class: 'text') +\n svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))\n end\n end\n end", "title": "" }, { "docid": "26784c3105096e013c76395150f4f467", "score": "0.5429323", "text": "def choose(items, title)\n @dialog.title = \"\\\"#{title}\\\"\"\n res = @dialog.menu(title, items)\n\n raise CancelPressed unless res\n\n res\n end", "title": "" }, { "docid": "bb822e42830be5c1c18c2ed58dd88379", "score": "0.54133403", "text": "def navigate_click(classname, location)\n btn = find(classname)\n @emberHelper.ember_transition_click btn\n expect(current_path).to eq(\"/#{locale}/app/#{location}\")\n end", "title": "" }, { "docid": "f279c8bda9320a22713fdceace2cc343", "score": "0.54128236", "text": "def clickOnSortingDropDown()\n el= @driver.find_element(:xpath, \"//a[@data-selector='sorting-btn']\")\n el.click\n end", "title": "" }, { "docid": "fbe2d8d641b9e765de9e27cb2b280563", "score": "0.5410292", "text": "def clickOnBuilderMenu(index, itemName)\n @currentProfile = itemName.downcase\n name = \"inBloom - \" + itemName + \" Profile\"\n menuItem = @explicitWait.until{@driver.find_elements(:class, \"profile_list\")[index].find_element(:link_text, name)}\n menuItem.click\n \n @explicitWait.until{@driver.find_element(:class,\"profilePageWrapper\").text.downcase.include? itemName.downcase}\nend", "title": "" }, { "docid": "302fecd94527447ba25534021b6483fa", "score": "0.5399225", "text": "def render_locale_link\n locales = I18n.config.available_locales\n other_locale = (locales - [I18n.locale]).pop\n link_to t(:language_name, :locale => other_locale), params.merge(:'umlaut.locale' => other_locale)\n end", "title": "" }, { "docid": "cb18ac72898efb17203ebbb6bc036f30", "score": "0.53806424", "text": "def click_menu choices, initial = nil\n words = ['wmii9menu']\n\n if initial\n words << '-i'\n\n unless choices.include? initial\n initial = \"<<#{initial}>>:\"\n words << initial\n end\n\n words << initial\n end\n\n words.concat choices\n command = words.shelljoin\n\n choice = `#{command}`.chomp\n choice unless choice.empty?\nend", "title": "" }, { "docid": "0525ad274f06446f6189382f516ce419", "score": "0.538017", "text": "def tapItems\n\n\t\t#need to add scrolling to be able to find all items\n\n\t\tn = 1\n\t\titem_displayed = true\n\t\t\n\t\t#this include n in the string\n\t\titem = '//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[' + n.to_s + ']'\n\t\t\n\t\tbegin\n\t\t\tfind_element(:xpath, item).click\n\t\t\tn += 1\n\t\t\titem = '//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[' + n.to_s + ']'\n\t\t\titem_displayed = find_element(:xpath, item).displayed?\n\t\trescue\n\t\t\titem_displayed = false\n\t\tend while item_displayed == true\n\tend", "title": "" }, { "docid": "23b217ca37a768bfc59d11325a25f2ab", "score": "0.5378844", "text": "def clickOnFlagPost()\n el= @driver.find_element(:xpath, \"//div[@class='view-more-actions']/div/a[3]/span[contains(text(),'Flag Post')]\")\n el.click\n end", "title": "" }, { "docid": "f3aab51f62c0f37ad4285cad20f12f5d", "score": "0.53654665", "text": "def user_menu_item(item)\n begin\n @driver.find_element(:id, 'user_menu' + item).displayed?\n rescue Selenium::WebDriver::Error::NoSuchElementError\n @driver.find_element(:link_text, item.split.map(&:capitalize).join(' '))\n end\n end", "title": "" }, { "docid": "a5c44075a6024802153eb733027899a9", "score": "0.5360383", "text": "def localized_select(loc_item, partner, loc_select)\n loc_item.select(\"#{LANG[partner.partner_info.parent][partner.partner_info.type][loc_select]}\"); end", "title": "" }, { "docid": "006a23ad698799cbbe39b95f5a4ee480", "score": "0.53498554", "text": "def on_click\n \n end", "title": "" }, { "docid": "83643918a488f311efbb745498dadb0e", "score": "0.53478163", "text": "def click_courses_menu_item(driver, test)\n elem = @elements[:courses_menu_item]\n elem.click\n ContentPage.new(driver, test)\n end", "title": "" }, { "docid": "9347bfc3312a31065ef00df7850234bb", "score": "0.5347593", "text": "def draft_item_open(item_name)\n draft_item_link = find_link(item_name)\n draft_item_link.click\n end", "title": "" }, { "docid": "5624cef05c3d4e740131647158a78bf8", "score": "0.5345988", "text": "def selectItem(event)\n @button = event.target.textContent\n\n if @button == 'Change Chair'\n initialize_chair_change()\n elsif @button == 'Establish Project'\n initialize_establish_project()\n elsif @button == 'Terminate Project'\n initialize_terminate_project()\n elsif @button == 'Out of Cycle Report'\n initialize_out_of_cycle()\n end\n\n retitle()\n end", "title": "" }, { "docid": "6ac9f57b8d11d9caac1d9449c049f096", "score": "0.53439146", "text": "def tab_link(locale = I18n.locale)\n find %Q{li.translation-tab a[href='.locale-#{locale}']}\n end", "title": "" }, { "docid": "905b946ebe080e6bf49f74ef0c669ae9", "score": "0.5341921", "text": "def subscription_selection\n \t#page.find(:link, 'Cancelar suscripción').\n page.find(:xpath, \"/html/body/div[6]/div/div[3]/form/div[1]/div[1]/div[4]/label\").click\n end", "title": "" }, { "docid": "ce0a340cc149c0ce01084dd156d05db1", "score": "0.5330892", "text": "def click_on_navigation_level_1 table\n \tmenus = table.hashes\n \tmenus.each do |menu_item| \n \t# Level 1\n \tlocation = @@nav_1 % Hash[menu_item.map{|(k,v)| [k.to_sym(&:downcase),v]}]\n \t@browser.element(xpath: location).click\n \tend\n \tend", "title": "" }, { "docid": "7bee9be03e0328bf80c539fb366805d9", "score": "0.531921", "text": "def click(text)\n click_on text\n @log.debug \" clicking #{text}\"\n end", "title": "" }, { "docid": "f349f5966df8feca0bad6fefafe54a33", "score": "0.53184986", "text": "def e_clicar_em_intranet\n click_on(\"Intranet\")\nend", "title": "" }, { "docid": "7df3abc149e9ce1154d62d100c859087", "score": "0.53181213", "text": "def btn_menu_pressed\n item = mapper.get_class('app.model.menuitem').new\n result = edit_menu(item) or return\n iter = add_item(selected_iter, item)\n @view.selection.select_iter(iter)\n end", "title": "" }, { "docid": "32757365b5d060c65ed925e3862b8d71", "score": "0.5313286", "text": "def switch_alert_event\n # TODO: clean out selected item details\n display_items\n end", "title": "" }, { "docid": "6d6ad36a035ccfbc2a64937d2fe09d14", "score": "0.5303678", "text": "def on_item_selected &b; end", "title": "" }, { "docid": "6d6ad36a035ccfbc2a64937d2fe09d14", "score": "0.5303678", "text": "def on_item_selected &b; end", "title": "" }, { "docid": "a97e9c20da992817a418ab3c7f0a675a", "score": "0.5301362", "text": "def nav_payment_method_checkout_click(snav_payment_checkout_click)\n case snav_payment_checkout_click\n when 'cartao de credito'\n nav_payment_cc.click\n when 'boleto bancario'\n puts \"foi boleto\"\n nav_payment_boleto.click\n when'transferencia bancaria online'\n nav_payment_transf_banc.click\n else\n puts \"\"\n end\n end", "title": "" }, { "docid": "763e5817900fcdc1226bf5063f71ae0b", "score": "0.52997077", "text": "def clicked\n end", "title": "" }, { "docid": "763e5817900fcdc1226bf5063f71ae0b", "score": "0.52997077", "text": "def clicked\n end", "title": "" }, { "docid": "763e5817900fcdc1226bf5063f71ae0b", "score": "0.52997077", "text": "def clicked\n end", "title": "" }, { "docid": "d20720d32145ccfdf00909d9bc283db9", "score": "0.52893", "text": "def click_audio_language_setting(listLocation)\n dialog.find_elements(:class, 'dialog-list')[listLocation].click\n end", "title": "" }, { "docid": "b4b74ecce74328a6349a00d936ce3132", "score": "0.5288827", "text": "def uhook_edit_menu_item(menu_item)\n unless menu_item.in_locale?(current_locale)\n redirect_to(ubiquo_menu_menu_items_path(menu_item.menu))\n false\n end\n end", "title": "" }, { "docid": "172a1f827f5a4b950a3dda818aec14c9", "score": "0.52787036", "text": "def get_menu_items_for_location_by_category(args, description = false)\n basic_check(args)\n meth = description ? '0205' : '0201'\n r = get(@base, { \"#{meth}#{@session_token}\" => args }, { format_out: 'parse' } )\n end", "title": "" }, { "docid": "4869283c70b5482e1ba1bfb22d7d900e", "score": "0.5277499", "text": "def uhook_find_menu_items\n ::MenuItem.locale(current_locale, :all).roots\n end", "title": "" }, { "docid": "64bf94ce9b01f78901c69251e1cdfe23", "score": "0.5275879", "text": "def translate_and_link(object, attribute)\n\t\tname = object.class.human_attribute_name(attribute)\n html = ''\n if attribute.to_s == @order_by\n html = icon(\"fas\", \"caret-down\", ' ')\n if @order_direction == \"DESC\"\n html = icon(\"fas\", \"caret-up\")\n end\n html += \" \"\n end\n (html.html_safe + link_to(name, self.send(\"#{controller_name}_path\", params.permit(preferences: {}).merge({:order => attribute, :ajax_id => @ajax_id}).to_unsafe_h), :remote => true, :class => \"spinner\")).html_safe\n\tend", "title": "" }, { "docid": "6a6ff29d469cb85f6209140493e2610d", "score": "0.52673", "text": "def click\n adapter.click\n end", "title": "" }, { "docid": "74580ffc9212331580b796cf4f4afcf0", "score": "0.5230125", "text": "def tap_sort_alert_option(option)\n ele = find_element(:xpath, \"//android.widget.CheckedTextView[@text='#{option}']\")\n ele.click\n end", "title": "" }, { "docid": "f4a769d7a3d81f74be063d581ed7b5d3", "score": "0.52230126", "text": "def _(element)\n LAYOUT_TRANSLATIONS[element][@item[:language]]\nend", "title": "" }, { "docid": "91be24e3b994ceafd3b432e805d7b26e", "score": "0.5213184", "text": "def click text\n\t\txpath = SeleniumAdapter.wait_for{element_search text, ['link', 'button']}\n\t\t@selenium.click \"xpath=#{xpath}\"\n\t\twait_for_load\n\tend", "title": "" }, { "docid": "02a439fb4be62586772bfb003ee8bdcb", "score": "0.52111", "text": "def acessarItem1()\n link_backpack.click()\n end", "title": "" }, { "docid": "68d920641ed46597e811cbdbb070eb41", "score": "0.52054876", "text": "def menu_select!\n Vedeu.bind(:_menu_select_) do |name|\n Vedeu.menus.by_name(name).select_item\n end\n end", "title": "" }, { "docid": "cb5490af57d25e65c3de262906f2e341", "score": "0.51945734", "text": "def menu_link_to(id)\n \n link = menu_link_in_language(id, @item[:language])\n link ||= menu_link_in_language(id, \"en\", fallback=true)\n link ||= menu_link_in_language(id, \"nl\", fallback=true)\n link\nend", "title": "" }, { "docid": "5b7063bb559c158519f365cdb51b1af8", "score": "0.51873374", "text": "def uhook_new_menu\n @forbid_item_creation = forbid_item_creation?\n ::Menu.translate(params[:from], current_locale)\n end", "title": "" }, { "docid": "bdd90c52ed6b1ecbc7567f91a68d5a30", "score": "0.5186904", "text": "def handle_click\n @choices.collect(&:handle_click).compact.first\n end", "title": "" }, { "docid": "a49bb9bbe50f9b40534d7745a485011f", "score": "0.517905", "text": "def menu_choice(choice)\n \n end", "title": "" }, { "docid": "3b76f53ac9700034666f9d4dd5f8aa16", "score": "0.517848", "text": "def click_on_sort_by_genre\n @driver.find_elements(:css, ELEMENTS.quicklinks).each do |title|\n if title.text == 'Western'\n title.click\n end\n end\n end", "title": "" }, { "docid": "b6b7fca5949ffacd3b8be88dc92b2ca3", "score": "0.5175651", "text": "def click_Button( page, id_name)\n\t\tfind(:xpath, getXpath(page, id_name)).click()\n\tend", "title": "" }, { "docid": "bab5d31b9a3730a2062ed6711bb12a63", "score": "0.51543397", "text": "def i_click_the_suggestion_containing text\n find(\".atwho-view-ul li\", text: text).click\n end", "title": "" }, { "docid": "de7ddd98701295c6a9a61cf2a42ec708", "score": "0.51488215", "text": "def acessarItem2\n item_2_title_link.click()\n end", "title": "" }, { "docid": "2abe875700c56f5f50019650e2703660", "score": "0.51476705", "text": "def on_category_ok; @quest_list_window.activate; end", "title": "" }, { "docid": "91d031a0c9ac80dc67e0725cedc6b51d", "score": "0.5145047", "text": "def context_menu(locator)\n do_command(\"contextMenu\", [locator,])\n end", "title": "" }, { "docid": "cdbd25ec3fc14584fb24b5bed1a328c7", "score": "0.51450336", "text": "def locale_tabs\n template.content_tag(:ul, :class => 'locales') do\n ::I18n.available_locales.map do |locale|\n template.content_tag(:li) do\n template.content_tag(:a, ::I18n.t(\"active_admin.translate.#{ locale }\"), :href => \"##{ field_id(locale) }\")\n end\n end.join.html_safe\n end\n end", "title": "" }, { "docid": "09883716eca68f09603e828ecc13dae0", "score": "0.51444334", "text": "def solutions_tab\r\n \t@browser.a(:xpath, \"//div/div[2]/ul/li[2]/a\").when_present.click\r\n end", "title": "" }, { "docid": "1529e6f247abbc6057cd4127738490aa", "score": "0.51404166", "text": "def ship_method_select(method)\n self.label(text: Regexp.new(method, Regexp::IGNORECASE)).click\n end", "title": "" }, { "docid": "f53ab79dcfb3a13543008fd86f7d17e2", "score": "0.51370656", "text": "def set_submenu *args\r\n case parse_item(args[0], 'name')\r\n when 'Invoices'; render partial: 'shared/navbar_invoices', locals: { active: parse_item(args[0], 'action') || 'sent' }\r\n when 'Categories'; render 'shared/navbar_categories'\r\n when 'Pixis'; render partial: 'shared/navbar_pixis', locals: { loc_name: @loc_name, rFlg: show_recent?, statusFlg: false }\r\n when 'Pixi'; render 'shared/navbar_show_pixi'\r\n when 'My Pixis'; render 'shared/navbar_mypixis'\r\n when 'My Accounts', 'Manage Accounts'; render 'shared/navbar_accounts'\r\n when 'Pending Orders'; render 'shared/navbar_pending'\r\n when 'Messages'; render 'shared/navbar_conversations'\r\n when 'Home'; render 'shared/navbar_home', locals: { loc_name: @loc_name }\r\n when 'PixiPosts'; render 'shared/navbar_pixi_post'\r\n when 'My PixiPosts'; render 'shared/navbar_pixi_post'\r\n when 'Inquiries'; render 'shared/navbar_inquiry'\r\n when 'Users'; render 'shared/navbar_users'\r\n when 'Sites'; render 'shared/navbar_sites'\r\n when 'Manage Pixis'; render 'shared/navbar_manage_pixis'\r\n when 'My Sellers', 'Manage Followers', 'My Followers'; render 'shared/navbar_sellers'\r\n when 'Manage Sites'; render 'shared/navbar_sites'\r\n else render 'shared/navbar_main'\r\n end\r\n end", "title": "" }, { "docid": "5e7567b8e6f99e1c62db7b38f0eeb727", "score": "0.5136314", "text": "def find_gear_menu_item(menu_item)\n menu_items=@wait.until{@browser.find_elements(:css=>'a.menu-item')}\n menu_item_choice=menu_items.find{|name| name.text==menu_item}\n puts \"Menu item name is #{menu_item_choice.text}\"\n menu_item_choice.click\nend", "title": "" }, { "docid": "5e7567b8e6f99e1c62db7b38f0eeb727", "score": "0.5136314", "text": "def find_gear_menu_item(menu_item)\n menu_items=@wait.until{@browser.find_elements(:css=>'a.menu-item')}\n menu_item_choice=menu_items.find{|name| name.text==menu_item}\n puts \"Menu item name is #{menu_item_choice.text}\"\n menu_item_choice.click\nend", "title": "" }, { "docid": "d92b30fa039fffe3c7854aee89025214", "score": "0.5134662", "text": "def click(button)\n end", "title": "" }, { "docid": "70b770db95c7b08f6655c3e4fa2a5a9d", "score": "0.5134125", "text": "def uhook_new_menu_item\n mi = ::MenuItem.translate(params[:from], current_locale)\n if mi.content_id.to_i == 0\n mi.parent_id = params[:parent_id] || 0\n mi.is_active = true\n end\n mi\n end", "title": "" }, { "docid": "1594190ff5471abd21952de96b0032d7", "score": "0.5131216", "text": "def clicked;end", "title": "" }, { "docid": "55192d260f83d6054b08bcaf313896a1", "score": "0.5122323", "text": "def btn_edit_pressed\n iter = selected_iter or return\n item = get_item(iter)\n if item.host?\n edit_host(item)\n elsif item.menu?\n edit_menu(item)\n end\n end", "title": "" }, { "docid": "a450264ae24876748fabbda8a3bcd12e", "score": "0.5120171", "text": "def clicked\n @sub_views.each do |view|\n view.clicked\n end\n end", "title": "" }, { "docid": "e2336b6adda13f3663c5a66897396453", "score": "0.5117999", "text": "def items_menu_prompt(**)\n item = model_item_name(capitalize: false)\n an = item.match?(/^[aeiou]/i) ? 'an' : 'a'\n \"Select #{an} #{item}\" # TODO: I18n\n end", "title": "" }, { "docid": "31a94e6865da33d3e8b051cd404f9288", "score": "0.5116069", "text": "def visit_by_menu(*args)\n within navbar do\n args.each do |path|\n link = find_link(path)\n link.visible?.should be_true\n link.click\n end\n end\n end", "title": "" }, { "docid": "a819ad34a3414e2dfc3ed12ec7ae094c", "score": "0.51123416", "text": "def locale_links(page)\n return [] unless localized?(page)\n\n list_items = Array.new\n\n page.data.locale[flavor].each do |lang|\n active = (lang == I18n.locale.to_s)\n\n if lang == I18n.default_locale.to_s\n if lang == I18n.locale.to_s\n url = page.url\n else\n url = page.url.gsub(\"/#{I18n.locale}/\", '/')\n end\n else\n if I18n.locale == I18n.default_locale\n url = \"/#{lang}#{page.url}\"\n else\n url = page.url.gsub(\"/#{I18n.locale}/\", \"/#{lang}/\")\n end\n end\n\n html = \"<a class='nav-link' href='#{url}'>\"\n html << \"<span class='lang-code'>#{lang}</span>\"\n html << \"<span class='lang-name'>#{t('lang.'+lang)}</span>\"\n html << '</a>'\n\n list_items << { html: html, active: active }\n end\n\n list_items\n end", "title": "" }, { "docid": "3794f79127c9eed1c96bc56d49dc2351", "score": "0.5107379", "text": "def flag_link(locale = I18n.locale)\n # find the flag icon by class and go back to parent to get the link\n find(:xpath, %Q{.//i[contains(@class, \"flag-#{locale}\")]/..})\n end", "title": "" }, { "docid": "bc2dcf800d9ed4f2256ab97eee565f55", "score": "0.510617", "text": "def localized_url(id)\n \n translated_item = @items.find do |i|\n i[:id] == id and i[:language] == @item[:language]\n end\n \n if translated_item.nil? then\n translated_item = @items.find do |i|\n i[:id] == id and i[:language] == \"en\"\n end\n end\n \n if translated_item.nil? then\n puts \"Warning: dead link to '#{id}' from page '#{@item[:id]}'\"\n return \"\"\n end\n \n translated_item.path\nend", "title": "" }, { "docid": "520f8489d103332b4a8cf7128159a9f7", "score": "0.51039714", "text": "def navega_categoria\n click_link('Por categoria')\n end", "title": "" }, { "docid": "e5959377d028046e34f99c0dc7685a3f", "score": "0.5101607", "text": "def growlNotifierClicked_context(sender, context)\n openInboxForAccountName(context) if context\n end", "title": "" }, { "docid": "6768de4be40429c3bc1a081f9e5d2eb0", "score": "0.510005", "text": "def language_switch\n content_tag(:ul, id: 'switch') do\n I18n.available_locales.each do |loc|\n locale_param = request.path == root_path ? root_path(locale: loc) : params.merge(locale: loc)\n concat content_tag(:li, (link_to I18n.t(:language, locale: loc), locale_param), class: (I18n.locale == loc ? \"active\" : \"\"))\n end\n end\n end", "title": "" }, { "docid": "6768de4be40429c3bc1a081f9e5d2eb0", "score": "0.510005", "text": "def language_switch\n content_tag(:ul, id: 'switch') do\n I18n.available_locales.each do |loc|\n locale_param = request.path == root_path ? root_path(locale: loc) : params.merge(locale: loc)\n concat content_tag(:li, (link_to I18n.t(:language, locale: loc), locale_param), class: (I18n.locale == loc ? \"active\" : \"\"))\n end\n end\n end", "title": "" }, { "docid": "1cfcc1ef9f20921cd3876609f14ba0a1", "score": "0.5098328", "text": "def click(thingtodo,item,testname=\"NONE\", snap=\"PIC\")\n\n\tif testname != \"NONE\"\n\t\ttestname = testname + \"_click_\" + thingtodo + \"_\"\n\tend\n\n\toptions = [\"text\",\"partialtext\",\"id\",\"css\",\"xpath\",\"class\",\"name\",\"tag\"]\n\n\telement = getelement(thingtodo,item,options)\n\n\tif element != \"ERROR\"\n\t\tputs \"Clicking \" + thingtodo + \": \" + item\n\t\tbegin\n\t\t\telement.click\n\t\trescue\n\t\t\tputs \"Clicking \" + thingtodo + \": \" + item + \" failed\"\n\t\t\tif snap != \"NO\"\n\t\t\t\tsnap = \"FAILED\"\n\t\t\tend\n\t\tend\n\telse \n\t\t\tputs \"The following option is not supported by click: \" + thingtodo\n\t\t\tputs \"Please try one of the following supported options:\"\n\t\t\tputs options\n\t\t\tsnap = \"FAILED\"\n\tend\n\tsnapit(\"click_\" + thingtodo,testname,snap)\nend", "title": "" }, { "docid": "04a4538120fb4fd9e23f9544283e6d4f", "score": "0.50901896", "text": "def search_for_item(item)\n search_bar_element.set item\n search_button\n end", "title": "" } ]
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "a5dd51fb7ab945e464cf9f676f852d9b", "score": "0.6616259", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end", "title": "" } ]
[ { "docid": "0795eac2a3b746fc7fea6373714e1986", "score": "0.79519033", "text": "def serialize\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.76465106", "text": "def serialize(object) end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.75808734", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.75808734", "text": "def serialize; end", "title": "" }, { "docid": "a53c0fe9b3ab050ba96491d963f00252", "score": "0.7441225", "text": "def serialize\n \n end", "title": "" }, { "docid": "bdb05f3eb80d71773cf53569e26e5fca", "score": "0.7209669", "text": "def serialize\n raise NotImplementedError\n end", "title": "" }, { "docid": "bdb05f3eb80d71773cf53569e26e5fca", "score": "0.7209669", "text": "def serialize\n raise NotImplementedError\n end", "title": "" }, { "docid": "4929c1b9891b14e8291b508cbeddebb3", "score": "0.720668", "text": "def dump\r\n super + to_s\r\n end", "title": "" }, { "docid": "d73ec2d15925764e922141210fbd00a7", "score": "0.701747", "text": "def serialize\n self.to_hash.to_json\n end", "title": "" }, { "docid": "b0bfc7c130fee59ad37d80a7f71bdfb2", "score": "0.7002693", "text": "def serialized\n serializer_class.new(self).serializable_hash\n end", "title": "" }, { "docid": "962d5fb0e8b384f5445d3b1cd17fdf9f", "score": "0.69936407", "text": "def serialize\n @raw_data\n end", "title": "" }, { "docid": "8e4cf6b93bc2bda43b53762bd2648085", "score": "0.6983181", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end", "title": "" }, { "docid": "3e934d5e32932e9c3ffce2f3901ceb36", "score": "0.6972398", "text": "def serialize\n @serializer.serialize(self.output)\n end", "title": "" }, { "docid": "d9aabe9cbbebb021084279a2b501d153", "score": "0.69675887", "text": "def serialize(_object, data); end", "title": "" }, { "docid": "d9aabe9cbbebb021084279a2b501d153", "score": "0.69675887", "text": "def serialize(_object, data); end", "title": "" }, { "docid": "ad75a298d7cc9868bf7bbd4ca2f42cd1", "score": "0.6942931", "text": "def serializer; end", "title": "" }, { "docid": "78e11a2a82cf31eea1575e69ea8ac41a", "score": "0.69420123", "text": "def to_json\n\t\t\tself.instance_variable_hash\n\t\tend", "title": "" }, { "docid": "28ee2da6840feee9562af047de23ca8b", "score": "0.6935524", "text": "def serialize!\n end", "title": "" }, { "docid": "46393d4345cfa3e260b7a484a5241da8", "score": "0.69145155", "text": "def serialize(object)\n object.serializable_hash\n end", "title": "" }, { "docid": "c3e5b5f046c9433d172fdf8a83c4251b", "score": "0.6891068", "text": "def serialize(object)\n object.to_s\n end", "title": "" }, { "docid": "423fb52e969b6cbb23564eabba631387", "score": "0.68803483", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.6877558", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.6877558", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.6877558", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "7505c4f2ba56ad590ef5fdb10aedef3a", "score": "0.6875324", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "6e12896a516f44f7242feb874b586488", "score": "0.68525094", "text": "def serialize\n YAML::dump(self)\n end", "title": "" }, { "docid": "4145618248ebb2dc28500b337e37de91", "score": "0.68368477", "text": "def inspect()\n serialize.to_s()\n end", "title": "" }, { "docid": "4145618248ebb2dc28500b337e37de91", "score": "0.68368477", "text": "def inspect()\n serialize.to_s()\n end", "title": "" }, { "docid": "f43efb9a4880908dbe66a97701c7cae4", "score": "0.6825207", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end", "title": "" }, { "docid": "9a528d7cbd57e0600f5f22b81130683c", "score": "0.6814586", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end", "title": "" }, { "docid": "5a659a36f1b7cf8160675da80f9074c6", "score": "0.6805507", "text": "def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end", "title": "" }, { "docid": "1aba29e6bef51939e4e190426b922609", "score": "0.6800522", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end", "title": "" }, { "docid": "650142b3fdf589633088905b422ae5af", "score": "0.67955524", "text": "def serialize(object, data); end", "title": "" }, { "docid": "c0316006221b00f6bc983ef260f72f2f", "score": "0.6773115", "text": "def serialize\n JSON.generate(to_h)\n end", "title": "" }, { "docid": "e5973219b67c3d314afa347dd51dd989", "score": "0.6734066", "text": "def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end", "title": "" }, { "docid": "2ab0dec72eb0d25fd34d20a5c6c88d2a", "score": "0.6728008", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "54a7648e29fbe4f430c43cb78c1d420b", "score": "0.66959995", "text": "def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end", "title": "" }, { "docid": "39273db2799aa93f15cb32a0107d13fd", "score": "0.66823745", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end", "title": "" }, { "docid": "51d190e0b38453bb737902acee90aea5", "score": "0.6673096", "text": "def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end", "title": "" }, { "docid": "a7a76e51592ab4cec6d5452778524650", "score": "0.66678214", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end", "title": "" }, { "docid": "d1f0b2c5ac4047cbf1e820319d475f66", "score": "0.66670305", "text": "def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend", "title": "" }, { "docid": "b9615070cc13ef0b292568a262e4c6e0", "score": "0.6659405", "text": "def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end", "title": "" }, { "docid": "9de4b58d246a11e5383cd14d25999c96", "score": "0.6655963", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "title": "" }, { "docid": "ea29d99cc3e1b2845f204e9cd99896f1", "score": "0.66511476", "text": "def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end", "title": "" }, { "docid": "7828008f87df2e46dcfb291bb0f328e4", "score": "0.6635537", "text": "def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend", "title": "" }, { "docid": "5bbbc62d7f73be50f37c5dab4651efa4", "score": "0.662825", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "5bbbc62d7f73be50f37c5dab4651efa4", "score": "0.662825", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "5bbbc62d7f73be50f37c5dab4651efa4", "score": "0.662825", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "b5a7868c0ae06ba7f122d40f881182f4", "score": "0.6627648", "text": "def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end", "title": "" }, { "docid": "4baec47f3f79d3631a344ec56d375f3c", "score": "0.6613713", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end", "title": "" }, { "docid": "f27a03603dd4ddbfbd575a4428cddf90", "score": "0.6610548", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end", "title": "" }, { "docid": "0cbc865b00a852f654b34796b6b3bf65", "score": "0.6596648", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end", "title": "" }, { "docid": "685f2e80cb97226f43d121d25c2b5876", "score": "0.6596455", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end", "title": "" }, { "docid": "decc683077b402597abe8bdde6dceb21", "score": "0.6594039", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end", "title": "" }, { "docid": "884ad7af4ffc538144c1b3e327bab65d", "score": "0.6591663", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end", "title": "" }, { "docid": "ffb6700ffa44932720b61d1ef2b5d257", "score": "0.65837413", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end", "title": "" }, { "docid": "cc358a6baf92f4272145a96c1fb91ec8", "score": "0.65800667", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end", "title": "" }, { "docid": "3d1c01d6e34e2740ffe9f4904cd42c72", "score": "0.6580038", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end", "title": "" }, { "docid": "d767afb641d31b419487101417d33a01", "score": "0.6576505", "text": "def serializable_hash\n self.attributes\n end", "title": "" }, { "docid": "5cdae890afc3942781448f3666d6f45f", "score": "0.6571032", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end", "title": "" }, { "docid": "c5723d1125e7dc93f23b173ae844bc16", "score": "0.65701735", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end", "title": "" }, { "docid": "11d9458830fad45fc5e754e9c852925a", "score": "0.6566823", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end", "title": "" }, { "docid": "00755170642a588cfef44e4a79378bda", "score": "0.656081", "text": "def serialize\n JSON.dump(@hash)\n end", "title": "" }, { "docid": "eac2773d2373ad9f2a762e517902a28d", "score": "0.6555125", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end", "title": "" }, { "docid": "cc0e97fb4b19160f868e2e44bde26d84", "score": "0.65403765", "text": "def to_s\r\n dump\r\n end", "title": "" }, { "docid": "f2b26b2195dd9c93b63aa9c403f38ae1", "score": "0.65372765", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"callee\", @callee)\n writer.write_object_value(\"caller\", @caller)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_object_value(\"failureInfo\", @failure_info)\n writer.write_collection_of_object_values(\"media\", @media)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n end", "title": "" }, { "docid": "64ada7b07f9f0e0d824c91480b3b4926", "score": "0.65342295", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end", "title": "" }, { "docid": "648959a41483769ae15a2fbf8106dedd", "score": "0.65266466", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end", "title": "" }, { "docid": "b2e0a28980e4fea5b8b6b95e92383ff4", "score": "0.65248185", "text": "def serialize(io)\n Encoder.encode(io, self)\n io\n end", "title": "" }, { "docid": "e5f65327afba6522ea4ef42d36f64513", "score": "0.65241057", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end", "title": "" }, { "docid": "919a4c7ec69fbc37a43c668d36064b87", "score": "0.6523422", "text": "def _dump() end", "title": "" }, { "docid": "db44893862c11c031669ec70b2c20eae", "score": "0.6517231", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end", "title": "" }, { "docid": "f52ad4c04d70e3c8a86f9bd0f4e80107", "score": "0.65129846", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end", "title": "" }, { "docid": "83d29b1268c5987d9ae7a84dac37a110", "score": "0.6507672", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end", "title": "" }, { "docid": "30673a84e2be9a2a9d242c7ad0d6f8f5", "score": "0.6499402", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end", "title": "" }, { "docid": "fa8a1c3cba4886457579c28c6e42d4aa", "score": "0.6498554", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end", "title": "" }, { "docid": "0f2922e620a615cff647c312c598a573", "score": "0.6496918", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end", "title": "" }, { "docid": "8b3d2d6e1dfd6ad6b5af18d392a336b0", "score": "0.6486062", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end", "title": "" }, { "docid": "944f1295549efbe9c292a0569f8f97e0", "score": "0.64815867", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end", "title": "" }, { "docid": "f57cb590ca9b6cc45778737dd4c690bf", "score": "0.6481207", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end", "title": "" }, { "docid": "6c387463edcd92e4ee34e0723f973ac1", "score": "0.6479458", "text": "def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end", "title": "" }, { "docid": "e7c5e272254a8677d7c16d306d28d619", "score": "0.64761055", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end", "title": "" }, { "docid": "34895100d854717cb2b93b9c4e324859", "score": "0.64750475", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end", "title": "" }, { "docid": "2bbe333d876a050f18872553a7a9a342", "score": "0.64679796", "text": "def _dump()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "93b0dca9366aa8dbd02fced5dfd6ba98", "score": "0.6462904", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end", "title": "" }, { "docid": "ca21918429a516f5b256d6671271c176", "score": "0.6462426", "text": "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end", "title": "" }, { "docid": "7cacc15a57f9b673af011b77df152b4e", "score": "0.6460337", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end", "title": "" }, { "docid": "3a30428439c66c85040924b41dbf6dfd", "score": "0.645633", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end", "title": "" }, { "docid": "41e1f416b15840e65cca6666cc336923", "score": "0.6448957", "text": "def inspect\n self.to_hash.inspect\n end", "title": "" }, { "docid": "85079a15e69bfe2d794e0dbb5b546dc0", "score": "0.64389867", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end", "title": "" }, { "docid": "55d0845d65a1566378f4f56cd777e8b3", "score": "0.6433835", "text": "def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end", "title": "" }, { "docid": "6c86b4b6a4d2c8c7d21744264cd8df8b", "score": "0.64322424", "text": "def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end", "title": "" }, { "docid": "570ef24921c102d38f53af60468bc47d", "score": "0.6424561", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.6421094", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.6421094", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.6421094", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.6421094", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.6421094", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "09f1af26ee6b08b737bc1a49cd6c5083", "score": "0.641823", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "ac4c49137f2a876e60afef9cd96520d0", "score": "0.64144397", "text": "def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end", "title": "" } ]
32795f9f7a4618e8e8cca50e37d20f5f
Install a gem from source builds and packages it first then installs. Examples: install_gem_from_source(source_dir, :install_dir => ...) install_gem_from_source(source_dir, gem_name) install_gem_from_source(source_dir, :skip => [...])
[ { "docid": "9b6990340201912d85d576391a559023", "score": "0.8422682", "text": "def install_gem_from_source(source_dir, *args)\n installed_gems = []\n opts = args.last.is_a?(Hash) ? args.pop : {}\n Dir.chdir(source_dir) do \n gem_name = args[0] || File.basename(source_dir)\n gem_pkg_dir = File.join(source_dir, 'pkg')\n gem_pkg_glob = File.join(gem_pkg_dir, \"#{gem_name}-*.gem\")\n skip_gems = opts.delete(:skip) || []\n\n # Cleanup what's already there\n clobber(source_dir)\n FileUtils.mkdir_p(gem_pkg_dir) unless File.directory?(gem_pkg_dir)\n\n # Recursively process all gem packages within the source dir\n skip_gems << gem_name\n packages = package_all(source_dir, skip_gems)\n \n if packages.length == 1\n # The are no subpackages for the main package\n refresh = [gem_name]\n else\n # Gather all packages into the top-level pkg directory\n packages.each do |pkg|\n FileUtils.copy_entry(pkg, File.join(gem_pkg_dir, File.basename(pkg)))\n end\n \n # Finally package the main gem - without clobbering the already copied pkgs\n package(source_dir, false)\n \n # Gather subgems to refresh during installation of the main gem\n refresh = packages.map do |pkg|\n File.basename(pkg, '.gem')[/^(.*?)-([\\d\\.]+)$/, 1] rescue nil\n end.compact\n \n # Install subgems explicitly even if ignore_dependencies is set\n if opts[:ignore_dependencies]\n refresh.each do |name| \n gem_pkg = Dir[File.join(gem_pkg_dir, \"#{name}-*.gem\")][0]\n install_pkg(gem_pkg, opts)\n end\n end\n end\n \n ensure_bin_wrapper_for(opts[:install_dir], opts[:bin_dir], *installed_gems)\n \n # Finally install the main gem\n if install_pkg(Dir[gem_pkg_glob][0], opts.merge(:refresh => refresh))\n installed_gems = refresh\n else\n installed_gems = []\n end\n end\n installed_gems\n end", "title": "" } ]
[ { "docid": "ebed54dd163b345ee450c63be8a39119", "score": "0.741251", "text": "def install_gem_from_source(repo_url, git_ref, gem_name = nil)\n uri = URI.parse(repo_url)\n repo_basename = ::File.basename(uri.path)\n repo_name = repo_basename.match(/(?<name>.*)\\.git/)[:name]\n gem_name ||= repo_name\n\n Chef::Log.debug(\"Building #{gem_name} gem from source\")\n\n gem_clone_path = ::File.join(Chef::Config[:file_cache_path], repo_name)\n gem_file_path = ::File.join(gem_clone_path, \"#{gem_name}-*.gem\")\n\n checkout_gem = Chef::Resource::Git.new(gem_clone_path, run_context)\n checkout_gem.repository(repo_url)\n checkout_gem.revision(git_ref)\n checkout_gem.run_action(:sync)\n\n ::FileUtils.rm_rf gem_file_path\n\n build_gem = Chef::Resource::Execute.new(\"build-#{gem_name}-gem\", run_context)\n build_gem.cwd(gem_clone_path)\n build_gem.command(\n <<-EOH\n#{::File.join(RbConfig::CONFIG['bindir'], 'gem')} build #{gem_name}.gemspec\n EOH\n )\n build_gem.run_action(:run) if checkout_gem.updated?\n\n install_gem = Chef::Resource::ChefGem.new(gem_name, run_context)\n install_gem_file_path = if windows?\n Dir.glob(gem_file_path.tr('\\\\', '/')).first\n else\n Dir.glob(gem_file_path).first\n end\n install_gem.source(install_gem_file_path)\n install_gem.run_action(:install) if build_gem.updated?\n end", "title": "" }, { "docid": "06423d1023e98a1617b4163536676ccc", "score": "0.69038033", "text": "def install\n spec_dir = File.join @install_dir, 'specifications'\n source_index = Gem::SourceIndex.from_gems_in spec_dir\n\n @gems_to_install.each do |spec|\n last = spec == @gems_to_install.last\n # HACK is this test for full_name acceptable?\n next if source_index.any? { |n,_| n == spec.full_name } and not last\n\n say \"Installing gem #{spec.full_name}\" if Gem.configuration.really_verbose\n\n _, source_uri = @specs_and_sources.assoc spec\n local_gem_path = download spec, source_uri\n\n inst = Gem::Installer.new local_gem_path,\n :env_shebang => @env_shebang,\n :force => @force,\n :format_executable => @format_executable,\n :ignore_dependencies => @ignore_dependencies,\n :install_dir => @install_dir,\n :security_policy => @security_policy,\n :wrappers => @wrappers\n\n spec = inst.install\n\n @installed_gems << spec\n end\n end", "title": "" }, { "docid": "75f0acbd1f5698eded8e72e22f74db3e", "score": "0.67692155", "text": "def install gem_name, version = :latest, source_url = :default\n ::Emissary::GemHelper.new(gem_name).install(version, source_url)\n end", "title": "" }, { "docid": "943ecf22ce40e2014810d522d61e21a5", "score": "0.6699397", "text": "def install_gem(install_dir, gem, version = nil)\n Gem.configuration.update_sources = false\n Gem.clear_paths # default to plain rubygems path\n installer = Gem::DependencyInstaller.new(:install_dir => install_dir)\n exception = nil\n begin\n installer.install gem, version\n rescue Gem::InstallError => e\n exception = e\n rescue Gem::GemNotFoundException => e\n puts \"Locating #{gem} in local gem path cache...\"\n spec = if version\n Gem.source_index.find_name(gem, \"= #{version}\").first\n else\n Gem.source_index.find_name(gem).sort_by { |g| g.version }.last\n end\n if spec && File.exists?(gem_file = \n File.join(spec.installation_path, 'cache', \"#{spec.full_name}.gem\"))\n installer.install gem_file\n end\n exception = e\n end\n if installer.installed_gems.empty? && e\n puts \"Failed to install gem '#{gem}' (#{e.message})\"\n end\n installer.installed_gems.each do |spec|\n puts \"Successfully installed #{spec.full_name}\"\n end\n end", "title": "" }, { "docid": "cabc189904f45875fa767e1ef5a1cc9f", "score": "0.6605501", "text": "def install_gem(gem_name, version, target_dir)\n installer = Gem::DependencyInstaller.new(:install_dir => target_dir)\n installer.install(gem_name, version)\nend", "title": "" }, { "docid": "cabc189904f45875fa767e1ef5a1cc9f", "score": "0.6605501", "text": "def install_gem(gem_name, version, target_dir)\n installer = Gem::DependencyInstaller.new(:install_dir => target_dir)\n installer.install(gem_name, version)\nend", "title": "" }, { "docid": "5cee75f7d67c4ea91496ba75cce1c2e1", "score": "0.65430015", "text": "def install( source=nil )\n\n # check if source is supplied.\n if source.nil?\n source = ( @opts.source || @opts.override )\n end\n\n begin\n require 'bz2'\n rescue LoadError\n # cannot find the libbzip2 binding.\n # Use system calls.\n warn \"Cannot find `bz2' binding.\"\n extract_bz2_by_system( source )\n end\n # TODO: implement for the bz2 binding.\n puts \"yay\"\n extract_bz2_by_binding( source )\n end", "title": "" }, { "docid": "7f7b2fba5716de404192597b23735d01", "score": "0.6416362", "text": "def _install\n _build_gem\n _uninstall\n sh \"gem install --no-rdoc --no-ri --local #{gem_name}-#{version}.gem\"\n end", "title": "" }, { "docid": "659621d722e9cc462b8ea45bf69604de", "score": "0.6356963", "text": "def install dep_or_name, version = LibGems::Requirement.default\n LibGems.with_rubygems_compat do\n if String === dep_or_name then\n find_spec_by_name_and_version dep_or_name, version, @prerelease\n else\n dep_or_name.prerelease = @prerelease\n @specs_and_sources = [find_gems_with_sources(dep_or_name).last]\n end\n\n @installed_gems = []\n\n gather_dependencies\n\n @gems_to_install.each do |spec|\n last = spec == @gems_to_install.last\n # HACK is this test for full_name acceptable?\n next if @source_index.any? { |n,_| n == spec.full_name } and not last\n\n # TODO: make this sorta_verbose so other users can benefit from it\n say \"Installing bpkg #{spec.full_name}\" if LibGems.configuration.really_verbose\n\n _, source_uri = @specs_and_sources.assoc spec\n begin\n local_gem_path = LibGems::RemoteFetcher.fetcher.download spec, source_uri,\n @cache_dir\n rescue LibGems::RemoteFetcher::FetchError\n next if @force\n raise\n end\n\n inst = LibGems::Installer.new local_gem_path,\n :bin_dir => @bin_dir,\n :development => @development,\n :env_shebang => @env_shebang,\n :force => @force,\n :format_executable => @format_executable,\n :ignore_dependencies => @ignore_dependencies,\n :install_dir => @install_dir,\n :security_policy => @security_policy,\n :source_index => @source_index,\n :user_install => @user_install,\n :wrappers => @wrappers\n\n spec = inst.install\n\n @installed_gems << spec\n end\n\n @installed_gems\n end\n end", "title": "" }, { "docid": "97499037115e9d66db7197bce0cccec0", "score": "0.63565606", "text": "def gem_install(gemname, options={})\n raise Nano::AlreadyInstalledError if installed?(gemname)\n\n # Get the gemspec; install it if needed.\n spec = get_gemspec(gemname)\n if spec.nil?\n gem_install_opts = \"--no-rdoc --no-ri --no-test\"\n run \"gem install #{gemname} #{gem_install_opts}\"\n raise Nano::NoGemError if $?.to_i > 0\n spec = get_gemspec(gemname)\n end\n\n # Add it (and it's dependencies) to the deps file,\n # and unpack the gems to vendor/.\n empty_directory \"vendor\"\n dependize(spec)\n end", "title": "" }, { "docid": "c266c4b4a291265489578fc09ff418ef", "score": "0.6347014", "text": "def install_gem\n Jeweler::Commands::InstallGem.build_for(self).run\n end", "title": "" }, { "docid": "b6172eaf42bb491e6763320f3756f647", "score": "0.63405263", "text": "def install_gemspec\n # find gemspec file\n gemspecs = Dir['*.gemspec']\n if gemspecs.size == 0\n raise Gem::Exception.new(\"gemspec not found\")\n elsif gemspecs.size > 1\n raise Gem::Exception.new(\"multiple gemspecs found\")\n end\n gemspec = gemspecs[0]\n\n # load gemspec file\n spec = eval File.read(gemspec)\n name, version = spec.name, spec.version\n prevent_overriding(name, version) unless options[:override]\n\n # build and install\n build_gem gemspec\n install_gem \"#{name}-#{version}.gem\"\n end", "title": "" }, { "docid": "2e3a4285a7a7e3f2540760b704dc9f1b", "score": "0.6311927", "text": "def install_gem(gem, options = {})\n refresh = options.delete(:refresh) || []\n from_cache = (options.key?(:cache) && options.delete(:cache))\n if from_cache\n install_gem_from_cache(gem, options)\n else\n version = options.delete(:version)\n Gem.configuration.update_sources = false\n\n # Limit source index to install dir\n update_source_index(options[:install_dir]) if options[:install_dir]\n\n installer = Gem::DependencyInstaller.new(options.merge(:user_install => false))\n \n # Force-refresh certain gems by excluding them from the current index\n if !options[:ignore_dependencies] && refresh.respond_to?(:include?) && !refresh.empty?\n source_index = installer.instance_variable_get(:@source_index)\n source_index.gems.each do |name, spec| \n source_index.gems.delete(name) if refresh.include?(spec.name)\n end\n end\n \n exception = nil\n begin\n installer.install gem, version\n rescue Gem::InstallError => e\n exception = e\n rescue Gem::GemNotFoundException => e\n if from_cache && gem_file = find_gem_in_cache(gem, version)\n puts \"Located #{gem} in gem cache...\"\n installer.install gem_file\n else\n exception = e\n end\n rescue => e\n exception = e\n end\n if installer.installed_gems.empty? && exception\n error \"Failed to install gem '#{gem} (#{version || 'any version'})' (#{exception.message})\"\n end\n ensure_bin_wrapper_for_installed_gems(installer.installed_gems, options)\n installer.installed_gems.each do |spec|\n success \"Successfully installed #{spec.full_name}\"\n end\n return !installer.installed_gems.empty?\n end\n end", "title": "" }, { "docid": "86db28ec2376023bb8f9b963c7fbf6cc", "score": "0.62993205", "text": "def setup_gem_source\n @source_path = Dir.mktmpdir(\"test_gem_source_path_#{$$}\")\n\n Dir.mkdir gemdir = File.join(@source_path, 'gems')\n\n @source_working = working = Dir.mktmpdir(\"test_gem_source_#{$$}\")\n FileUtils.mkdir_p rzspecdir = File.join(@source_path, \"quick/Marshal.#{Gem.marshal_version}\")\n\n Dir.mkdir File.join(working, 'lib')\n\n gemspecs = %w[a b c].map do |name|\n FileUtils.touch File.join(working, 'lib', \"#{name}.rb\")\n FileUtils.touch File.join(rzspecdir, \"#{name}spec.rz\")\n Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = name\n s.version = 1.0\n s.author = 'rubygems'\n s.email = 'example@example.com'\n s.homepage = 'http://example.com'\n s.description = 'desc'\n s.summary = \"summ\"\n s.require_paths = %w[lib]\n s.files = %W[lib/#{name}.rb]\n s.rubyforge_project = 'rubygems'\n end\n end\n\n # add prerelease gem versions\n prerelease_gemspecs = %w[x y].map do |name|\n FileUtils.touch File.join(working, 'lib', \"#{name}.rb\")\n FileUtils.touch File.join(rzspecdir, \"#{name}spec.rz\")\n Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = name\n s.version = \"0.1.b\"\n s.author = 'rubygems'\n s.email = 'example@example.com'\n s.homepage = 'http://example.com'\n s.description = 'desc'\n s.summary = \"summ\"\n s.require_paths = %w[lib]\n s.files = %W[lib/#{name}.rb]\n s.rubyforge_project = 'rubygems'\n end\n end\n\n gemspecs.concat(prerelease_gemspecs)\n\n gemspecs.each do |spec|\n path = File.join(working, \"#{spec.name}.gemspec\")\n open(path, 'w') do |io|\n io.write(spec.to_ruby)\n end\n Dir.chdir(working) do\n gem_file = Gem::Package.build(spec)\n FileUtils.mv(gem_file, File.join(@source_path, 'gems', gem_file))\n end\n end\n\n @source_gems = Dir[File.join(gemdir, '*.gem')].map {|p|File.basename(p)}\n\n Gem::Indexer.new(@source_path).generate_index\n end", "title": "" }, { "docid": "0dda57272df5e606c5c9e38e173da52b", "score": "0.62957305", "text": "def install_rubygem(gem, version = nil)\n Gem.configuration.update_sources = false\n Gem.clear_paths\n installer = Gem::DependencyInstaller.new(:install_dir => freezer_dir)\n exception = nil\n begin\n installer.install gem, version\n rescue Gem::InstallError => e\n exception = e\n rescue Gem::GemNotFoundException => e\n puts \"Locating #{gem} in local gem path cache...\"\n spec = version ? Gem.cache.find_name(gem, \"= #{version}\").first : Gem.cache.find_name(gem).sort_by { |g| g.version }.last\n if spec && File.exists?(gem_file = spec.installation_path / 'cache' / \"#{spec.full_name}.gem\")\n installer.install gem_file\n end\n exception = e\n end\n if installer.installed_gems.empty? && e\n puts \"Failed to install gem '#{gem}' (#{e.message})\"\n end\n installer.installed_gems.each do |spec|\n puts \"Successfully installed #{spec.full_name}\"\n end\n end", "title": "" }, { "docid": "e8ccc6cb08ee1e7582377009fcb2a10b", "score": "0.6284432", "text": "def install(local: false)\n\tpath = self.build\n\t\n\t@helper.install_gem(path, local)\nend", "title": "" }, { "docid": "441b8e7ac3611ca7e99b58fb5ce4aae0", "score": "0.6273867", "text": "def install(gem_dependency, options = {})\n with_gem_sources(*options.delete(:sources)) do\n with_correct_verbosity do\n dependency_installer(**options).install(gem_dependency)\n end\n end\n end", "title": "" }, { "docid": "9443639125b911172e5b24a28cfe362c", "score": "0.62690336", "text": "def install_from_source(source, release)\n unless File.exist? \"#{RVM.path}/repos/ruby\"\n system \"#{RVM.path}/bin/rvm fetch ruby-head\" \n end\n\n Dir.chdir(\"#{RVM.path}/repos/ruby\") do\n `git checkout #{source} 2>/dev/null`\n `git pull`\n end\n\n log = gitlog(\"#{RVM.path}/repos/ruby\")\n rev = if source == 'trunk'\n \"n#{log.svnid}\"\n else\n \"s#{log.commit}-n#{log.svnid}\"\n end\n\n release=PROFILE.rvm['bin'].split('-')[1]\n\n unless File.exist? \"#{RVM.path}/bin/ruby-#{release}-#{rev}\"\n shell \"#{RVM.path}/bin/rvm --autolibs=read install ruby-#{release}-#{rev}\"\n exit unless File.exist? \"#{RVM.path}/wrappers/ruby-#{release}-#{rev}\"\n end\n\n \"ruby-#{release}-#{rev}\"\n end", "title": "" }, { "docid": "7601c1961283bba526ca1f787c1f5085", "score": "0.6250372", "text": "def install!\n src = package_source\n dst = ::File.join(Chef::Config[:file_cache_path],\n ::File.basename(src))\n chk = package_checksum\n remote_file dst do\n source src\n checksum chk\n end\n dpkg_package dst do\n options '--skip-same-version'\n end\n end", "title": "" }, { "docid": "df8156e2904e618e72da1a02377afae3", "score": "0.6203146", "text": "def install!\n install_dependencies!\n \n if !Config.force? && File.exist?(install_path)\n log(:debug, \"Already installed `#{@gem_spec}'\")\n else\n log(:info, \"Installing `#{@gem_spec}'\")\n download\n unpack\n \n load_full_spec!\n \n replace(data_dir, install_path)\n replace(gem_file, gem_cache_file)\n \n create_bin_wrappers!\n create_ruby_gemspec!\n end\n end", "title": "" }, { "docid": "a8f3d9a01e7c6699f8466c928f5c8d74", "score": "0.62016356", "text": "def install\n if @resource[:source]\n install_from_file\n else\n install_from_repo\n end\n\n unless self.query\n fail(_(\"Could not find package '%{name}'\") % { name: @resource[:name] })\n end\n end", "title": "" }, { "docid": "03ff5b990225077a9805da6da9b39efd", "score": "0.6169134", "text": "def install(package=@pkg)\n if source = download(package)\n if add_pkg_to_fs(package)\n add_pkg_to_db(package)\n touch_installed(package)\n end\n end\n # no need to keep the archive file around\n FileUtils.rm_f(package['pkg_source_path'])\n end", "title": "" }, { "docid": "25115afb59a61f7780e8de1e3b306381", "score": "0.6140569", "text": "def install\n # get spec information\n @spec = compute_spec\n # define name and platform\n if @installname\n @spec[:installname] = @installname\n else\n @spec[:installname] = name_and_platform(@spec[:name])\n end\n # set install dir\n @installdir = \"#{@spec[:installname]}-#{@spec[:version]}\"\n # install gem\n Gem::Installer.new(@filename, :env_shebang => true, :ignore_dependencies => true,\n :install_dir => File.expand_path(@installdir), :bin_dir => File.expand_path(\"#{@installdir}/bin\"),\n :wrappers => true).install\n # install build files\n install_build_files\n # get file list\n files\n # build tar.gz\n build_source\n end", "title": "" }, { "docid": "5c840a6123e5d483857dd474db601f31", "score": "0.610392", "text": "def source_package(options, workspace: Autoproj.workspace)\n package_common(options, workspace: workspace) do |pkg|\n pkg.srcdir = pkg.name\n yield(pkg) if block_given?\n end\nend", "title": "" }, { "docid": "a44b9a904f28931ded5542fafc927a15", "score": "0.6011457", "text": "def install dep_or_name, version = Gem::Requirement.default\n if String === dep_or_name then\n find_spec_by_name_and_version dep_or_name, version, @prerelease\n else\n dep_or_name.prerelease = @prerelease\n @specs_and_sources = [find_gems_with_sources(dep_or_name).last]\n end\n\n @installed_gems = []\n\n gather_dependencies\n\n @gems_to_install.each do |spec|\n last = spec == @gems_to_install.last\n # HACK is this test for full_name acceptable?\n next if @source_index.any? { |n,_| n == spec.full_name } and not last\n\n # TODO: make this sorta_verbose so other users can benefit from it\n say \"Installing spd #{spec.full_name}\" if Gem.configuration.really_verbose\n\n _, source_uri = @specs_and_sources.assoc spec\n begin\n local_gem_path = Gem::RemoteFetcher.fetcher.download spec, source_uri,\n @cache_dir\n rescue Gem::RemoteFetcher::FetchError\n next if @force\n raise\n end\n\n inst = Spade::Installer.new local_gem_path,\n :bin_dir => @bin_dir,\n :development => @development,\n :env_shebang => @env_shebang,\n :force => @force,\n :format_executable => @format_executable,\n :ignore_dependencies => @ignore_dependencies,\n :install_dir => @install_dir,\n :security_policy => @security_policy,\n :source_index => @source_index,\n :user_install => @user_install,\n :wrappers => @wrappers\n\n spec = inst.install\n\n @installed_gems << spec\n end\n\n @installed_gems\n end", "title": "" }, { "docid": "4dfa104f0fced783edc5a5655b14ec49", "score": "0.599214", "text": "def install_gem_from_cache(gem, options = {})\n version = options.delete(:version)\n Gem.configuration.update_sources = false\n installer = Gem::DependencyInstaller.new(options.merge(:user_install => false))\n exception = nil\n begin\n if gem_file = find_gem_in_cache(gem, version)\n puts \"Located #{gem} in gem cache...\"\n installer.install gem_file\n else\n raise Gem::InstallError, \"Unknown gem #{gem}\"\n end\n rescue Gem::InstallError => e\n exception = e\n end\n if installer.installed_gems.empty? && exception\n error \"Failed to install gem '#{gem}' (#{e.message})\"\n end\n ensure_bin_wrapper_for_installed_gems(installer.installed_gems, options)\n installer.installed_gems.each do |spec|\n success \"Successfully installed #{spec.full_name}\"\n end\n end", "title": "" }, { "docid": "f353af66e56fffb5bc64b1f6022f19fd", "score": "0.59814906", "text": "def gem_install( gem, opts = {} )\n version = Array( opts[ :version ] )\n ver = (version.length == 1) && version[0] =~ /^=?\\s*([0-9]\\S+)/ && $1\n\n unless ( opts[:check] ||\n opts[:minimize] == false ||\n opts[:spec_check] == false ||\n ver.nil? )\n\n prefix = if opts[:user_install]\n jruby_user_gem_dir( opts[:user_install] )\n else\n jruby_gem_home\n end\n\n specs = [ \"#{prefix}/specifications/#{gem}-#{ver}-java.gemspec\",\n \"#{prefix}/specifications/#{gem}-#{ver}.gemspec\" ]\n\n shopts = {}\n case opts[ :user_install ]\n when String\n shopts[ :user ] = opts[ :user_install ]\n when nil, false\n shopts[ :user ] = :root\n end\n\n sh_if( \"[ ! -e #{specs[0]} -a ! -e #{specs[1]} ]\", shopts ) do\n super\n end\n else\n super\n end\n end", "title": "" }, { "docid": "18258a3762efb9f0e90913ad7f685734", "score": "0.59671694", "text": "def install!\n return if is_gem?\n \n puts \"\\nInstalling lyp...\\n\\n\"\n copy_package_files\n create_wrapper_batch_files\n end", "title": "" }, { "docid": "f59cef1d2681f31c8e2e19385070cf66", "score": "0.59591764", "text": "def install\n args = %w{install -q}\n args += install_options if @resource[:install_options]\n if @resource[:source]\n if String === @resource[:ensure]\n args << \"#{@resource[:source]}@#{@resource[:ensure]}#egg=#{\n @resource[:name]}\"\n else\n args << \"#{@resource[:source]}#egg=#{@resource[:name]}\"\n end\n else\n case @resource[:ensure]\n when String\n args << \"#{@resource[:name]}==#{@resource[:ensure]}\"\n when :latest\n args << \"--upgrade\" << @resource[:name]\n else\n args << @resource[:name]\n end\n end\n lazy_pip(*args)\n end", "title": "" }, { "docid": "20a9f7b60f65677e03bb5b32e20f6f7f", "score": "0.59438324", "text": "def install_gem_from_rubygems(gem_name, gem_version = nil)\n Chef::Log.debug(\"Installing #{gem_name}#{\" v#{gem_version}\" if gem_version} from #{new_resource.rubygems_url}\")\n chefgem = Chef::Resource::ChefGem.new(gem_name, run_context)\n chefgem.source(new_resource.rubygems_url) if new_resource.rubygems_url\n chefgem.version(gem_version) if gem_version\n chefgem.run_action(:install)\n end", "title": "" }, { "docid": "b4a113283ba7143b5e0be4e3b92c2e02", "score": "0.5943565", "text": "def do_src_install\n\n puts \"Downloading source from ... \"+@source_url\n Download.new(@source_url, @src_dir)\n fp = FNParser.new(@source_url)\n src_tarball_fname, src_tarball_bname = fp.name\n # major, minor, patch = fp.version\n\n src_extract_folder = File.join(@build_dir, src_tarball_bname)\n @src_build_dir = src_extract_folder\n\n if Dir.exists?(src_extract_folder)\n puts \"Source file folder exists in \"+src_extract_folder\n puts \"Deleting it\"\n self.Run( ['rm -rf', src_extract_folder].join(' ') )\n end\n puts \"Extracting...\"\n self.Run( \"tar xf \"+File.realpath(File.join(@src_dir, src_tarball_fname))+\" -C \"+@build_dir )\n\n opts = [\"--prefix=\"+@prefix]+@conf_options\n\n if @need_sudo\n inst_cmd = \"sudo make install\"\n else\n inst_cmd = \"make install\"\n end\n\n @env['CC'] = 'gcc'\n @env['CXX'] = 'g++'\n\n # Ok let's rock!\n puts \"Compiling (with #{@Processors} processors) and Installing ...\"\n cmds = [\n \"cd\", src_extract_folder, \"&&\",\n File.join(src_extract_folder,\"configure\"),\n opts.join(\" \"), \"&&\",\n \"nice make -j\", @Processors.to_s, \"&&\",\n inst_cmd\n ]\n self.RunInstall( env: @env, cmd: cmds.join(\" \") )\n\n self.WriteInfo\n\n puts \"Let's install additional packages!\"\n npm_cmd = File.join(@prefix,'bin/npm')\n self.RunInstall( cmd: \"#{npm_cmd} install -g #{$npm_global_pkgs.join(' ')}\" )\n\n end", "title": "" }, { "docid": "959e74a86cdba443ae88bdf53b58d174", "score": "0.5942502", "text": "def install(name, params = {})\n \n @output.puts \"Installing gem '#{name}'\".yellow\n if name != nil\n\n with_working_dir(\"#{@exe} install #{name}\") do |cmd|\n assess_status(OS::ExecCommand.call(cmd) do |mod, spec|\n @output.puts spec[:output].strip\n end)\n end\n else\n @errOut.puts \"Name is needed for gem install operation\"\n end \n end", "title": "" }, { "docid": "ab73f1662f5be9e8a97312153c95936a", "score": "0.5930691", "text": "def prepare_package\n unless File.directory?( source_directory )\n shell \"mkdir -p #{source_directory}\"\n end\n chdir PKGDIR\n download_source\n chdir source_directory\n unpack_source\n chdir package_directory\n end", "title": "" }, { "docid": "bf318d225c8ffe89708357aeb5044061", "score": "0.59254754", "text": "def install\n system \"make\"\n bin.install('inputsource')\n end", "title": "" }, { "docid": "d9173ae351ecbc5809d0ff9536ced0d1", "score": "0.59125817", "text": "def install_package(name, version)\n if source_is_remote? && new_resource.gem_binary.nil?\n if new_resource.options.nil?\n @gem_env.install(gem_dependency, sources: gem_sources)\n elsif new_resource.options.is_a?(Hash)\n options = new_resource.options\n options[:sources] = gem_sources\n @gem_env.install(gem_dependency, options)\n else\n install_via_gem_command(name, version)\n end\n elsif new_resource.gem_binary.nil?\n @gem_env.install(new_resource.source)\n else\n install_via_gem_command(name, version)\n end\n true\n end", "title": "" }, { "docid": "11733d57f00efd4c101217a782571558", "score": "0.58979595", "text": "def repositorize_installed_gem\n if File.directory? gem_dir\n puts \"gem-src: #{installer.spec.name} - repositorizing...\" if verbose?\n `cd #{gem_dir} && ! git rev-parse --is-inside-work-tree 2> /dev/null && git init && git checkout -qb gem-src_init && git add -A && git commit -m 'Initial commit by gem-src'`\n end\n end", "title": "" }, { "docid": "11733d57f00efd4c101217a782571558", "score": "0.58979595", "text": "def repositorize_installed_gem\n if File.directory? gem_dir\n puts \"gem-src: #{installer.spec.name} - repositorizing...\" if verbose?\n `cd #{gem_dir} && ! git rev-parse --is-inside-work-tree 2> /dev/null && git init && git checkout -qb gem-src_init && git add -A && git commit -m 'Initial commit by gem-src'`\n end\n end", "title": "" }, { "docid": "70f343afb86e6e5cd8e332950e0dd135", "score": "0.5897771", "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": "96c9a4b6692288007ef16a2f7ccfc6b7", "score": "0.589286", "text": "def install_from_source(source, release)\n Dir.chdir ENV['RBENV_ROOT'] do\n ruby_source = \"sources/#{source}/ruby-#{source}\"\n rev = nil\n\n if File.exist? ruby_source\n Dir.chdir(ruby_source) { `git pull` }\n rev = \"#{release}-r#{gitlog(ruby_source).svnid}\"\n versions = `rbenv versions --bare`.lines.map(&:strip)\n return rev if versions.include? rev\n end\n\n system \"rm -rf sources/#{source} versions/#{source}\"\n system \"rbenv global system\"\n system \"rbenv install -k #{source}\"\n\n rev ||= \"#{release}-r#{gitlog(ruby_source).svnid}\"\n\n if File.exist? \"versions/#{source}\"\n system \"mv versions/#{source} versions/#{rev}\"\n system \"ln -s #{rev} versions/#{source}\"\n end\n\n rev\n end\n end", "title": "" }, { "docid": "f88956e5d9e109ac3e210c7ecc54694e", "score": "0.58861905", "text": "def pin_gem_source name, type = :default, source = nil\n source_description =\n case type\n when :default then '(default)'\n when :path then \"path: #{source}\"\n when :git then \"git: #{source}\"\n else '(unknown)'\n end\n\n raise ArgumentError,\n \"duplicate source #{source_description} for gem #{name}\" if\n @gem_sources.fetch(name, source) != source\n\n @gem_sources[name] = source\n end", "title": "" }, { "docid": "7b88827aa4ba82332727b02eee0eec24", "score": "0.5885513", "text": "def install_local(path, opts={})\n plugin_source = Gem::Source::SpecificFile.new(path)\n plugin_info = {\n plugin_source.spec.name => {\n \"gem_version\" => plugin_source.spec.version.to_s,\n \"local_source\" => plugin_source,\n \"sources\" => opts.fetch(:sources, [])\n }\n }\n @logger.debug(\"Installing local plugin - #{plugin_info}\")\n internal_install(plugin_info, nil, env_local: opts[:env_local])\n plugin_source.spec\n end", "title": "" }, { "docid": "2c8a224dee4bf4756f27c10ca864b306", "score": "0.58735913", "text": "def install_gem(gem_name)\n if gem_name.match(/getopt/)\n install_name = \"getopt\"\n else\n install_name = gem_name.gsub(/\\//,\"-\")\n end\n puts \"Information:\\tInstalling #{install_name}\"\n %x[gem install #{install_name}]\n Gem.clear_paths\n require \"#{gem_name}\"\nend", "title": "" }, { "docid": "1a9d328a61ce1e029e0313f080c385f8", "score": "0.5855747", "text": "def install(gem_path, install_dir = nil, version = Gem::Requirement.default)\n Gem.install(gem_path, version, install_dir: install_dir, ignore_dependencies: true)\n end", "title": "" }, { "docid": "ee6dd8be210ad8bf581c57781dc1dfcc", "score": "0.58515376", "text": "def download(spec, source_uri)\n gem_file_name = \"#{spec.full_name}.gem\"\n local_gem_path = File.join @install_dir, 'cache', gem_file_name\n\n Gem.ensure_gem_subdirectories @install_dir\n\n source_uri = URI.parse source_uri unless URI::Generic === source_uri\n scheme = source_uri.scheme\n\n # URI.parse gets confused by MS Windows paths with forward slashes.\n scheme = nil if scheme =~ /^[a-z]$/i\n\n case scheme\n when 'http' then\n unless File.exist? local_gem_path then\n begin\n say \"Downloading gem #{gem_file_name}\" if\n Gem.configuration.really_verbose\n\n remote_gem_path = source_uri + \"gems/#{gem_file_name}\"\n\n gem = Gem::RemoteFetcher.fetcher.fetch_path remote_gem_path\n rescue Gem::RemoteFetcher::FetchError\n raise if spec.original_platform == spec.platform\n\n alternate_name = \"#{spec.name}-#{spec.version}-#{spec.original_platform}.gem\"\n\n say \"Failed, downloading gem #{alternate_name}\" if\n Gem.configuration.really_verbose\n\n remote_gem_path = source_uri + \"gems/#{alternate_name}\"\n\n gem = Gem::RemoteFetcher.fetcher.fetch_path remote_gem_path\n end\n\n File.open local_gem_path, 'wb' do |fp|\n fp.write gem\n end\n end\n when nil, 'file' then # TODO test for local overriding cache\n begin\n FileUtils.cp source_uri.to_s, local_gem_path\n rescue Errno::EACCES\n local_gem_path = source_uri.to_s\n end\n\n say \"Using local gem #{local_gem_path}\" if\n Gem.configuration.really_verbose\n else\n raise Gem::InstallError, \"unsupported URI scheme #{source_uri.scheme}\"\n end\n\n local_gem_path\n end", "title": "" }, { "docid": "622747654cd3f05b72d4735d9f538a00", "score": "0.5844175", "text": "def install_gem(load_name, install_name)\n puts \"Information:\\tInstalling #{install_name}\"\n %x[gem install #{install_name}]\n Gem.clear_paths\n require \"#{load_name}\"\nend", "title": "" }, { "docid": "386032432e4ce9db011d5894e7bb1dec", "score": "0.5814416", "text": "def install_gem(name, options)\n installer = Gem::DependencyInstaller.new(options)\n\n temp_argv(options[:extconf]) do\n log \"Installing gem #{name}\"\n installer.install(name, options[:version])\n end\n end", "title": "" }, { "docid": "c88d18d347e5b3314ca124fcff441911", "score": "0.57831204", "text": "def install_gem(gem_file)\n require 'rubygems/commands/install_command'\n Gem::Commands::InstallCommand.new.invoke gem_file\n end", "title": "" }, { "docid": "5fac58ce7f5552fd276db4b41e00181d", "score": "0.5774281", "text": "def install_gem name, version = nil\n gem_cmd = Gem.default_exec_format % 'gem'\n sudo = 'sudo ' unless Hoe::WINDOZE\n local = '--local' unless version\n version = \"--version '#{version}'\" if version\n sh \"#{sudo}#{gem_cmd} install #{local} #{name} #{version}\"\n end", "title": "" }, { "docid": "5fac58ce7f5552fd276db4b41e00181d", "score": "0.5774281", "text": "def install_gem name, version = nil\n gem_cmd = Gem.default_exec_format % 'gem'\n sudo = 'sudo ' unless Hoe::WINDOZE\n local = '--local' unless version\n version = \"--version '#{version}'\" if version\n sh \"#{sudo}#{gem_cmd} install #{local} #{name} #{version}\"\n end", "title": "" }, { "docid": "66c8e8fe0a5812a8071ee1dc8d25f356", "score": "0.5756649", "text": "def install\n ENV[\"GOPATH\"] = buildpath\n (buildpath/\"src/github.com/MichaelMure/git-bug\").install buildpath.children\n # Language::Go.stage_deps resources, buildpath/\"src\"\n cd \"src/github.com/MichaelMure/git-bug\" do\n system \"make\", \"build\"\n bin.install \"git-bug\"\n prefix.install_metafiles\n end\n end", "title": "" }, { "docid": "08cb4f154833e33899edb252908686ee", "score": "0.5727209", "text": "def gem(name, *version_requirements)\n dependency = Gem::Dependency.new(name, *version_requirements)\n if Gem.source_index.search(dependency).empty?\n puts \"Installing #{dependency}\"\n installer.install(dependency)\n else\n puts \"#{dependency} is already installed\"\n end\n end", "title": "" }, { "docid": "1d101e8d368c79ec000996546dc0d1c1", "score": "0.571989", "text": "def install gem_name, version=nil\n args = ['--no-ri', '--no-rdoc', gem_name]\n args += ['--version', version] if version\n cmd = Gem::Commands::InstallCommand.new\n cmd.handle_options args\n cmd.execute\n rescue Gem::SystemExitException => e\n # Not sure why the install command raises SystemExitException in successful cases, but it does.\n # So we just check for a success exit code 0.\n raise unless e.exit_code == 0\n end", "title": "" }, { "docid": "7a758c5a2651070b6c4d455e7d1c950f", "score": "0.571618", "text": "def setup_gem(name, options)\n try_require_gem(name, options)\n rescue Exception\n try_installing_gem(name, options)\n end", "title": "" }, { "docid": "0bd3a92877e84fec7cbbb0941a6266c5", "score": "0.57029885", "text": "def install(gem_name, version_requirement = \"> 0.0.0\", force=false,\n install_dir=Gem.dir, install_stub=true)\n unless version_requirement.respond_to?(:satisfied_by?)\n version_requirement = Version::Requirement.new [version_requirement]\n end\n installed_gems = []\n begin\n spec, source = find_gem_to_install(gem_name, version_requirement)\n dependencies = find_dependencies_not_installed(spec.dependencies)\n\n installed_gems << install_dependencies(dependencies, force, install_dir)\n\n cache_dir = @options[:cache_dir] || File.join(install_dir, \"cache\")\n destination_file = File.join(cache_dir, spec.full_name + \".gem\")\n\n download_gem(destination_file, source, spec)\n\n installer = new_installer(destination_file)\n installed_gems.unshift installer.install(force, install_dir, install_stub)\n rescue RemoteInstallationSkipped => e\n puts e.message\n end\n installed_gems.flatten\n end", "title": "" }, { "docid": "f2a520c13a61a5174afc7b63a3831b2b", "score": "0.56959134", "text": "def install\n #TRANSLATORS Sun refers to the company name, do not translate\n raise Puppet::Error, _(\"Sun packages must specify a package source\") unless @resource[:source]\n options = {\n :adminfile => @resource[:adminfile],\n :responsefile => @resource[:responsefile],\n :source => @resource[:source],\n :cmd_options => @resource[:install_options]\n }\n pkgadd prepare_cmd(options)\n end", "title": "" }, { "docid": "2c2b054f5993f4155b6b74e5547c1ddd", "score": "0.56812274", "text": "def install_gem(load_name,install_name)\n puts \"Information:\\tInstalling #{install_name}\"\n %x[gem install #{install_name}]\n Gem.clear_paths\n require \"#{load_name}\"\nend", "title": "" }, { "docid": "86fe8d7583befb1c771e67525b8f0594", "score": "0.5674557", "text": "def install_gem(gem, version: nil, environment: {})\n cmd = \"gem install --user-install --no-format-executable --no-ri --no-rdoc #{gem}\"\n cmd << \" --version #{version}\" unless version.nil?\n system(environment, cmd)\n end", "title": "" }, { "docid": "bcbcb4cda023eb210e8a03fcf9b80393", "score": "0.56537896", "text": "def install_ruby_build\n poise_git ::File.join(options['prefix'], 'install', options['install_rev']) do\n repository options['install_repo']\n revision options['install_rev']\n user 'root'\n end\n end", "title": "" }, { "docid": "94d472dcc873b66f58403938a637ec7f", "score": "0.5649528", "text": "def cookbook_gem_installing(gem, version); end", "title": "" }, { "docid": "65ce8a170f8dc8d786519300a7e4b588", "score": "0.5645691", "text": "def puppet_module_install(opts)\n # Defaults etc.\n opts = {\n :source => 'forge',\n :node => rspec_system_node_set.default_node,\n :module_path => \"/etc/puppet/modules\",\n }.merge(opts)\n\n source = opts[:source]\n module_name = opts[:module_name]\n module_path = opts[:module_path]\n node = opts[:node]\n\n raise \"Must provide :source and :module_name parameters\" unless source && module_name\n\n if source =~ /forge/\n log.info(\"Now installing module onto node\")\n system_run(:n => node, :c => \"puppet module install #{module_name} --modulepath #{module_path}\")\n else\n log.info(\"Now transferring module onto node\")\n system_rcp(:sp => source, :d => node, :dp => File.join(module_path, module_name))\n end\n end", "title": "" }, { "docid": "3615cf3d60b583efbeea43fa637b72f5", "score": "0.560531", "text": "def gem_install( gem, opts = {} )\n cmd = [ gem_command, 'install',\n gem_install_args,\n ( '--user-install' if opts[ :user_install ] ),\n ( '--format-executable' if opts[ :format_executable ] ),\n ( '--conservative' if opts[ :minimize] != false ),\n ( '--minimal-deps' if opts[ :minimize] != false &&\n min_deps_supported? ),\n gem_version_flags( opts[ :version ] ),\n gem ].flatten.compact.join( ' ' )\n\n shopts = {}\n\n case opts[ :user_install ]\n when String\n shopts[ :user ] = opts[ :user_install ]\n when nil, false\n shopts[ :user ] = :root\n end\n\n clean_env( opts[ :user_install ] ) do\n if opts[ :check ]\n _,out = capture( cmd, shopts )\n\n count = 0\n out.split( \"\\n\" ).each do |oline|\n if oline =~ /^\\s*(\\d+)\\s+gem(s)?\\s+installed/\n count = $1.to_i\n end\n end\n count\n else\n sh( cmd, shopts )\n end\n end\n\n end", "title": "" }, { "docid": "2cbc36b5e257301a56f15047f95ba50e", "score": "0.5592876", "text": "def find_gem_to_install(gem_name, version_requirement)\n specs_n_sources = specs_n_sources_matching gem_name, version_requirement\n\n top_3_versions = specs_n_sources.map{|gs| gs.first.version}.uniq[0..3]\n specs_n_sources.reject!{|gs| !top_3_versions.include?(gs.first.version)}\n\n binary_gems = specs_n_sources.reject { |item|\n item[0].platform.nil? || item[0].platform==Platform::RUBY\n }\n\n # only non-binary gems...return latest\n return specs_n_sources.first if binary_gems.empty?\n\n list = specs_n_sources.collect { |spec, source_uri|\n \"#{spec.name} #{spec.version} (#{spec.platform})\"\n }\n\n list << \"Skip this gem\"\n list << \"Cancel installation\"\n\n string, index = choose_from_list(\n \"Select which gem to install for your platform (#{RUBY_PLATFORM})\",\n list)\n\n if index.nil? or index == (list.size - 1) then\n raise RemoteInstallationCancelled, \"Installation of #{gem_name} cancelled.\"\n end\n\n if index == (list.size - 2) then\n raise RemoteInstallationSkipped, \"Installation of #{gem_name} skipped.\"\n end\n\n specs_n_sources[index]\n end", "title": "" }, { "docid": "f0c022c01730483e5f909f34f1fdaeb9", "score": "0.5584643", "text": "def gen_sources_for(gem)\n require_dep! 'awesome_spawn'\n require_cmd! md5sum_cmd\n in_repo do\n AwesomeSpawn.run \"#{md5sum_cmd} #{gem.gem_path} > sources\"\n File.write('sources', File.read('sources').gsub(\"#{GemCache::DIR}/\", ''))\n end\n end", "title": "" }, { "docid": "ff369286fe67da4320689e988b143a15", "score": "0.5581679", "text": "def install\n system \"echo 'Building Julia from source. This will take a while!'\"\n system \"ENV[prefix]=#{prefix}\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "a52c63a5e189a2379b240ea22fe9fd3e", "score": "0.5580218", "text": "def install_gem_from_rubygems(gem_name, gem_version)\n Chef::Log.warn(\"Installing #{gem_name} v#{gem_version} from Rubygems.org\")\n chefgem = Chef::Resource::ChefGem.new(gem_name, run_context)\n chefgem.version(gem_version)\n chefgem.run_action(:install)\n end", "title": "" }, { "docid": "4590c95360a80474acca518f6870259a", "score": "0.5561124", "text": "def build_gem\n `gem build #{spec.name}.gemspec`\n `mkdir -p pkg`\n `mv #{gem} pkg/#{gem}`\n yay \"Gem built.\"\nend", "title": "" }, { "docid": "0ce9c4c73a50f7112c2302e271840ee9", "score": "0.5548434", "text": "def with_gem_sources(*sources)\n sources.compact!\n original_sources = Gem.sources\n Gem.sources = sources unless sources.empty?\n yield\n ensure\n Gem.sources = original_sources\n end", "title": "" }, { "docid": "389bce2d7033fac617f930b92c318bd5", "score": "0.5548342", "text": "def install!\n src = package_source\n chk = package_checksum\n dmg_package 'Chef Development Kit' do\n app ::File.basename(src, '.dmg')\n volumes_dir 'Chef Development Kit'\n source \"#{'file://' if src.start_with?('/')}#{src}\"\n type 'pkg'\n package_id 'com.getchef.pkg.chefdk'\n checksum chk\n end\n end", "title": "" }, { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.5539528", "text": "def install!\n download_package\n install_package\n end", "title": "" }, { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.5539528", "text": "def install!\n download_package\n install_package\n end", "title": "" }, { "docid": "86fe6ee5c02d796b4fdc1fb587e2f8aa", "score": "0.5525526", "text": "def package_gem spec\n enter_gem_directory spec.file_name.sub(/\\.gem/,'')\n symlink_bin\n Gem::Builder.new(spec).build\n rescue Gem::InvalidSpecificationException\n return nil\n ensure\n unlink_bin\n end", "title": "" }, { "docid": "d8040ef889121ed9c1a923161468890e", "score": "0.5515828", "text": "def install_gem(options)\n \n # Get the Gem name.\n gem_name = options[\"gem_name\"]\n \n # Check we have a name and try to install it.\n response = \"No Gem name was given\"\n if gem_name != nil && gem_name != \"\"\n response = Os.run(\"gem install #{gem_name}\")\n end\n \n # If we need to format for HTML then we do that.\n if options[\"format\"] == \"html\"\n response.gsub!(/[\\r\\n]+/, \"<br>\")\n end\n \n # Return the response.\n return response\n \n end", "title": "" }, { "docid": "3007558537915e355dafb49384964e78", "score": "0.55068636", "text": "def install_source_dependencies(user)\n return <<-EOF\n set -e -o pipefail\n\n # Install in /usr/local\n export PREFIX=/usr/local\n\n # Make PKG_CONFIG_PATH explicit, even if /usr/local/lib/pkgconfig is enabled per default\n export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig\n echo 'export PKG_CONFIG_PATH=\"'${PKG_CONFIG_PATH}'\"' >> ~#{user}/.bash_profile\n\n # All source packages integrate with pkg-config, remove any previous overrides\n sed -i '/BORG_.*_PREFIX/d' ~#{user}/.bash_profile\n\n # Setup pyenv to pick up the custom openssl version (python >= 3.9 requires openssl >= 1.1.1)\n echo 'export PYTHON_CONFIGURE_OPTS=\"--with-openssl='\"${PREFIX}\"' --with-openssl-rpath=auto\"' >> ~#{user}/.bash_profile\n echo 'export LDFLAGS=-Wl,-rpath,'\"${PREFIX}\"'/lib' >> ~#{user}/.bash_profile\n\n # Silence git warning about shallow clones\n git config --global advice.detachedHead false\n\n # libattr\n VERSION_LIBATTR=2.5.1\n curl -s -L https://download.savannah.nongnu.org/releases/attr/attr-${VERSION_LIBATTR}.tar.gz | tar xvz --strip-components=1 --one-top-level=attr -f - -C ${PREFIX}/src\n cd ${PREFIX}/src/attr\n ./configure --prefix=${PREFIX}\n make -j$(nproc) install\n\n # libacl\n VERSION_LIBACL=2.3.1\n curl -s -L https://download.savannah.nongnu.org/releases/acl/acl-${VERSION_LIBACL}.tar.gz | tar xvz --strip-components=1 --one-top-level=acl -f - -C ${PREFIX}/src\n cd ${PREFIX}/src/acl\n ./configure --prefix=${PREFIX}\n make -j$(nproc) install\n\n # liblz4\n VERSION_LIBLZ4=1.9.4\n git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBLZ4} https://github.com/lz4/lz4.git\n cd ${PREFIX}/src/lz4\n make -j$(nproc) install PREFIX=${PREFIX}\n\n # libzstd\n VERSION_LIBZSTD=1.5.4\n git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBZSTD} https://github.com/facebook/zstd.git\n cd ${PREFIX}/src/zstd\n make -j$(nproc) install PREFIX=${PREFIX}\n\n # xxHash\n VERSION_LIBXXHASH=0.8.1\n git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBXXHASH} https://github.com/Cyan4973/xxHash.git\n cd ${PREFIX}/src/xxHash\n make -j$(nproc) install PREFIX=${PREFIX}\n\n # openssl\n VERSION_OPENSSL=1_1_1t\n git -C ${PREFIX}/src clone --depth 1 --branch OpenSSL_${VERSION_OPENSSL} https://github.com/openssl/openssl.git\n cd ${PREFIX}/src/openssl\n ./config --prefix=${PREFIX} --openssldir=${PREFIX}/lib/ssl\n make -j$(nproc)\n make -j$(nproc) install\n\n # libfuse3 requires ninja\n VERSION_NINJA=1.11.1\n git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_NINJA} https://github.com/ninja-build/ninja.git\n cd ${PREFIX}/src/ninja\n python3 configure.py --bootstrap\n install --mode=755 --target-directory=${PREFIX}/bin ninja\n\n # libfuse3 requires meson >= 0.50; python3.5 support is dropped in meson >= 0.57\n VERSION_MESON=0.56.2\n git -C ${PREFIX}/src clone --depth 1 --branch ${VERSION_MESON} https://github.com/mesonbuild/meson.git\n ln -s ${PREFIX}/src/meson/meson.py ${PREFIX}/bin/meson\n\n # libfuse3\n VERSION_LIBFUSE=3.14.0\n git -C ${PREFIX}/src clone --depth 1 --branch fuse-${VERSION_LIBFUSE} https://github.com/libfuse/libfuse.git\n cd ${PREFIX}/src/libfuse\n mkdir build; cd build\n meson setup --prefix ${PREFIX} --libdir ${PREFIX}/lib ..\n ninja\n ninja install\n EOF\nend", "title": "" }, { "docid": "daa73b20065dcc4cf80aa3c048d7b07c", "score": "0.5497803", "text": "def gem name, *requirements\n options = requirements.pop if requirements.last.kind_of?(Hash)\n options ||= {}\n\n options[:git] = @current_repository if @current_repository\n\n source_set = false\n\n source_set ||= gem_path name, options\n source_set ||= gem_git name, options\n source_set ||= gem_github name, options\n\n return unless gem_platforms options\n\n groups = gem_group name, options\n\n return unless (groups & @without_groups).empty?\n\n pin_gem_source name, :default unless source_set\n\n gem_requires name, options\n\n @set.gem name, *requirements\n end", "title": "" }, { "docid": "880d3a313f8f01582d379f2770cca41a", "score": "0.5492231", "text": "def install\n ENV['GOPATH'] = buildpath\n ENV['GOBIN'] = buildpath\n ENV['CGO_ENABLED'] = '0'\n\n (buildpath/'src/github.com/ericchiang/pup/').install Dir['*']\n Language::Go.stage_deps resources, buildpath/'src'\n system 'go', 'build', '-o', \"#{bin}/pup\", 'github.com/ericchiang/pup/'\n end", "title": "" }, { "docid": "e37db9e98b5178b6318e75d9d0a166e4", "score": "0.5488583", "text": "def install_dep(dep)\n puts \"Installing #{dep}\"\n Gem::DependencyInstaller.new.install(dep)\nend", "title": "" }, { "docid": "27c352ceb65f0059b1a36c3a72aa7772", "score": "0.54794025", "text": "def install_plugin(source_url, plugin_name, plugin_version, opts = {})\n test = (source_url || plugin_version != :latest) ? true : false\n if test\n url = if source_url\n source_url\n else\n remote_plugin_data = plugin_universe[plugin_name]\n # Compute some versions; Parse them as `Gem::Version` instances for easy comparisons.\n latest_version = plugin_version(remote_plugin_data['version'])\n # Replace the latest version with the desired version in the URL\n remote_plugin_data['url'].gsub!(latest_version.to_s, desired_version(plugin_name, plugin_version).to_s)\n end\n end\n ensure_update_center_present!\n executor.execute!('install-plugin', escape(test ? url : plugin_name), opts[:cli_opts])\n end", "title": "" }, { "docid": "e5270c919a50866d1963f5ac7026330c", "score": "0.54671574", "text": "def install(plugin_name, opts = {})\n # TODO: - check plugins.json for validity before trying anything that needs to modify it.\n validate_installation_opts(plugin_name, opts)\n\n # TODO: change all of these to return installed spec/gem/thingy\n # TODO: return installed thingy\n if opts[:path]\n install_from_path(plugin_name, opts)\n elsif opts[:gem_file]\n install_from_gem_file(plugin_name, opts)\n else\n install_from_remote_gems(plugin_name, opts)\n end\n\n update_plugin_config_file(plugin_name, opts.merge({ action: :install }))\n end", "title": "" }, { "docid": "46e35a6846f43792e85c8c171408e4cc", "score": "0.5460669", "text": "def gen_sources_for(gem)\n in_repo do\n AwesomeSpawn.run \"#{md5sum_cmd} #{gem.gem_path} > sources\"\n File.write('sources', File.read('sources').gsub(\"#{GemCache::DIR}/\", ''))\n end\n end", "title": "" }, { "docid": "d57c8a87dd25758585d9f779b507f2b1", "score": "0.5444412", "text": "def gen_sources_for(gem)\n require_cmd! md5sum_cmd\n in_repo do\n AwesomeSpawn.run \"#{md5sum_cmd} #{gem.gem_path} > sources\"\n File.write('sources', File.read('sources').gsub(\"#{GemCache::DIR}/\", ''))\n end\n end", "title": "" }, { "docid": "f4500472d47e845c7e97859a4b249ea5", "score": "0.54415435", "text": "def install\n system \"unzip\", \"source.zip\"\n system \"/bin/bash\", \"build.sh\"\n bin.install \"objconv\"\n end", "title": "" }, { "docid": "4a0cde5e695e7de4abb1a4613488fe8b", "score": "0.5438292", "text": "def gem_install(gem_name, upgrade_if_old: true)\n if gem_installed?(gem_name)\n latest_version = get_gem_latest_version(gem_name)\n current_version = current_gem_version(gem_name)\n if upgrade_if_old && latest_version > current_version\n say_info \"upgrading system gem #{gem_name} version: #{current_version.version} -> \"\\\n \"#{latest_version.version}\"\n `gem install #{gem_name}`\n end\n else\n `gem install #{gem_name}`\n end\nend", "title": "" }, { "docid": "b3ec0ca0b61b7d5fadadb1dea754be1b", "score": "0.54360163", "text": "def fetch\n source.gems.each do |gem|\n versions_for(gem).each do |version|\n filename = gem.filename(version)\n begin\n satisfied = gem.requirement.satisfied_by?(version)\n rescue StandardError\n logger.debug(\"Error determining is requirement satisfied for #{filename}\")\n end\n name = gem.name\n\n if gem_exists?(filename) || ignore_gem?(name, version) || !satisfied\n logger.debug(\"Skipping #{filename}\")\n next\n end\n\n # Prevent circular dependencies from messing things up.\n configuration.ignore_gem(gem.name, version)\n\n spec = fetch_specification(gem, version)\n\n next unless spec\n\n spec = load_specification(spec)\n deps = dependencies_for(spec)\n\n unless deps.empty?\n logger.info(\"Fetching dependencies for #{filename}\")\n\n fetch_dependencies(deps)\n end\n\n logger.info(\"Fetching #{filename}\")\n\n gemfile = fetch_gem(gem, version)\n\n configuration.mirror_directory.add_file(filename, gemfile) if gemfile\n end\n end\n end", "title": "" }, { "docid": "fb35aee9df0069d6afd471674ded0be8", "score": "0.54326415", "text": "def install_gemfile_if_necessary!\n if use_gemfile? && !gemfile_installed?\n App.info 'Bundle', @full_path\n unless system(\"bundle install\")\n App.fail \"Failed to install the target's Gemfile.\"\n end\n @gemfile_installed = true\n end\n end", "title": "" }, { "docid": "46dd0e6bcfb58274b08f15f22a5020d4", "score": "0.54299563", "text": "def gem(name, *version_requirements)\n dependency = Gem::Dependency.new(name, *version_requirements)\n if Gem.source_index.search(dependency).empty?\n puts \"Installing #{dependency}\"\n `gem install #{name} --version \\\"#{version_requirements.first}\\\"`\n else\n puts \"#{dependency} is already installed\"\n end\n end", "title": "" }, { "docid": "4d832d790edf03548120945ba1413c26", "score": "0.54291236", "text": "def install\n # Getting the python package name, regardless of whether we\n # are in a virtualenv.\n pypkg = @resource[:name].split('@')[0]\n args = %w{install -q}\n\n # Adding any install options\n opts = install_options\n if opts\n args << opts\n end\n if @resource[:source]\n if String === @resource[:ensure]\n # If there's a SCM revision specified, ensure a `--upgrade`\n # is specified to ensure package is actually installed.\n self.class.instances.each do |pip_package|\n if pip_package.name == pypkg\n # Specify default upgrade-strategy\n if args.include? \"--upgrade-strategy\" or args.any? { |arg| arg.is_a?(Hash) and arg.key?(\"--upgrade-strategy\")}\n args << '--upgrade'\n else\n args << '--upgrade' << '--upgrade-strategy' << 'only-if-needed'\n end\n break\n end\n end\n args << \"#{@resource[:source]}@#{@resource[:ensure]}#egg=#{pypkg}\"\n else\n args << \"#{@resource[:source]}#egg=#{pypkg}\"\n end\n else\n case @resource[:ensure]\n when String\n args << \"#{pypkg}==#{@resource[:ensure]}\"\n when :latest\n # Specify default upgrade-strategy\n if args.include? \"--upgrade-strategy\" or args.any? { |arg| arg.is_a?(Hash) and arg.key?(\"--upgrade-strategy\")}\n args << '--upgrade' << pypkg\n else\n args << '--upgrade' << '--upgrade-strategy' << 'only-if-needed' << pypkg\n end\n else\n args << pypkg\n end\n end\n lazy_pip *args\n end", "title": "" }, { "docid": "c18295c42efc0e788c912ba42285122d", "score": "0.54217297", "text": "def install(gem_file)\n line = Cocaine::CommandLine.new 'gem', 'install :gem_file'\n\n line.run gem_file: gem_file\n end", "title": "" }, { "docid": "de1130bfd14c16a98946ab289e86ce68", "score": "0.54126376", "text": "def autotools_package(name, workspace: Autoproj.workspace)\n package_common(:autotools, name, workspace: workspace) do |pkg|\n pkg.depends_on \"autotools\"\n common_make_based_package_setup(pkg)\n yield(pkg) if block_given?\n end\nend", "title": "" }, { "docid": "886db40baa84a4ef5c2003cd3b25d31f", "score": "0.540712", "text": "def make_install(source, ext_name, flags)\n run(\"mkdir -p -m 0777 /tmp/pgbundle/\")\n remove_source(ext_name)\n source.load(host, system_user, load_destination(ext_name))\n run(make_install_cmd(ext_name, flags))\n remove_source(ext_name)\n source.clean\n end", "title": "" }, { "docid": "a4f81e7b8332752f6d524383a8e19cfc", "score": "0.5407012", "text": "def install(pkg)\n package pkg do\n action :install\n end\nend", "title": "" }, { "docid": "319f7f01f83118358e6aa42b98b45adb", "score": "0.5402557", "text": "def install\n raise ArgumentError, \"source must be provided to install HP-UX packages\" unless resource[:source]\n args = standard_args + [\"-s\", resource[:source], resource[:name]]\n swinstall(*args)\n end", "title": "" }, { "docid": "a8a3438798fec74ff4c32ed399e7f5fa", "score": "0.54006654", "text": "def cp_gem(name, repo_name, branch = 'master', path: false)\n return gem(name) if SKIP_UNRELEASED_VERSIONS\n\n opts = if path\n { path: \"../#{repo_name}\" }\n else\n url = \"https://github.com/CocoaPods/#{repo_name}.git\"\n { git: url, branch: branch }\n end\n\n # gem 'claide', git: \"https://github.com/CocoaPods/CLAide.git\", branch: 'master'\n # gem 'cocoapods-core', git: \"https://github.com/CocoaPods/Core.git\", branch: 'master'\n gem(name, opts)\nend", "title": "" }, { "docid": "fd11bf10d2fcd93e6601c6de95b6f938", "score": "0.5395091", "text": "def install(force=false, install_dir=Gem.dir, ignore_this_parameter=false)\n require 'fileutils'\n\n # if we're forcing the install, then disable security, _unless_ \n # the security policy says that we only install singed gems\n # (this includes Gem::Security::HighSecurity)\n security_policy = @options[:security_policy]\n security_policy = nil if force && security_policy && \n security_policy.only_signed != true\n\n format = Gem::Format.from_file_by_path(@gem, security_policy)\n unless force\n spec = format.spec\n # Check the Ruby version.\n if (rrv = spec.required_ruby_version)\n unless rrv.satisfied_by?(Gem::Version.new(RUBY_VERSION))\n raise \"#{spec.name} requires Ruby version #{rrv}\"\n end\n end\n \tunless @options[:ignore_dependencies]\n \t spec.dependencies.each do |dep_gem|\n\t ensure_dependency!(spec, dep_gem)\n \t end\n \tend\n end\n \n raise Gem::FilePermissionError.new(install_dir) unless File.writable?(install_dir)\n\n # Build spec dir.\n @directory = File.join(install_dir, \"gems\", format.spec.full_name)\n FileUtils.mkdir_p @directory\n\n extract_files(@directory, format)\n generate_bin(format.spec, install_dir)\n build_extensions(@directory, format.spec)\n \n # Build spec/cache/doc dir.\n build_support_directories(install_dir)\n \n # Write the spec and cache files.\n write_spec(format.spec, File.join(install_dir, \"specifications\"))\n unless File.exist? File.join(install_dir, \"cache\", @gem.split(/\\//).pop)\n FileUtils.cp @gem, File.join(install_dir, \"cache\")\n end\n\n format.spec.loaded_from = File.join(install_dir, 'specifications', format.spec.full_name+\".gemspec\")\n return format.spec\n end", "title": "" }, { "docid": "e5983222e47bb9fb275791682712cf21", "score": "0.53948635", "text": "def install_gems\n # Excluded groups.\n without = []\n # Validate install paths.\n validate_path(runtime.gem_path)\n validate_path(runtime.mysql_dir)\n # Install!\n without << '\"\"' if without.length == 0\n system(\"#{@ruby_bin}/bundle\", 'install', '--local', '--no-cache', '--without', *without)\n raise InstallationError.new('Gem installation failed!') unless $?.success?\n end", "title": "" }, { "docid": "23223c28cf78fd98019fc15f4c9de192", "score": "0.53929853", "text": "def source!\n IO.popen('bash', 'r+') do |h|\n h.puts(pkgbuild)\n\n h.write('printf \"%s\\n\" \"${makedepends[@]}\" ')\n h.write(' \"${depends[@]}\" '.strip) unless build_only?\n h.puts\n\n h.close_write\n h.read.split(\"\\n\")\n end\n end", "title": "" }, { "docid": "4e827d4017389452a171def82006fdcd", "score": "0.5385784", "text": "def gem_install(name, version = nil)\n version_name = [name, version].compact.join('-')\n version_file = \"#{ENV['GEM_HOME']}/versions/#{version_name}\"\n return if File.exist?(version_file)\n warn \"installing #{version_name} to #{ENV['GEM_HOME']}\"\n command = \"gem install --no-rdoc --no-ri #{name}\"\n command += \" -v '~> #{version}'\" if version\n command += \" >/dev/null\"\n sh command\n mkdir_p File.dirname(version_file)\n File.open(version_file, 'wb') { }\nend", "title": "" }, { "docid": "477db8e1f12754067fbb291671532c04", "score": "0.53805393", "text": "def gem_install(version, gems = BASE_GEMS)\n gems.each do |gem|\n unless `gem list --local`.include?(gem)\n puts \"Installing #{gem} for ruby version #{version}\"\n `gem install #{gem} --no-rdoc --no-ri`\n end\n end\nend", "title": "" }, { "docid": "aee7ff1340ff51abfe62bc01f2e35e85", "score": "0.53773546", "text": "def install\n build if not File.exists? @build_dir\n run_in_build \"make install 2> /dev/null\"\n end", "title": "" }, { "docid": "8476ffc6d35e105e3a15337f6e2a5077", "score": "0.53653", "text": "def install\n system \"./bootstrap\" if build.head?\n\n system \"./configure\", \"--prefix=#{prefix}\",\n \"--enable-debug=no\",\n \"--enable-assert=no\",\n \"--enable-optimize=yes\",\n \"--enable-testing=no\",\n \"--disable-jaql\",\n \"--without-rubygem\"\n system \"make install\"\n end", "title": "" }, { "docid": "57596de392910312adb78cec43811334", "score": "0.5363191", "text": "def install!\n each_module do |repo|\n\n print_verbose \"\\n##### processing module #{repo[:name]}...\"\n\n module_dir = File.join(module_path, repo[:name])\n\n unless File.exists?(module_dir)\n case\n when repo[:git]\n install_git module_path, repo[:name], repo[:git], repo[:ref]\n when repo[:tarball]\n install_tarball module_path, repo[:name], repo[:tarball]\n else\n abort('only the :git and :tarball provider are currently supported')\n end\n else\n print_verbose \"\\nModule #{repo[:name]} already installed in #{module_path}\"\n end\n end\n end", "title": "" } ]
aafd8cdf46b3a93407377cea7c325ed2
Override in subclasses as appropriate
[ { "docid": "83c0523a52323dc0191d7ef0a696841f", "score": "0.0", "text": "def priority\n Settings.delayed_job.priority.base_job\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.8288387", "text": "def override; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.76076335", "text": "def overrides; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.76076335", "text": "def overrides; end", "title": "" }, { "docid": "7d3206fdee515addbaa426dffb5132aa", "score": "0.7342869", "text": "def method\n raise NotImplementedError, 'Define this method on the child classes'\n end", "title": "" }, { "docid": "09ff6112321a5dbf09d1ab62ae266582", "score": "0.68819", "text": "def method_missing ( method, *args )\n return super\n end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.68814874", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.68814874", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "a3e329e0268db7585a7bbd600993dd42", "score": "0.68814874", "text": "def init\n #Override in subclass\n end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.68593735", "text": "def methodmissing; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.68394065", "text": "def extended; end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.68352354", "text": "def inherited(base); end", "title": "" }, { "docid": "2b16fb64e7a123e3ef5466602b807687", "score": "0.6832554", "text": "def dispatch\n raise NotImplementedError, \"subclass responsibility\"\n end", "title": "" }, { "docid": "bbd56afdc93cde27c46acc00bf4e03df", "score": "0.6787847", "text": "def super_method()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5a00af6c1c2ddaa2801d724d43edc78f", "score": "0.6782259", "text": "def apply\n raise Exception, 'Must be implemented in a subclass'\n end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.67413586", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.67413586", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.67413586", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.67413586", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.67413586", "text": "def implementation; end", "title": "" }, { "docid": "dc9aba66cedecac67c8f843df1ecf517", "score": "0.67242175", "text": "def __override__(object); object; end", "title": "" }, { "docid": "170e7cc6f3b91fc8d88704f0d36db709", "score": "0.6719319", "text": "def initialize; super; end", "title": "" }, { "docid": "75f52a8d4eb4a5a5e38825f4d1941496", "score": "0.66918224", "text": "def call\n raise NotImplementedError, 'Please implement in a subclass'\n end", "title": "" }, { "docid": "8b9b3841246e1bf840b152bdd1188a84", "score": "0.6657821", "text": "def process\n raise 'implement in subclasses'\n end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.6645678", "text": "def extended?; end", "title": "" }, { "docid": "e1cebde27e047bf83b8f95a278d13853", "score": "0.6644254", "text": "def inherited(subclass); end", "title": "" }, { "docid": "ac9ee4121a1546c6a7ad6b006e0fa06e", "score": "0.66426307", "text": "def apply\n\t\tsuper\n\tend", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.66193837", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.66193837", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.66193837", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.66193837", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.66193837", "text": "def inherited(klass); end", "title": "" }, { "docid": "43eb008058b525fad99cb28cd2cb7087", "score": "0.66002226", "text": "def inspect; super; end", "title": "" }, { "docid": "c4dc12fd5b8e618db2763499bee57eb9", "score": "0.6599198", "text": "def abstract?; end", "title": "" }, { "docid": "c4dc12fd5b8e618db2763499bee57eb9", "score": "0.6599198", "text": "def abstract?; end", "title": "" }, { "docid": "94016abe628f509bb786a4de1b47d543", "score": "0.6581498", "text": "def superclass; end", "title": "" }, { "docid": "94016abe628f509bb786a4de1b47d543", "score": "0.6581498", "text": "def superclass; end", "title": "" }, { "docid": "836a5371c4b8bdee973c8580ee6fc6da", "score": "0.65721875", "text": "def name_override; end", "title": "" }, { "docid": "cd9babfde151d32593c5ec2dc35185fd", "score": "0.65615463", "text": "def baseclass; end", "title": "" }, { "docid": "d509f8cefdd8fc87fefabff3705478b5", "score": "0.6539852", "text": "def custom\n \n end", "title": "" }, { "docid": "d363caefe61e3a4850d8c5b44a7dc7cb", "score": "0.6535284", "text": "def call\n raise NotImplementedError, 'Implement this in a subclass'\n end", "title": "" }, { "docid": "7eb5eaecb1844c31c742351959f5a19c", "score": "0.6517187", "text": "def override\n use(:__override__)\n end", "title": "" }, { "docid": "5b6f301c768ed6b55f8c9a6c7362a955", "score": "0.64800704", "text": "def abstract!; end", "title": "" }, { "docid": "3923598cefdb39ff94e39293456a9cf0", "score": "0.6465006", "text": "def call\n # implement in subclasses\n end", "title": "" }, { "docid": "b8b2ff0ace83db0fddbed8106fca76eb", "score": "0.6447417", "text": "def interface\n super\n end", "title": "" }, { "docid": "b8b2ff0ace83db0fddbed8106fca76eb", "score": "0.6447417", "text": "def interface\n super\n end", "title": "" }, { "docid": "d1ce814d963fb341cec479719f3c1875", "score": "0.6429542", "text": "def data; super; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6415881", "text": "def desired; end", "title": "" }, { "docid": "55f927fea4cad00a9e9f9d217abc0f75", "score": "0.6410384", "text": "def abstract_class?; end", "title": "" }, { "docid": "e174f2df0828cb4d6a4a89af03ea808b", "score": "0.63957834", "text": "def extend; end", "title": "" }, { "docid": "e174f2df0828cb4d6a4a89af03ea808b", "score": "0.63957834", "text": "def extend; end", "title": "" }, { "docid": "e174f2df0828cb4d6a4a89af03ea808b", "score": "0.63957834", "text": "def extend; end", "title": "" }, { "docid": "e174f2df0828cb4d6a4a89af03ea808b", "score": "0.63957834", "text": "def extend; end", "title": "" }, { "docid": "5dd1a74b0f115cd47711b80cc3db8b33", "score": "0.63811684", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "f447cf23f5a32da61a3a69ed782522c2", "score": "0.6364868", "text": "def base_class; end", "title": "" }, { "docid": "eecc79f68f5be1c0f004efe0b826adb0", "score": "0.6362901", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "eecc79f68f5be1c0f004efe0b826adb0", "score": "0.6362901", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "7f446b6a2d77828174e09738f235d6ba", "score": "0.6359901", "text": "def method_to_be_overridden; end", "title": "" }, { "docid": "cfc5874da585aa59205b7b867bed425d", "score": "0.63480127", "text": "def inherited( hooked_instance )\n \n super if defined?( super )\n \n end", "title": "" }, { "docid": "54a6d578905ca36fce1f2875117abb14", "score": "0.6345802", "text": "def init\n super\n end", "title": "" }, { "docid": "d386555cb708266bc6bf360cbd5aa6ed", "score": "0.63383657", "text": "def inherited(subclass)\n super(subclass)\n self.hereditary = true\n end", "title": "" }, { "docid": "41dde721b40209f82e6aff77babe3747", "score": "0.6319181", "text": "def attic\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "465936ef29dc887acdb2e6cb1a0a85f3", "score": "0.6316277", "text": "def initialize\n super\n end", "title": "" }, { "docid": "6a003d403052afd600147e4ea1b664dc", "score": "0.6307741", "text": "def initialize(_)\n super()\n end", "title": "" }, { "docid": "1dacf6a807abbd70f442cd91e0aefce2", "score": "0.63073033", "text": "def new_processing\n throw \"This method must be reimplemented in a subclass\"\n end", "title": "" }, { "docid": "acdfafb4fc580fa512ee50bbed61b3c5", "score": "0.63022727", "text": "def apply\n\t\tsuper()\n\tend", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6296085", "text": "def initialize\n super\n end", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6296085", "text": "def initialize\n super\n end", "title": "" }, { "docid": "f466bb6c7455ea8d2d5ecdd1b8896422", "score": "0.6296085", "text": "def initialize\n super\n end", "title": "" }, { "docid": "b54531b8acbe83da08913cdafbf2a7a5", "score": "0.6292823", "text": "def generic\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.629142", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.629142", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.629142", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.629142", "text": "def initialize\n super\n end", "title": "" }, { "docid": "b67857094fe8aeefcc444737d5a8e081", "score": "0.62879246", "text": "def type\n raise \"override me\"\n end", "title": "" }, { "docid": "5bebb50e6017c68ad99e99d9a4ff9fc8", "score": "0.62792253", "text": "def inherited(child_class); end", "title": "" }, { "docid": "f48249c7165e826e6d9992b83653b96b", "score": "0.6270479", "text": "def custom\n\n end", "title": "" }, { "docid": "ba8bd5d5121fd3d967b44d4b4741c220", "score": "0.62476224", "text": "def execute\n raise NotImplementedError.new('Override in subclass')\n end", "title": "" }, { "docid": "8ed875317acaf0556f9d09a01e04d24f", "score": "0.62363166", "text": "def process_hook\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "8ed875317acaf0556f9d09a01e04d24f", "score": "0.62363166", "text": "def process_hook\n fail 'sub class to implement'\n end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6234393", "text": "def initialize\n super\n end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6234393", "text": "def initialize\n super\n end", "title": "" }, { "docid": "d32d079ac77d92cda0a4952da5bac293", "score": "0.6234393", "text": "def initialize\n super\n end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.6232095", "text": "def internal; end", "title": "" }, { "docid": "6f025bbb64347e047a226807cf67d09c", "score": "0.6225887", "text": "def method_missing(*args, &block); super; end", "title": "" }, { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.62244904", "text": "def _self; end", "title": "" }, { "docid": "2a77a5c9a41f66fcf2e47ce6042526ef", "score": "0.62240183", "text": "def name; super; end", "title": "" }, { "docid": "2a77a5c9a41f66fcf2e47ce6042526ef", "score": "0.62240183", "text": "def name; super; end", "title": "" }, { "docid": "2a77a5c9a41f66fcf2e47ce6042526ef", "score": "0.62240183", "text": "def name; super; end", "title": "" }, { "docid": "9278a71decc628a19aadc1718dfe1b74", "score": "0.62218404", "text": "def mine\n raise NotImplementedError\n end", "title": "" }, { "docid": "1d99b6c985a26a66bf3dc3a5c3a01347", "score": "0.6218583", "text": "def overrides=(_arg0); end", "title": "" }, { "docid": "e2db455903ac912c69c40d8f1d7ecb4b", "score": "0.62179947", "text": "def base_class?; end", "title": "" }, { "docid": "a990ebd92169ace1db948c90c68cc3a1", "score": "0.62122124", "text": "def abstract\n abstract_class self\n end", "title": "" }, { "docid": "08c09e41f0351d35a11fef26bba131c1", "score": "0.6200913", "text": "def unhandled_overridden?; end", "title": "" }, { "docid": "4facd28fa9ca3f2a12619837e61004af", "score": "0.6192542", "text": "def called(context); super if defined? super end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.61719674", "text": "def initialize()\n super\n end", "title": "" }, { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.61719173", "text": "def initialize()\n super\n end", "title": "" } ]
499125f9e512902eb67d6480a117322c
Creates an outbound phone call.
[ { "docid": "8ff92dcbf23dd3310f1052af0878735f", "score": "0.5351692", "text": "def create_call(account_id,\r\n body)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => false }\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n case _response.status_code\r\n when 400\r\n raise ApiErrorException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n when 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n when 403\r\n raise ApiErrorException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n when 404\r\n raise ApiErrorException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n when 415\r\n raise ApiErrorException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n when 429\r\n raise ApiErrorException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n when 500\r\n raise ApiErrorException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response, data: CreateCallResponse.from_hash(decoded)\r\n )\r\n end", "title": "" } ]
[ { "docid": "fb7e3426bb9abfb649a8d18e80c6a00f", "score": "0.6778285", "text": "def finalize_call(outbound: nil)\n account.calls.where(network_id: params[:CallSid]).first_or_create!(\n to: stripped(:To),\n from: stripped(:From),\n outbound: outbound,\n duration: params[:CallDuration]\n )\n end", "title": "" }, { "docid": "17114a0bc7200090df2dbf8e27bea01b", "score": "0.6574832", "text": "def dial_out_to( number_to_call, route_to_execute )\n where = \"HELPER: \" + (__method__).to_s\n begin\n @call = $twilio_account.calls.create({\n :from => ENV['TWILIO_CALLER_ID'],\n :to => number_to_call,\n :url => \"#{SITE}\" + route_to_execute\n })\n puts \"DIALING OUT TO: \"+number_to_call\n\n rescue Exception => e; log_exception( e, where ); end\n end", "title": "" }, { "docid": "029b8a31589ce77896f1d912fdc5ba9b", "score": "0.65732396", "text": "def makecall\n if !params['number']\n redirect_to :action => '.', 'msg' => 'Invalid phone number'\n return\n end\n\n # parameters sent to Twilio REST API\n data = {\n :from => CALLER_ID,\n :to => params['number'],\n :url => BASE_URL + '/reminder',\n }\n\n begin\n client = Twilio::REST::Client.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n client.account.calls.create data\n rescue StandardError => bang\n redirect_to :action => '.', 'msg' => \"Error #{bang}\"\n return\n end\n\n redirect_to :action => '', 'msg' => \"Calling #{params['number']}...\"\n end", "title": "" }, { "docid": "ba5c1a96de7b4cf9c10c752b70e70e8c", "score": "0.6556839", "text": "def makecall\n p params\n p \"1---\" * 10\n unless params['number']\n p params['number']\n p \"2---\" * 10\n redirect_to :action => '.', 'msg' => 'Invalid phone number'\n return\n end\n\n # parameters sent to Twilio REST API\n data = {\n :from => CALLER_NUM,\n :to => params['number'],\n :url => BASE_URL + '/reminder',\n }\n\n begin\n p \"3---\" * 10\n p client = Twilio::REST::Client.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n p \"4---\" * 10\n p client.account.calls.create data\n p \"5---\" * 10\n rescue StandardError => bang\n redirect_to :action => '.', 'msg' => \"Error #{bang}\"\n return\n end\n\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end", "title": "" }, { "docid": "bb5a76541f43ceb57f393646d165b015", "score": "0.65547204", "text": "def create_calls_makecall(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/calls/makecall.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'From' => options['from'],\r\n 'To' => options['to'],\r\n 'Url' => options['url'],\r\n 'Method' => options['method'],\r\n 'StatusCallBackUrl' => options['status_call_back_url'],\r\n 'StatusCallBackMethod' => options['status_call_back_method'],\r\n 'FallBackUrl' => options['fall_back_url'],\r\n 'FallBackMethod' => options['fall_back_method'],\r\n 'HeartBeatUrl' => options['heart_beat_url'],\r\n 'HeartBeatMethod' => options['heart_beat_method'],\r\n 'Timeout' => options['timeout'],\r\n 'PlayDtmf' => options['play_dtmf'],\r\n 'HideCallerId' => options['hide_caller_id'],\r\n 'Record' => options['record'],\r\n 'RecordCallBackUrl' => options['record_call_back_url'],\r\n 'RecordCallBackMethod' => options['record_call_back_method'],\r\n 'Transcribe' => options['transcribe'],\r\n 'TranscribeCallBackUrl' => options['transcribe_call_back_url'],\r\n 'IfMachine' => options['if_machine'],\r\n 'IfMachineUrl' => options['if_machine_url'],\r\n 'IfMachineMethod' => options['if_machine_method'],\r\n 'Feedback' => options['feedback'],\r\n 'SurveyId' => options['survey_id']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "e38186c198963be47bb6da2ca38532d7", "score": "0.6508441", "text": "def makecall\n # parameters sent to Twilio REST API\n\n order = Order.new(params[:order].to_unsafe_h)\n\n order.save\n\n\n data = {\n :from => CALLER_ID,\n :to => order.hotel.phone,\n :url => BASE_URL + '/reminder',\n }\n\n begin\n client = Twilio::REST::Client.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n call = client.account.calls.create(data)\n order.sid = call.sid\n rescue StandardError => bang\n redirect_to :action => 'error', 'msg' => \"Error #{bang}\"\n return\n end\n\n redirect_to :action => \"index\", 'msg' => \"Calling #{order.hotel.phone}...\"\n end", "title": "" }, { "docid": "589eb408f2979ca979ad3c2952891533", "score": "0.6337546", "text": "def makecall\n if !params['number']\n redirect_to({ :action => :makecall, 'msg' => 'Invalid phone number' })\n return\n end\n\n @client = get_twilio\n \n begin\n @call = @client.account.calls.create(SITE['twilio_number'], :to => params['number'], :url => request.host+'/callme/hello.xml')\n rescue StandardError => bang\n redirect_to({ :action => :makecall, 'msg' => \"Error #{ bang }\" })\n return\n end\n\n redirect_to({ :action => :makecall, 'msg' => \"Calling #{ params['number'] }...\" })\n\n end", "title": "" }, { "docid": "75d6eb640efea649c59e91ca1e1e5b29", "score": "0.623134", "text": "def create_call(fonenumber, to, opts = {})\n data, _status_code, _headers = create_call_with_http_info(fonenumber, to, opts)\n return data\n end", "title": "" }, { "docid": "05bbb767f93952d715a043761d80ef4d", "score": "0.6191572", "text": "def create(optional_params = {})\n response = Network.post(['IncomingPhoneNumbers'], optional_params)\n IncomingPhoneNumber.new(response)\n end", "title": "" }, { "docid": "32fb68329f2b394bb447b513b01e78d8", "score": "0.6183864", "text": "def create_incomingphone_updatenumber(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/updatenumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'PhoneNumber' => options['phone_number'],\r\n 'VoiceUrl' => options['voice_url'],\r\n 'FriendlyName' => options['friendly_name'],\r\n 'VoiceMethod' => options['voice_method'],\r\n 'VoiceFallbackUrl' => options['voice_fallback_url'],\r\n 'VoiceFallbackMethod' => options['voice_fallback_method'],\r\n 'HangupCallback' => options['hangup_callback'],\r\n 'HangupCallbackMethod' => options['hangup_callback_method'],\r\n 'HeartbeatUrl' => options['heartbeat_url'],\r\n 'HeartbeatMethod' => options['heartbeat_method'],\r\n 'SmsUrl' => options['sms_url'],\r\n 'SmsMethod' => options['sms_method'],\r\n 'SmsFallbackUrl' => options['sms_fallback_url'],\r\n 'SmsFallbackMethod' => options['sms_fallback_method']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "090d6425e00611119546af0247cc198b", "score": "0.61803186", "text": "def makecall\n if !params['number']\n redirect_to({ :action => '.', 'msg' => 'Invalid phone number' })\n return\n end\n\n # parameters sent to Twilio REST API\n d = {\n 'Caller' => CALLER_ID,\n 'Called' => params['number'],\n 'Url' => BASE_URL + '/reminder',\n }\n begin\n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n resp = account.request(\n \"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/Calls\",\n 'POST', d)\n resp.error! unless resp.kind_of? Net::HTTPSuccess\n rescue StandardError => bang\n redirect_to({ :action => '.', 'msg' => \"Error #{ bang }\" })\n return\n end\n\n redirect_to({ :action => '',\n 'msg' => \"Calling #{ params['number'] }...\" })\n end", "title": "" }, { "docid": "92981e775821aa6a98528a7da9eaf8c3", "score": "0.61631024", "text": "def create(opts)\n raise \"You must set either :PhoneNumber or :AreaCode\" if !opts.include?(:AreaCode) && !opts.include?(:PhoneNumber)\n Twilio.post(\"/IncomingPhoneNumbers\", :body => opts)\n end", "title": "" }, { "docid": "1443d66267647a1e2fdcff8e4e7c407a", "score": "0.61400527", "text": "def place_call\n client = Twilio::REST::Client.new.account.calls\n client.create(\n from: Settings.calls.default_caller_id,\n to: @call.member_phone_number,\n url: twiml_url\n )\n rescue Twilio::REST::RequestError => e\n # 13223: Dial: Invalid phone number format\n # 13224: Dial: Invalid phone number\n # 13225: Dial: Forbidden phone number\n # 13226: Dial: Invalid country code\n # 21211: Invalid 'To' Phone Number\n # 21214: 'To' phone number cannot be reached\n if (e.code >= 13_223 && e.code <= 13_226) || [21_211, 21_214].include?(e.code)\n @errors[:member_phone_number] ||= []\n @errors[:member_phone_number] << I18n.t('call_tool.errors.phone_number.cant_connect')\n else\n Rails.logger.error(\"Twilio Error: API responded with code #{e.code} for #{@call.attributes.inspect}\")\n @errors[:base] ||= []\n @errors[:base] << I18n.t('call_tool.errors.unknown')\n end\n end", "title": "" }, { "docid": "eb3119196e1245459a182c3692c37c6c", "score": "0.61214244", "text": "def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, if_machine: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, url: :unset, application_sid: :unset)\n data = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'Url' => url,\n 'ApplicationSid' => application_sid,\n 'Method' => method,\n 'FallbackUrl' => fallback_url,\n 'FallbackMethod' => fallback_method,\n 'StatusCallback' => status_callback,\n 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },\n 'StatusCallbackMethod' => status_callback_method,\n 'SendDigits' => send_digits,\n 'IfMachine' => if_machine,\n 'Timeout' => timeout,\n 'Record' => record,\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SipAuthUsername' => sip_auth_username,\n 'SipAuthPassword' => sip_auth_password,\n 'MachineDetection' => machine_detection,\n 'MachineDetectionTimeout' => machine_detection_timeout,\n 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },\n 'Trim' => trim,\n 'CallerId' => caller_id,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid], )\n end", "title": "" }, { "docid": "df118e7e287cfe83362ffb128e69d5cb", "score": "0.6110122", "text": "def create\n @phone_call = PhoneCall.new(phone_call_params)\n @phone_call.user_id = current_user.id\n @phone_call.from = '+' + Rails.application.secrets.twilio_num.to_s\n respond_to do |format|\n if @phone_call.save\n format.html { redirect_to @phone_call, notice: 'Phone call was successfully created.' }\n format.json { render :show, status: :created, location: @phone_call }\n else\n format.html { render :new }\n format.json { render json: @phone_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "769f62e09e586ebf9d0d25e3abff6585", "score": "0.6080572", "text": "def make(to, from, url, optional_params = {})\n opts = { :To => to, :From => from, :Url => url }.merge(optional_params)\n response = Network.post(['Calls'], opts)\n Call.new(response)\n end", "title": "" }, { "docid": "ea0a484a199d49e3a142c9934e069db0", "score": "0.6064723", "text": "def call(to_number, url = nil)\n raise NoMethodError unless self.is_oakpotable?\n raise NoMethodError unless Oakpot.is_connectable?\n raise ArgumentError, 'missing TwiML url' unless url\n @@connection.account.calls.create(from: number, to: to_number,\n url: url)\n end", "title": "" }, { "docid": "8ed708283a48ce57e09ace43fa4d9bcc", "score": "0.6051699", "text": "def makecall\n @business = Business.find_by_phone(params[:business_phone])\n # parameters sent to Twilio REST API\n d = {\n 'From' => CALLER_ID,\n 'To' => params[:business_phone],\n 'Url' => BASE_URL + \"/confirm.xml?business_id=#{@business.id}\",\n }\n begin\n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n resp = account.request(\"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/Calls\", 'POST', d)\n resp.error! unless resp.kind_of? Net::HTTPSuccess\n rescue StandardError => bang\n redirect_to({ :action => '.', 'msg' => \"Error #{ bang }\" })\n return\n end\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "7d12debb195e75711287bb9e2e21fc66", "score": "0.60062134", "text": "def handle_call_me(to, from)\n body = ApiCreateCallRequest.new\n body.to = from\n body.from = to\n body.answer_url = BASE_URL + \"/StartGatherTransfer\"\n body.application_id = VOICE_APPLICATION_ID\n\n begin\n result = $voice_client.create_call(VOICE_ACCOUNT_ID ,body: body)\n rescue Exception => e\n puts e\n end \nend", "title": "" }, { "docid": "fefaca152b0816c683c70b515e0aeca1", "score": "0.6003897", "text": "def dial url\n\tget_messages.each {|msg| @client.account.calls.create(to: msg.from, from: ENV[PUBLIC_CALL_NUMBER], url: url)}\nend", "title": "" }, { "docid": "88ed9d7cee7f662cebc01f12f2875a4d", "score": "0.59918857", "text": "def create_incomingphone_transferphonenumbers(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/transferphonenumbers.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'phonenumber' => options['phonenumber'],\r\n 'fromaccountsid' => options['fromaccountsid'],\r\n 'toaccountsid' => options['toaccountsid']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "75ff6b9604ff68c7a071e9cf200d4aa3", "score": "0.5942679", "text": "def dial_out\n\t\tbegin #error handling for params :delay & :number\n\t\t\tif params[:delay]\n\t\t\t\t# Throws an error if delay is not numeric\n\t\t\t\traise \"Delay is not a valid number\" if !CalculationHelpers.numeric?(params[:delay])\n\t\t\t\t# I shouldn't have to do this validation, but I am too tired to figure out why it's not working right now :)\n\t\t\t\traise \"Not a valid number\" if !CalculationHelpers.numeric?(params[:number]) || params[:number].nil? || params[:number].length != 10\n\t\t\t\tCall.delay(run_at: params[:delay].to_i.minutes.from_now).outgoing_call(params[:number])\n\t\t\telse\n\t\t\t\tCall.outgoing_call(params[:number]) #throws an error if :number is not 7 digits & not numeric\n\t\t\tend\n\t\t\tCall.create(number: params[:number], delay: params[:delay])\n\t\t\t@result = {}\n\t\t\t@result['status'] = true\n\t\t\trender json: @result\n\t\trescue Exception => e\n\t\t\tputs e.message\n\t\t\tresponse = Twilio::TwiML::Response.new do |r|\n\t\t\t r.Say 'Not a valid number'\n\t\t\tend\n\t\t\t@result = {}\n\t\t\t@result['status'] = false\n\t\t\t@result['error'] = e.message\n\t\t\trender json: @result\n\t\tend\n\tend", "title": "" }, { "docid": "6c1778c690cef993e6b2eb661c252784", "score": "0.5921428", "text": "def doCall(to,echo)\n\t\t\taccount_sid = \"AC4ec831329d317ff210717149d88ce48d\"\n\t\t\tauth_token = \"1bed194febf4682c9eed34871f5c739a\"\n\t\t\techo = \"http://twimlets.com/echo?Twiml=<Response><Say>#{echo}</Say></Response>\"\n\t\t\t#URI Encoding of the String\n\t\t\techo = URI::encode(echo)\n\t\t\t@client = Twilio::REST::Client.new account_sid, auth_token\n\t\t\t@client.account.calls.create(\n\t\t\t\t:from => '+17025054171',\n\t\t\t\t:to=>\"#{to}\",\n\t\t\t\t# Passing the Twimlet to Twilio for Proccessing\n\t\t\t\t:url => \"#{echo}\" \n\t\t\t)\n\t\tend", "title": "" }, { "docid": "50baafb40c0c9bda4d137c79f60c06c5", "score": "0.59139496", "text": "def create_call_0(fonenumber, to, opts = {})\n data, _status_code, _headers = create_call_0_with_http_info(fonenumber, to, opts)\n return data\n end", "title": "" }, { "docid": "ce70daf806024fe49b81900773d8de99", "score": "0.5900795", "text": "def make_phone_call(number, international_code=1, area_code=408)\n \"#{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "511b1ab23be15ced6124ea74b0db5c66", "score": "0.58787555", "text": "def create(api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, identity_sid: :unset, address_sid: :unset, phone_number: :unset, area_code: :unset)\n data = Twilio::Values.of({\n 'PhoneNumber' => phone_number,\n 'AreaCode' => area_code,\n 'ApiVersion' => api_version,\n 'FriendlyName' => friendly_name,\n 'SmsApplicationSid' => sms_application_sid,\n 'SmsFallbackMethod' => sms_fallback_method,\n 'SmsFallbackUrl' => sms_fallback_url,\n 'SmsMethod' => sms_method,\n 'SmsUrl' => sms_url,\n 'StatusCallback' => status_callback,\n 'StatusCallbackMethod' => status_callback_method,\n 'VoiceApplicationSid' => voice_application_sid,\n 'VoiceCallerIdLookup' => voice_caller_id_lookup,\n 'VoiceFallbackMethod' => voice_fallback_method,\n 'VoiceFallbackUrl' => voice_fallback_url,\n 'VoiceMethod' => voice_method,\n 'VoiceUrl' => voice_url,\n 'EmergencyStatus' => emergency_status,\n 'EmergencyAddressSid' => emergency_address_sid,\n 'TrunkSid' => trunk_sid,\n 'IdentitySid' => identity_sid,\n 'AddressSid' => address_sid,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n IncomingPhoneNumberInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end", "title": "" }, { "docid": "6ca42928b0dc46c4c696b20fc0af5a55", "score": "0.5857226", "text": "def create\n @outbound = Outbound.new(params[:outbound])\n\n respond_to do |format|\n if @outbound.save\n format.html { redirect_to @outbound, notice: 'Outbound was successfully created.' }\n format.json { render json: @outbound, status: :created, location: @outbound }\n else\n format.html { render action: \"new\" }\n format.json { render json: @outbound.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "183e3a9e2c43d6394e43c063ed7858e2", "score": "0.5846335", "text": "def alarm(receiver)\n client = Twilio::REST::Client.new @config.account_sid, @config.auth_token\n client.calls.create(\n from: @config.phone_nbr_from,\n to: receiver,\n url: @config.twiml_bin_message_url + @message.tr(' ', '+')\n )\n rescue StandardError => errormsg\n LOGGER.warn \"Call probably not made!\\nReceiver: #{receiver}\\nMessage: #{@message}\\nError: #{errormsg}!\"\n else\n LOGGER.info \"#{receiver} called.\"\n end", "title": "" }, { "docid": "44ca187bc0845323b9375a9b4c3f27e9", "score": "0.58436", "text": "def add_call(campaign_id, phone_number)\n parameters = {\n public_key: @api_public_key,\n campaign_id: campaign_id,\n phone: phone_number\n }\n post PATH_PHONES_CALL, parameters\n end", "title": "" }, { "docid": "9d2d873c3f10e4f501cec659fa090c38", "score": "0.58116364", "text": "def create_call_0_with_http_info(fonenumber, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CallsApi.create_call_0 ...\"\n end\n # verify the required parameter 'fonenumber' is set\n if @api_client.config.client_side_validation && fonenumber.nil?\n fail ArgumentError, \"Missing the required parameter 'fonenumber' when calling CallsApi.create_call_0\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling CallsApi.create_call_0\"\n end\n # resource path\n local_var_path = \"/calls\"\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 form_params[\"fonenumber\"] = fonenumber\n form_params[\"to\"] = to\n form_params[\"tts\"] = opts[:'tts'] if !opts[:'tts'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse2011')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CallsApi#create_call_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c90cd75102516b4cc187dadd69764ca1", "score": "0.58074963", "text": "def create_call_with_http_info(fonenumber, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CallsApi.create_call ...\"\n end\n # verify the required parameter 'fonenumber' is set\n if @api_client.config.client_side_validation && fonenumber.nil?\n fail ArgumentError, \"Missing the required parameter 'fonenumber' when calling CallsApi.create_call\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling CallsApi.create_call\"\n end\n # resource path\n local_var_path = \"/calls\"\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 form_params[\"fonenumber\"] = fonenumber\n form_params[\"to\"] = to\n form_params[\"tts\"] = opts[:'tts'] if !opts[:'tts'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse2011')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CallsApi#create_call\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fa400f6b24634a04572304872ffb1a0b", "score": "0.58056575", "text": "def create\n @draft = SmsOnRails::Draft.find(params[:sms_draft_id]) if params[:sms_draft_id]\n @outbound = SmsOnRails::Outbound.create_with_phone(params[:outbound], @draft)\n\n respond_to do |format|\n unless @outbound.errors.any?\n flash[:notice] = 'Outbound was successfully created.'\n format.html { redirect_to(sms_draft_outbound_path(@draft, @outbound))}\n format.xml { render :xml => @outbound, :status => :created, :location => @outbound }\n else\n # evil hack as forms are rejected with an id value\n @outbound.phone_number.id = nil if @outbound.phone_number\n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @outbound.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5e453f36d0c3b7be82f9a64fd7c8920", "score": "0.57797194", "text": "def send_phone_call\n puts 'Making a phone call'\n end", "title": "" }, { "docid": "bcc5092a0797878387a1cf67eb841af9", "score": "0.5777811", "text": "def add_call_with_clip_generation(campaign_id, phone_number, text, speaker = nil)\n parameters = {\n public_key: @api_public_key,\n campaign_id: campaign_id,\n phone: phone_number,\n text: text,\n speaker: speaker\n }\n post PATH_PHONES_CALL, parameters\n end", "title": "" }, { "docid": "ad91c65dba8df369ad82d89a8cda2dc4", "score": "0.57624805", "text": "def create_incomingphone_availablenumber(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/availablenumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'numbertype' => options['numbertype'],\r\n 'areacode' => options['areacode'],\r\n 'pagesize' => options['pagesize']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "a8f24cebc6c719a9cfc5424c102e17d5", "score": "0.57562786", "text": "def send_recording_via_twilio(to_number, from_number, url)\n if false#Donotcall.find_by_number(number)\n #cannot call\n puts \"BLOCKED: - Number:#{number}\"\n else\n begin\n # credentials\n @account_sid = ENV['TWILIO_ACCOUNT_SID']\n @auth_token = ENV['TWILIO_AUTH_TOKEN']\n # set up a client to talk to the Twilio REST API\n @client = Twilio::REST::Client.new(@account_sid, @auth_token)\n \n #call\n # make a new outgoing call\n @call = @client.account.calls.create(\n :from => \"+1\" + from_number,\n :to => \"+1\" + to_number,\n :url => url,\n 'IfMachine' => 'continue'\n )\n rescue StandardError => failedWith\n send_via_tropo_call(\"Error twilio_with_URL #{url}\", ENV['ADMIN_PHONE_NUMBER'], 'United States', 1, 1) \n #Deliveryerror.create(:objecttype => 1, :deliverytype => 2, :objectid => announce.id, :errormessage => failedWith, :user_id => user.id).save\n end\n end\n end", "title": "" }, { "docid": "cd5a7248007bb989bf29b92244ff700e", "score": "0.5742222", "text": "def create_incomingphone_massupdatenumber(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/massupdatenumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'PhoneNumber' => options['phone_number'],\r\n 'VoiceUrl' => options['voice_url'],\r\n 'FriendlyName' => options['friendly_name'],\r\n 'VoiceMethod' => options['voice_method'],\r\n 'VoiceFallbackUrl' => options['voice_fallback_url'],\r\n 'VoiceFallbackMethod' => options['voice_fallback_method'],\r\n 'HangupCallback' => options['hangup_callback'],\r\n 'HangupCallbackMethod' => options['hangup_callback_method'],\r\n 'HeartbeatUrl' => options['heartbeat_url'],\r\n 'HeartbeatMethod' => options['heartbeat_method'],\r\n 'SmsUrl' => options['sms_url'],\r\n 'SmsMethod' => options['sms_method'],\r\n 'SmsFallbackUrl' => options['sms_fallback_url'],\r\n 'SmsFallbackMethod' => options['sms_fallback_method']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "768730f792fd39d93765641a9688543c", "score": "0.57367927", "text": "def makecall\n if !params['number']\n render :status => 401,\n :json => { :success => false,\n :info => 'Invalid phone number or no number suplied.',\n :data => {} }\n return\n end\n attempt = params[:attempt] || \"first\"\n if params[:call_id]\n call_id = params[:call_id]\n else\n call_log = current_user.call_logs.create(:patient_mobile_number => params['number'])\n call_id = call_log.id\n end\n # parameters sent to Twilio REST API\n \n data = {\n :from => TWILIO_CONFIG['from'],\n :to => params['number'],\n :url => BASE_URL + \"/patient_call?call_id=#{call_id}&user_email=#{params[:user_email]}&user_token=#{params[:user_token]}\",\n :IfMachine => 'Continue',\n :StatusCallback => BASE_URL + \"/call_status?call_id=#{call_id}&user_email=#{params[:user_email]}&user_token=#{params[:user_token]}&attempt=#{attempt}\"\n }\n begin\n client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])\n client.account.calls.create data\n rescue StandardError => msg\n render :status => 401,\n :json => { :success => false,\n :info => \"Error: #{msg}\",\n :data => {} }\n call_log.update_attributes(:call_status => \"Completed with error.\")\n return\n end\n render :status => 200,\n :json => { :success => true,\n :info => \"Thank you, please hang up, Docit will call you back once your party is reached.\",\n :data => { } }\n #flash[:notice] = \"Thank you, please hang up, Docit will call you back once your party is reached.\"\n #redirect_to root_url\n end", "title": "" }, { "docid": "1fb888d7347fdcc24eacf47a3d4efc5c", "score": "0.5711876", "text": "def create_call(user_id, protocol)\n broadcast('@type' => 'createCall',\n 'user_id' => user_id,\n 'protocol' => protocol)\n end", "title": "" }, { "docid": "d94eb7ef4dd0a498335745561693b95e", "score": "0.57015604", "text": "def offer_call\n\n profile_id = params[:session][:parameters][:profile_id]\n caller_id = params[:session][:parameters][:caller_id]\n call_id = params[:session][:parameters][:call_id]\n session_id = params[:session][:parameters][:session_id]\n\n sys_config = SysConfig.first\n user = Profile.get(profile_id).user\n\n forwarding_numbers = user.phone_numbers.collect {|num|\n num.number\n }\n\n tropo = Tropo::Generator.new do\n\n signal_url = \"signal_peer?event=voicemail&call_id=#{call_id}&session_id=#{session_id}\"\n\n on(:event => 'error', :next => signal_url)\n on(:event => 'hangup', :next => signal_url)\n on(:event => 'incomplete', :next => signal_url)\n on(:event => 'continue', :next => \"user_menu_selection?profile_id=#{profile_id}&caller_id=#{caller_id}&call_id=#{call_id}&session_id=#{session_id}\")\n call( :to => forwarding_numbers)\n ask( :name => 'main_menu',\n :attempts => 2,\n :bargein => true,\n :choices => { :value => \"connect(1), voicemail(2)\", :mode => \"DTMF\" },\n :say => {:value => \"Incoming call from #{sys_config.server_url}/voice/get_contact_recording?caller_id=#{caller_id}&amp;profile_id=#{profile_id} . Press 1 to connect. To send to voicemail press 2 or simply hangup.\"})\n end\n\n render :json => tropo.response\n\n end", "title": "" }, { "docid": "4af2d4f811cc442f93bcf5ebf07d0789", "score": "0.56821334", "text": "def add_outbound_access opt={}\n @outbound_ports.push generate_access(opt)\n end", "title": "" }, { "docid": "dc3e0ae93b6604609fa4da0ec5d02b07", "score": "0.5680456", "text": "def create\n @user = User.find(params[:id])\n @call = Call.create(from_user: current_user, to_user: @user)\n end", "title": "" }, { "docid": "a0083c7c02d10a7eedf2e0a10ce4384e", "score": "0.5676702", "text": "def phone_call(message)\n Ruboty::Callng::Actions::Call.new(message).call\n end", "title": "" }, { "docid": "67a85c27acfdd1ff081c0060c265755b", "score": "0.5675251", "text": "def outbound_url\n Rails.application.routes.url_helpers.twilio_phone_outbound_url(\n Rails.configuration.action_controller.default_url_options\n .merge(tree_name: name, format: :xml)\n )\n end", "title": "" }, { "docid": "cc0a2b0ebed28a5ad12caf99bfd92893", "score": "0.5655366", "text": "def create_outbound_subscription(sender_address, options, &blk)\n post(\"/smsmessaging/outbound/#{sender_address}/subscriptions\", \n build_query_string(options),\n SMSIFIED_HTTP_HEADERS, &blk\n )\n end", "title": "" }, { "docid": "3bc9630c73c21b3b7433c71218ef96d1", "score": "0.56534016", "text": "def create\n # puts \"\\n--calls#create\".yellowish\n \n @call = Call.new(params[:call])\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to(@call, :notice => 'Call was successfully created.') }\n format.xml { render :xml => @call, :status => :created, :location => @call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "961c5dab854f2375d98aa82c9ece525d", "score": "0.56467414", "text": "def dial from, to, options={}\n parameters = { from: from, to: to }\n options.keep_if {|key, _v| [:recording_enabled, :bridge_id].include? key }\n\n _body, headers = post 'calls', parameters.merge(options)\n headers['location'].match(/[^\\/]+$/)[0]\n end", "title": "" }, { "docid": "03d5f97e8e28ee2752d46a79d2632ae1", "score": "0.5614091", "text": "def make_phone_call(number, international_code = 1, area_code = 918)\n # international and area codes are defaults or optional\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "55b7bd42ffa409d97f8a3850c055d33d", "score": "0.5611532", "text": "def call\n @@twilio_sid = '#'\n @@twilio_token = '#'\n @@twilio_number = '#'\n @@api_host = '#'\n\n contact = Contact.new\n contact.user_phone = params[:userPhone]\n @client = Twilio::REST::Client.new @@twilio_sid, @@twilio_token\n # Connect an outbound call to the number submitted\n @call = @client.calls.create(\n :from => @@twilio_number,\n :to => contact.user_phone,\n :timeout => 29,\n :url => \"#{@@api_host}/lagu\" # Fetch instructions from this URL when the call connects\n )\n # Let's respond to the ajax call with some positive reinforcement\n @msg = { :message => 'Phone call incoming!', :status => 'ok' }\n end", "title": "" }, { "docid": "8436e912678c1e096d7c5d36990d830e", "score": "0.5597584", "text": "def create\n phone_call_params = params\n phone_call_params.delete(:phone)\n phone_call_params[:phone_id] = if params[:phone].present?\n Phone.find_by_value(params[:phone]).try(:id)\n else\n nil\n end\n @phone_call = PhoneCall.new(phone_call_params)\n response = if @phone_call.save\n { id: @phone_call.id, status: 200 }\n else\n { status: 500 }\n end\n render json: response, status: response[:status]\n end", "title": "" }, { "docid": "9f6cfe5dda6fb4c40b7df692a80eeadc", "score": "0.55750984", "text": "def makecall(user_number, message_from_user)\n @client = Twilio::REST::Client.new ACCOUNT_SID, ACCOUNT_TOKEN\n \n if message_from_user\n if /\\A\\d+\\z/.match(message_from_user)\n specified_song_number = message_from_user.to_i\n end\n end\n \n if !specified_song_number\n @call = @client.account.calls.create(\n :from => CALLER_ID, # From your Twilio number\n :to => user_number, # To any number\n # Fetch instructions from this URL when the call connects\n :url => BASE_URL + \"/initiatecall\"\n )\n \n @client.account.messages.create(:body => WELCOME_MESSAGE,\n :to => user_number,\n :from => CALLER_ID)\n \n song_list = \"\"\n SONG_ARRAY.each_with_index {|val, index| song_list += \"#{index}: #{val.split('/')[-1].split('.')[-2].gsub(/[+]/, ' ')} \\n\" }\n \n @client.account.messages.create(:body => song_list,\n :to => user_number,\n :from => CALLER_ID)\n else\n @client.account.messages.create(:body => \"Hi. We currently do not support song requests via SMS. Please enter the song number via your keypad during the call.\",\n :to => user_number,\n :from => CALLER_ID)\n end\nend", "title": "" }, { "docid": "e62d128982d8cf084723e890fefed05f", "score": "0.5572088", "text": "def create_calls_recordcalls(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/calls/recordcalls.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'CallSid' => options['call_sid'],\r\n 'Record' => options['record'],\r\n 'Direction' => options['direction'],\r\n 'TimeLimit' => options['time_limit'],\r\n 'CallBackUrl' => options['call_back_url'],\r\n 'Fileformat' => options['fileformat']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "6f34519a01a6f8532b3c3995abf88ae6", "score": "0.5564846", "text": "def incoming\n if Sip::Events.ringing?(params)\n call_params = Sip::Call.attributes(params)\n company_number = CompanyNumber.find_by(sip_endpoint: call_params[:to])\n\n if company_number\n Call.create!({\n number: call_params[:number],\n company_number: company_number,\n uuid: call_params[:uuid],\n name: call_params[:name]\n })\n\n response = Sip::Response.forward_to_endpoints(\n call_params[:number],\n Rails.application.routes.url_helpers.dialcallback_calls_url(host: ENV['HOST'], protocol: ENV['PROTOCOL']),\n Rails.application.routes.url_helpers.dialaction_calls_url(host: ENV['HOST'], protocol: ENV['PROTOCOL']),\n UserNumber.all.map(&:sip_endpoint))\n end\n end\n\n respond_to do |format|\n format.xml { render xml: response || Sip::Response.empty }\n end\n end", "title": "" }, { "docid": "fb095329c2369a35313d1cf32b4b18bb", "score": "0.5558053", "text": "def make_phone_call (number, intertional_code=57, area_code=36)\n puts \"Calling #{intertional_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "a3e5d6fcc1e7ef93c9f8557907a2c7fe", "score": "0.55552244", "text": "def create\n @call = Call.new(params[:call].merge(:creator => current_user))\n\n respond_to do |format|\n if @call.save\n flash[:notice] = 'Call was successfully created.'\n format.html { redirect_to(@call) }\n format.xml { render :xml => @call, :status => :created, :location => @call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fd8a477da97d802103f6458e84aa285", "score": "0.5549889", "text": "def create_call(account_id,\n\t body: nil)\n\t # Prepare query url.\n\t _query_builder = config.get_base_uri\n\t _query_builder << '/accounts/{accountId}/calls'\n\t _query_builder = APIHelper.append_url_with_template_parameters(\n\t _query_builder,\n\t 'accountId' => account_id\n\t )\n\t _query_url = APIHelper.clean_url _query_builder\n\n\t # Prepare headers.\n\t _headers = {\n\t 'accept' => 'application/json',\n\t 'content-type' => 'application/json; charset=utf-8'\n\t }\n\n\t # Prepare and execute HttpRequest.\n\t _request = config.http_client.post(\n\t _query_url,\n\t headers: _headers,\n\t parameters: body.to_json\n\t )\n\t VoiceV2BasicAuth.apply(config, _request)\n\t _response = execute_request(_request)\n\t validate_response(_response)\n\n\t # Return appropriate response type.\n\t decoded = APIHelper.json_deserialize(_response.raw_body)\n\t ApiCallResponse.from_hash(decoded)\n\t end", "title": "" }, { "docid": "0c494bf7ffb7fac2bbf0a3aeca1fb01c", "score": "0.55330706", "text": "def create_incomingphone_buynumber(phone_number)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/buynumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'PhoneNumber' => phone_number\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "4cf8948a965fa152843f0111dc0e63ae", "score": "0.55297256", "text": "def call\n contact = Contact.new\n contact.user_phone = params[:userPhone]\n contact.sales_phone = params[:salesPhone]\n\n # Validate contact\n if contact.valid?\n @client = Twilio::REST::Client.new @twilio_sid, @twilio_token\n # Connect an outbound call to the number submitted\n @call = @client.calls.create(\n to: contact.user_phone,\n from: @twilio_number,\n url: \"#{@api_host}/connect/#{contact.encoded_sales_phone}\" # Fetch instructions from this URL when the call connects\n )\n\n # Let's respond to the ajax call with some positive reinforcement\n @msg = { message: 'Phone call incoming!', status: 'ok' }\n else\n\n # Oops there was an error, lets return the validation errors\n @msg = { message: contact.errors.full_messages, status: 'ok' }\n end\n\n respond_to do |format|\n format.json { render json: @msg }\n end\n end", "title": "" }, { "docid": "b45b006f750639f52cdde8764c1efdab", "score": "0.55216944", "text": "def create\n @call = Call.new(params[:call])\n\n respond_to do |format|\n if @call.save\n flash[:notice] = 'Call was successfully created.'\n format.html { redirect_to(@call) }\n format.xml { render :xml => @call, :status => :created, :location => @call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87f7ce0b20ebfca0dfd71ebfb96408d2", "score": "0.5520233", "text": "def create\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87f7ce0b20ebfca0dfd71ebfb96408d2", "score": "0.5520233", "text": "def create\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87f7ce0b20ebfca0dfd71ebfb96408d2", "score": "0.5520233", "text": "def create\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c63e23834795365082ab7772385cb7a8", "score": "0.5517869", "text": "def calculate(message, phone)\n account_sid = ''\n auth_token = ''\n @client = Twilio::REST::Client.new account_sid, auth_token\n message = @client.account.messages.create(:body => message,\n :to => \"+1#{phone}\",\n :from => \"() -6896\"\n )\n puts message.to\n end", "title": "" }, { "docid": "9f9f206a8712fd0bfaeb5cac55adf1c5", "score": "0.5505725", "text": "def create_incomingphone_listnumber(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/listnumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'Page' => options['page'],\r\n 'PageSize' => options['page_size'],\r\n 'NumberType' => options['number_type'],\r\n 'FriendlyName' => options['friendly_name']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "d3d26c4fc6d240c651df7a0e76e2bcdb", "score": "0.54976636", "text": "def create\n # Include the helper gateway class\n require_relative 'AfricasTalkingGateway.rb'\n\n\n # Specify your login credentials\n user = params.require(:call).permit(:username)\n username = user['username']\n\n api =params.require(:call).permit(:apikey)\n apikey = api['apikey']\n\n\n # Specify your Africa's Talking phone number in international format\n caller = \"+254711082300\"\n \n # Please ensure you include the country code (+254 for Kenya in this case)\n to = params.require(:call).permit(:destinationNumber)\n tof = to['destinationNumber']\n\n\n # Create a new instance of our awesome gateway class\n gateway = AfricasTalkingGateway.new(username, apikey)\n\n # Any gateway errors will be captured by our custom Exception class below,\n # so wrap the call in a try-catch block\n begin\n # Make the call\n reports = gateway.call(caller, tof)\n puts reports\n puts \"Calls have been initiated. Time for song and dance!\\n\";\n # Our API will now contact your callback URL once recipient answers the call! \n #Receive Ingoing Calls \n #First read in a couple of POST variables passed in with the request \n @call = Call.new(amount: params[:amount], callerNumber: params[:callerNumber], destinationNumber: params[:destinationNumber])\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call successfully initiated.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n rescue AfricasTalkingGatewayException => ex\n puts 'Encountered an error: ' + ex.message\n end\n\n end", "title": "" }, { "docid": "d8a0f6bf2f178ffae8d4ffc9f45eb4ca", "score": "0.5492259", "text": "def create\n @call = Call.new(params[:call])\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to root_url, notice: 'Call was successfully created.' }\n format.json { render json: @call, status: :created, location: @call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67b700295a48649a57f25d8094816990", "score": "0.54918146", "text": "def create\n @call = Call.new(params[:call])\n\n respond_to do |format|\n if @call.save\n flash[:notice] = 'Call was successfully created.'\n format.html { redirect_to(@call) }\n format.xml { render xml: @call, status: :created, location: @call }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7e2fcc6465a38a77fc11858c6661e51", "score": "0.5485782", "text": "def dial(options={})\n check_state \n \n destinations = parse_destinations(options[:args])\n options = { :callerID => '4155551212' }\n options['headers'] = set_headers\n @current_call.transfer destinations, options\n @agi_response + \"0\\n\"\n rescue => e\n log_error(this_method, e)\n end", "title": "" }, { "docid": "2c3f057468b1b72d0585311986f9a93f", "score": "0.54819435", "text": "def make_phone_call(number, international_code =966, area_code = 555)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "445a550ce4b9dcb7a1746493124b77a4", "score": "0.54811996", "text": "def make_phone_call(number, international_code = 1, area_code = 646)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "445a550ce4b9dcb7a1746493124b77a4", "score": "0.54811996", "text": "def make_phone_call(number, international_code = 1, area_code = 646)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "8fe52e94399975b9619b767b5f55f3d4", "score": "0.54635763", "text": "def create_calls_interruptcalls(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/calls/interruptcalls.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'CallSid' => options['call_sid'],\r\n 'Url' => options['url'],\r\n 'Method' => options['method'],\r\n 'Status' => options['status']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "aa9595e3994247fb6ab4da2fd39237a8", "score": "0.5459935", "text": "def set_twilio_number(area_code, forward_to, name, inboundno)\n return false if area_code.blank? || forward_to.blank? || name.blank? || inboundno.blank?\n job_status = JobStatus.create(:name => \"Campaign.set_twilio_number\")\n \n begin\n # CALL URLS ############################################ \n phone_number_md5 = Base64.encode64(inboundno)\n url_friendly_num = CGI.escape(phone_number_md5)\n call_url = \"http://#{APP_CONFIG[:host]}/api/v1/calls/#{url_friendly_num}/connect\"\n fallback_url = \"http://#{APP_CONFIG[:host]}/api/v1/calls/#{url_friendly_num}/connect\"\n status_url = \"http://#{APP_CONFIG[:host]}/api/v1/calls/#{url_friendly_num}/complete\"\n sms_url = \"http://#{APP_CONFIG[:host]}/api/v1/calls/#{url_friendly_num}/sms_collect\"\n fallback_sms_url = \"http://#{APP_CONFIG[:host]}/api/v1/calls/#{url_friendly_num}/sms_collect\"\n \n # Set up the parameters we will be sending into Twilio, we are requesting the provision of inboundno in this case\n d = { 'Name' => self.name,\n 'PhoneNumber' => inboundno,\n 'VoiceUrl' => \"#{call_url}\",\n 'VoiceMethod' => 'POST',\n 'VoiceFallbackUrl' => \"#{fallback_url}\",\n 'VoiceFallbackMethod' => 'POST',\n 'StatusCallback' => \"#{status_url}\",\n 'StatusCallbackMethod' => 'POST',\n 'SmsUrl' => \"#{sms_url}\",\n 'SmsMethod' => 'POST',\n 'SmsFallbackUrl' => \"#{fallback_sms_url}\",\n 'SmsFallbackMethod' => 'POST',\n 'VoiceCallerIdLookup' => true\n }\n \n # We want to make sure we have a twilio_id on this account before we call anytype of API request\n self.account.create_twilio_subaccount if self.account.twilio_id.blank? || Account.get_active_twilio_subaccounts.none?{|account| account['sid'] == self.account.twilio_id}\n \n # Make API call to twilio, requesting the param[:inboundno]\n resp = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN).request(\"/#{API_VERSION}/Accounts/#{self.account.twilio_id}/IncomingPhoneNumbers.json\", 'POST', d)\n \n # Catch it if it is no 200/201\n raise unless resp.kind_of? Net::HTTPSuccess\n \n # Grab the twilio response and parse it out\n r = JSON.parse(resp.body)\n \n # This is to check if the number you requested was actually provisioned\n if r['sid'].present? && r['phone_number'].gsub(\"+\", \"\") == inboundno\n new_phone_number = self.phone_numbers.build\n new_phone_number.twilio_id = r['sid']\n new_phone_number.inboundno = r['phone_number'].gsub(\"+\", \"\")\n new_phone_number.forward_to = forward_to\n new_phone_number.name = self.name\n new_phone_number.descript = self.name\n new_phone_number.twilio_version = API_VERSION\n new_phone_number.id_callers = true\n new_phone_number.record_calls = true\n new_phone_number.transcribe_calls = false\n new_phone_number.text_calls = false\n new_phone_number.active = true\n new_phone_number.save!\n return true\n else\n return false\n end\n rescue Exception => ex\n job_status.finish_with_errors(ex)\n raise\n end\n end", "title": "" }, { "docid": "be8fc2319445d9cfc70e0194b348bf63", "score": "0.54549503", "text": "def accept_call(call)\n if self.available?\n self.lock_agent\n $twilio_client.account.calls.create(\n :from => \"+16023888925\",\n :to => \"#{self.phone}\",\n :url => @@router.patch_agent_call_handler_url(:format => :xml, :call_id => call.id),\n :method => \"GET\"\n )\n end\n end", "title": "" }, { "docid": "800c0fe1d40593d04f1374fb7ea561c6", "score": "0.54403186", "text": "def new_call(time, address, type, incident_number)\n get_or_new_hour(time).new_call(time, address, type, incident_number)\n end", "title": "" }, { "docid": "b9c6a8e87783c4180e7bae809df9a926", "score": "0.5410421", "text": "def make_phone_call(number,international_code = 1,area_code = 646)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "433f1611551c5806ed9b52aa20446a23", "score": "0.54099727", "text": "def create_calls_senddigits(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/calls/senddigits.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'CallSid' => options['call_sid'],\r\n 'PlayDtmf' => options['play_dtmf'],\r\n 'PlayDtmfDirection' => options['play_dtmf_direction']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "1d402a6a9d1980d6117b9f0be7ada745", "score": "0.5404854", "text": "def create\n #Receive Incoming Calls \n #First read in a couple of POST variables passed in with the request\n @pickcall = Pickcall.new(sessionId: params[:sessionId], isActive: params[:isActive], callerNumber: params[:callerNumber])\n @response = Response.new\n if @pickcall.save\n # redirect_to call_path, :notice => \"Your call session was saved\"\n # Reads the variables sent via POST from our gateway\n sessionId = @pickcall.sessionId\n isActive = @pickcall.isActive\n callerNumber = @pickcall.callerNumber\n end\n if isActive == 1\n # Compose response\n text = \" Please wait while we connect your call!\"\n\n # Compose the response and make it available to read\n response = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n response += '<Response>'\n response += '<Say>'+text+'</Say>'\n response += '<Dial phoneNumbers=\"+254787235065,+254708415904\" ringbackTone=\"http://5.175.146.43/SautiFinaleMoney.mp3\"/>'\n\n response += '</Response>'\n @response.now = response\n\n # Print the response onto the page so that our gateway can read it\n #header('Content-type: text/plain');\n render plain: @response.now\n puts \"Content-Type: text/plain\"\n puts @response.now\n # DONE!!!\n else\n @call = Call.new(durationInSeconds: params[:durationInSeconds], currencyCode: params[:currencyCode], amount: params[:amount])\n @call.save\n render \"new\"\n end\n end", "title": "" }, { "docid": "8d993e8df0dfcdf0e5fa9be743954b32", "score": "0.53748703", "text": "def create\n v = Tropo::Generator.parse request.env[\"rack.input\"].read\n t = Tropo::Generator.new\n\n #This will be hit when a request is sent to Tropo to make a call\n if v[:session][:parameters]\n\n to = v[:session][:parameters][:num]\n #Create record\n @c = Call.create(:start_time => Time.now.utc.strftime('%a %b %d %H:%M:%S +0000 %Y'), :to => to, :from => \"14071234321\", :success => \"true\", :duration => Time.now.utc.seconds_since_midnight.to_i, :network => \"VOICE\", :direction => \"out\")\n #make the call\n t.call(:to => \"+#{to}\")\n #send thread to make the call\n t.on :event => 'continue', :next => 'calls/sendCall'\n \n #This is hit when a user calls into the app\n else\n \n #Create record\n @c = Call.create(:start_time => Time.now.utc.strftime('%a %b %d %H:%M:%S +0000 %Y'), :to => v[:session][:to][:name], :from => v[:session][:from][:name], :success => \"true\", :duration => Time.now.utc.seconds_since_midnight.to_i, :network => v[:session][:to][:channel], :direction => \"in\")\n \n #send the thread to start the functionalities \n t.on :event => 'continue', :next => \"calls/startCall\"\n t.on :event => 'hangup', :next => 'calls/hangup'\n end\n\n #send JSON back to Tropo\n render :json => t.response\n end", "title": "" }, { "docid": "ac7991ee06b390eaeb4f093b28f0c768", "score": "0.5354847", "text": "def trigger_call_from_customer\n client.calls.create(\n from: \"+#{config['callee_id']}\",\n to: \"+#{config['caller_id']}\",\n url: twiml_test_message_url\n )\n end", "title": "" }, { "docid": "31293775e26019e0ae5a415569cffcfa", "score": "0.5346803", "text": "def phone_call_with_message(message)\n Ruboty::Callng::Actions::Call.new(message).call_with_message\n end", "title": "" }, { "docid": "a873659c387ea468d4706f876c6021f7", "score": "0.53417027", "text": "def create\n\n # Construct and authorise the phone number\n @phone_number = @organization.phone_numbers.build( buy_phone_number_params )\n @phone_number.communication_gateway = @organization.communication_gateway_for(:twilio)\n authorize! :create, @phone_number\n\n begin\n @phone_number.purchase!\n flash[:success] = 'Phone number was successfully created.' if @phone_number.update(buy_phone_number_params)\n\n rescue Twilio::REST::RequestError => ex\n case ex.code\n when Twilio::ERR_PHONE_NUMBER_NOT_AVAILABLE\n flash[:error] = \"Sorry, #{ view_context.humanize_phone_number @phone_number.number } is no longer available. (Detailed message: #{ ex.message })\"\n else\n flash[:error] = 'Unknown error! (%s: %s)' % [ex.code, ex.message]\n end\n ensure\n respond_with @organization, @phone_number\n end\n end", "title": "" }, { "docid": "6bad00fabe6b542d55451f26c79cc4e0", "score": "0.5338247", "text": "def make_phone_call(number, internation_code = 91, area_code = 45)\n puts \"calling #{internation_code}-#{area_code}-#{number}\"\nend", "title": "" }, { "docid": "798597213595eba65d94333b4ebae20f", "score": "0.5331921", "text": "def create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset)\n data = Twilio::Values.of({\n 'PhoneNumber' => phone_number,\n 'FriendlyName' => friendly_name,\n 'CallDelay' => call_delay,\n 'Extension' => extension,\n 'StatusCallback' => status_callback,\n 'StatusCallbackMethod' => status_callback_method,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n ValidationRequestInstance.new(@version, payload, account_sid: @solution[:account_sid], )\n end", "title": "" }, { "docid": "f8eed4777d599389a123f540630133b0", "score": "0.5329012", "text": "def create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset)\n data = Twilio::Values.of({\n 'PhoneNumber' => phone_number,\n 'FriendlyName' => friendly_name,\n 'CallDelay' => call_delay,\n 'Extension' => extension,\n 'StatusCallback' => status_callback,\n 'StatusCallbackMethod' => status_callback_method,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n ValidationRequestInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end", "title": "" }, { "docid": "21d62198f9fe427802f2034a1fbfacbb", "score": "0.5314119", "text": "def create_forwarding_address(\n destination,\n callback_url: nil,\n enable_confirmations: false,\n mining_fees_satoshis: nil\n )\n payload = {\n destination: destination,\n callback_url: callback_url,\n enable_confirmations: enable_confirmations,\n mining_fees_satoshis: mining_fees_satoshis\n }\n api_http_post('/payments', json_payload: payload)\n end", "title": "" }, { "docid": "f609faa0842605eb35df7f01e5433364", "score": "0.53092194", "text": "def call\n # Rails.logger.info \"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#{params[:ph_no]}\"\n #@client_name = params[:client]\n meeting = Meeting.find(params[:meeting_id])\n @receiver = meeting.receiver\n @caller = meeting.caller\n @client_name = @caller.name\n Rails.logger.info \"##########ddfdfdfdf#{@client_name}#########\"\n # Rails.logger.info \"top #{@client_name}\"\n if @client_name.nil?\n @client_name = $default_client\n end\n # @client_phone = params[:ph_no]\n # Find these values at twilio.com/user/account\n account_sid = 'AC1e7ff5d3ece16ab5ad2f63f7e201cb00'\n auth_token = 'cb902e68e940a3457383b6c813ab68f1'\n capability = Twilio::Util::Capability.new account_sid, auth_token\n # Create an application sid at twilio.com/user/account/apps and use it here\n capability.allow_client_outgoing \"AP8270d0631a20c1edddf407e99299eca6\"\n #capability.allow_client_incoming @client_name\n capability.allow_client_incoming @client_name\n Rails.logger.info \"botom #{@client_name}\"\n @token = capability.generate\n end", "title": "" }, { "docid": "8e67e255ddb2001690f7640b5ad19600", "score": "0.53011477", "text": "def create\n @call2 = Call2.new(params[:call2])\n\n respond_to do |format|\n if @call2.save\n format.html { redirect_to @call2, notice: 'Call2 was successfully created.' }\n format.json { render json: @call2, status: :created, location: @call2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call2.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a25da1c0e3cb28f8014d4f84e9d26b44", "score": "0.5299711", "text": "def create_phone_verification()\n path = '/account/verification/phone'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'POST',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Token\n )\n end", "title": "" }, { "docid": "c9307a5a7490146475ad380a8246547e", "score": "0.52982765", "text": "def create_incomingphone_viewnumber(phone_number)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/viewnumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'PhoneNumber' => phone_number\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "b009f5a5beb10652ca83e64d6dd31614", "score": "0.5269779", "text": "def create\n if signed_in? && current_user.role_id == 2\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render action: 'show', status: :created, location: @call }\n else\n format.html { render action: 'new' }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n else\n restricted_access\n end\n end", "title": "" }, { "docid": "0c2971a1b35e79c01fd39396ec78ea4c", "score": "0.5262477", "text": "def action\n response = \\\n case params['Digits']\n when '1'\n Twilio::TwiML::VoiceResponse.new do |r|\n r.dial(action: calls_complete_url) do |dial|\n dial.number('+33 7 50 33 25 63')\n end\n end\n when '2'\n Twilio::TwiML::VoiceResponse.new do |r|\n r.say t('calls.messages.record')\n r.record(timeout: 10, transcribe: true, action: calls_complete_url)\n end\n else\n Twilio::TwiML::VoiceResponse.new do |r|\n r.redirect calls_handle_url, method: :post\n end\n end\n\n render xml: response\n end", "title": "" }, { "docid": "a51142d92111a87b6851d1008bd6d2f4", "score": "0.5254234", "text": "def create\n @port_call = PortCall.new(port_call_params)\n\n respond_to do |format|\n if @port_call.save\n format.html { redirect_to @port_call, notice: 'Port call was successfully created.' }\n format.json { render :show, status: :created, location: @port_call }\n else\n format.html { render :new }\n format.json { render json: @port_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0b65d697975ff842a1a8bed35fdc4cd", "score": "0.5249134", "text": "def create\n\t\taccount_sid = ENV['TWILIO_API_ACCOUNTSID']\n\t\tauth_token = ENV['TWILIO_AUTHTOKEN']\n\n\t\tbegin\n\t\t\t\n\t\t\t@client = Twilio::REST::Client.new account_sid, auth_token\n\n\t\t\tfrom = ENV['TWILIO_PHONE_NUMBER']\n\t\t\t\n\t\t\tbody = \"Just a quick reminder that you still have my crap. With Love: #{current_user.username}\"\n\n\t\t\t@to = \"+1\" + params[:phone]\n\t\t\t\n\t\t\t# Attempting to clean up number.\n\n\t\t\t@to.gsub(/[ .,-]/, \"\")\n\t\t\t\n\n\t\t\tmessage = @client.account.messages.create(\n\t\t\t\t:from => from,\n\t\t\t\t:to => @to,\n\t\t\t\t:body => body \n\t\t\t\t) \n\t\t\t\n\t\t\tredirect_to profile_path(current_user.id), notice: \"Message Sent!\"\n\t\t\t\n\t\t\tend\n\n\t\t# If the message doesn't send return the error message to the console.\n\t\t# Redirect to the user's profile.\n\n\t\trescue Twilio::REST::RequestError => e\n\n\t\t\tputs e.message\n\n\t\t\tredirect_to profile_path(current_user.id), alert: \"Message not sent.\"\n\tend", "title": "" }, { "docid": "c46046ba3b830b18abb3ad89c6e89cf6", "score": "0.52465224", "text": "def create_incomingphone_massreleasenumber(phone_number)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/incomingphone/massreleasenumber.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'PhoneNumber' => phone_number\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "44e7792fb5862c50d9c67320f51dad45", "score": "0.52258366", "text": "def create\n\t\t@sip_gateway = SipGateway.new(params[:sip_gateway])\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @sip_gateway.save\n\t\t\t\tformat.html { redirect_to( @sip_gateway, :notice => t(:sip_gateway_was_created) ) }\n\t\t\t\tformat.xml { render :xml => @sip_gateway, :status => :created, :location => @sip_gateway }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @sip_gateway.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "43023b8280275439231c962739873dc0", "score": "0.5225759", "text": "def dial\n validate\n if errors.blank?\n Sipgate.instance.voice_call(origin, destination)\n else\n { :status_code => 407, :status_string => 'Invalid parameter value.' }\n end\n end", "title": "" }, { "docid": "63765e1fe22be3b14fce6e856683b81f", "score": "0.5211849", "text": "def send_verification_code_call(dst_number)\n code = rand(999_999)\n @client.calls.create(\n @app_number,\n [dst_number],\n \"https://twofa-answerurl.herokuapp.com/answer_url/#{code}\"\n )\n code\n rescue PlivoRESTError => e\n puts 'Exception: ' + e.message\n end", "title": "" }, { "docid": "8001bb3e4bf30ca844a7305b317395b0", "score": "0.5211725", "text": "def to_phone(options = {})\n number_to_phone(self.to_i, options)\n end", "title": "" }, { "docid": "7802db1d3c36634b88457016c6f74f3f", "score": "0.52086437", "text": "def create\n @outgoing_caller_id = OutgoingCallerId.new(params[:outgoing_caller_id])\n @outgoing_caller_id.status = 'init'\n\n respond_to do |format|\n if @outgoing_caller_id.save\n url = \"#{@request_url}/outgoing_caller_ids/#{ @outgoing_caller_id.id}/status_update\"\n response = @twilio_client.account.outgoing_caller_ids.create(\n phone_number: @outgoing_caller_id.phone_number,\n status_callback: url,\n friendly_name: @outgoing_caller_id.friendly_name,\n call_delay: 5\n )\n \n @outgoing_caller_id.update_attribute :validation_code, response.validation_code\n format.html { redirect_to @outgoing_caller_id, notice: \"Outgoing caller was successfully created. #{url}\" }\n format.json { render json: @outgoing_caller_id, status: :created, location: @outgoing_caller_id }\n else\n format.html { render action: \"new\" }\n format.json { render json: @outgoing_caller_id.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
7cf3621a65bab1734138d2c20feb07e8
we want this test to run first on an empty table
[ { "docid": "4feed4dcd4903f48e433b84ee7d46292", "score": "0.0", "text": "def test_use_case_foos\n Foo.undo_all = true\n \n foo1_id = Foo.create(:name => 'foo').id\n Foo.find(foo1_id).update_attributes(:name => 'MOO')\n foo_change = Foo.undo_manager.last_operation # remeber this point\n foo2_id = Foo.create(:name => 'bar').id\n foo_destroy_all = Foo.undoable('destroy all foos') { Foo.destroy_all }\n \n # check there's no foos, and that there's 4 undoables in the right order\n assert_equal [], Foo.find(:all)\n assert_equal ['destroy all foos', \"create foo: #{foo2_id}\", \"update foo: #{foo1_id}\", \"create foo: #{foo1_id}\"],\n @foo_manager.undoables.collect {|op| op.description}\n \n # now undo foo_change (undoing all ops in between) and check\n foo_change.undo\n \n assert_equal ['foo'], Foo.find(:all).collect {|r| r.name}\n assert_equal [\"create foo: #{foo1_id}\"], @foo_manager.undoables.collect {|op| op.description}\n assert_equal [\"update foo: #{foo1_id}\", \"create foo: #{foo2_id}\", \"destroy all foos\"],\n @foo_manager.redoables.collect {|op| op.description}\n \n # redo twice (using different idioms) and check\n Foo.undo_manager.redo\n @foo_manager.redo\n assert_equal ['MOO', 'bar'], Foo.find(:all).collect {|r| r.name}\n assert_equal [\"create foo: #{foo2_id}\", \"update foo: #{foo1_id}\", \"create foo: #{foo1_id}\"],\n @foo_manager.undoables.collect {|op| op.description}\n assert_equal ['destroy all foos'], @foo_manager.redoables.collect {|op| op.description}\n \n # make new change (this will destory the currently undone foo_destroy_all operation) and check\n foo3_id = Foo.create(:name => 'woooo').id\n assert_equal ['MOO', 'bar', 'woooo'], Foo.find(:all).collect {|r| r.name}\n assert_equal [\"create foo: #{foo3_id}\", \"create foo: #{foo2_id}\", \"update foo: #{foo1_id}\", \"create foo: #{foo1_id}\"],\n @foo_manager.undoables.collect {|op| op.description}\n assert_equal [], @foo_manager.redoables.collect {|op| op.description}\n \n # try and undo the stale foo_destroy_all operation, it will raise an error and do nothing the the db\n assert_raise(Ardes::UndoOperation::Stale) { foo_destroy_all.undo }\n assert_equal ['MOO', 'bar', 'woooo'], Foo.find(:all).collect {|r| r.name} \n assert_equal [\"create foo: #{foo3_id}\", \"create foo: #{foo2_id}\", \"update foo: #{foo1_id}\", \"create foo: #{foo1_id}\"],\n @foo_manager.undoables.collect {|op| op.description}\n assert_equal [], @foo_manager.redoables.collect {|op| op.description}\n end", "title": "" } ]
[ { "docid": "443a534df312fcb18936a37701e5ae18", "score": "0.73848635", "text": "def test_empty_table\n connection = Connection.new($login_params)\n function = connection.get_function(\"STFC_DEEP_TABLE\")\n fc = function.get_function_call\n it = fc[:IMPORT_TAB]\n it.each {}\n connection.close\n end", "title": "" }, { "docid": "1ae041da6a5071fad546d68f36e47e88", "score": "0.67860883", "text": "def test_isEmpty?\n assert_equal(@table.isEmpty?, true)\n @table.add(IntHash.new(2))\n assert_equal(@table.isEmpty?, false)\n end", "title": "" }, { "docid": "fc41ff870f064a2575942be10fd81e47", "score": "0.67826355", "text": "def test_dont_create_goals_for_empty_table\n goals = Goal.all\n assert_equal 0, goals.size\n @worker.create_goals_for_next_cycle\n goals = Goal.all\n assert_equal 0, goals.size\n end", "title": "" }, { "docid": "b823896426fa9e124bc39ae21f832038", "score": "0.66502243", "text": "def test_empty\n end", "title": "" }, { "docid": "909742a21bbf0dd20882b8918f214d06", "score": "0.6583316", "text": "def before_create_table\n\t\t\t# No-op\n\t\tend", "title": "" }, { "docid": "faa0eb1eccb76f4c2c621a9b254c0e3d", "score": "0.6474688", "text": "def test_table_container\r\n assert_nothing_raised { $ff.table(:id, 't1').html }\r\n end", "title": "" }, { "docid": "032dda161cbf683baf60de88e1343307", "score": "0.6453804", "text": "def fill_tables\n # Filling the table \"Test\"\n # Filling a table: table(\"name\") << [field1, field2 etc...]\n table(\"Test\") << [0, \"A name\", false]\n end", "title": "" }, { "docid": "154bf38cd98a6210e36ee19253da5e90", "score": "0.64352363", "text": "def ensure_table!\n root_class.class_eval do\n @table_created ||= !!self.count\n end\n end", "title": "" }, { "docid": "c4327c6193810db36f9a3c10df0204ed", "score": "0.6431064", "text": "def after_create_table\n\t\t\t# No-op\n\t\tend", "title": "" }, { "docid": "09d38102dd357e2e3aab935d19eb578a", "score": "0.63911647", "text": "def test_existence_of_db_table\n \n end", "title": "" }, { "docid": "a92c741c4a71602203554c3d876125fe", "score": "0.6360475", "text": "def ensure_table_empty (db, log)\n has_rows = check_counts(db, log);\n conn = db.get_conn();\n if has_rows then\n q = \"TRUNCATE TABLE #{DB_TAB}\";\n log.d(q);\n conn.execute(q);\n end\n conn.close();\nend", "title": "" }, { "docid": "baafbe3a1893ab068ee3f9dad1e77621", "score": "0.63526356", "text": "def test_DB_initialization\r\n assert(@fdb.size > 0, \"Database entries not correctly read in\")\r\n end", "title": "" }, { "docid": "5d5c362418df48d55cbb72fd91b357ba", "score": "0.6334655", "text": "def test_DB_initialization\n assert(@fdb.size > 0, \"Database entries not correctly read in\")\n end", "title": "" }, { "docid": "5d5c362418df48d55cbb72fd91b357ba", "score": "0.6334655", "text": "def test_DB_initialization\n assert(@fdb.size > 0, \"Database entries not correctly read in\")\n end", "title": "" }, { "docid": "b14348a9c638624fca113ed7b49be477", "score": "0.6327544", "text": "def ensure_table!\n fail \"Must have active connection\" unless table\n end", "title": "" }, { "docid": "1463e991c9c5c0883e7dda2a07cf3306", "score": "0.6275591", "text": "def test_empty_insert_statement\n DbType.create!\n assert DbType.first\n assert_not_nil DbType.first.id\n end", "title": "" }, { "docid": "0ac8cd4591808212fccc1c1b386f07cb", "score": "0.626371", "text": "def before_table\r\n\t\t\t''\r\n\t\tend", "title": "" }, { "docid": "65c438b1e9bb0dd598d9b00f1ed3e3b4", "score": "0.6255484", "text": "def ensure_table!\n fail \"Must have active connection\" unless table\n end", "title": "" }, { "docid": "107ceab32d468ab0e04bda66b13fba6c", "score": "0.62336427", "text": "def excuteBatchNoArgs\n db=Rho::Database.new(Rho::Application.databaseFilePath('local'), \"local\");\n db.executeBatchSql(\"CREATE TABLE t1(x INTEGER, y TEXT);CREATE TABLE t2(x INTEGER, y TEXT);CREATE TABLE t3(x INTEGER, y TEXT);CREATE TABLE t4(x INTEGER, y TEXT)\")\n puts \"#{db.isTableExist(\"t1\")}\"\n puts \"#{db.isTableExist(\"t2\")}\"\n puts \"#{db.isTableExist(\"t3\")}\"\n puts \"#{db.isTableExist(\"t4\")}\"\n redirect :action => :index\n end", "title": "" }, { "docid": "a25fc4f15cff2020bbad8e18c7b129d4", "score": "0.6219684", "text": "def test_require_sql\n assert_flunked /no queries/ do\n assert_efficient_sql{}\n end\n end", "title": "" }, { "docid": "aec430e0650f88a48d96fa87f53487bc", "score": "0.6198864", "text": "def test_init_records_as_default\n assert_equal 0, AxOrder.count\n AxOrder.init_records\n assert_equal AxOrder::INIT_RECORDS, AxOrder.count\n end", "title": "" }, { "docid": "4d80142ba84b9cf0aaba083ed8ad9f8b", "score": "0.6194379", "text": "def teardown\n @table.reset!\n end", "title": "" }, { "docid": "e98750816dfd196b2840d3948c308d32", "score": "0.6166472", "text": "def empty?\n @table.empty?\n end", "title": "" }, { "docid": "ceef4d652829b8fb5e47237dfe757247", "score": "0.6158999", "text": "def test_create_tables\n assert_nothing_raised {\n @connection.create_table :order do |t|\n t.column :group, :string\n end\n }\n end", "title": "" }, { "docid": "06e85dbf3091acd5a6fab18be7f25524", "score": "0.6150898", "text": "def table\n first\n end", "title": "" }, { "docid": "446b5518b2ed848d6b2c6b9307dfe5c6", "score": "0.61263335", "text": "def initial_setup\n @db.execute(SQL_BUILDING_TABLE)\n @db.execute(SQL_APARTMENTS_TABLE)\n end", "title": "" }, { "docid": "421c5a7d5fcbc1d5f72fba90783a1bfb", "score": "0.61193013", "text": "def prepare_db_for_test\n clear_db_after_test\n ActiveRecord::Migration.create_table :tops, {:force => true}\n end", "title": "" }, { "docid": "a35bab9303221973bee5cece5107347d", "score": "0.6111561", "text": "def empty?\n @table.empty?\n end", "title": "" }, { "docid": "7e3276b15a69419bd90605e9f836c9d0", "score": "0.6099827", "text": "def after_create_table\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "7e3276b15a69419bd90605e9f836c9d0", "score": "0.6099827", "text": "def after_create_table\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "2d3276ae2092344521faed8efcb1b24e", "score": "0.609018", "text": "def test_non_existing_tables\r\n assert_raise(NoMethodError) { @slice.not_existing_tables }\r\n end", "title": "" }, { "docid": "8c7b7eda7fbabe9f264535d873b3f895", "score": "0.6065104", "text": "def before_create_table\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "8c7b7eda7fbabe9f264535d873b3f895", "score": "0.6065104", "text": "def before_create_table\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "d210490e962dcf8307cdd031a877ba79", "score": "0.60422736", "text": "def empty?\n @table.size==0\n end", "title": "" }, { "docid": "a0d125200e8afc569defdb1c430e13d6", "score": "0.60347104", "text": "def before_setup\n # Reset the DB before each test to make a clean slate.\n # I swear this was easier back in like 2012!\n [ShortCode].each do |model|\n ApplicationRecord.connection.execute(\"Delete from #{model.table_name}\")\n ApplicationRecord.connection.execute(\"DELETE FROM SQLITE_SEQUENCE WHERE name='#{model.table_name}'\")\n end\n\n super\n end", "title": "" }, { "docid": "4dcb10bdc625d058a683fc86ef8e4c20", "score": "0.6003461", "text": "def create_tables\n #pre\n assert tables_exist? == false\n\n @db.execute \"CREATE TABLE leaderboard (\n name varchar(64),\n wins int,\n losses int,\n ties int\n );\"\n\n #post\n assert tables_exist?\n end", "title": "" }, { "docid": "de35a06e51ec8fdac465a43345ecb730", "score": "0.6001093", "text": "def empty?\n @table.empty?\n end", "title": "" }, { "docid": "42ccb73890c23c87b8cd24bdfaaf4582", "score": "0.59899276", "text": "def test_non_existing_tables\n assert_raise(NoMethodError) { @slice.not_existing_tables }\n end", "title": "" }, { "docid": "42a8583cdc5a2464b787f1748bc879b3", "score": "0.59698105", "text": "def init\n puts ActiveRecord::Base.connection.tables\n if ActiveRecord::Base.connection.table_exists? 'workers'\n# unless Property.table_exists?\n give_infos(Worker)\n # Systematically dropin the table is not\n # ideal but we won't do this shit during prod\n ActiveRecord::Migration.drop_table(:workers)\n end\n create_table_details\n if ActiveRecord::Base.connection.table_exists? 'cars'\n give_infos(Car)\n ActiveRecord::Migration.drop_table(:cars)\n end\n create_table_cars\n if ActiveRecord::Base.connection.table_exists? 'debts'\n give_infos(Debt)\n ActiveRecord::Migration.drop_table(:debts)\n end\n create_table_debts\n end", "title": "" }, { "docid": "575ad6320d669f1129ed13b1a07d8296", "score": "0.5960847", "text": "def empty?\n @table.nil?\n end", "title": "" }, { "docid": "4467c3be1d5a4c33f6e747553dbe7f01", "score": "0.59277", "text": "def reset!\n @table.clear\n end", "title": "" }, { "docid": "4467c3be1d5a4c33f6e747553dbe7f01", "score": "0.59277", "text": "def reset!\n @table.clear\n end", "title": "" }, { "docid": "4467c3be1d5a4c33f6e747553dbe7f01", "score": "0.59277", "text": "def reset!\n @table.clear\n end", "title": "" }, { "docid": "7214532e009c23580296c1438807ed01", "score": "0.591475", "text": "def test_import_none\n metal.ask \"DELETE FROM alloys\"\n metal.import \"alloys\", []\n expect! metal.ask(\"SELECT COUNT(*) FROM alloys\") => 0\n end", "title": "" }, { "docid": "25e2454cae162b6a7b2487c7925aad03", "score": "0.5906411", "text": "def before_drop_table\n\t\t\t# No-op\n\t\tend", "title": "" }, { "docid": "54410797bb6f47bc2ccbc918a3f80ce7", "score": "0.5905372", "text": "def executeNoArgs\n db =Rho::Database.new(Rho::Application.databaseFilePath('local'), \"local\");\n db.executeSql(\"CREATE TABLE tall(x INTEGER, y TEXT)\") \n val=db.isTableExist(\"tall\")\n puts \"#{val}\"\n redirect :action => :index\n end", "title": "" }, { "docid": "9471b612f1158e844e53d82610cfa323", "score": "0.5895096", "text": "def generate_additional_tables\n # no additional tables\n end", "title": "" }, { "docid": "2ea268a2478d5464525e745a8f917e85", "score": "0.58810836", "text": "def empty_from_sql\n nil\n end", "title": "" }, { "docid": "c2c6c71e5ba9b2220d269ff904e4e8fa", "score": "0.58666617", "text": "def table_exists?; end", "title": "" }, { "docid": "7a5bf1a0c673fd0ab9b936c4e17fdab1", "score": "0.58513343", "text": "def empty_table (db, log, start_with_memberid)\n empty_table_sql = \"TRUNCATE holdings_cluster_htmember_jn\";\n if start_with_memberid != nil then\n empty_table_sql = %W!\n DELETE FROM \n holdings_cluster_htmember_jn \n WHERE \n member_id >= '#{start_with_memberid}'\n !.join(' ');\n end\n conn = db.get_conn();\n log.d(empty_table_sql);\n empty_table_query = conn.prepare(empty_table_sql);\n empty_table_query.execute();\n conn.close();\nend", "title": "" }, { "docid": "dc7f8b999b842ceda64524dd65211805", "score": "0.58460826", "text": "def create_unlogged_tables; end", "title": "" }, { "docid": "4996c111c07d2147cca4add563676313", "score": "0.5842788", "text": "def tables_a1; @tables_a1 ||= nil; end", "title": "" }, { "docid": "b4594798fe5867be21d3e5757f90edda", "score": "0.5842006", "text": "def create_table_clear_test\n begin\n @file_clear=@session.open('CLEAR_TEST')\n rescue\n @session.execute('CREATE.FILE CLEAR_TEST 18 1409 2')\n @file_clear=@session.open('CLEAR_TEST')\n end\nend", "title": "" }, { "docid": "14b191ab632aeb02fc531ac4a3ac0440", "score": "0.5838011", "text": "def after_table\r\n\t\t\t''\r\n\t\tend", "title": "" }, { "docid": "fd8af386884b98b07584acd095938685", "score": "0.5835072", "text": "def table_empty?(table_name)\n quoted = connection.quote_table_name(table_name)\n connection.select_value(\"SELECT COUNT(*) FROM #{quoted}\").to_i.zero?\nend", "title": "" }, { "docid": "1fdc19eafdd49f0d1ab57e79a21e09ca", "score": "0.5828612", "text": "def setup_test_database\n connection = PG.connect(dbname: 'chitter_manager_test')\n # this bit i.e. TRUNCATE clears the things held in peeps.\n connection.exec(\"TRUNCATE peeps;\")\nend", "title": "" }, { "docid": "235e12ee88f70c8379519d2096bf3af0", "score": "0.5807072", "text": "def initialize\n\t\t@on_table = false\n\tend", "title": "" }, { "docid": "dc9b6c049c655bf93b1c5d24ee7d23ed", "score": "0.57924306", "text": "def verify_absence_of_no_flights_tables\n assert_select(\"table[id$=?]\", \"-with-no-flights-table\", {count: 0}, \"This view shall not show a no flights table when not logged in\")\n end", "title": "" }, { "docid": "7944220667b0cacee53cd795330b00c3", "score": "0.5790865", "text": "def assert_table\n if @asserted\n return\n end\n begin\n # Assert the db into existence\n r.db_create(@db).run(@conn)\n rescue RethinkDB::RqlRuntimeError => rre\n unless rre.to_s.include?('already exists')\n raise\n end\n end\n begin\n # We set durability to soft because we don't actually care if\n # the write is confirmed on disk, we just want the change\n # notification (i.e. the message on the queue) to be generated.\n r.table_create(@name, :durability => :soft).run(@conn)\n rescue RethinkDB::RqlRuntimeError => rre\n unless rre.to_s.include?('already exists')\n raise\n end\n end\n @asserted = true\n end", "title": "" }, { "docid": "e136a1a9c04abf3d31476debec73aa2b", "score": "0.57559985", "text": "def populate_users\n create_system_users if User.table_exists? and User.count == 0\nend", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "dbc0e704f7ddd1336aa4e43172ddd6ef", "score": "0.5755261", "text": "def table; end", "title": "" }, { "docid": "b21afecf08bcc7c1446e51eb62532488", "score": "0.57534915", "text": "def test_get_next_ax_order_number_begin_empty_table\n assert_equal \"SO 0000001\", AxOrder.next_ax_order_number\n end", "title": "" }, { "docid": "d812e0d8611a1bfcee8907a10907cd97", "score": "0.5746609", "text": "def after_drop_table\n\t\t\t# No-op\n\t\tend", "title": "" }, { "docid": "bb7615b5d8691fa06a527edd2567ad62", "score": "0.57330084", "text": "def no_table?\n if table\n false\n else\n @status = NO_TABLE\n true\n end\n end", "title": "" }, { "docid": "694fa234e9ca0da26cdf8ac42961226c", "score": "0.5717879", "text": "def test_initialize_creates_empty_array\n\t\tdb = Database.new()\n\t\t# check index[0] is nil\n\t\tassert_equal nil, db.db_array[0]\n\t\t# check db is a database object\n\t\tassert db.is_a?(Database)\n\tend", "title": "" }, { "docid": "3da81979cd934bad3f903e2a50c83c99", "score": "0.5713532", "text": "def create_initial_table_in_database\n if ScraperWiki.show_tables()[\"swdata\"] == nil\n ScraperWiki.sqliteexecute(\"CREATE TABLE 'swdata' ('date_scraped' text, 'description' text, 'info_url' text, 'council_reference' text, 'address' text, 'comment_url' text, 'page_content' text, 'status' text, 'responsible_officer_name' text, 'responsible_officer_property' text)\");\n end\nend", "title": "" }, { "docid": "3da81979cd934bad3f903e2a50c83c99", "score": "0.5713532", "text": "def create_initial_table_in_database\n if ScraperWiki.show_tables()[\"swdata\"] == nil\n ScraperWiki.sqliteexecute(\"CREATE TABLE 'swdata' ('date_scraped' text, 'description' text, 'info_url' text, 'council_reference' text, 'address' text, 'comment_url' text, 'page_content' text, 'status' text, 'responsible_officer_name' text, 'responsible_officer_property' text)\");\n end\nend", "title": "" }, { "docid": "2f92a6e85206e739064e02d886a308e1", "score": "0.57072556", "text": "def test_pstmt_disable\n pend(\"TODO/TBD\") do\n assert false # FIXME\n\n each_connection do |conn|\n create_table conn\n insert conn.table(@table_name)\n\n # Batch-enabled object\n conn.table(@table_name).batch\n\n 10000.times do |i|\n # Should not fail\n t = conn.table(@table_name)\n t.count(\"id = #{i}\")\n end\n\n # OK\n assert true\n end\n end\n end", "title": "" }, { "docid": "bfc2dab8a6edffbc2eb5c2f757977f3f", "score": "0.5705338", "text": "def ignore_tables; end", "title": "" }, { "docid": "fcbaeee5918585e02c57268ac183a16e", "score": "0.5691555", "text": "def truncate_all_tables_once\n unless $truncated_all_tables_once\n $truncated_all_tables_once = true\n print \"truncating tables ... \"\n truncate_all_tables\n puts \"done\"\n end\n end", "title": "" }, { "docid": "3f12a4ed81c75ca3c4f69b2b52be889f", "score": "0.56866395", "text": "def require_table?\n return false\n end", "title": "" }, { "docid": "3f12a4ed81c75ca3c4f69b2b52be889f", "score": "0.56866395", "text": "def require_table?\n return false\n end", "title": "" }, { "docid": "3f12a4ed81c75ca3c4f69b2b52be889f", "score": "0.56866395", "text": "def require_table?\n return false\n end", "title": "" }, { "docid": "3f12a4ed81c75ca3c4f69b2b52be889f", "score": "0.56866395", "text": "def require_table?\n return false\n end", "title": "" }, { "docid": "437babf6d2c7291b058570282f933e66", "score": "0.56845427", "text": "def test_blank\n assert_equal false, @cell_s.blank?\n assert_equal true, @cell_blank.blank?\n end", "title": "" }, { "docid": "e80c6fb6e076197f9101a155f900d7a3", "score": "0.5684382", "text": "def create_initial_table_in_database\n if ScraperWiki.show_tables()[\"swdata\"] == nil\n ScraperWiki.sqliteexecute(\"CREATE TABLE 'swdata' ('date_scraped' text, 'description' text, 'info_url' text, 'council_reference' text, 'address' text, 'comment_url' text, 'page_content' text)\");\n end\nend", "title": "" }, { "docid": "e80c6fb6e076197f9101a155f900d7a3", "score": "0.5684382", "text": "def create_initial_table_in_database\n if ScraperWiki.show_tables()[\"swdata\"] == nil\n ScraperWiki.sqliteexecute(\"CREATE TABLE 'swdata' ('date_scraped' text, 'description' text, 'info_url' text, 'council_reference' text, 'address' text, 'comment_url' text, 'page_content' text)\");\n end\nend", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d", "score": "0.56814235", "text": "def tables; end", "title": "" }, { "docid": "3c3fa430506ccbb4b548c8bde56fc67b", "score": "0.5675623", "text": "def empty_row\n @engine.empty_row self\n end", "title": "" }, { "docid": "329aa4f2426a708c7a70b4809ecbc482", "score": "0.5673738", "text": "def firstRun\n end", "title": "" }, { "docid": "2f8765fb96cdd45454b34b3a772dc58c", "score": "0.56704026", "text": "def create_table1\r\n @sh.client.run \"CREATE TABLE IF NOT EXISTS users (\" +\r\n \" id INT(11) NOT NULL AUTO_INCREMENT,\" +\r\n \" first VARCHAR(255) NOT NULL,\" +\r\n \" last VARCHAR(255) NOT NULL,\" +\r\n \" PRIMARY KEY (id)\" +\r\n \" );\"\r\n end", "title": "" }, { "docid": "9482bfb9dd9a44c6cc6db7514f2fc29f", "score": "0.56698066", "text": "def reset\n self.class.tables.keys.each do |table_name|\n prefixed_name = table_name_prefixed(table_name)\n if @db_connection.table_exists?(prefixed_name)\n @db_connection.drop_table(prefixed_name, cascade: true)\n end\n end\n super if defined?(super)\n setup\n end", "title": "" }, { "docid": "d13ea6115bc943a64b35b42842e7151e", "score": "0.56683725", "text": "def init_table(dbh, tbl_engine)\n begin\n dbh.do(\"DROP TABLE IF EXISTS money\")\n dbh.do(\"CREATE TABLE money (name CHAR(5), amt INT) ENGINE = \" +\n tbl_engine)\n dbh.do(\"INSERT INTO money (name, amt) VALUES('Eve', 10)\")\n dbh.do(\"INSERT INTO money (name, amt) VALUES('Ida', 0)\")\n rescue DBI::DatabaseError => e\n puts \"Cannot initialize test table\"\n puts \"#{e.err}: #{e.errstr}\"\n end\nend", "title": "" }, { "docid": "79305d342dddd37d41ad760479181839", "score": "0.5665506", "text": "def test_table_existence\r\n assert @wait.until {\r\n @browser.find_element(:id, \"booktable\").displayed?\r\n }\r\n end", "title": "" }, { "docid": "3227609b019db5c70521a8f52b3d6c31", "score": "0.56615525", "text": "def setup\n @bigtable = $bigtable\n refute_nil @bigtable, \"You do not have an active bigtable to run the tests.\"\n super\n end", "title": "" }, { "docid": "1019a79005aa7fdaaed6183848a6b8b1", "score": "0.5649001", "text": "def test_aempty\n@t.empty\nassert_equal 0,@t.pending.size\nassert_equal 0,@t.completed.size\nassert_equal 0,@t.list.size\nend", "title": "" }, { "docid": "03929265c8c05cac2f9c70e968965347", "score": "0.56452334", "text": "def setup_db\n without_transaction do\n silence_stream(STDOUT) do\n ActiveRecord::Base.connection.create_table :crud_test_models, :force => true do |t|\n t.string :name, :null => false, :limit => 50\n t.string :password\n t.string :whatever\n t.integer :children\n t.integer :companion_id\n t.float :rating\n t.decimal :income, :precision => 14, :scale => 2\n t.date :birthdate\n t.time :gets_up_at\n t.datetime :last_seen\n t.boolean :human, :default => true\n t.text :remarks\n\n t.timestamps\n end\n end\n ActiveRecord::Base.connection.create_table :other_crud_test_models, :force => true do |t|\n t.string :name, :null => false, :limit => 50\n t.integer :more_id\n end\n ActiveRecord::Base.connection.create_table :crud_test_models_other_crud_test_models, :force => true do |t|\n t.belongs_to :crud_test_model\n t.belongs_to :other_crud_test_model\n end\n\n CrudTestModel.reset_column_information\n end\n end", "title": "" }, { "docid": "2b5f007693cefbb5ad1f8e6976db6d79", "score": "0.5635126", "text": "def setup_test_database\n con = PG.connect(dbname: 'bookmark_manager_test')\n con.exec('TRUNCATE bookmarks;')\nend", "title": "" } ]
ca4cea5b5f039518d080a494ab02469e
Check position value within table length and width also check position values are not less than zero
[ { "docid": "41734bf283f631832546d48b180ee945", "score": "0.6536424", "text": "def is_valid_position?(position)\n position.x < length && position.y < width && position.x >= 0 && position.y >= 0\n end", "title": "" } ]
[ { "docid": "213048d66d3e5e84a88031b872fb003b", "score": "0.78427505", "text": "def valid_position_x?(position)\n position >= 0 && position < @table_width\n end", "title": "" }, { "docid": "fc3d87aff1e99e436a02f46014a5b414", "score": "0.7185546", "text": "def check_position\n boundary = 11 - @length\n if ((@heading == \"h\" && column(@position) > boundary) || (@heading == \"v\" && row(@position) > boundary)) || (column(@position) > 10 || row(@position) > 10)\n false\n else\n true\n end\n end", "title": "" }, { "docid": "622e7437f9cfa384c2ff3161096956f1", "score": "0.7064204", "text": "def validate_position(r, c)\n cell = @table[r, c]\n (r >= 0 && r < @row && c >= 0 && c < @col && !cell.flagged && !cell.discovered)\n end", "title": "" }, { "docid": "673fb5c978b07ba3ea5e6b5d83820131", "score": "0.6992817", "text": "def valid_pos?(pos)\n pos.all? { |coor| coor < rows.size && coor >= 0 }\n end", "title": "" }, { "docid": "d8d99669624511465dce0d3e0cde6244", "score": "0.69300276", "text": "def valid_placement?\n self.x <= @table.x && self.y <= @table.y\n end", "title": "" }, { "docid": "eff75a3c453db4c91ab2d068ebfef151", "score": "0.68377805", "text": "def valid_pos(row, col)\n row >= 0 && row <= 7 && col >= 0 && col <= 7\nend", "title": "" }, { "docid": "19788b3447e6eec63d72e7bd7f8a35ae", "score": "0.68148667", "text": "def xy_within_table?(x_pos, y_pos)\n (0...@table_width).include?(x_pos) && (0...@table_height).include?(y_pos)\n end", "title": "" }, { "docid": "2ba6b375cf0ee6c91f05c06ff8c5feae", "score": "0.6793067", "text": "def placed_on_table?(x, y)\n\t\ttable_range(@width).include?(x) && table_range(@height).include?(y)\n\tend", "title": "" }, { "docid": "6c355482c7c0ef40e0227c55502a93c4", "score": "0.67218465", "text": "def valid_row?(row, col, start_row, table)\n pos_val = table[row][col]\n return false if pos_val == 0\n if(start_row <= 3)\n (start_row .. (start_row + 3)).each do |option_start|\n return false if (( option_start > 6) or (table[row][option_start] == pos_val * -1 ))\n end\n else\n ((start_row - 3) .. start_row).each do |option_start|\n return false if ((option_start < 0) or (table[row][option_start] == pos_val * -1))\n end\n end\n true\nend", "title": "" }, { "docid": "53132a1fbdb79d6c098132eb10a782e3", "score": "0.66955674", "text": "def on_the_table?(position)\n position.between?(START_BOUNDARY, END_BOUNDARY)\n end", "title": "" }, { "docid": "5fbccfb5900a68814265f139d47deea7", "score": "0.66853607", "text": "def next_position_valid?\n return false if table.nil?\n\n table.position_valid?(next_position[:x], next_position[:y])\n end", "title": "" }, { "docid": "d8107cb967b7f3fe01a56b6886f8e839", "score": "0.6623727", "text": "def within_field?(row,col)\n row >= 0 && row < row_count && col >= 0 && col < column_count\n end", "title": "" }, { "docid": "309461ae00dbfa5c87b5b28e968e5f73", "score": "0.6599307", "text": "def validPosition?(line, column)\n\t\treturn line < @lines && line >= 0 && column < @columns && column >= 0\n\tend", "title": "" }, { "docid": "2cfb1cf51669adaa3e170344ff0256eb", "score": "0.6589975", "text": "def valid_position?(x, y)\n x >= 0 && x <= (@rows -1) && y >= 0 && y <= (@columns -1)\n end", "title": "" }, { "docid": "f56ec9558490e952bb0e6ff91a69f660", "score": "0.6573028", "text": "def proper_length?(new_row, new_column)\n delta_row = (new_row - position_row).abs\n delta_col = (new_column - position_column).abs\n (delta_row <= 1) && (delta_col <= 1) \n end", "title": "" }, { "docid": "960f77ceadf0568f8ae546cd9540d6af", "score": "0.6563603", "text": "def valid_coord?(x, y)\n x >= 0 && x < @table.width && y >= 0 && y< @table.width\n end", "title": "" }, { "docid": "2fd2dde8fd7fc9dccf3eb7486f47e14c", "score": "0.6561181", "text": "def valid_pos?(pos)\n return false unless ((pos[0] >= 0) && (pos[0] < @row_num))\n (pos[1] >= 0) && (pos[1] < @col_num)\n end", "title": "" }, { "docid": "e9082ff098b180c13ceb1858a2f93f40", "score": "0.6533927", "text": "def isPlaceed\n\t\t(!(@x.nil?) && !(@y.nil?) && !(@facing.nil?) && @x >= 0 && @x < @@table_width && @y >= 0 && @y < @@table_height)\n\tend", "title": "" }, { "docid": "94e9605f8ec2b3f79164c75be6365162", "score": "0.6516687", "text": "def valid_pos?(pos)\n row,col = pos\n return false if !row.between?(0,7) || !col.between?(0,7)\n true \n end", "title": "" }, { "docid": "0fa2e6b1b9425869f52e326f3ad03748", "score": "0.6484773", "text": "def valid_cell? x, y\n x >= 0 && x < width && y >= 0 && y < height\n end", "title": "" }, { "docid": "6b385e585fc16d0dcc60e7a7d6e24f6b", "score": "0.64732575", "text": "def is_valid?(position)\n\t (position[:x] < 0 || position[:y] < 0 || position[:x] >= @rows || position[:y] >= @cols) ? false : true\n end", "title": "" }, { "docid": "60d0aa89559bd9de3310c4eac7211d09", "score": "0.6372559", "text": "def valid_location?(east, north)\n # This logic determines the width and length of our table\n # east >= 0 && east < @width && north >= 0 && north < @length\n\n # A cleaner way to determine our logic, the spread operator will exclude the value at the end of the range. In our case this is 0-4 (Removing 5). \n (0...@width).cover?(east) && (0...@length).cover?(north)\n end", "title": "" }, { "docid": "337336bac0bacb8de540e05e3f996285", "score": "0.6346372", "text": "def expect_time_slot_to_display_properly(slot, row)\n w, l = calculate_position(slot, @department.department_config)\n expect(row[\"style\"]).to match(/width:\\s*#{w.to_i}.*%\\s*/)\n expect(row[\"style\"]).to match(/left:\\s*#{l.to_i}.*%\\s*/)\n end", "title": "" }, { "docid": "6496c002f3753de309d2223379c39f8b", "score": "0.6318582", "text": "def inside?(position, table)\n (0..table.first).include?(position.first) && (0..table.last).include?(position.last)\n end", "title": "" }, { "docid": "bfe76c9f4900e6127b743ee957bb515b", "score": "0.6296992", "text": "def valid_move?(tablero, indice)\n indice = indice.to_i\n if position_taken?(tablero, indice) && indice >= 0\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "f5bae0d2676fc2ab48fef3c8949704fa", "score": "0.627652", "text": "def valid?(position)\n row, col = position\n position.all? do |i|\n i < @grid.length && i >= 0\n end\n end", "title": "" }, { "docid": "694b61226f0b9a5d9feee3f7eb7f68dc", "score": "0.6273079", "text": "def position_valid?\n pos_valid?(last_word_start - 1) && \n pos_valid?(cursor_column)\n end", "title": "" }, { "docid": "2cbae558f791ebcb2f6510cb4487176b", "score": "0.62690306", "text": "def position_is_valid?(position)\n position.x_coord < @length &&\n position.y_coord < @width &&\n position.x_coord >= 0 &&\n position.y_coord >= 0\n end", "title": "" }, { "docid": "bb589349c96215b0eafcdf15d32e3292", "score": "0.6261652", "text": "def valid_pos?(pos)\n\n row, col = pos\n return false unless (0..7).to_a.include?(row) && (0..7).to_a.include?(col)\n true\n end", "title": "" }, { "docid": "d02778f0c63447bc6ec7c232e73015dc", "score": "0.62554073", "text": "def check_row(position, a, b, value)\n c = 15 - a - b\n # Squares are out of bounds (should not ever happen)\n if a < 1 || a > 9 || b < 1 || b > 9\n puts \"Out of bounds error while checking row #{a} #{b}!\"\n return false\n # Third space is not legal\n elsif c < 1 || c > 9 || c == a || c == b || a == b\n return false\n # Check whether third space has the value we're looking\n elsif position[a] == value && position[b] == value && position[c] == value\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "d02778f0c63447bc6ec7c232e73015dc", "score": "0.62548715", "text": "def check_row(position, a, b, value)\n c = 15 - a - b\n # Squares are out of bounds (should not ever happen)\n if a < 1 || a > 9 || b < 1 || b > 9\n puts \"Out of bounds error while checking row #{a} #{b}!\"\n return false\n # Third space is not legal\n elsif c < 1 || c > 9 || c == a || c == b || a == b\n return false\n # Check whether third space has the value we're looking\n elsif position[a] == value && position[b] == value && position[c] == value\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "8e79e5072d768f6a3c49eed0e260261d", "score": "0.6247381", "text": "def validation_of_user_input\n if @element.between?(1,9) && @row.between?(1,9) && @column.between?(1,9)\n return 1\n else\n return 0\n end\n end", "title": "" }, { "docid": "73ad67e2f851f5aced0f50df527050fe", "score": "0.6246055", "text": "def position_taken?(position)\n !(self.board.cells[position].nil? || self.board.cells[position] == \" \")\n end", "title": "" }, { "docid": "274ed17e2bf9bbc1fc8cb864abf09dda", "score": "0.62374914", "text": "def taken?(position)\n @cells[position.to_i-1] != \" \" && @cells[position.to_i-1] != \"\"\n end", "title": "" }, { "docid": "a7c1231f32a0e1dd9518b5830d3112cc", "score": "0.6203334", "text": "def position_taken?(board,index)\n content=board[index]\n return !(content==NIL || content==\" \" || content==\"\")\nend", "title": "" }, { "docid": "433033a76c354f700b3465e77730781a", "score": "0.6194156", "text": "def is_pos_ok(matrix, pos, number)\n\t!pos.empty? &&\n\tis_col_ok(matrix, pos[0], number) &&\n\tis_row_ok(matrix, pos[0], number) &&\n\tis_small_ok(matrix, pos[0], number)\nend", "title": "" }, { "docid": "ac1c616182fe653c9c3f32d9f25a613c", "score": "0.617652", "text": "def check_curpos #:nodoc:\n # if the cursor is ahead of data in this row then move it back\n # i don't think this is required\n return\n if @pcol+@curpos > @buffer.length\n addcol((@pcol+@buffer.length-@curpos)+1)\n @curpos = @buffer.length \n maxlen = (@maxlen || @width-@internal_width)\n\n # even this row is gt maxlen, i.e., scrolled right\n if @curpos > maxlen\n @pcol = @curpos - maxlen\n @curpos = maxlen-1 \n else\n # this row is within maxlen, make scroll 0\n @pcol=0\n end\n set_form_col \n end\n end", "title": "" }, { "docid": "464c00d70a7de19dc53ab3f4853f7cd3", "score": "0.61733896", "text": "def within_column_limits?(table_cell)\n (table_cell.column_number >= 0) && (table_cell.column_number < @column_count)\n end", "title": "" }, { "docid": "082de2f15eccf69e8879b7a9236981ce", "score": "0.6153166", "text": "def out_of_boundary?(new_row, new_column)\n new_row < 0 || new_row > 7 || new_column < 0 || new_column > 7\n end", "title": "" }, { "docid": "3ba88b377a00fd058ffbb7ff1abc446d", "score": "0.61508477", "text": "def space_valid?(location)\n row = location[0]\n col = location[1]\n row.between?(0,5) and col.between?(0,6)\n end", "title": "" }, { "docid": "5107389f7ee419350ad695a80bb4734d", "score": "0.61490023", "text": "def check_pos(col,row,num)\n mat_num = row / 3 + col / 3\n check_row row, num and check_col col, num and check_mat mat_num, num\n end", "title": "" }, { "docid": "4128b480fd1a2d818d3909badd6b1323", "score": "0.6133984", "text": "def is_valid_position?\n @object_array.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n # Next if:\n # - The cell of the game piece array is 0 (not part of the 'physical' piece)\n # - The cell of the game piece array is 'above' the first row of the tetris board array\n next if cell.zero? || (position_y + y).negative?\n\n # Check if:\n # - Part of the game piece is 'lower' that the bottom of the board\n # - Part of the game piece is outside of the left or right bounds of the tetris board array\n # - Part of the game piece is overlapping another landed piece on the tetris game board\n if position_y + y >= @board.length ||\n (@position[:x] + x).negative? || @position[:x] + x >= @board[0].length ||\n !@board[position_y + y][@position[:x] + x].zero?\n return false\n end\n end\n end\n true\n end", "title": "" }, { "docid": "9327957c317087e0eed3fed3b18533a9", "score": "0.6124987", "text": "def validate_position\n \n end", "title": "" }, { "docid": "9327957c317087e0eed3fed3b18533a9", "score": "0.6124987", "text": "def validate_position\n \n end", "title": "" }, { "docid": "eca3c39af1af6af1ce951fbcc1658dcf", "score": "0.6124422", "text": "def validate_position(row, col)\n if row > MAX_INDEX || col > MAX_INDEX\n puts 'Invalid position.'\n elsif @board[row][col] != EMPTY\n puts 'That position is occupied'\n else\n true\n end\n end", "title": "" }, { "docid": "98cda8b362f564823996f011566c7881", "score": "0.6119207", "text": "def bounds_check\n h = scrollatrow()\n rc = row_count\n #$log.debug \" PRE CURR:#{@current_index}, TR: #{@toprow} RC: #{rc} H:#{h}\"\n @current_index = 0 if @current_index < 0 # not lt 0\n @current_index = rc-1 if @current_index >= rc and rc>0 # not gt rowcount\n @toprow = rc-h-1 if rc > h and @toprow > rc - h - 1 # toprow shows full page if possible\n # curr has gone below table, move toprow forward\n if @current_index - @toprow > h\n @toprow = @current_index - h\n elsif @current_index < @toprow\n # curr has gone above table, move toprow up\n @toprow = @current_index\n end\n #$log.debug \" POST CURR:#{@current_index}, TR: #{@toprow} RC: #{rc} H:#{h}\"\n if @oldrow != @current_index\n #$log.debug \"going to call on leave and on enter\"\n on_leave_row @oldrow if respond_to? :on_leave_row # to be defined by widget that has included this\n on_enter_row @current_index if respond_to? :on_enter_row # to be defined by widget that has included this\n end\n set_form_row\n #set_form_col 0 # added 2009-02-15 23:33 # this works for lists but we don't want this in TextArea's\n @repaint_required = true\n end", "title": "" }, { "docid": "6f904d9141606813767a11b53a6672fa", "score": "0.61166674", "text": "def missing_row_pos; end", "title": "" }, { "docid": "675d8885494688fa4e1ff86df968af72", "score": "0.6112767", "text": "def position_taken?\n board = [nil \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"]\nelse between?\n (0, 8)\nend", "title": "" }, { "docid": "1760b044ed6e014ecc528a35ccd6b51b", "score": "0.61015004", "text": "def position_blank?\n return self.send(position_column).blank?\n end", "title": "" }, { "docid": "7ed50fe30d1200678940b7014004844f", "score": "0.60869145", "text": "def full?\n @cells.none? do | position |\n position == \" \" || position == \"\"\n end\n end", "title": "" }, { "docid": "6c21da23a5eaeb19b0b4d2de5dfb7eca", "score": "0.6082266", "text": "def position_taken?(board, position)\n !(board[position.to_i] == \" \") \nend", "title": "" }, { "docid": "234055df176be8f56f1c85863f439b93", "score": "0.6054383", "text": "def position_taken?(index)\n\n end", "title": "" }, { "docid": "7e46a89f01528165432543699c6f5faf", "score": "0.6052744", "text": "def check_curpos #:nodoc:\n @buffer = @list[@current_index]\n # if the cursor is ahead of data in this row then move it back\n if @pcol+@curpos > @buffer.length\n addcol((@pcol+@buffer.length-@curpos)+1)\n @curpos = @buffer.length \n maxlen = (@maxlen || @width-@internal_width)\n\n # even this row is gt maxlen, i.e., scrolled right\n if @curpos > maxlen\n @pcol = @curpos - maxlen\n @curpos = maxlen-1 \n else\n # this row is within maxlen, make scroll 0\n @pcol=0\n end\n set_form_col \n end\n end", "title": "" }, { "docid": "7a841d0ef0a0dbe6c73ebca8a7d7c217", "score": "0.6051455", "text": "def check_margins(length, edit_posn)\r\n old_margins = [left_margin, right_margin]\r\n\r\n if length < base_width\r\n set_left_margin(0)\r\n elsif edit_posn < left_margin\r\n set_left_margin([edit_posn - scroll_step, 0].max)\r\n elsif edit_posn > right_margin\r\n set_right_margin(edit_posn + scroll_step)\r\n end\r\n\r\n old_margins == [left_margin, right_margin]\r\n end", "title": "" }, { "docid": "00d268c3648a0a001a43bd0e494b331b", "score": "0.6041059", "text": "def position_taken?(index)\r\n !(@board[index].nil? || @board[index] == \" \")\r\nend", "title": "" }, { "docid": "de153188f3de9b95690d489789401f16", "score": "0.60395366", "text": "def within_row_limts?(table_cell)\n (table_cell.row_number >= 0) && (table_cell.row_number < @row_count)\n end", "title": "" }, { "docid": "c3374d0de099514a9618c9a352c09280", "score": "0.603425", "text": "def position_taken?(board, ind)\n board[ind] != \" \"\nend", "title": "" }, { "docid": "39783628076c9c7d02e3fb7d38a70922", "score": "0.6033911", "text": "def position_taken? (index)\n \n @board[index]!= \" \"\n \n end", "title": "" }, { "docid": "733e12bec0f04d4d10877e17da015f96", "score": "0.60327667", "text": "def validate_position(game, r, c)\n (r >= 0 && r < game.row && c >= 0 && c < game.col)\n end", "title": "" }, { "docid": "e36f11853d24fb82e9eaeb12d8bf0751", "score": "0.60049176", "text": "def position_taken?(board, position)\n !(board[position.to_i].nil? || board[position.to_i] == \" \")\nend", "title": "" }, { "docid": "491f666b7ecb78f092fa6fea8a0a4725", "score": "0.6004458", "text": "def valid?(position)\n row, col = position\n (row >= 0 && row < @grid.length) && (col >= 0 && col < @grid[0].length)\n end", "title": "" }, { "docid": "9548d807137839a9265906489a187c1c", "score": "0.6004154", "text": "def position_taken?(board, position)\n index = position.to_i - 1\n (board[index] != \"\" && board[index] != \" \" && board[index] != nil)? true:false\nend", "title": "" }, { "docid": "9548d807137839a9265906489a187c1c", "score": "0.6004154", "text": "def position_taken?(board, position)\n index = position.to_i - 1\n (board[index] != \"\" && board[index] != \" \" && board[index] != nil)? true:false\nend", "title": "" }, { "docid": "8834ccc499614bf49a6409b199756d21", "score": "0.5997037", "text": "def free_pos?(grid)\r\n @board[grid[0]][grid[1]] == \" \"\r\n end", "title": "" }, { "docid": "c57589d1eda936ebfb4ef07187b611aa", "score": "0.5996683", "text": "def position_taken?(board,position)\n board[position] != \" \"\nend", "title": "" }, { "docid": "740d7f7f8a1facc164c487d21641b372", "score": "0.59952915", "text": "def position_taken?(board, index_number)\n if (board[index_number]==\" \") || (board[index_number]==\"\")|| (board[index_number]==nil)\n false\n else\n true\n end\nend", "title": "" }, { "docid": "055b1317cbdc53cdf31b3be39d8319f2", "score": "0.5992656", "text": "def position_taken? (board, index_number)\n board[index_number]!=\" \" && board[index_number]!=\"\" && board[index_number]!=nil\nend", "title": "" }, { "docid": "82b4819e3bd4964750b4eb29cc52f536", "score": "0.5992265", "text": "def position_taken?(board, index)\n cell = board[index]\n cell != \" \" && cell != \"\" && cell != nil\nend", "title": "" }, { "docid": "df9a8134e315232747a2b91e3875e5e2", "score": "0.5991143", "text": "def valid?(pos)\n row, column = pos\n return true if (row < @grid.length && row >=0) && (column < @grid.length && column >= 0)\n false\n end", "title": "" }, { "docid": "cc15155ede4c1dfa8759a74a427d75c3", "score": "0.5990399", "text": "def valid_pos(pos)\n # create function to check valid position\n true\nend", "title": "" }, { "docid": "e39ec5105c18baf51477c74a8e486279", "score": "0.5989666", "text": "def is_small_ok(matrix, pos, number)\n\t!matrix.values_at(* matrix.each_index.select do |i| \n\t\t(i / 9) / 3 == (pos / 9) / 3 && (i % 9) / 3 == (pos % 9) / 3\n\tend).include? number\nend", "title": "" }, { "docid": "0b60acf0557eb069782abb5ccc8c2d33", "score": "0.5986774", "text": "def position_taken?(board, pos)\n empty_space = [\"\", \" \", nil]\n return !empty_space.include?(board[pos])\nend", "title": "" }, { "docid": "e3e9900c675711049b21ab41d16d86a2", "score": "0.5971861", "text": "def position_taken?(index)\r\n @board[index] != \" \"\r\n end", "title": "" }, { "docid": "e5900e4f9433c845424051b0983cffa1", "score": "0.59663165", "text": "def position_taken?(index)\n @board[index] != \" \"\n end", "title": "" }, { "docid": "e5900e4f9433c845424051b0983cffa1", "score": "0.59663165", "text": "def position_taken?(index)\n @board[index] != \" \"\n end", "title": "" }, { "docid": "3fab9e876e6b6735556251b56baa6036", "score": "0.5964307", "text": "def position_taken?(board, i)\n return board[i] != \" \"\nend", "title": "" }, { "docid": "3fab9e876e6b6735556251b56baa6036", "score": "0.5964307", "text": "def position_taken?(board, i)\n return board[i] != \" \"\nend", "title": "" }, { "docid": "94f183789823d5cc2603bd0c9ea9b3bc", "score": "0.5963585", "text": "def position_taken?(position)\n @board[position.to_i] != \" \" && @board[position.to_i] != \"\"\n end", "title": "" }, { "docid": "81e5687d00476135a58da3ffe25a1dc7", "score": "0.5962483", "text": "def position_taken?(index)\n @board[index] != \" \" && @board[index] != \"\" && @board[index] != nil\n end", "title": "" }, { "docid": "81e5687d00476135a58da3ffe25a1dc7", "score": "0.5962483", "text": "def position_taken?(index)\n @board[index] != \" \" && @board[index] != \"\" && @board[index] != nil\n end", "title": "" }, { "docid": "81e5687d00476135a58da3ffe25a1dc7", "score": "0.5962483", "text": "def position_taken?(index)\n @board[index] != \" \" && @board[index] != \"\" && @board[index] != nil\n end", "title": "" }, { "docid": "8b5db68d4607d98ee6b6dca678de3146", "score": "0.5959457", "text": "def position_taken?(index)\n if @board[index] == \" \" || @board[index] == \"\" || @board[index] == nil\n false\n else\n true\n end\n\nend", "title": "" }, { "docid": "6cf252c17f0f5800dc635e8452f02e53", "score": "0.5958301", "text": "def validPos?(pos)\n row, col = pos\n len = @grid.length\n if row < 0 || col < 0 || row >= len || col >= len\n return false\n end\n true\n end", "title": "" }, { "docid": "6043cae6f3c3179a068cc9bcd960099d", "score": "0.5957129", "text": "def position_taken?(board,index)\nif board[index] == \" \" || board[index] == \" \" || board[index] == \" \" || board[index] == \"\" || board[index] == nil\n return false\nelse return true\nend\nend", "title": "" }, { "docid": "07dd9f1e817edefe6827cab8201e65f6", "score": "0.59540796", "text": "def valid?(pos)\n pos.each_index.all? { |i| pos[i] >= 0 && pos[i] < @n }\n end", "title": "" }, { "docid": "ab81ecd2937fe4ff8268a991b8793b13", "score": "0.59537065", "text": "def position_taken?(board, position)\n index = position.to_i - 1\n !(board[index] == \" \" || board[index] == \"\" || board[index] == nil)\nend", "title": "" }, { "docid": "476c6df66ff1a8b3396a6d5d065f4abc", "score": "0.59530306", "text": "def position_taken? (index)\n if @board[index] == \" \" || @board[index] == \"\" || @board[index] == nil\n false\n else\n true\n end\nend", "title": "" }, { "docid": "8e381a81d96f29daeae9ef8f10700d11", "score": "0.59495246", "text": "def position_taken? (board, index)\n index = index.to_i\n board[index] != \" \" && board[index] != nil\nend", "title": "" }, { "docid": "ad12860117001954599a88775c83f127", "score": "0.5947087", "text": "def __find_table_positions__(pdf, max_width)\n pos = PDF::Writer::OHash.new\n x = t = adjustment_width = set_width = 0\n\n max_width.each do |name, w|\n pos[name] = t\n # If the column width has been specified then set that here, also\n # total the width avaliable for adjustment.\n if not @cols[name].nil? and\n not @cols[name].width.nil? and\n @cols[name].width > 0\n t += @cols[name].width\n max_width[name] = @cols[name].width - @gap\n set_width += @cols[name].width\n else\n t += w + @gap\n adjustment_width += w\n set_width += @gap\n end\n end\n pos[:__last_column__] = t\n\n [pos, t, x, adjustment_width, set_width]\n end", "title": "" }, { "docid": "7a5c7130607c807ea231195544ee9ae6", "score": "0.5941193", "text": "def is_row_ok(matrix, pos, number)\n\t!matrix.values_at(* matrix.each_index.select {|i| i / 9 == pos / 9}).include? number\nend", "title": "" }, { "docid": "64f05f2094717738a9668dc10d0e3012", "score": "0.5937122", "text": "def position_taken?(b,i)\n if b[i] == \" \" || b[i] == \"\" || b[i] == nil\n false\n else\n true\n end\nend", "title": "" }, { "docid": "dcdf3e6e66cb75d7b9ab2d947d235b3e", "score": "0.59360474", "text": "def check_curpos #:nodoc:\n @buffer = @list[@current_index]\n # if the cursor is ahead of data in this row then move it back\n if @pcol+@curpos > row_length\n addcol((@pcol+row_length-@curpos)+1)\n @curpos = row_length \n maxlen = (@maxlen || @width-@internal_width)\n\n # even this row is gt maxlen, i.e., scrolled right\n if @curpos > maxlen\n @pcol = @curpos - maxlen\n @curpos = maxlen-1 \n else\n # this row is within maxlen, make scroll 0\n @pcol=0\n end\n set_form_col \n end\n end", "title": "" }, { "docid": "da7e127b201e4bd885bd8c8828c31a30", "score": "0.5934707", "text": "def position_taken?(index)\n if @board[index] == \" \"\n false\n else\n true\n end\n end", "title": "" }, { "docid": "bcb6a08b4ccc71e1a5b03f65b7ce56fe", "score": "0.59316826", "text": "def position_taken?(board, index)\n board[index] != \" \"\nend", "title": "" }, { "docid": "bcb6a08b4ccc71e1a5b03f65b7ce56fe", "score": "0.59316826", "text": "def position_taken?(board, index)\n board[index] != \" \"\nend", "title": "" }, { "docid": "bcb6a08b4ccc71e1a5b03f65b7ce56fe", "score": "0.59316826", "text": "def position_taken?(board, index)\n board[index] != \" \"\nend", "title": "" }, { "docid": "22d798c691d357bb07b5129abf374eb1", "score": "0.5931171", "text": "def position_taken?(index) # T = position taken\n @board[index] != \" \" # F = position not taken\n end", "title": "" }, { "docid": "4467237e0b45973cb647d84ab8b1e35c", "score": "0.59278023", "text": "def position_taken?(board, pos)\n entry = board[pos]\n if pos > board.length\n return false\n else\n entry == \" \" || entry == \"\" || entry == nil \n end\nend", "title": "" }, { "docid": "a82ec25845904039ec8f95407b58aa90", "score": "0.5923403", "text": "def checkBounds(row, col)\n (row >= 0 && row < @size) && (col >= 0 && col < @size)\n end", "title": "" }, { "docid": "7877cd15b08ee079d3b7cafaacee8022", "score": "0.59223866", "text": "def bounds_check\n r,c = rowcol\n @current_index = 0 if @current_index < 0\n @current_index = @content_rows-1 if @current_index > @content_rows-1\n $status_message.value = \"visible #{@prow} , #{@current_index} \"\n unless is_visible? @current_index\n if @prow > @current_index\n $status_message.value = \"1 #{@prow} > #{@current_index} \"\n @prow -= 1\n else\n end\n end\n #end\n check_prow\n $log.debug \"XXX: PAD BOUNDS ci:#{@current_index} , old #{@oldrow},pr #{@prow}, max #{@maxrow} \"\n @crow = @current_index + r - @prow\n @crow = r if @crow < r\n # 2 depends on whetehr suppressborders\n @crow = @row + @height -2 if @crow >= r + @height -2\n setrowcol @crow, nil\n if @oldrow != @prow || @oldcol != @pcol\n @repaint_required = true\n end\n end", "title": "" } ]
8e31e1fdda2f62b254d3caf1e217747b
Calls Attachersave. Called before model save.
[ { "docid": "01e4d8265e7250b1ca0750ec9bddd4d3", "score": "0.5577409", "text": "def sequel_before_save\n save\n end", "title": "" } ]
[ { "docid": "740882d69d372fab9871c3a10b34c5de", "score": "0.6663147", "text": "def saving\n name = @name\n @klass.send(:before_save) do\n logger.info \"[attached] saving #{name}\"\n send(name).save\n end\n end", "title": "" }, { "docid": "1f8410075c7713ba9e7b0b15660b4b73", "score": "0.6572656", "text": "def activerecord_before_save\n save\n end", "title": "" }, { "docid": "40bfed53462d6583e45339203fc4de95", "score": "0.6304152", "text": "def save!(*)\n super.tap do\n changes_applied\n end\n end", "title": "" }, { "docid": "40bfed53462d6583e45339203fc4de95", "score": "0.6304152", "text": "def save!(*)\n super.tap do\n changes_applied\n end\n end", "title": "" }, { "docid": "40bfed53462d6583e45339203fc4de95", "score": "0.6304152", "text": "def save!(*)\n super.tap do\n changes_applied\n end\n end", "title": "" }, { "docid": "dac675a5fca2cda7a0e9f7463e2e290c", "score": "0.6290238", "text": "def save!(*) #:nodoc:\n super.tap do\n @previously_changed = changes\n @changed_attributes.clear\n end\n end", "title": "" }, { "docid": "84f5d0ac42a5e635ad60528e0f228f28", "score": "0.6277174", "text": "def save_attachments\n send_to_attachments(:save)\n end", "title": "" }, { "docid": "773d235e6831cbc1e0c91b3e53eb8f03", "score": "0.62129295", "text": "def save!(*) #:nodoc:\n super.tap do\n @previously_changed = changes\n @changed_attributes.clear\n end\n end", "title": "" }, { "docid": "5b565d9d7ddb8594623fd284aee23419", "score": "0.62039804", "text": "def after_attachment_saved(&block)\n write_inheritable_array(:after_attachment_saved, [block])\n end", "title": "" }, { "docid": "6c7da5e45d1fdb967f53b508fc80cd9f", "score": "0.6195892", "text": "def after_attachment_saved(&block)\n write_inheritable_array(:after_attachment_saved, [block])\n end", "title": "" }, { "docid": "f950ba6233f0c3642055b0a10410ae6e", "score": "0.6146415", "text": "def save_eav_attributes # :nodoc:\n eav_attributes.select { |a| a.changed? }.each do |a|\n if a.new_record?\n a.send( :write_attribute, self_key, self.id )\n end\n\n a.save!\n end\n end", "title": "" }, { "docid": "0e2e8b0c38948bbca1c1fea3d778da51", "score": "0.6133783", "text": "def save!\n save_modified_attributes!\n save_modified_associations!\n true\n end", "title": "" }, { "docid": "3c863a52894b822d333750fa7e17c957", "score": "0.61311334", "text": "def save\n run_callbacks :save do\n persist_models\n end\n end", "title": "" }, { "docid": "0d9f247c7c4052e1870701ff289f0f16", "score": "0.61121315", "text": "def after_save() end", "title": "" }, { "docid": "965c5bc16551fbfe4eba08bc01527fc8", "score": "0.60888386", "text": "def save\n super save\n end", "title": "" }, { "docid": "965c5bc16551fbfe4eba08bc01527fc8", "score": "0.60888386", "text": "def save\n super save\n end", "title": "" }, { "docid": "5696f94554e843d7040925f199dbbe58", "score": "0.608574", "text": "def activerecord_after_save\n finalize\n persist\n end", "title": "" }, { "docid": "d0accfd9790866759358bef8e12015db", "score": "0.60711336", "text": "def attachment(*)\n super\n after_save :save_attachments\n before_destroy :destroy_attachments\n end", "title": "" }, { "docid": "3cbaf973774133d56e2c7a6a8db43d56", "score": "0.602654", "text": "def after_save(attrs)\n end", "title": "" }, { "docid": "b055e1c23ca369d35bb91742156eb0b8", "score": "0.6005374", "text": "def before_save\n # runs before update\n end", "title": "" }, { "docid": "305edc68d2fd7ec6db8277612ab36b4b", "score": "0.5986973", "text": "def save_modified_eav_attributes\n return if @save_eav_attr.nil?\n @save_eav_attr.each do |s|\n model, attribute_name = s\n related_attribute = find_related_eav_attribute(model, attribute_name)\n unless related_attribute.nil?\n if related_attribute.send(eav_options[model.name][:value_field]).nil?\n eav_related(model).delete(related_attribute)\n else\n related_attribute.save\n end\n end\n end\n @save_eav_attr = []\n end", "title": "" }, { "docid": "833207bdd6eca47faf0f1c4c355106a7", "score": "0.59781593", "text": "def save(*) #:nodoc:\n if status = super\n @previously_changed = changes\n @changed_attributes.clear\n end\n status\n end", "title": "" }, { "docid": "b4a91800f5f76ecb894e3870177ccb78", "score": "0.5955788", "text": "def save(*) #:nodoc:\n if status = super\n @previously_changed = changes\n @changed_attributes = {}\n end\n status\n end", "title": "" }, { "docid": "005181680da5e990412e5ad7db12d695", "score": "0.59512454", "text": "def save_logic( defer=false, mask_exception = true )\n encode_attachments if self[:_attachment] \n ensure_id\n if defer\n database.add_to_bulk_cache( self )\n else\n # clear any bulk saving left over ...\n database.bulk_save if database.bulk_cache.size > 0\n if mask_exception\n save_now\n else\n save_now( false )\n end \n end \n end", "title": "" }, { "docid": "67205148a34da8f8bc79dd41f28babd4", "score": "0.59168726", "text": "def before_save() end", "title": "" }, { "docid": "67205148a34da8f8bc79dd41f28babd4", "score": "0.59168726", "text": "def before_save() end", "title": "" }, { "docid": "34503bfdabe557d4e6498ab53c4fad47", "score": "0.59056306", "text": "def mongoid_before_save\n return unless changed?\n\n save\n end", "title": "" }, { "docid": "8f531e12c1d82946cb647a72da22ad88", "score": "0.58987343", "text": "def save(*)\n saved = super\n remove_destroyables\n saved\n end", "title": "" }, { "docid": "8f531e12c1d82946cb647a72da22ad88", "score": "0.58987343", "text": "def save(*)\n saved = super\n remove_destroyables\n saved\n end", "title": "" }, { "docid": "77208c662581ebfdec4ed1a12a815efc", "score": "0.58885676", "text": "def save\n super\n reset_changes\n end", "title": "" }, { "docid": "0684ccccb2fe7f5a6667d3cefd26f48f", "score": "0.5877288", "text": "def save(*) #:nodoc:\n if status = super\n @previously_changed = changes\n @changed_attributes.clear\n end\n status\n end", "title": "" }, { "docid": "9770f3b69c36f96de331712d1b9d2212", "score": "0.58770245", "text": "def save_if_changed\n save if changed?\n end", "title": "" }, { "docid": "b830b374a4bb8bcd05b4e82bdea96af9", "score": "0.5872092", "text": "def save!\n raise RecordNotSaved, errors.full_messages.to_sentence unless valid?\n\n run_callbacks :save do\n persist! && _parent.save!\n end\n end", "title": "" }, { "docid": "0fd16d31e815750e50d83375f36d09dc", "score": "0.5863764", "text": "def after_save\n \n end", "title": "" }, { "docid": "945d406a8f2a8cb1fbb2070817889949", "score": "0.5857049", "text": "def did_save; end", "title": "" }, { "docid": "8f69718924557489a0b5eeffe8d6f0e6", "score": "0.58551615", "text": "def save!\n save_parents && save_self && save_children\n end", "title": "" }, { "docid": "20172833671c2efbd2798e11af0b151e", "score": "0.58458364", "text": "def save_attached_files; end", "title": "" }, { "docid": "20172833671c2efbd2798e11af0b151e", "score": "0.58458364", "text": "def save_attached_files; end", "title": "" }, { "docid": "20172833671c2efbd2798e11af0b151e", "score": "0.58458364", "text": "def save_attached_files; end", "title": "" }, { "docid": "20172833671c2efbd2798e11af0b151e", "score": "0.58458364", "text": "def save_attached_files; end", "title": "" }, { "docid": "4052c52260d326c7b4ef9030ab86f00d", "score": "0.5839639", "text": "def process_attachment\n @saved_attachment = save_attachment?\n end", "title": "" }, { "docid": "75776b01afc2f274a1cf0de213df261d", "score": "0.5834564", "text": "def attach(*attachables)\n record.public_send(\"#{name}=\", blobs + attachables.flatten)\n if record.persisted? && !record.changed?\n return if !record.save\n end\n record.public_send(\"#{name}\")\n end", "title": "" }, { "docid": "e554fa81bae2d08e99de71f658ccd85d", "score": "0.58179873", "text": "def save\n _save\n end", "title": "" }, { "docid": "4bef560cbf1df56cf46a2491a1d56484", "score": "0.5813152", "text": "def save\n _save(true)\n end", "title": "" }, { "docid": "42bfaa009fd2e0947b22fce9ac2fd047", "score": "0.58026886", "text": "def save\n Mara.instrument('model.save', model: self) do\n next false unless valid?\n\n Mara::Batch.save_model(to_item)\n end\n end", "title": "" }, { "docid": "a8cf6471c5d450d61225f0de08bed26d", "score": "0.5787659", "text": "def mark_as_persisted!; end", "title": "" }, { "docid": "53eeebabf5cfce4b5cdfadf55fe6a5c5", "score": "0.5778402", "text": "def mongoid_after_save\n return unless changed?\n\n finalize\n persist\n end", "title": "" }, { "docid": "428b0ffb575a536bb657a6237552c3eb", "score": "0.57761365", "text": "def save(*) #:nodoc:\n status = super\n changes_applied\n status\n end", "title": "" }, { "docid": "bd7919693ba12a04de44dd507c67af63", "score": "0.57722026", "text": "def save_changes\n self.save!\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "14ffd5116ca8c4041256c2a31f38b066", "score": "0.57512456", "text": "def save()\n super\n end", "title": "" }, { "docid": "f383b58de691cac214ecf5277f0b0aa4", "score": "0.5749831", "text": "def before_save\n \n end", "title": "" }, { "docid": "65d16449ad322eb7f71eaa0b4a6e4c53", "score": "0.57439995", "text": "def save\n @associations.values.each { |a| a._save }\n end", "title": "" }, { "docid": "207f5af97baf4c1f6732ab98a0340694", "score": "0.57416785", "text": "def will_save; end", "title": "" }, { "docid": "207f5af97baf4c1f6732ab98a0340694", "score": "0.57416785", "text": "def will_save; end", "title": "" }, { "docid": "fb35e04dd141acaa742854e99e251957", "score": "0.5740561", "text": "def save!\n run_policies :before_nested_model_ops\n perform_nested_model_ops!\n run_policies :before_model_save\n model.save!\n end", "title": "" }, { "docid": "8a66b371b9b6c77107f35fe037475e8a", "score": "0.57308096", "text": "def save!\n metadata.save\n pull_hook :on_save\n self.load\n end", "title": "" }, { "docid": "8a66b371b9b6c77107f35fe037475e8a", "score": "0.57308096", "text": "def save!\n metadata.save\n pull_hook :on_save\n self.load\n end", "title": "" }, { "docid": "0d91d83a7c4c0f8922ab2c1b47393eec", "score": "0.5708186", "text": "def on_before_save(&block)\n @on_before_save << block\n self\n end", "title": "" }, { "docid": "0d91d83a7c4c0f8922ab2c1b47393eec", "score": "0.5708186", "text": "def on_before_save(&block)\n @on_before_save << block\n self\n end", "title": "" }, { "docid": "504e21618894a46c43edd6d160572d4c", "score": "0.5695693", "text": "def after_process_attachment\n if @saved_attachment\n save_to_storage\n update_thumbnails\n callback_with_args :after_attachment_saved, nil\n end\n end", "title": "" }, { "docid": "11643e1a2d12fa1ec8d693479f8b633e", "score": "0.5693802", "text": "def save!(opts={})\n save_modified_attributes!(opts)\n save_modified_associations!\n true\n end", "title": "" }, { "docid": "2dd6f6cf4381d92bc509bf8ff1fcdc0e", "score": "0.5683101", "text": "def save_orig_values\n #self.orig_source = self.source # if self.has_attribute?(:source)\n self.orig_add_watermark = self.add_watermark if self.has_attribute?(:add_watermark)\n end", "title": "" }, { "docid": "629192988bec8faeb65312d2de275b4b", "score": "0.5673713", "text": "def save\n super\n end", "title": "" }, { "docid": "14933f67b2dc2cf07940ee69906459e7", "score": "0.56659853", "text": "def after_save\n end", "title": "" }, { "docid": "31ba780d20184e89f43def44f846a54c", "score": "0.5663406", "text": "def after_save_propagation\n # stuff\n end", "title": "" }, { "docid": "1a49bb60b0f8eaeac6bf4669d0ec952e", "score": "0.5660043", "text": "def save!\n self.class.created_val(self)\n end", "title": "" }, { "docid": "4be7484346e5b0a5c0380f287231730c", "score": "0.56571263", "text": "def before_save; end", "title": "" }, { "docid": "8b6073dc811b9512c7c38452323b8034", "score": "0.5647575", "text": "def attach(attachable)\n record.public_send(\"#{name}=\", attachable)\n if record.persisted? && !record.changed?\n return if !record.save\n end\n record.public_send(\"#{name}\")\n end", "title": "" }, { "docid": "9e557cd7e054bfa3f1f758684a4bf3cb", "score": "0.56452453", "text": "def before_save( event)\n # * remember the changes made to this model\n @_changes = event.changes\n end", "title": "" }, { "docid": "a571aeb1caa3aa389e99ffb4e2727f92", "score": "0.5626138", "text": "def reflect_on_all_autosave_associations; end", "title": "" }, { "docid": "507ffbb9b29cbccbf2c0f019f77b5bfb", "score": "0.56231934", "text": "def save\n return false unless valid?\n before_save \n successful = super\n after_save if successful\n successful\n end", "title": "" }, { "docid": "bed5a78d1682460d2472632065b6e004", "score": "0.5618411", "text": "def add_autosave_association_callbacks(reflection); end", "title": "" }, { "docid": "e51a80d38603a2ea81fd972fdf6ce5d4", "score": "0.5607164", "text": "def attachments_attributes=(value)\n @attachments_attributes = value\n collect_files_for_deletion_and_update(value)\n end", "title": "" }, { "docid": "aca52100a0ae677212c2946c9a6dcc3b", "score": "0.5605434", "text": "def save!\n _save(false)\n end", "title": "" }, { "docid": "830c5f569457322e3e1dcebc0583d141", "score": "0.56009287", "text": "def attachment_attributes=(attachment_attributes)\n attachment_attributes.each do |attributes|\n attachment.build(attributes)\n end\nend", "title": "" }, { "docid": "977a1b907f6cc220d79cb1a883366fd4", "score": "0.55939794", "text": "def save!\n if new_record?\n _run_create_callbacks { _run_save_callbacks { _save! } }\n else\n _run_save_callbacks { _save! }\n end\n end", "title": "" }, { "docid": "58b3123867bb8a650f4c883dbdbf24b6", "score": "0.55935097", "text": "def save \n @saved = true\n end", "title": "" }, { "docid": "a446d916252f5c0cf7b579962d5e71a1", "score": "0.5586142", "text": "def attach; end", "title": "" }, { "docid": "a446d916252f5c0cf7b579962d5e71a1", "score": "0.5586142", "text": "def attach; end", "title": "" }, { "docid": "a4a4e29b2846e0d1fbf8eae829f0904d", "score": "0.55855715", "text": "def persist\n if current_file.new_record?\n file_set.save\n else\n current_file.save\n end\n end", "title": "" }, { "docid": "9c6dc3db1a744cc497564865ba33a71f", "score": "0.5581144", "text": "def save\n self.class.save(self)\n end", "title": "" }, { "docid": "c5e2c8bc867e9b36345f16ae090d2fd8", "score": "0.5581041", "text": "def before_save\n end", "title": "" }, { "docid": "6e781e61767b686043a946e281c758a7", "score": "0.55809236", "text": "def before_save\n # runs before create\n end", "title": "" }, { "docid": "58812278801d41239d7aeaf5138ba679", "score": "0.5580233", "text": "def after_save\n children.map(&:after_save)\n super\n end", "title": "" }, { "docid": "ad8cc28ba5aadd71936d541996dd11d4", "score": "0.557647", "text": "def post_persist\n reset_persisted_descendants\n reset_attributes_before_type_cast\n move_changes\n end", "title": "" }, { "docid": "7dfbe95e79278e152d04668f902a381d", "score": "0.557326", "text": "def autosave; end", "title": "" }, { "docid": "dc1b41717b5d587f7d4b4c523e09dfd1", "score": "0.5539569", "text": "def save_modified_custom_field_attributes\n return if @save_attrs.nil?\n @save_attrs.each do |s|\n if s.value.nil? || (s.respond_to?(:empty) && s.value.empty?)\n s.destroy if !s.new_record?\n else\n s.save\n end\n end\n @save_attrs = []\n end", "title": "" }, { "docid": "a5f754ad6181e8b4fda10d391baeb48f", "score": "0.55349183", "text": "def after_save_callback\n end", "title": "" }, { "docid": "056a74a7064366a2d01ceffc41c9e883", "score": "0.5534192", "text": "def after_save\n end", "title": "" }, { "docid": "d7923f3194db551d310a3aafadff9dc4", "score": "0.5529497", "text": "def after_update\r\n\t\t\tself.children.each do |child|\r\n\t\t\t\tchild.path = self.path + '/' + child.filename\r\n\t\t\t\tchild.save\r\n\t\t\tend\r\n\t\tend", "title": "" }, { "docid": "7b35d32fe71f4c809041c229fa3c911d", "score": "0.55220526", "text": "def save(attrs = {}, _path = nil)\n super(attrs, _path)\n end", "title": "" }, { "docid": "2d14d77e23a9ebc87b8ecf48a5d2f037", "score": "0.5521378", "text": "def save\n\t\tsuper\n\tend", "title": "" }, { "docid": "e4c029b4544db45e6dc33aa63552cf5d", "score": "0.55080336", "text": "def save_parent\n parent.save! unless parent_saved?\n end", "title": "" } ]
1f6d5a57282d2f4815a2c330d1ec52f5
The fragment component for this URI.
[ { "docid": "ac2ce867945034df6d080d71deec55f1", "score": "0.6469275", "text": "def fragment; end", "title": "" } ]
[ { "docid": "816ba268c90b26a165080d73a58ba3d6", "score": "0.79302406", "text": "def fragment\n return @fragment\n end", "title": "" }, { "docid": "816ba268c90b26a165080d73a58ba3d6", "score": "0.79302406", "text": "def fragment\n return @fragment\n end", "title": "" }, { "docid": "141ac6805dc4b598f3cc92f88e81b767", "score": "0.7810866", "text": "def uri_fragment\n @uri.fragment || self.class.default_template_ref(self)\n end", "title": "" }, { "docid": "1b2b4a5f58515e7cdae7cc5696a853be", "score": "0.74790096", "text": "def fragment; self[:fragment] end", "title": "" }, { "docid": "fc058208f31fb2cc0f98bb5b675ab1d3", "score": "0.69410723", "text": "def fragment_name; end", "title": "" }, { "docid": "fc058208f31fb2cc0f98bb5b675ab1d3", "score": "0.69410723", "text": "def fragment_name; end", "title": "" }, { "docid": "fc058208f31fb2cc0f98bb5b675ab1d3", "score": "0.69410723", "text": "def fragment_name; end", "title": "" }, { "docid": "fc058208f31fb2cc0f98bb5b675ab1d3", "score": "0.69410723", "text": "def fragment_name; end", "title": "" }, { "docid": "be6540a80469dabdb9830b1c66dba097", "score": "0.6844136", "text": "def fragment_code\n @dataset_uri.hash\n end", "title": "" }, { "docid": "be6540a80469dabdb9830b1c66dba097", "score": "0.6844136", "text": "def fragment_code\n @dataset_uri.hash\n end", "title": "" }, { "docid": "89fe31f944a5f8e6b3a55b14f4b82e30", "score": "0.6800713", "text": "def fragment_code\n self.dataset_uri.hash\n end", "title": "" }, { "docid": "6281740c4e831f64da3cd34ab49e3883", "score": "0.6783758", "text": "def full_uri_for(fragment)\n case fragment\n when /^http:\\/\\//\n # The fragment is a complete URI\n fragment\n when /^\\//\n # The fragment is relative to the root of this host\n host_uri + fragment\n else\n # The fragment is relative to this directory\n relative_uri + fragment\n end\n end", "title": "" }, { "docid": "66ecb331e393af63aaae8addc9788e78", "score": "0.6746274", "text": "def url_fragment(url)\n (encode_and_parse_url(url).fragment || '').sub(/^\\!/, '')\n end", "title": "" }, { "docid": "866321e0572f1570c3eca8886ce1333d", "score": "0.6582567", "text": "def path\n [@uri.path, @uri.fragment].compact.join(\"#\")\n end", "title": "" }, { "docid": "03d31815ef24a373e547fd49039deb01", "score": "0.64036685", "text": "def name\n \"#document-fragment\"\n end", "title": "" }, { "docid": "7ef550d3ac34f2b3fb198da0eec9b194", "score": "0.63958186", "text": "def name\n '#document-fragment'\n end", "title": "" }, { "docid": "6a9f3e5e64043227d29d1a12c5bbefca", "score": "0.62731844", "text": "def collection_uri_fragment(uri)\n \"/#{uri_components(uri)[0]}\" rescue nil\n end", "title": "" }, { "docid": "329d70343ef0efc8bc838ace5d771421", "score": "0.6256022", "text": "def fragment\n context.fragments.detect { |f| f.identifier == identifier } ||\n context.fragments.build(identifier: identifier)\n end", "title": "" }, { "docid": "cf17ccc72fac4426e45418262a8b5a1c", "score": "0.62344056", "text": "def normalized_fragment; end", "title": "" }, { "docid": "cf17ccc72fac4426e45418262a8b5a1c", "score": "0.62344056", "text": "def normalized_fragment; end", "title": "" }, { "docid": "6bbaba18c7ecc6cc50840e58175b8adc", "score": "0.5949456", "text": "def display\n part = \"#{@uri.path}#{@uri.query}#{@uri.fragment}\"\n part = @uri.to_s if part.empty?\n return part\n end", "title": "" }, { "docid": "cecc40ccbac616f21e82b4420addfd87", "score": "0.59235233", "text": "def to_path_fragment() end", "title": "" }, { "docid": "9edb1269f1ffbf0777d36357d69db262", "score": "0.5902799", "text": "def path(fragment)\n File.join root, fragment\n end", "title": "" }, { "docid": "512bd3d96bc497ba0f170e3c905120f7", "score": "0.5876008", "text": "def fragment_id(jid, node)\n id = Digest::SHA1.hexdigest(\"#{node.name}:#{node.namespace.href}\")\n \"#{jid}-#{id}\"\n end", "title": "" }, { "docid": "bc1060cc85554f0541f3d4eb0e3dbd19", "score": "0.5830802", "text": "def fragment=(v); self[:fragment]=v end", "title": "" }, { "docid": "c002b5accc804c439624ecbd0f09ae04", "score": "0.58137727", "text": "def fragment_for(*args)\n Fragment.for(*args)\n end", "title": "" }, { "docid": "2cd51d0b1039da6a8d682fbc84fa7560", "score": "0.58127624", "text": "def local_fragment_key\n name\n end", "title": "" }, { "docid": "7cdfbeff8cbd6233c800dba2a95ca954", "score": "0.5807476", "text": "def url_fragment_for_tab(tab)\n url_fragment_for(\"#{param_name}=#{tab.name}\")\n end", "title": "" }, { "docid": "e91345f46429e5fa462e982b1b7a7be8", "score": "0.5792995", "text": "def fragment(*args, &block)\n Loofah::HTML::DocumentFragment.parse(*args, &block)\n end", "title": "" }, { "docid": "f73b22c8e116b3f1aa49fb5411a566c6", "score": "0.5782006", "text": "def url_for(fragment)\n fragment = \"/#{fragment}\" unless fragment[0,1] == '/'\n \"#{request.script_name}#{fragment}\"\n end", "title": "" }, { "docid": "4470c290226e8f797a19d5950a254172", "score": "0.5779095", "text": "def nodeName\n \"#document-fragment\"\n end", "title": "" }, { "docid": "eeb6d9cb8a8f65067d7d9eb3982fb3dc", "score": "0.5752979", "text": "def fragment\n @fragment ||= Query::Fragment.new \"#{name}Fields\".to_sym, schema_type.to_sym, selection\n end", "title": "" }, { "docid": "441454761d184e93315243f00e1b3868", "score": "0.5736322", "text": "def parse_fragment_definition\n expect_keyword('fragment')\n ASTNode.new(kind: Kinds::FRAGMENT_DEFINITION, params: {\n name: parse_fragment_name,\n type_condition: (expect_keyword('on') && parse_named_type),\n directives: parse_directives(false),\n selection_set: parse_selection_set\n })\n end", "title": "" }, { "docid": "b7fbbddd8d16383d37d564c7231afc07", "score": "0.5733356", "text": "def fragment?\n !fragment.nil?\n end", "title": "" }, { "docid": "a7708f05bd22f86f0966cf178ffaceb7", "score": "0.5732666", "text": "def full_path\n path + query + fragment\n end", "title": "" }, { "docid": "b28729935be3b934cd0ae63003ac149f", "score": "0.56952524", "text": "def fragment?\n node_type == DOCUMENT_FRAGMENT_NODE\n end", "title": "" }, { "docid": "30e698fd3dac2588526af415242eb007", "score": "0.5690382", "text": "def mediafragment_uri\n \"#{master_file&.rdf_uri}?#{internal.fragment_value.object}\"\n rescue\n \"#{master_file&.rdf_uri}?t=#{start_time},#{end_time}\"\n end", "title": "" }, { "docid": "e2025d53984b6bb54234e4a6bcdc91b9", "score": "0.5619669", "text": "def url_fragment(portions=[], local_portion=nil)\n local_portion = local_fragment if adds_deep_link? and local_portion.nil?\n \n portions.unshift(local_portion) # prepend portions as we move up.\n \n return portions.compact.join(\"/\") if isRoot?\n \n parent.url_fragment(portions)\n end", "title": "" }, { "docid": "77b0f5d64c2b8667a9f93e1363d2fb82", "score": "0.5615127", "text": "def fragment(*args, &block); end", "title": "" }, { "docid": "77b0f5d64c2b8667a9f93e1363d2fb82", "score": "0.5615127", "text": "def fragment(*args, &block); end", "title": "" }, { "docid": "77b0f5d64c2b8667a9f93e1363d2fb82", "score": "0.5615127", "text": "def fragment(*args, &block); end", "title": "" }, { "docid": "0e8a7ca66b8150f3d07f7b27e3cae983", "score": "0.5588675", "text": "def resource\n name = [ segment, query_string, fragment_string ].compact.join\n name.empty? ? nil : name\n end", "title": "" }, { "docid": "6ccf587ee552448f530c15fee1c67be0", "score": "0.5587051", "text": "def fragment?\r\n node_type == DOCUMENT_FRAG_NODE\r\n end", "title": "" }, { "docid": "7c54cab0270f95affd901f23c787aba4", "score": "0.55608153", "text": "def fragment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = FRAGMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 9:12: 'fragment'\n match( \"fragment\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end", "title": "" }, { "docid": "af6d2a3626e26dbff9f3b8fb2280da57", "score": "0.5553261", "text": "def fragment_for(fragment_source_position)\n fragment = nil\n @aggregators.each { |agg| fragment ||= agg.fragment_for(fragment_source_position); return fragment if fragment }\n nil\n end", "title": "" }, { "docid": "abc96fb2ff38c51b2df39312f1e825fc", "score": "0.5537073", "text": "def fix_fragment url\n spl = url.split('#')\n if spl.size > 1\n spl[-1] = URI::encode(spl[-1])\n spl.join('#')\n else\n url\n end\nend", "title": "" }, { "docid": "d86ca8ac4e7193bd406a089d51fd7b8c", "score": "0.5535848", "text": "def fragment_for(fragment_source_position)\n fragment_set.for_source_position(fragment_source_position)\n end", "title": "" }, { "docid": "44dafd2270856a58a015b956d04722d5", "score": "0.54881877", "text": "def hash\n fragments.hash\n end", "title": "" }, { "docid": "9dbf4d4121cce1722c9c288a811f8cac", "score": "0.5472665", "text": "def cached_fragment\n controller.read_fragment cache_key\n end", "title": "" }, { "docid": "c308e7ae0364a62f97e12be9470f487a", "score": "0.5462911", "text": "def split_uri!(uri)\n if(uri.fragment)\n fragment = uri.fragment\n uri.fragment = '' \n [uri.path, fragment]\n else\n path_parts = /\\A(.*[\\/#])([^\\/#]+)\\Z/.match(uri.path)\n uri.path = path_parts[1]\n [ path_parts[1], path_parts[2] ]\n end\n end", "title": "" }, { "docid": "a696cf307b9c6d3df98fedddd0dd31da", "score": "0.544798", "text": "def hashed_url_from_fragment(url)\n url_host(url) + ('/#/' + (encode_and_parse_url(url).fragment || '')).gsub(/\\/\\//, '/')\n end", "title": "" }, { "docid": "02ff1c9bf43da69bb4e31efc6e81402a", "score": "0.5442369", "text": "def fragment?\n type == DOCUMENT_FRAG_NODE\n end", "title": "" }, { "docid": "8b74697074e157b2c74e4650286a8101", "score": "0.54265106", "text": "def host\n full_uri = URI.parse( self.uri )\n full_uri.to_s.gsub( full_uri.path, '' )\n end", "title": "" }, { "docid": "623e7a5a21c74c2776ac73e6c30aea56", "score": "0.54242784", "text": "def fragment=(new_fragment)\n @fragment = new_fragment\n end", "title": "" }, { "docid": "204dff4e5350f459c7337eb4729a68fb", "score": "0.54117566", "text": "def nodeattr\n node['fragments']\n end", "title": "" }, { "docid": "cb8203691ae5c84146156b2cf765ba25", "score": "0.5402581", "text": "def traditional_url_from_fragment(url)\n url_host(url) + ('/' + (encode_and_parse_url(url).fragment || '')).gsub(/\\/\\//, '/')\n end", "title": "" }, { "docid": "cdb925ad1d275cb5b5b027e8c23e1d8d", "score": "0.53786325", "text": "def fragment_for original\n relative_path_of(original, settings[:input])\n end", "title": "" }, { "docid": "d202ccc8c80b899d084f649e322b70c2", "score": "0.53675115", "text": "def hashed_url_from_fragment(url)\n url_host(url) + strip_slashes(fragment_string + normalized_url_fragment(url))\n end", "title": "" }, { "docid": "87a554beba2f908a4586c5da0f9ef8f2", "score": "0.5342052", "text": "def uri\n @reference[0].sub(/(\\/)+$/, \"\") if @reference[0].present?\n end", "title": "" }, { "docid": "ee3632c8b859e223d09a019121c54c3b", "score": "0.5341641", "text": "def normalized_url_fragment(url)\n '/'+ url_fragment(url).sub(/^\\!?\\/*/, '')\n end", "title": "" }, { "docid": "df25ef2e90eb4ea83e83634b9de54054", "score": "0.53246695", "text": "def url_with_fragment(url, fragment)\n if Hash === fragment\n fragment = fragment.entries.map { |key, value| [uri_escape(key.to_s), uri_escape(value.to_s)].join('=') }.join('&')\n else\n fragment = uri_escape(fragment)\n end\n uri = URI.parse(url)\n uri.fragment = fragment\n uri.to_s\n end", "title": "" }, { "docid": "7b5ede87228318575579c3593cbc1d44", "score": "0.5323401", "text": "def query\n parsed_uri.query\n end", "title": "" }, { "docid": "9ad3a0746dbefed18a3aa108010b548a", "score": "0.53098255", "text": "def base_uri\n URI.parse(read(Tuple[:base_uri].any).uri)\n end", "title": "" }, { "docid": "f6ebfde98deeaac70a866d3b498a39ee", "score": "0.5304623", "text": "def html5_fragment(*args, &block)\n Loofah::HTML5::DocumentFragment.parse(*args, &block)\n end", "title": "" }, { "docid": "f31d26c5c5e30f687d3fc022a96ef920", "score": "0.53016484", "text": "def traditional_url_from_fragment(url)\n url_host(url) + normalized_url_fragment(url)\n end", "title": "" }, { "docid": "f46821446743568c0d1a688e9ec188d4", "score": "0.52818096", "text": "def fragment!(frag_options)\n return nil if @error or @content.class <= String\n frags = @content.fragment!(frag_options)\n if frags\n frags.collect! do |x|\n frag = self.dup\n frag.unique!\n frag.content = x\n frag\n end\n end\n return frags\n end", "title": "" }, { "docid": "c76ee1d1ca712028f9cc424801e84cad", "score": "0.5281499", "text": "def ip_frag\n\t\tself[:ip_frag].to_i\n\tend", "title": "" }, { "docid": "d48dfab1a0ef04a3fd74f09925ac2022", "score": "0.5281115", "text": "def endpoint\n @reference[1]\n end", "title": "" }, { "docid": "07f6ad88876b37dc4bd424b739f92af7", "score": "0.5279115", "text": "def find_fragment(jid, node)\n raise 'subclass must implement'\n end", "title": "" }, { "docid": "f33d05e1ee98de658723f81622da5af6", "score": "0.52603906", "text": "def string\n @fragments.join(\" \")\n end", "title": "" }, { "docid": "b881d91c879ef0340645b665d8453d86", "score": "0.52479595", "text": "def [](name)\n @fragments[name]\n end", "title": "" }, { "docid": "ae8b8938eceb01d6b191a8c25bdcc322", "score": "0.5247427", "text": "def fragment_offset\n Utils.word16((bytes[6] & 0x1F), bytes[7])\n end", "title": "" }, { "docid": "e7507926ea5f0a74be49468270b4163a", "score": "0.52407247", "text": "def fragment=(new_fragment); end", "title": "" }, { "docid": "e7507926ea5f0a74be49468270b4163a", "score": "0.52407247", "text": "def fragment=(new_fragment); end", "title": "" }, { "docid": "494060ce75916f5bd9e183b9abf66a39", "score": "0.52316", "text": "def fragment_cache_key(key)\n ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split(\"://\").last : key, :views)\n end", "title": "" }, { "docid": "2c59ce9f83a78bc8f83dde4e7f34dce3", "score": "0.5229969", "text": "def fragment(tags)\n document.related_class(\"DocumentFragment\").new(document, tags, self)\n end", "title": "" }, { "docid": "58d6e3048bc47b764716a29bf5edae49", "score": "0.5204952", "text": "def decode_uri_component\n `decodeURIComponent(#{self})`\n end", "title": "" }, { "docid": "2ae9acf143ca5bce76dc19ce3229ed20", "score": "0.51902324", "text": "def existing_fragment(fragment)\n node.run_state['fragments']['cluster']['fragments']\n .find { |f| f.name == fragment.name }\nend", "title": "" }, { "docid": "0fbe3a60c46772ed79fb66c406f41867", "score": "0.5180464", "text": "def parse_fragment\n start = current_token\n expect_token(tokens_config[:ellipsis])\n\n has_type_condition = expect_optional_keyword('on').success?\n if !has_type_condition && current_token_is?(tokens_config[:name_class])\n return ASTNode.new(kind: Kinds::FRAGMENT_SPREAD, params: {\n name: parse_fragment_name,\n directives: parse_directives(false)\n })\n end\n\n ASTNode.new(kind: Kinds::INLINE_FRAGMENT, params: {\n type_condition: has_type_condition ? parse_named_type : nil,\n directives: parse_directives(false),\n selection_set: parse_selection_set\n })\n\n end", "title": "" }, { "docid": "ad41deccbaf90ed776f271f92e6a79c0", "score": "0.5179019", "text": "def full_path\n @uri.to_s\n end", "title": "" }, { "docid": "65bde957e915bef61ae822328a4faaaf", "score": "0.51724386", "text": "def uri()\n return @endpoint.uri if @endpoint.respond_to?(:uri)\n return @endpoint\n end", "title": "" }, { "docid": "5ab7a41b28d91552f5af366e9b600804", "score": "0.5161954", "text": "def [](name)\n\t\t\t\t\t@fragments[name]\n\t\t\t\tend", "title": "" }, { "docid": "d76e61015a29f0995e2d34fe417c0336", "score": "0.5152137", "text": "def fragment(string, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block)\n HTML4::DocumentFragment.parse(string, encoding, options, &block)\n end", "title": "" }, { "docid": "7941b89fc1f83f16a87df8a8bf1c6510", "score": "0.51486325", "text": "def cache_fragment_name(name = {}, skip_digest: nil, digest_path: nil)\n if skip_digest\n name\n else\n fragment_name_with_digest(name, digest_path)\n end\n end", "title": "" }, { "docid": "ac9f8959e4d52abed4590fc14f07be79", "score": "0.51483744", "text": "def uri\n uri_prefix + Digest::MD5.hexdigest(self.address)\n end", "title": "" }, { "docid": "a31c39ec974abf6289c835f16148fc95", "score": "0.5145075", "text": "def get_fragment_from_buffer(pointer)\n @buffer[pointer, (@buffer.length - pointer)]\n end", "title": "" }, { "docid": "6a51f56f8d6770e77d85e605842ab50a", "score": "0.51379704", "text": "def fragment!(frag_options)\n return nil if @error or @content.class <= String\n frags = @content.fragment!(frag_options)\n if frags\n frags.collect! do |x|\n frag = self.dup\n frag.content = x\n frag.time_offset = @time_offset / frags.length\n frag\n end\n end\n return frags\n end", "title": "" }, { "docid": "845c33aa98db7c3b50f31402ab02670b", "score": "0.51142", "text": "def remove_fragment\n self.gsub(/#.*/,'')\n end", "title": "" }, { "docid": "782b0091366fac02ce8ed21c6049d1cc", "score": "0.51089114", "text": "def decode_uri_component\n `decodeURIComponent(self)`\n end", "title": "" }, { "docid": "d96317acb37733ed83a583af574670ca", "score": "0.5089442", "text": "def fragment(val)\n modify do |c|\n c.fragment = val.to_s\n end\n end", "title": "" }, { "docid": "52074ab52d617b31ad376fb740be2e97", "score": "0.5078742", "text": "def get_fragment(env, src)\n if src =~ %r{^\\w+://}\n get_remote_fragment(env, src)\n else\n get_local_fragment(env, src)\n end\n rescue Exception => ex\n [500, {}, '']\n end", "title": "" }, { "docid": "42bad479981a3c26c02363aac2c6e882", "score": "0.5069933", "text": "def getURIBase\n URI_BASE\n end", "title": "" }, { "docid": "0eb7ae0bf968cd721342144dfaf18971", "score": "0.50668615", "text": "def name_fragment\n [field && field.name_fragment,\n @name || (field && field.name)].compact.join('_')\n end", "title": "" }, { "docid": "4ba88758647c6a4b8e4fbf35418f6862", "score": "0.50544107", "text": "def frag_offset\n @hexstr[6..7].unpack(\"n\").pop & 0x1fff\n end", "title": "" }, { "docid": "fedc6bc7b4ece6c94d6a200091dfc240", "score": "0.5042343", "text": "def url_for url_fragment, mode=:path_only\n return url_fragment if url_fragment.include? \"://\"\n url_fragment = \"/#{url_fragment}\" unless url_fragment.starts_with? \"/\"\n case mode\n when :path_only\n base = request.script_name\n when :full\n scheme = request.scheme\n if (scheme == 'http' && request.port == 80 ||\n scheme == 'https' && request.port == 443)\n port = \"\"\n else\n port = \":#{request.port}\"\n end\n base = \"#{scheme}://#{request.host}#{port}#{request.script_name}\"\n else\n raise TypeError, \"Unknown url_for mode #{mode}\"\n end\n \"#{base}#{url_fragment}\"\n end", "title": "" }, { "docid": "5bf2e2069782bd8ee295c7b85f19b7e4", "score": "0.5041912", "text": "def html4_fragment(*args, &block)\n Loofah::HTML4::DocumentFragment.parse(*args, &block)\n end", "title": "" }, { "docid": "d4dab398005d8854b36df9272dfeebd9", "score": "0.5039049", "text": "def fragment tags = nil\n DocumentFragment.new(self, tags)\n end", "title": "" } ]
c4f1eac42fa769de6f4f7e2d591128fc
TODO: for local ActiveRecord::Base.configurations = YAML.load_file('database.yml') ActiveRecord::Base.establish_connection(:development) ActiveRecord::Base.establish_connection(ENV['DATABASE_URL']) class Entries < ActiveRecord::Base; end
[ { "docid": "e0052ede72cfdf34c5882db0cc59873e", "score": "0.0", "text": "def fetch(published, url, needpush)\n\n entry = HTMLParser.fetch(url)\n\n if entry != nil then\n entry[:published] = published\n entry[:uploaded_thumbnail_url] = Array.new()\n entry[:uploaded_raw_image_url] = Array.new()\n entry[:uploaded_thumbnail_file_name] = Array.new()\n entry[:uploaded_raw_image_file_name] = Array.new()\n\n Downloader.save_image(entry) { |url_origin, saved_file_name, type|\n ret = ParseApiClient.upload_photo(Downloader::Dirname, saved_file_name)\n\n if type == Downloader::Thumbnail then\n entry[:uploaded_thumbnail_url].push(ret['url'])\n entry[:uploaded_thumbnail_file_name].push(ret['name'])\n else\n entry[:uploaded_raw_image_url].push(ret['url'])\n entry[:uploaded_raw_image_file_name].push(ret['name'])\n end\n # 画像アップロードに完了した場合URLの向き先を変更する\n entry[:entrybodyin] = \"#{entry[:entrybodyin]}\".gsub(\"#{url_origin}\", \"#{ret[\"url\"]}\")\n }\n # TODO:Net::ReadTimeoutが投げられる可能性があるのでbegin-rescueでリトライする\n begin\n # Memberテーブルを参照しメンバーを紐付ける\n query = Parse::Query.new(\"Member\").eq(\"rss_url\", entry[:rss_url])\n member = query.get.first\n entry[:author_id] = member['objectId']\n entry[:author_image_url] = member['image_url']\n # ParseにEntryオブジェクトを作成する\n ParseApiClient.insert(entry, needpush)\n rescue Net::ReadTimeout => e\n puts \"Error ! #{e} ¥n retry insert url -> #{url}\"\n retry\n end\n else\n puts \"entry is nil\"\n end\n\nend", "title": "" } ]
[ { "docid": "e8fbbca450be7c2e7e0d1432dccf75a6", "score": "0.75656104", "text": "def establish_connection \n ActiveRecord::Base.establish_connection(YAML.load_file(\"#{RAILS_ROOT}/config/database.yml\")[ENV['RAILS_ENV']])\nend", "title": "" }, { "docid": "f735ed2d5d7862252957c7db770dd1b1", "score": "0.73804444", "text": "def prepare_database\n ActiveRecord::Base.configurations = YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), 'config', 'database.yml')))\n ActiveRecord::Base.establish_connection(:development)\nend", "title": "" }, { "docid": "6fda77e9b9e2a499a22a5bcd1f65e12b", "score": "0.7213924", "text": "def run(environment:)\n ActiveRecord::Base.establish_connection(YAML.load_file('db/config.yml')[environment])\n end", "title": "" }, { "docid": "4e98bc51ef97eac6a17a7f833879fbf3", "score": "0.69689965", "text": "def setup_in_memory_db\n # Database Setup & Config\n\n db_config = {\n adapter: 'sqlite3',\n database: ':memory:'\n }\n\n pp db_config\n\n ActiveRecord::Base.logger = Logger.new( STDOUT )\n ## ActiveRecord::Base.colorize_logging = false - no longer exists - check new api/config setting?\n\n ## NB: every connect will create a new empty in memory db\n ActiveRecord::Base.establish_connection( db_config )\n\n\n ## build schema\n\n LogDb.create\n ConfDb.create\n TagDb.create\n WorldDb.create\n SportDb.create\n\n SportDb.read_builtin\nend", "title": "" }, { "docid": "c3f2904a50b74ee63849fcfb4e907f7d", "score": "0.6817242", "text": "def establish_connection\r\n raise \"No RAILS_ENV is defined\" unless defined?(RAILS_ENV)\r\n ActiveRecord::Base.establish_connection(@yaml[RAILS_ENV])\r\n end", "title": "" }, { "docid": "05f2a8befdb41e76421adee2efd9eb57", "score": "0.68076646", "text": "def setup #:nodoc:\n require 'rubygems'\n gem \"activerecord\"\n require 'active_record' \n db_config = YAML.load_file( File.expand_path( @config ) )[@env]\n ::ActiveRecord::Base.establish_connection(db_config)\n end", "title": "" }, { "docid": "03f6c783c72138911828982b82a447ff", "score": "0.67975193", "text": "def connect_activerecord()\n # FIXME: parameterise the adapter\n ActiveRecord::Base.establish_connection(:adapter => 'mysql2',\n :host => @settings[:desthost],\n :username => @settings[:destuser],\n :password => @settings[:destpass],\n :database => @settings[:destdb])\n PmacctEntry.establish_connection(:adapter => 'mysql2',\n :host => @settings[:sourcehost],\n :username => @settings[:sourceuser],\n :password => @settings[:sourcepass],\n :database => @settings[:sourcedb])\n end", "title": "" }, { "docid": "ce15283b18b2a899986a0797080b7c80", "score": "0.6779278", "text": "def initialize_database\n if configuration.frameworks.include?(:active_record)\n ActiveRecord::Base.configurations = configuration.database_configuration\n ActiveRecord::Base.establish_connection\n end\n end", "title": "" }, { "docid": "f79d7c74e65e2ba011dbe40f9e3055bb", "score": "0.6675594", "text": "def config_db\n # Initialize the database connection\n if(@config[\"standalone_db\"])\n talia_logger.info(\"TaliaCore using standalone database\")\n\n ActiveRecord::Base.configurations['talia'] = db_connection_opts\n ActiveRecord::Base.establish_connection(:talia)\n ActiveRecord::Base.logger = talia_logger\n else\n talia_logger.info(\"TaliaCore using exisiting database connection.\")\n unless(ActiveRecord::Base.logger)\n talia_logger.info(\"ActiveRecord logger not active, setting it to Talia logger\")\n ActiveRecord::Base.logger = talia_logger\n end\n end\n talia_logger.info(\"Setting Active Record to full STI use.\") unless(ActiveRecord::Base.store_full_sti_class)\n ActiveRecord::Base.store_full_sti_class = true\n end", "title": "" }, { "docid": "d935f11ab56e147a6c372e2df806c988", "score": "0.6673142", "text": "def setup_active_record(root_path,tenv)\n require 'rubygems'\n if self.java?\n env = 'development'\n env = 'production' if Socket.gethostname=='svbalance.cure.com.ph'\n env = tenv if tenv!=nil\n end\n # env = 'production' #now using connection pools so always production\n #ENV['RAILS_ENV'] ||= env\n #RAILS_ENV=env\n gem 'activerecord'\n require 'active_record'\n \n # ENV['RAILS_ENV'] ||= env\n # RAILS_ENV=env\n path= root_path + \"config/database.yml\"\n puts \"path is #{path}\" if @debug\n data=File.open(path).readlines.join\n # puts \"file open\"\n result=ERB.new(data).result\n # puts \"after erb #{result}\"\n parsed=YAML.load(result)\n # puts \" values are: #{parsed.to_s}\" # if @debug\n puts \"env is #{env} values are: #{parsed[env]}\" if @debug\n \n @database_env=parsed[env]\n # puts \"db temp #{self.database_env.to_s}\"\n puts \"Database settings: #{self.database_env.inspect} from environment #{env} in database.yml\"\n puts \"JNDI Needed: #{self.database_env['jndi']} please ensure configured!\" if self.database_env['jndi'] !=nil\n ActiveRecord::Base.allow_concurrency = true\n establish_ar_jdbc_pool\n ActiveRecord::Base.logger = Logger.new(STDOUT) #RAILS_DEFAULT_LOGGER\n # grab all the models\n # model_path = root_path + \"app/models/*.rb\"\n load_models(root_path)\n #puts \"after DIR\"\n end", "title": "" }, { "docid": "7ea7a07b66b855770e88f1f9a029803b", "score": "0.6610651", "text": "def initialize_database\n return unless configuration.frameworks.include?(:active_record)\n ActiveRecord::Base.configurations = configuration.database_configuration\n ActiveRecord::Base.establish_connection(RESTORE_ENV)\n end", "title": "" }, { "docid": "aa93b8afa31bbb5cd06d13014c0e78db", "score": "0.6566189", "text": "def establish_db_connection \n return if ActiveRecord::Base.connected? || !@environment\n require 'active_record'\n \n database = YAML.load_file( conf_path( \"database.yml\" ) )\n ActiveRecord::Base.colorize_logging = true\n ActiveRecord::Base.logger = logger # set up the AR logger before connecting\n logger.debug \"--- Establishing database connection in '#{@environment.upcase}' environment\" \n ActiveRecord::Base.establish_connection( database[@environment] )\n end", "title": "" }, { "docid": "31c9018f602d9c092a4157f2e871cef5", "score": "0.6543666", "text": "def establish_connection(klass)\n if ComfyPress.config.database_config && !Rails.env.test?\n klass.establish_connection \"#{ComfyPress.config.database_config}_#{Rails.env}\"\n end\n end", "title": "" }, { "docid": "7a53ed710f27f2f29725a53eb74b9654", "score": "0.65145934", "text": "def configure_database(config_path)\n configuration = YAML.load_file(config_path)\n ActiveRecord::Base.establish_connection(configuration)\n end", "title": "" }, { "docid": "5f07ce3e5186ecc3e856f2cf12eece79", "score": "0.6496794", "text": "def dbconfig\n dbname = DefaultDb\n {'development' => {\n :adapter => 'sqlite3',\n :pool => 5,\n :database => DataDirectory + dbname,\n :timeout => 5000 }}\n end", "title": "" }, { "docid": "3d360d95c87f6eec95b2f042fcf078bc", "score": "0.64382505", "text": "def establish_database_connection!\n orm_module::Base.establish_connection(:adapter => 'sqlite3', :database => options[:database])\n #ActiveRecord::Migration.class_eval(\"def self.connection; #{@orm_module.to_s}::Base.connection; end \")\n end", "title": "" }, { "docid": "321d9108d4bb5db9f8df0830f0185574", "score": "0.64072317", "text": "def connection\n ActiveRecord::Base.connection\n end", "title": "" }, { "docid": "321d9108d4bb5db9f8df0830f0185574", "score": "0.64072317", "text": "def connection\n ActiveRecord::Base.connection\n end", "title": "" }, { "docid": "89fca55b45eaa5a82710e206e8975d22", "score": "0.6405074", "text": "def establish\n ActiveRecord::Base.establish_connection(\n adapter: ENV['adapter'],\n database: ENV['database'],\n username: ENV['username'],\n password: ENV['password'],\n host: ENV['host'],\n pool: 5,\n timeout: 5000,\n port: ENV['port'] || 5432\n )\n end", "title": "" }, { "docid": "f6bd6fa987e007388b21a18e53647518", "score": "0.6402629", "text": "def connect!\n ActiveRecord::Base.establish_connection(adapter: 'sqlite3', \n database: path_to_database,\n timeout: default_timeout)\n end", "title": "" }, { "docid": "dcc456f094a0765835779ccd20ebeec4", "score": "0.6401441", "text": "def attach\n ActiveRecord::Base.establish_connection({\n adapter: 'sqlite3',\n database: DATABASE_PATH,\n })\n end", "title": "" }, { "docid": "dd592386f007e14041f2772db3ff3cc2", "score": "0.6399207", "text": "def db_config; end", "title": "" }, { "docid": "dd592386f007e14041f2772db3ff3cc2", "score": "0.6399207", "text": "def db_config; end", "title": "" }, { "docid": "dd592386f007e14041f2772db3ff3cc2", "score": "0.6399207", "text": "def db_config; end", "title": "" }, { "docid": "dd592386f007e14041f2772db3ff3cc2", "score": "0.6399207", "text": "def db_config; end", "title": "" }, { "docid": "dd592386f007e14041f2772db3ff3cc2", "score": "0.6399207", "text": "def db_config; end", "title": "" }, { "docid": "0d39883de95671a5113ad3176611ac90", "score": "0.63990575", "text": "def setup_database\n puts \"Creating in-memory test database ...\"\n ActiveRecord::Base.configurations = {\n 'test' => { :adapter => 'sqlite3', :dbfile => ':memory:' }\n } \n ActiveRecord::Base.establish_connection 'test'\n load \"#{DIR}/db/schema.rb\" \nend", "title": "" }, { "docid": "837fba57b6071f9053f2e90cd618b849", "score": "0.6396148", "text": "def abc\n ActiveRecord::Base.connection_config\n end", "title": "" }, { "docid": "a150433928087f2a9b4a2ec0008092bc", "score": "0.63914144", "text": "def connect_to_database_for(details)\n ActiveRecord::Base.establish_connection(details)\n end", "title": "" }, { "docid": "44855e2b6c0a9141182c0e4ba8e9c87c", "score": "0.63717735", "text": "def from_active_record(config)\n @adapter = ar_to_sequel(config[:adapter])\n @database = config[:database]\n @user = config[:username]\n @password = config[:password]\n @host = config[:host]\n @port = config[:port]\n @options = (config.keys - STANDARD).map {|k| [k, config[k]]}\n self\n end", "title": "" }, { "docid": "2f0aeb55598f03601086f1452b038373", "score": "0.6331972", "text": "def db \n # gateway thing for production make sure to open_port at the beginning of tasks\n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database=>\"crawlfishdevdb\",\n :user=>\"root\",\n :password=>\"Sector@123\",\n :host=>\"127.0.0.1\",\n :port => 3307).connection()\n # Old school local approach for development\n #ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n # :database=>\"prod2\",\n # :user=>\"root\",\n # :password=>\"Sector@123\").connection() \n end", "title": "" }, { "docid": "156b54665aaa191cf4de2fde9c1bf947", "score": "0.63317525", "text": "def secondbase_config(env)\n ActiveRecord::Base.configurations[SecondBase::CONNECTION_PREFIX][env]\nend", "title": "" }, { "docid": "fccb53ccce726d3fc55865c57437d856", "score": "0.63296974", "text": "def connect!\n ActiveRecord::Base.establish_connection(\n :adapter => self.adapter,\n :database => self.database\n )\n end", "title": "" }, { "docid": "872ed323b13072e85f8f7ad0aa29531b", "score": "0.63234216", "text": "def database_configuration; end", "title": "" }, { "docid": "872ed323b13072e85f8f7ad0aa29531b", "score": "0.63234216", "text": "def database_configuration; end", "title": "" }, { "docid": "6f9fff04b6317469d9bfcc2f49e704f9", "score": "0.6318587", "text": "def connection\n ::ActiveRecord::Base.connection\n end", "title": "" }, { "docid": "4ff5dfc9c698f938fd9942d158894b1f", "score": "0.6284876", "text": "def connection\n @@connection ||= begin\n raise 'Please call Lhm.setup' unless defined?(ActiveRecord)\n @@connection = Connection.new(connection: ActiveRecord::Base.connection)\n end\n end", "title": "" }, { "docid": "aee27aa93fbe96bdd03645b8b34c47fd", "score": "0.6283617", "text": "def initialize\n config = YAML.load(File.open(\"#{File.dirname(__FILE__)}/../db.yml\"))\n ActiveRecord::Base.establish_connection(config)\n\n Dir.glob(\"#{File.dirname(__FILE__)}/../models/*.rb\").each{|model|\n require model\n }\n\n #Clean out all user/chat relationships in the join table\n Chat.clear_relations\n\n @run_uuid = UUID.new.generate\n\n @connections = {}\n #after a user discconects, their connection gets added here indexed by UUID\n @old_connections = {}\n end", "title": "" }, { "docid": "5cc5abdc14ebfa6b7deef6ef22ec4ce0", "score": "0.628142", "text": "def create( config )\n begin\n if config['adapter'] =~ /sqlite/\n if File.exist?(config['database'])\n $stderr.puts \"#{config['database']} already exists\"\n else\n begin\n ActiveRecord::Base.establish_connection(config)\n ActiveRecord::Base.connection\n rescue\n $stderr.puts $!, *($!.backtrace)\n $stderr.puts \"Couldn't create database for #{config.inspect}\"\n end\n end\n return\n else\n ActiveRecord::Base.establish_connection(config)\n ActiveRecord::Base.connection\n end\n rescue\n case config['adapter']\n when 'mysql'\n @charset = ENV['CHARSET'] || 'utf8'\n @collation = ENV['COLLATION'] || 'utf8_general_ci'\n begin\n ActiveRecord::Base.establish_connection(config.merge('database' => nil))\n ActiveRecord::Base.connection.create_database(config['database'], :charset => (config['charset'] || @charset), \n :collation => (config['collation'] || @collation))\n ActiveRecord::Base.establish_connection(config)\n rescue\n $stderr.puts \"Couldn't create database for #{config.inspect}, charset: #{config['charset'] || @charset}, \n collation: #{config['collation'] || @collation}\"\n end\n when 'postgresql'\n @encoding = config[:encoding] || ENV['CHARSET'] || 'utf8'\n begin\n ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))\n ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => @encoding))\n ActiveRecord::Base.establish_connection(config)\n rescue\n $stderr.puts $!, *($!.backtrace)\n $stderr.puts \"Couldn't create database for #{config.inspect}\"\n end\n end\n else\n $stderr.puts \"#{config['database']} already exists\"\n end\nend", "title": "" }, { "docid": "f11306b5f9d884361df34edf5f0546f6", "score": "0.62806433", "text": "def open_connection_in_config\n config = Rails.configuration.database_configuration\n host = config[Rails.env]['host']\n port = config[Rails.env]['port']\n database = config[Rails.env]['database']\n username = config[Rails.env]['username']\n password = config[Rails.env]['password']\n @con = Mysql.new host.to_s.strip, username.to_s.strip, password.to_s.strip, database.to_s.strip, port.to_s.strip.to_i\n end", "title": "" }, { "docid": "a4fd8dd8048af7d3ced8f7ddca188f7c", "score": "0.6278402", "text": "def database; self.class.database; end", "title": "" }, { "docid": "6a2da03b15c7a71afa74399f11e503cf", "score": "0.6273857", "text": "def connect_database\n if Settings.present? && Settings.db.to_h.size > 0\n Log.info \"Connecting to database: #{Settings.db.host}\"\n\n ActiveRecord::Base.logger = Log.instance\n ActiveRecord::Base.establish_connection(**Settings.db)\n elsif Settings.present? && Settings.db.to_h.size < 1\n error_message = \"config/settings/#{ruby_env}.yml has no :db values specified\"\n Log.error error_message\n\n raise IOError.new(error_message)\n else\n error_message \"Missing database config for RACK_ENV=`#{ruby_env}` - add it into `config/settings` folder\"\n Log.error error_message\n raise IOError.new(error_message)\n end\nend", "title": "" }, { "docid": "f772d68d99da9afdb6adc191d7790d68", "score": "0.62380123", "text": "def establish_connection\n ActiveRecord::Base.establish_connection(@connection_parameters)\n # this require must come after establishing the base connection\n # otherwise it will throw errors\n require 'ar-extensions'\n end", "title": "" }, { "docid": "db90f07450f38e01da74700563d73731", "score": "0.6234879", "text": "def initialize(*args)\n @db_type = args[0]\n if DB_TYPES.include? @db_type\n yaml_file=(args[1]) ? args[1] : Dir.pwd+\"/conf/#{@db_type}_db.yml\"\n @db = ActiveRecord::Base\n @db.establish_connection YAML.load_file(yaml_file)\n # ONLY FOR DEBUG\n #require 'logger'\n #ActiveRecord::Base.logger = Logger.new 'log/db.log'\n require File.expand_path(File.dirname(__FILE__)+\"/db/models/#{@db_type}.rb\")\n else\n raise ArgumentError, \"Invalid database type: #{@db_type}\"\n end\n end", "title": "" }, { "docid": "33cdc1b94008cfc115b39fbbe16302dd", "score": "0.62258357", "text": "def database_engine; end", "title": "" }, { "docid": "33cdc1b94008cfc115b39fbbe16302dd", "score": "0.62258357", "text": "def database_engine; end", "title": "" }, { "docid": "33cdc1b94008cfc115b39fbbe16302dd", "score": "0.62258357", "text": "def database_engine; end", "title": "" }, { "docid": "33cdc1b94008cfc115b39fbbe16302dd", "score": "0.62258357", "text": "def database_engine; end", "title": "" }, { "docid": "401ff19e0cea1bcc0fdac54ff8c7c500", "score": "0.6222222", "text": "def establish_connection\n ActiveRecord::Base.establish_connection(@connection_parameters)\n end", "title": "" }, { "docid": "8feed1bfe5a0cee9d51f5c0b8acc6b4a", "score": "0.62094766", "text": "def connect_db\n$DB = ActiveRecord::Base.establish_connection(\n :adapter => \"mysql\",\n :database => \"php_info\",\n :username => \"root\",\n :password => \"\",\n :socket => \"/var/run/mysqld/mysqld.sock\",\n :host => \"localhost\"\n)\nend", "title": "" }, { "docid": "98841b674fcb65a9ca2a0a8ea5711c55", "score": "0.6192868", "text": "def connect()\n #To consider: disable colorized logging?\n #To consider: create config option for this?\n #ActiveRecord::Base.logger = Logger.new(STDERR)\n #ActiveRecord::Base.logger.level = Logger::WARN\n ActiveRecord::Base.time_zone_aware_attributes = true\n ActiveRecord::Base.default_timezone = :utc\n ActiveRecord::Base.establish_connection(\n :adapter => self.db_type,\n :database => self.database,\n :username => self.username,\n :password => self.password,\n :host => self.server,\n :port => self.port)\n end", "title": "" }, { "docid": "cd2897a3ff7813941cab72ab101ac6d2", "score": "0.6180942", "text": "def load_schema\n config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))\n ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + \"/debug.log\") \n \n db_adapter = 'mysql'\n ActiveRecord::Base.establish_connection(config[db_adapter])\n load(File.dirname(__FILE__) + \"/schema.rb\")\n require File.dirname(__FILE__) + '/../init.rb'\nend", "title": "" }, { "docid": "90f8fff4e740708568b89a2f31c2ab7a", "score": "0.6169812", "text": "def _db_local\n @_db_local ||= YAML::load_file(\"config/database.yml\")['development']\n end", "title": "" }, { "docid": "462d1555d05aa03425cd8320aad3d783", "score": "0.61687636", "text": "def db_config\r\n { rails_env => {\r\n :database => database,\r\n :username => db_username,\r\n :host => \"10.5.1.62\",\r\n :adapter => \"mysql\",\r\n :password => \"code1T\"\r\n } }\r\nend", "title": "" }, { "docid": "d368d3d2f1c35374ef4805b5aa4c6bfb", "score": "0.61651343", "text": "def make_testing_db(dbname)\n current = standard_db_path(dbname)\n ActiveRecord::Base.configurations = {\n 'testing' => {\n :adapter => 'sqlite3',\n :database => current,\n :pool => 5,\n :timeout => 5000\n }\n }\n ActiveRecord::Base.establish_connection(:testing)\n setup_db\nend", "title": "" }, { "docid": "8eb7703d2739faea0ec43ca966a619c1", "score": "0.6136478", "text": "def db\n @db ||= self.class.db(database_config)\n end", "title": "" }, { "docid": "432e14b7e2dc62770894451ccedc717e", "score": "0.6127768", "text": "def connect_database\n\n\t\t@db = YAML::load(File.open('./database.yml'))\n\t\tActiveRecord::Base.establish_connection(@db)\n\n\tend", "title": "" }, { "docid": "44703aa4938670926e1b3e3b63437511", "score": "0.61116517", "text": "def with_engine_connection\n original = ActiveRecord::Base.remove_connection\n ActiveRecord::Base.establish_connection(irely_configuration_key)\n yield\nensure\n ActiveRecord::Base.establish_connection(original)\nend", "title": "" }, { "docid": "d9f36fd6315cc707f7ab4e582e619499", "score": "0.6106581", "text": "def active_record_connect\n\t\t\t\tActiveRecord::Base.establish_connection(\n\t\t\t\t\t:adapter => self.db_adapter,\n\t\t\t\t\t:database => self.db_name\n\t\t\t\t)\t\t\t\n\n\t\t\t\t#if using sqlite3, enable foreign keys\n\t\t\t\tself.sqlite_enable_foreign_keys\n\t\t\tend", "title": "" }, { "docid": "9604435f95f6ecdd3b9f32ccbcf5dbec", "score": "0.61008024", "text": "def load_active_record_config\n ROM::Rails::ActiveRecord::Configuration.new.call\n end", "title": "" }, { "docid": "cfb4db63031f7ed4cd695f2fda6bfa79", "score": "0.6095026", "text": "def setup_database\n DatabaseConnector.establish_connection\n end", "title": "" }, { "docid": "e7dc9dc7cd39b98a8cdda2d38221c0f8", "score": "0.60905015", "text": "def use(db)\n Sequel.open \"sqlite:///#{db}\"\n $: << File.expand_path(File.dirname(__FILE__))\n require 'models'\n \n # Build up the tables after a clean or on first run\n Feed.create_table unless Feed.table_exists?\n Entry.create_table unless Entry.table_exists? \nend", "title": "" }, { "docid": "ab2e4c1e2dc8d0e64922e5dbc91b4005", "score": "0.60814756", "text": "def dbconnect!\n configure_logger 'activerecord'\n\n ActiveRecord::Base.establish_connection required(:db)\n ActiveRecord::Base.logger = Log4r::Logger['activerecord']\n end", "title": "" }, { "docid": "35682073b4758420ddf58e2c14c61600", "score": "0.6081301", "text": "def connect_to_database\n ActiveRecord::Base.establish_connection(worker_database_config)\n end", "title": "" }, { "docid": "a341076d6694a97471f9cced12292ab1", "score": "0.606468", "text": "def db_for(klass)\n @db[klass.to_s] ||= {}\n end", "title": "" }, { "docid": "6ca27b3558aba94ca38ef0324f8c69be", "score": "0.60625154", "text": "def configure_database\n env = @config['rails_environment'] || CloudController.environment\n if @database_environment\n config = @database_environment[env]\n else\n # using CloudController db configuration\n config = AppConfig[:database_environment][env]\n end\n logger = Logger.new(STDOUT)\n logger.level = Logger::INFO\n establish_database_connection(config, logger)\n end", "title": "" }, { "docid": "3f4e55be028093ba09914c620b5492c0", "score": "0.6054437", "text": "def main_db_configuration\n ::ActiveRecord::Base.configurations[::Rails.env].symbolize_keys\n end", "title": "" }, { "docid": "9b5aa63b99d0844587509dd800c02519", "score": "0.604361", "text": "def _db\n @_db ||= begin\n unless ActiveRecord::Base.connected?\n ActiveRecord::Base.establish_connection(adapter:'sqlite3', database:':memory:')\n end\n ActiveRecord::Base.connection\n end\n end", "title": "" }, { "docid": "f6f1814ca58512d6f11a70937156d63c", "score": "0.60375994", "text": "def setup_database\n File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)\n ActiveRecord::Base.establish_connection(\n \"adapter\" => \"sqlite3\", \"timeout\" => 5000, \"database\" => TEST_DATABASE_FILE\n )\n create_tables\nend", "title": "" }, { "docid": "72c2a5595156829d8c496f5f00e95fc7", "score": "0.60331017", "text": "def initialize\n\t\tActiveRecord::Base.establish_connection(\n\t\t\t:adapter => \"mysql2\",\n\t\t\t:host => \"badgerdb.cz2y13cetnjg.us-west-2.rds.amazonaws.com\",\n\t\t\t:username => SQLUsername,\n\t\t\t:password => SQLPassword,\n\t\t\t:database => \"BadgerDB\"\n\t\t)\n\tend", "title": "" }, { "docid": "e24a7c8b56fbb9830869b6cc263c2148", "score": "0.6007975", "text": "def initialize\n @db = ActiveRecord::Base.establish_connection(@@settings)\n\n unless Torrent.table_exists?\n ActiveRecord::Schema.define do\n create_table :torrents do |table|\n table.text :path, :null => false\n table.text :metadata, :null => false\n table.string :infohash, :null => false\n table.timestamp :timestamp, :null => false\n end\n \n add_index :torrents, :infohash, :unique => true\n end\n end\n \n unless Peer.table_exists?\n ActiveRecord::Schema.define do\n create_table :peers do |table|\n table.string :torrent_infohash, :null => false\n table.string :peer_id\n table.integer :port\n table.integer :uploaded\n table.integer :downloaded\n table.integer :left\n table.string :ip\n \n table.timestamps\n end\n \n add_index :peers, [:peer_id,:torrent_infohash], :unique => true\n end\n end\n \n unless DelayedJob.table_exists?\n ActiveRecord::Schema.define do\n create_table :delayed_jobs do |table|\n table.string :filename, :null => false\n \n table.timestamp :created_at\n end\n \n add_index :delayed_jobs, :filename, :unique => true\n end\n end\n end", "title": "" }, { "docid": "5dd41063d6c89ac627462976362c5e33", "score": "0.59974486", "text": "def establish_connection(options)\n ActiveRecord::Base.establish_connection(options)\n EventProvider.establish_connection(options)\n Event.establish_connection(options)\n end", "title": "" }, { "docid": "ffbc10ce78802203b17f0be81f274e90", "score": "0.5994869", "text": "def set_connection(settings)\n ActiveRecord::Base.establish_connection(settings)\n end", "title": "" }, { "docid": "f7a6905c36c6b269d970911a4bf5e1b6", "score": "0.59931403", "text": "def initialize_database\n Serv::Log.info \"-> Connecting to database\"\n ActiveRecord::Base.establish_connection(Configuration::database_configuration)\n end", "title": "" }, { "docid": "f72e7ee11bd1ca2a34858171ac3f5363", "score": "0.59803987", "text": "def setup(config)\n config = DEFAULT_CONFIG.merge(config)\n db = Database.new(config)\n\n if config[:type].to_s == 'remote'\n db.client!\n else\n db.file!\n end\n\n databases[config[:name]] = db\n db\n end", "title": "" }, { "docid": "02919c728f85b6317c2a9f863036c479", "score": "0.5973288", "text": "def database_url\n ENV['DATABASE_URL']\nend", "title": "" }, { "docid": "909496106242293cc0d8503df14c727e", "score": "0.59707355", "text": "def connect_to_db\n\n\tActiveRecord::Base.establish_connection(\n\t\t\t:adapter => 'mysql',\n\t\t\t:host => 'localhost',\n\t\t\tusername: 'cooking_user',\n\t\t\tpassword: 'password',\n\t\t\tdatabase: 'cooking'\n\t\t)\n\t\nend", "title": "" }, { "docid": "01af5f1f5385f45789243bfd0f296c18", "score": "0.59674877", "text": "def find_db_config(env); end", "title": "" }, { "docid": "d4a62ff8828381a071b90872971087fe", "score": "0.59669065", "text": "def master_database_config\n ActiveRecord::Base.configurations[Rails.env].with_indifferent_access\n end", "title": "" }, { "docid": "b3a2a164126334942eafdcaeb3504494", "score": "0.59615", "text": "def initialize \n @Handle = SQLite3::Database.new(Configuration.instance.Attributes[\"DATABASE_NAME\"]) \n end", "title": "" }, { "docid": "03683fd354db10850baf477ebe973469", "score": "0.5951339", "text": "def connect_to_database\n require 'cloud_crowd/models'\n CloudCrowd.configure_database(\"#{@options[:config_path]}/database.yml\")\n end", "title": "" }, { "docid": "53da665312ad0407c24855d61a2dcb02", "score": "0.59485984", "text": "def connection\n orm_module::Base.connection\n end", "title": "" }, { "docid": "7e22482a2e2470e5621cc1bac45d6403", "score": "0.5936469", "text": "def load_db\n# stdout = $stdout\n# $stdout = StringIO.new # suppress output while building the schema\n# db = YAML.load_file(File.join(ENV['APP_ROOT'], 'db', 'database.yml'))\n# ActiveRecord::Base.establish_connection(db['test'])\n\n #load File.join(ENV['APP_ROOT'], 'schema.rb')\n# $stdout = stdout\nend", "title": "" }, { "docid": "8ab8df59f575c6ac87f1037d06a22f5e", "score": "0.592602", "text": "def initialize_activeresource\n ActiveRecord::Base.configurations = @database\n ActiveRecord::Base.establish_connection(@database)\n\n begin\n Schema.new.change\n logger.info(\"Created table in database at path: #{@database}\")\n rescue => ex\n logger.warn(\"Assuming database tables already exist - #{ex.message}:#{ex.backtrace}\")\n nil\n end\nend", "title": "" }, { "docid": "8fc4f69cd8c80d129b5c26ca3ece8a42", "score": "0.59233016", "text": "def start\n info \"Connection to the database...\"\n ActiveRecord::Base.establish_connection(@dbconfig)\n ActiveRecord::Base.logger = ::Logger.new(STDERR)\n end", "title": "" }, { "docid": "7b6650d32066cf627f440e71feff2660", "score": "0.5919424", "text": "def configure_databases(options)\n if options.has_key?('hosts')\n ReplsetDatabase.new(options).configure\n else\n Database.new(options).configure\n end\n end", "title": "" }, { "docid": "ebbe2d0bc942975ea6f9ecc6f03fbc51", "score": "0.591413", "text": "def master_database_config\n ActiveRecord::Base.configurations[RAILS_ENV].with_indifferent_access\n end", "title": "" }, { "docid": "337e47a7b9379176ca4bc87ef7e3aa09", "score": "0.5912412", "text": "def database_url\n if ENV['DATABASE_URL']\n ENV['DATABASE_URL']\n else\n db = SETTINGS[:database]\n db[:type] + \"://\" + db[:user] + \":\" + db[:password] + \"@\" + db[:server] + \"/\" + db[:name]\n end\nend", "title": "" }, { "docid": "860725dd40e2eee6bc64b47444bbef2d", "score": "0.5900947", "text": "def with_engine_connection\n original = ActiveRecord::Base.remove_connection\n # ActiveRecord::Base.establish_connection \"sqlbox_#{Rails.env}\".to_sym\n ActiveRecord::Base.establish_connection 'sqlbox'.to_sym\n yield\nensure\n ActiveRecord::Base.establish_connection original\nend", "title": "" }, { "docid": "a0089ea715363e1ac47f097ceb8b3569", "score": "0.5893073", "text": "def build_connection_model\n url = config[\"url\"]\n\n # resolve spec\n if !url && config[\"spec\"]\n config_options = {env_name: PgHero.env, PgHero.spec_name_key => config[\"spec\"], PgHero.include_replicas_key => true}\n resolved = ActiveRecord::Base.configurations.configs_for(**config_options)\n raise Error, \"Spec not found: #{config[\"spec\"]}\" unless resolved\n url = ActiveRecord::VERSION::STRING.to_f >= 6.1 ? resolved.configuration_hash : resolved.config\n end\n\n url = url.dup\n\n Class.new(PgHero::Connection) do\n def self.name\n \"PgHero::Connection::Database#{object_id}\"\n end\n\n case url\n when String\n url = \"#{url}#{url.include?(\"?\") ? \"&\" : \"?\"}connect_timeout=5\" unless url.include?(\"connect_timeout=\")\n when Hash\n url[:connect_timeout] ||= 5\n end\n establish_connection url if url\n end\n end", "title": "" }, { "docid": "38a5498f3ee2055dbe918a970a39a58e", "score": "0.5892583", "text": "def database_config\n # in production, we have a ConnectionProxy with many adapters\n # otherwise #connection directly returns the adapter\n adapter = self.connection.instance_eval { @current } || self.connection\n adapter.instance_eval { @config }\n end", "title": "" }, { "docid": "6614796f0c154d757819f434917b40c8", "score": "0.58876044", "text": "def connect\n if File.exists?(config_file)\n Merb.logger.info!(\"Connecting to database...\")\n\n Thread.new{ loop{ sleep(60*60); ::ActiveRecord::Base.verify_active_connections! } }.priority = -10\n\n ::ActiveRecord::Base.verification_timeout = 14400\n ::ActiveRecord::Base.logger = Merb.logger\n ::ActiveRecord::Base.configurations = configurations\n ::ActiveRecord::Base.establish_connection config\n else\n copy_sample_config\n Merb.logger.error! \"No database.yml file found in #{Merb.root}/config.\"\n Merb.logger.error! \"A sample file was created called database.sample.yml for you to copy and edit.\"\n exit(1)\n end\n end", "title": "" }, { "docid": "ed1a22b7a7b2caf73737f46b2c505c0c", "score": "0.58864105", "text": "def raw_database_adapter; end", "title": "" }, { "docid": "a9dba49934fb0d5b65fc315b8e78ab72", "score": "0.5885434", "text": "def set_up_connections\n EdiHelper::edi_log.write \"connecting to db..\"\n ActiveRecord::Base.establish_connection(Globals.get_mes_conn_params)\n EdiHelper::edi_log.write \"connected to db\" \n true\n end", "title": "" }, { "docid": "5275ee3ea50e7c1df85bd26406fd18f2", "score": "0.5885255", "text": "def initialize name, settings = {} # :nodoc:\n @meta = {} # little place to store our things\n # a magical constant you can define to change the defaults for magical web hosting\n # where the web server wants to configure an app's chill connection details\n # dynamically without bothering the user with such things\n settings = ChillDBConnectionDefaults.merge(settings) if Kernel.const_defined? :ChillDBConnectionDefaults\n @url = URI::HTTP.build(\n host: settings[:host] || 'localhost',\n port: settings[:port] || 5984,\n userinfo: [settings[:user], settings[:pass]],\n path: settings[:path] || \"/#{settings[:database_name_prefix]}#{URI.escape hyphenate(name)}/\"\n )\n \n # make this database if it doesn't exist yet\n $stderr.puts \"New database created at #{@url}\" if http('').put('').code == 201\n end", "title": "" }, { "docid": "e68bb5bdd2b7e203259050bb36d8e901", "score": "0.5884242", "text": "def active_record_mysql_setup\n patch_mysql_adapter\n create_db\n active_record_load_schema\n end", "title": "" }, { "docid": "0231d86c0d416f593ec51a6ba28d8730", "score": "0.5883724", "text": "def set_up_db_configuration(db_config_path)\n # setting the db configuration file path\n db_config_file_path = db_config_path\n\n # creating a pointer to the file content\n f_db_config = File.open(db_config_file_path, 'r')\n\n # loading the db configuration from the YAML file\n db_config = YAML.load(f_db_config)\n\n ## setting a global path for the database (only for the sqlite3 database)\n #db_config[db_type]['database'] = \"#{File.dirname(__FILE__)}/#{db_config[db_type]['database']}\"\n\n # saving the configurations loaded from file './database.yml'\n ActiveRecord::Base.configurations = db_config\nend", "title": "" }, { "docid": "dc7b0d5a2b6c847223316ed58f3d23e1", "score": "0.58804095", "text": "def database_engine\n :mysql\n end", "title": "" }, { "docid": "dc7b0d5a2b6c847223316ed58f3d23e1", "score": "0.58804095", "text": "def database_engine\n :mysql\n end", "title": "" }, { "docid": "0c022ae1f85afd2fa575469798025cf0", "score": "0.5878873", "text": "def db\n @db ||= self.class.db\n end", "title": "" }, { "docid": "42ead947aff09af863c5c543e602adda", "score": "0.5860809", "text": "def db_connection_to( dbfile_name )\n if dbfile_name == \":memory:\"\n return ::Amalgalite::Database.new( dbfile_name )\n else\n unless connection = load_path_db_connections[ dbfile_name ] \n connection = ::Amalgalite::Database.new( dbfile_name )\n load_path_db_connections[dbfile_name] = connection\n end\n return connection\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e69f9a2721d88c5dc80be6c14660f86c", "score": "0.0", "text": "def set_document\n @document = Document.find(params[:document_id])\n unless @document.collection.available?(@current_user)\n respond_to do |format|\n format.html { redirect_to collections_path, error: \"Cannot access the document\"}\n render json: {msg: 'Cannot access document'}, status: 401 \n end \n return\n end\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@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.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
f1f03b4c1982ac9c3592306a1eeaa3d6
Constants are inherited by nested classes
[ { "docid": "9086fa5afac9a146ba3864a21a042653", "score": "0.7134102", "text": "def test_nested_classes_inherit_constants_from_enclosing_classes\n assert_equal 4, Animal::NestedAnimal.new.legs_in_nested_animal\n end", "title": "" } ]
[ { "docid": "14d35fdc4f2ea305134e9017e80ac6b4", "score": "0.8137294", "text": "def inherited_constants; end", "title": "" }, { "docid": "e96510949270c3ff9ebc501b7850800a", "score": "0.7128951", "text": "def test_subclasses_inherit_constants_from_parent_classes\n assert_equal 4, Reptile.new.legs_in_reptile\n end", "title": "" }, { "docid": "45d97ce1710493eba4a755bcdfea0c3f", "score": "0.70656157", "text": "def const_base; end", "title": "" }, { "docid": "b0d807e2a6df784d2f3ca2903c130af3", "score": "0.6685163", "text": "def on_top_const_field(constant); end", "title": "" }, { "docid": "d78873966032a112ba7234d010725f87", "score": "0.66463184", "text": "def ConstPathField(parent, constant); end", "title": "" }, { "docid": "7f1256e80f4a4a9bd31952c790d5b258", "score": "0.66436636", "text": "def transfer_nested_constants=(_arg0); end", "title": "" }, { "docid": "3d209ae8eba74da2150edfd1c3ec0db9", "score": "0.66065794", "text": "def TopConstField(constant); end", "title": "" }, { "docid": "ac36ac33a8dcd2002c19b99dfb770ab2", "score": "0.6590935", "text": "def constants(inherit = T.unsafe(nil)); end", "title": "" }, { "docid": "ac36ac33a8dcd2002c19b99dfb770ab2", "score": "0.6590935", "text": "def constants(inherit = T.unsafe(nil)); end", "title": "" }, { "docid": "a61b64373887d3118eaf78f678c648be", "score": "0.6515164", "text": "def test_who_wins_with_both_nested_and_inherited_constants\n assert_equal 2, MyAnimals::Bird.new.legs_in_bird\n end", "title": "" }, { "docid": "78eb540e8bbae871ebb99d80c5bb6565", "score": "0.6479506", "text": "def local_constants\n inherited = {}\n ancestors.each do |anc|\n next if anc == self\n anc.constants.each { |const| inherited[const] = anc.const_get(const) }\n end\n constants.select do |const|\n ! inherited.key?(const) || inherited[const].object_id != const_get(const).object_id\n end\n end", "title": "" }, { "docid": "a2ee9909b89e6a41c99c5b08238aed91", "score": "0.6460789", "text": "def const_magic\n namespace == self ? super : namespace.const_magic\n end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422165", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422165", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422165", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "0bf9ceb80fd9e85cd5a64a2edf5c8c22", "score": "0.6422158", "text": "def constant; end", "title": "" }, { "docid": "44e3406bafc25dee556f4aba95994055", "score": "0.6418379", "text": "def on_const_path_ref(parent, constant); end", "title": "" }, { "docid": "7f1bde720f8e50c5965d66250176f507", "score": "0.64008456", "text": "def process_const(exp)\n # TODO: may have removed a shift by mistake\n @definition.superklass << exp.value\n process_until_empty(exp)\n s()\n end", "title": "" }, { "docid": "8d8c8c9fa8d0546ca855d478711ce20a", "score": "0.63855267", "text": "def test_Module_ClassMethods_constants\n\t\t# Notice, not same as book.\n\t\tassert_equal([:SPURIOUS_CONSTANT], Module2.constants.sort[1..3])\n\t\tassert_equal(true, (Module2.constants.include? :CONST_MIXIN) )\n\t\tassert_equal([:SPURIOUS_CONSTANT], Module2.constants(false))\n\t\tassert_equal([:SPURIOUS_CONSTANT, :CONST_MIXIN], Module2.constants(true))\n\tend", "title": "" }, { "docid": "7958bcebcd961dd6afb93cac89ef2564", "score": "0.6377721", "text": "def on_const_path_field(parent, constant); end", "title": "" }, { "docid": "c72e16487b3f120b1154d951155b19a7", "score": "0.6359689", "text": "def const_base\n frame.nesting.last\n end", "title": "" }, { "docid": "04a1328f86f8f7f7929ac592e9565a37", "score": "0.6357521", "text": "def define_constant c, as\n self.attr_chainable c\n self.class_eval \"def #{c.to_s}= value; unless value.nil?; self.constants.delete_if{|x| x.code == '#{codify(as)}'}; self.constants<< Constant.new('#{codify(as)}', value); @#{c.to_s}=value; end; end\"\n end", "title": "" }, { "docid": "018c5c2cd45cc6f4fe5080993d58346e", "score": "0.6352082", "text": "def included_constants; end", "title": "" }, { "docid": "b4c3901d683fbbcd5df5b71e38d5fffa", "score": "0.63479775", "text": "def inherited_constants\n inheritance_tree[1..-1].inject([]) do |list, superclass|\n if superclass.is_a?(Proxy)\n list\n else\n list += superclass.constants.reject do |o|\n child(:name => o.name) || list.find {|o2| o2.name == o.name }\n end\n end\n end\n end", "title": "" }, { "docid": "ca1adce8dac0145ce5cafc49cdffc62c", "score": "0.6281327", "text": "def constants(opts = {})\n opts = SymbolHash[:inherited => true].update(opts)\n super(opts) + (opts[:inherited] ? inherited_constants : [])\n end", "title": "" }, { "docid": "6765e1580b171e6af526540d93124faf", "score": "0.62644243", "text": "def visit_top_const_field(node); end", "title": "" }, { "docid": "46023d9d35ddc4b5da4942f11357233c", "score": "0.61937416", "text": "def shareable_constant_value; end", "title": "" }, { "docid": "46023d9d35ddc4b5da4942f11357233c", "score": "0.61937416", "text": "def shareable_constant_value; end", "title": "" }, { "docid": "d2f81a5ca65785736664659da5a8a34a", "score": "0.6183533", "text": "def check\r\n assert_equal(TOP_LEVEL_CONST, 2)\r\n assert_equal(Object::TOP_LEVEL_CONST, 2)\r\n \r\n assert_equal(CONST, 1)\r\n assert_equal(My_const::CONST, 1)\r\n end", "title": "" }, { "docid": "d58a046824171566c9a44aa7062360a4", "score": "0.6168839", "text": "def with_constants\n [self.code.constants].flatten.each do |const|\n next if do_not_wrap?(const)\n add_child ConstNode.new(const, self)\n end\n end", "title": "" }, { "docid": "6ccfae0b5064e26589e97da6822602a0", "score": "0.61636657", "text": "def const_missing(name)\n klass = Class.new\n klass.extend ClassMethods\n klass.send :prepend, ContextMethods\n set_context_accessor name\n const_set name, klass\n end", "title": "" }, { "docid": "8d74c3ee9f86e1e4c266367f34057564", "score": "0.6141045", "text": "def ConstPathRef(parent, constant); end", "title": "" }, { "docid": "bba0afc6a9b40806c6a8cbe176c79329", "score": "0.6112903", "text": "def constants\n evaluate('Object.constants + self.class.constants + (class << self; constants; end)').map(&:to_s)\n end", "title": "" }, { "docid": "9b293f605b8832c269fd3af9ea6d56aa", "score": "0.6076454", "text": "def getConstant; end", "title": "" }, { "docid": "a423a1e02cca44f4542ce59f88bd2076", "score": "0.60723114", "text": "def visit_const(node); end", "title": "" }, { "docid": "dceff999c351e5e0655584a36d5e10b9", "score": "0.60600215", "text": "def handle_constants(type, class_name, const_name, definition)\n class_obj = find_class(class_name)\n unless class_obj\n warn(\"Enclosing class/module for '#{const_name}' not known\")\n return\n end\n \n comment = find_const_comment(type, const_name)\n\n # In the case of rb_define_const, the definition and comment are in\n # \"/* definition: comment */\" form. The literal ':' and '\\' characters\n # can be escaped with a backslash.\n if type.downcase == 'const' then\n elements = mangle_comment(comment).split(':')\n if elements.nil? or elements.empty? then\n con = Constant.new(const_name, definition, mangle_comment(comment))\n else\n new_definition = elements[0..-2].join(':')\n if new_definition.empty? then # Default to literal C definition\n new_definition = definition\n else\n new_definition.gsub!(\"\\:\", \":\")\n new_definition.gsub!(\"\\\\\", '\\\\')\n end\n new_definition.sub!(/\\A(\\s+)/, '')\n new_comment = $1.nil? ? elements.last : \"#{$1}#{elements.last.lstrip}\"\n con = Constant.new(const_name, new_definition,\n mangle_comment(new_comment))\n end\n else\n con = Constant.new(const_name, definition, mangle_comment(comment))\n end\n\n class_obj.add_constant(con)\n end", "title": "" }, { "docid": "7ce094aee0dd150550b7d1d8541f36f4", "score": "0.6045393", "text": "def namespace_from_thor_class(constant); end", "title": "" }, { "docid": "86c93579296cd3b16520ef3a269cb327", "score": "0.6018284", "text": "def do_constants class_name\n c = find_class class_name\n c.body.scan(%r{%constant\\s+(\\w+)\\s+(\\w+)\\s*=\\s*(\\w+)\\s*;}xm) do\n |type, const_name, definition|\n # swig puts all constants under module\n\thandle_constants(type, @@module_name, const_name, definition)\n end\n end", "title": "" }, { "docid": "d07e8ab1ba1933207ee4913aa7ec1730", "score": "0.59820914", "text": "def constants(inherit = true)\n Module.instance_method(:constants).bind(@wrapped).call(inherit)\n end", "title": "" }, { "docid": "03ca4e82d3158d7181821d21f160328e", "score": "0.59764445", "text": "def visit_const_path_ref(node)\n s(\n :const,\n [visit(node.parent), node.constant.value.to_sym],\n smap_constant(\n srange_find_between(node.parent, node.constant, \"::\"),\n srange_node(node.constant),\n srange_node(node)\n )\n )\n end", "title": "" }, { "docid": "d5588ac1f7f673940c8034385d35fad9", "score": "0.59356815", "text": "def inherited(subclass)\n # don't set the constant yet - any class methods will be called after self.inherited\n # unless self.status = ... is set explicitly, the status code will be inherited\n register_status_code(subclass, self.status) if self.status?\n end", "title": "" }, { "docid": "973f39255b8c21068b1450ee2f9b2e96", "score": "0.5917331", "text": "def test_top_level_constants_are_referenced_by_double_colons\n assert_equal 'top level', ::C\n end", "title": "" }, { "docid": "5dd1a74b0f115cd47711b80cc3db8b33", "score": "0.5913258", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "e88a4892ea25ae7071ad070bd33f6b2e", "score": "0.5889353", "text": "def visit_top_const_ref(node)\n s(\n :const,\n [\n s(:cbase, [], smap(srange_length(node.start_char, 2))),\n node.constant.value.to_sym\n ],\n smap_constant(\n srange_length(node.start_char, 2),\n srange_node(node.constant),\n srange_node(node)\n )\n )\n end", "title": "" }, { "docid": "0f7cb0da3d63d4e0d374e9557b2b81c6", "score": "0.58815235", "text": "def test_Module_InstanceMethods_constSet\n\t\t# TODO, need add test cases.\n\t\t# Math.const_set(\"HIGH_SCHOOL_PI\", 22.0/7.0)\n\t\t# assert_equal(0.0012644892673496777, Math::HIGH_SCHOOL_PI - Math::PI)\n\tend", "title": "" }, { "docid": "e0ea75b2ec4ff1aeb3c113098f1abca8", "score": "0.58797234", "text": "def TopConstRef(constant); end", "title": "" }, { "docid": "4c254523825759378c67a8c5692f98aa", "score": "0.58749944", "text": "def visit_class(node)\n node.copy(\n constant: visit(node.constant),\n superclass: visit(node.superclass),\n bodystmt: visit(node.bodystmt)\n )\n end", "title": "" }, { "docid": "32fb16d15e3940dea47941a8015056c4", "score": "0.58748853", "text": "def process_const(exp)\n c = exp.shift\n if c.to_s =~ /^[A-Z]/ then\n # TODO: validate that it really is a const?\n type = @genv.lookup(c) rescue @env.lookup(c)\n return t(:const, c, type)\n else\n raise \"I don't know what to do with const #{c.inspect}. It doesn't look like a class.\"\n end\n raise \"need to finish process_const in #{self.class}\"\n end", "title": "" }, { "docid": "ee7ea909ab2f6ac048de907d525f1c40", "score": "0.58586234", "text": "def visit_top_const_ref(node); end", "title": "" }, { "docid": "cd9babfde151d32593c5ec2dc35185fd", "score": "0.58495724", "text": "def baseclass; end", "title": "" }, { "docid": "6b6fe83b965c8b46d05783695bf828ed", "score": "0.5849543", "text": "def constants\n root.constants.select { |e| e.namespace === self }.sort_by { |e| e.name }\n end", "title": "" }, { "docid": "b18d4d0d067c437d24670f7fa28e22ee", "score": "0.5831932", "text": "def visit_const(node)\n s(\n :const,\n [nil, node.value.to_sym],\n smap_constant(nil, srange_node(node), srange_node(node))\n )\n end", "title": "" }, { "docid": "eecc79f68f5be1c0f004efe0b826adb0", "score": "0.58231", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "eecc79f68f5be1c0f004efe0b826adb0", "score": "0.58231", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "e0dceace5c90bcab8752beb5e14d51f7", "score": "0.58200246", "text": "def on_class(constant, superclass, bodystmt); end", "title": "" }, { "docid": "6fac84bbca092f9b8b2103baff0bba04", "score": "0.5818389", "text": "def nested_classes_for(constant, root = nil)\n new_root = root ? root.const_get(constant) : constant\n return [] unless new_root.kind_of? ::Module\n new_root.constants.map { |c| new_root.inspect + \"::\" + c.to_s } +\n new_root.constants.map { |c| nested_classes_for(c, new_root) }\n end", "title": "" }, { "docid": "1fecaaf1e0f71a4e5d46043230920305", "score": "0.57882214", "text": "def all_constants_for(constant, root = nil)\n return nested_classes_for(constant, root).flatten.map { |c| c.gsub(/^[^>]+>::/, '') }\n end", "title": "" }, { "docid": "76f4a243b4feac087ae3529b25720b14", "score": "0.57793605", "text": "def abstract_constants\n constants.grep(/(^|::)(Base$|Abstract)/)\n end", "title": "" }, { "docid": "b62686fa2777fc75919c1b36a276fa85", "score": "0.5778551", "text": "def test_nested_constants_may_also_be_referenced_with_relative_paths\n assert_equal \"nested\", C\n end", "title": "" }, { "docid": "0b89c8016b5c546fe9be9022c92c0ceb", "score": "0.57649463", "text": "def on_top_const_ref(constant); end", "title": "" }, { "docid": "31fe3acc1d7cb8374143e67afa3dd0b0", "score": "0.5755164", "text": "def baseclass #:nodoc:\n end", "title": "" }, { "docid": "183f7a18ca00dd9bbb4025ecb494f2c5", "score": "0.57461196", "text": "def inspect\n \"Const(#{self})\"\n end", "title": "" }, { "docid": "e7fff9bae124b75946c8f8ec9c87ded1", "score": "0.5742041", "text": "def Const(value); end", "title": "" }, { "docid": "ae84d3b841f370229619f634fe7dafcd", "score": "0.57416356", "text": "def visit_top_const_field(node)\n node.copy(constant: visit(node.constant))\n end", "title": "" }, { "docid": "172ad27e98fb8799cf0553a19d220c96", "score": "0.57100564", "text": "def m_classes\n self.constants.select do |c|\n mod = self.sub_mod(c.to_s)\n mod.class == Class && (mod.methods(false).count > 0)\n end.map do |c|\n self.sub_mod(c.to_s)\n end\n end", "title": "" }, { "docid": "433b4d15198bbc7f650be3b50fb571bf", "score": "0.5695682", "text": "def on_const(value); end", "title": "" }, { "docid": "e45d9b686b7d2ce7a1ba6a385a37a88c", "score": "0.56735694", "text": "def const_missing(*args)\n if base_instance.const_defined?(*args)\n base_instance.const_get(*args)\n else\n super\n end\n end", "title": "" }, { "docid": "12137053ae5ac3a712ce9e729c1877f8", "score": "0.5667392", "text": "def visit_const_path_field(node)\n if node.parent.is_a?(VarRef) && node.parent.value.is_a?(Kw) &&\n node.parent.value.value == \"self\" && node.constant.is_a?(Ident)\n s(:send, [visit(node.parent), :\"#{node.constant.value}=\"], nil)\n else\n s(\n :casgn,\n [visit(node.parent), node.constant.value.to_sym],\n smap_constant(\n srange_find_between(node.parent, node.constant, \"::\"),\n srange_node(node.constant),\n srange_node(node)\n )\n )\n end\n end", "title": "" }, { "docid": "d6cc766573fc680ce4f25ce10007f353", "score": "0.56616426", "text": "def full_constant_name; end", "title": "" }, { "docid": "001dcf04341fe3af2082e069dcee362a", "score": "0.56455934", "text": "def define_constant(name, &block)\n if name.include?(PATH_SEPARATOR)\n path = name.split(PATH_SEPARATOR)\n target = lookup_constant_path(path[0..-2])\n definition = target.define_constant(path[-1], &block)\n else\n definition = add_child_definition(:const, name, &block)\n end\n\n definition.define_self\n\n return definition\n end", "title": "" }, { "docid": "78100e4a4a0843c9bbd0c991d82b4c7f", "score": "0.5643221", "text": "def get_CONSTANT # CONSTANT getter and setter in global space\n return THIS_IS_A_CONSTANT\nend", "title": "" }, { "docid": "1bbb6594f6b6828c8ab131d3a0014279", "score": "0.564273", "text": "def visit_top_const_field(node)\n s(\n :casgn,\n [\n s(:cbase, [], smap(srange_length(node.start_char, 2))),\n node.constant.value.to_sym\n ],\n smap_constant(\n srange_length(node.start_char, 2),\n srange_node(node.constant),\n srange_node(node)\n )\n )\n end", "title": "" }, { "docid": "f7c4235d6bc77fc6779ba322dde34e45", "score": "0.5642505", "text": "def name_of_constant(node)\n node.children[1]\n end", "title": "" }, { "docid": "d7aa14891805d135eca0cd3135641f35", "score": "0.5621056", "text": "def in_classe\n Object.const_get self\n end", "title": "" }, { "docid": "f447cf23f5a32da61a3a69ed782522c2", "score": "0.5604737", "text": "def base_class; end", "title": "" }, { "docid": "77e3766a8467389b15a46bdaefb019b7", "score": "0.56045616", "text": "def get_constant(n, algebraic_structure, constant)\n # Example: \"tgroup.zero, ugroup.zero\"\n constants_commaed = TYPE_SYMBOLS.first(n).map{ |t| \"#{t.downcase}#{algebraic_structure}.#{constant}\" }.join(\", \")\n \"override def #{constant} = (#{constants_commaed})\"\nend", "title": "" }, { "docid": "37f8e11e1c3f4559804828c51fa724f1", "score": "0.5594344", "text": "def visit_const_ref(node)\n s(\n :const,\n [nil, node.constant.value.to_sym],\n smap_constant(nil, srange_node(node.constant), srange_node(node))\n )\n end", "title": "" }, { "docid": "d88af082bdf798c97aeeb48e0d585613", "score": "0.5594171", "text": "def add_group_constants\n @code_module.constants.each do |constant|\n const_set(constant, @code_module.const_get(constant))\n end\n end", "title": "" }, { "docid": "707ab78447bd15a54861974d14fb8f28", "score": "0.55905265", "text": "def print_constant(*) end", "title": "" }, { "docid": "6c272e4a7745d21128dbffac211cf67c", "score": "0.5585752", "text": "def base_klass; end", "title": "" }, { "docid": "6aae9ef13382925c1db3a53242b5609e", "score": "0.5583093", "text": "def const_missing(name)\n Data.types[name.to_s] || super\n end", "title": "" }, { "docid": "aeb016ef4e2387dcd23db1eb648e73bc", "score": "0.5568844", "text": "def const_missing(name)\n if name.to_s == 'ARMY_TYPE' && self.to_s =~ /^Army::/\n self.const_set(name, self.to_s.demodulize.upcase)\n else\n super\n end\n end", "title": "" }, { "docid": "069e827c3bf2f8296eb17a4e4eb92921", "score": "0.5556397", "text": "def const_get(base, klass, const_name)\n if klass.const_defined?(const_name)\n klass.const_get(const_name)\n elsif base.const_defined?(const_name)\n base.const_get(const_name)\n elsif base.const_defined?(:\"#{const_name}Type\")\n base.const_get(:\"#{const_name}Type\")\n else\n nil\n end\n end", "title": "" }, { "docid": "a77a5770eb5885f0c417e80bc42102c8", "score": "0.55559903", "text": "def handleclassconst(klass, name, options)\n const = genconst_string(name, options)\n\n if is_constant_defined?(const)\n if options[:overwrite]\n Puppet.info \"Redefining #{name} in #{self}\"\n remove_const(const)\n else\n raise Puppet::ConstantAlreadyDefined,\n \"Class #{const} is already defined in #{self}\"\n end\n end\n const_set(const, klass)\n\n const\n end", "title": "" }, { "docid": "2a8453b624705d45833ede4826183796", "score": "0.5549876", "text": "def class_mod; end", "title": "" }, { "docid": "382b1c10acb2f73482c62dcc6604cb54", "score": "0.5544032", "text": "def inspect\n \"#<Constant #{@name}>\"\n end", "title": "" }, { "docid": "403462900d105e497cd279f54ca06b4b", "score": "0.55323195", "text": "def classes\n # Not going to work - ancestors returns only modules\n # self.ancestors.select{ |m| m.class == Class}\n self.constants.select do |c|\n self.sub_mod(c.to_s).class == Class\n end.map do |c|\n self.sub_mod(c.to_s)\n end\n end", "title": "" }, { "docid": "9f3a76b3c67862b056721e4175bfc683", "score": "0.5530277", "text": "def dir(inherited=false)\n Module.constants\n end", "title": "" }, { "docid": "cef9612e0f077f7ad6b4cd34ff3209ac", "score": "0.5515727", "text": "def const_defined?(name,*inherit)\n if super(name,*inherit)\n true\n else\n # attempt to load the file that might have the constant\n require_file(OpenNamespace.const_path(name))\n\n # check for the constant again\n return super(name,*inherit)\n end\n end", "title": "" }, { "docid": "7696107219f824de103cb2ed05fc9efd", "score": "0.5514631", "text": "def const_get(path, *inherit)\n top = self\n paths = path.to_s.split(\"::\")\n if path.to_s.start_with?(\"::\")\n top = Object\n paths.shift\n end\n paths.reduce(top) { |klass, name| klass.__const_get__(name, *inherit) }\n end", "title": "" }, { "docid": "2e4552ab7c1b4c49c92fa8790a6bd3d0", "score": "0.5514479", "text": "def definition(class_name)\n expanded_name = \"#{class_name}::#{@spec['name']}\"\n \"const #{@spec['type']} #{expanded_name} = #{@spec['value']}\"\n end", "title": "" }, { "docid": "91208fead64e07fbf7e51ad4fd12b9e4", "score": "0.55072576", "text": "def process_constant_node(node)\n nodes = process_all(node).compact.flatten\n name = nodes.detect { |n| n.type == :name }\n\n if nodes.length == 1\n [AST::Node.new(node.type, name.children)]\n else\n child_nodes = nodes.select { |n| n.type == :class || n.type == :module }\n new_nodes = child_nodes.each_with_object([AST::Node.new(node.type, name.children)]) do |n, a|\n a << AST::Node.new(n.type,[\"#{name.children.first}::#{n.children.first}\".to_sym])\n end\n new_nodes\n end\n end", "title": "" }, { "docid": "7dcf7027d4c883f1774af35c4d52a51e", "score": "0.55026764", "text": "def const_receiver?; end", "title": "" }, { "docid": "7dcf7027d4c883f1774af35c4d52a51e", "score": "0.55026764", "text": "def const_receiver?; end", "title": "" } ]
d3eea7a56ae672e2e0644cec20937b4b
Return the number of hops that were inferred from symmetry assumptions
[ { "docid": "8d14b5ac4636668cfdf90adebcdb500c", "score": "0.83846796", "text": "def num_sym_assumptions()\n count = 0\n for hop in @hops\n count += 1 if hop.type == :sym or hop.type == \"sym\"\n end\n count\n end", "title": "" } ]
[ { "docid": "d06b78fcc67eb00410cc186a4b88241f", "score": "0.6636597", "text": "def count_ops()\n 0\n end", "title": "" }, { "docid": "b822533c471ce7d250ab2b293643ce16", "score": "0.66081905", "text": "def symbolic_count(count); end", "title": "" }, { "docid": "6d19c2b0dd80573fded23c900b3afd9a", "score": "0.61981064", "text": "def nbHypotheses()\n\t\treturn @grillesHypothese.count\n\tend", "title": "" }, { "docid": "093a3b86bdceac0c43d6e5403d9f59fd", "score": "0.61333615", "text": "def num_symbols\n @symtab.keys.count\n end", "title": "" }, { "docid": "9604445a38188428d038f30a3315e1a8", "score": "0.60008526", "text": "def number_of_edges\n @adj.values.map(&:length).inject(:+)\n end", "title": "" }, { "docid": "44ddf94663736d38526e82970d0c0444", "score": "0.59903336", "text": "def count\n @symbols.count\n end", "title": "" }, { "docid": "c7cf2a9f24eff7915cad3af5bc4c80bb", "score": "0.5949406", "text": "def counts\n @rules.inject(Hash.new(0)) do |counts, (lhs, rhs)|\n counts[lhs] += 2 if lhs == @start\n rhs.each { |node| counts[node.value] += 1 if nonterm? node.value }\n counts\n end\n end", "title": "" }, { "docid": "fa16c90a7879000c82202a83893a6f58", "score": "0.5943569", "text": "def num_not_advertised\n @hops.find_all { |hop| hop.prefix.nil? }.size\n end", "title": "" }, { "docid": "b30858c223f7c0fc8048877c0279aa59", "score": "0.5931204", "text": "def longest_sym_sequence()\n count = 0\n max = 0\n for hop in @hops\n if hop.type != :sym and hop.type != \"sym\"\n count = 0 \n else\n count += 1\n max = (count > max) ? count : max\n end\n end\n\n max\n end", "title": "" }, { "docid": "45bc42f0fad10179f68a1ab5ba8a3829", "score": "0.58798265", "text": "def length\n @operands.length\n end", "title": "" }, { "docid": "d969c4ccc61c3f256c64fe62f9f35e22", "score": "0.58445835", "text": "def max_hops; end", "title": "" }, { "docid": "3db867be76481f1f7c9a31b6885e2d87", "score": "0.58186686", "text": "def hydrogen_count\n @ob.implicit_hydrogen_count + @ob.explicit_hydrogen_count\n end", "title": "" }, { "docid": "df5c8b0ba7670f114a0e79d95ebb85fb", "score": "0.58010226", "text": "def get_num_items(ops)\n\n if ops.is_a?(Hash)\n ops = ops.keys\n end\n\n num_items = 0\n ops.each do |op|\n num_items += op.input_array(INPUT_ARRAY).length\n end\n num_items\n end", "title": "" }, { "docid": "9cbc7e2e1a066038c2f4db77611ba03e", "score": "0.57568294", "text": "def num_vars\n constraint.lhs.size\n end", "title": "" }, { "docid": "2b5005fd93e8940475b7dc7dca2b7300", "score": "0.57256085", "text": "def size\n @rules.inject(0) { |acc, (lhs, rhs)| acc + rhs.size }\n end", "title": "" }, { "docid": "71f7b09cad838b39a3aa2bb8bdb66cc5", "score": "0.572479", "text": "def p2sh_sigops_count(tx)\n return 0 if tx.is_coinbase?\n\n sigops = 0\n tx.inputs.each do |txin|\n txout = @storage.output_for_outpoint(txin.prev_out, txin.prev_out_index)\n if txout.parsed_script.is_p2sh?\n sigops += ::Bitcoin::Script.new(txin.script_sig).sigops_count_for_p2sh\n end\n end\n\n return sigops\n end", "title": "" }, { "docid": "a89790711f255f3e94cd5ad0c6c84975", "score": "0.56953794", "text": "def cardinality\n @rhs.size\n end", "title": "" }, { "docid": "d6432e288fdf46220ab0c37234bc8948", "score": "0.56650937", "text": "def number_of_steps\n case current_instruction.opcode\n when 3, 4\n 2\n else\n 4\n end\n end", "title": "" }, { "docid": "d6432e288fdf46220ab0c37234bc8948", "score": "0.56650937", "text": "def number_of_steps\n case current_instruction.opcode\n when 3, 4\n 2\n else\n 4\n end\n end", "title": "" }, { "docid": "d6432e288fdf46220ab0c37234bc8948", "score": "0.56650937", "text": "def number_of_steps\n case current_instruction.opcode\n when 3, 4\n 2\n else\n 4\n end\n end", "title": "" }, { "docid": "fc2638459e1d96faa3cb3a42cde2501a", "score": "0.56518424", "text": "def number_of_syllables\n return (@words.map { |word| Helpfulness::PT::Syllable::syllables( word ).length }.inject(:+).to_f) || 0\n end", "title": "" }, { "docid": "0db78bd86c5e4ebb32be0c3b89dd34eb", "score": "0.5645007", "text": "def number_of_zeros\r\n total_zeros = 0\r\n @seminarians.each do |sem|\r\n zeros = sem.number_of_zeros\r\n total_zeros += zeros\r\n end\r\n\r\n #Divide by 2 to correct the fact that each was counted twice\r\n return total_zeros/2\r\n end", "title": "" }, { "docid": "ddc2b54b6e892e7dde1540294d41701e", "score": "0.5643693", "text": "def operation_count\n \toperations.count\n end", "title": "" }, { "docid": "87a3fc21eeb888eaaec8c0d3bd08acde", "score": "0.56395924", "text": "def size() @symbols.size end", "title": "" }, { "docid": "59aae178bcd4f9d97b8ffc50d0f91242", "score": "0.563251", "text": "def num_non_responsive\n @hops.find_all { |hop| !hop.ping_responsive }.size\n end", "title": "" }, { "docid": "306875f9930153ee6a9f99509276c6bb", "score": "0.5623917", "text": "def number_of_conflicts\n p (1.0-self.fitness) * $time_slots.size * $classes_array.size\n ((1.0-self.fitness) * $time_slots.size * $classes_array.size).round.to_i\n end", "title": "" }, { "docid": "84659670688fc2bba2d5ea2269d1ef70", "score": "0.5600242", "text": "def edges\n i = 0\n @hypernyms.each do |key, values|\n i += values.length\n end\n i\n end", "title": "" }, { "docid": "1941f1693e8ef90a6c54566453fc5bdc", "score": "0.5590932", "text": "def num_edges()\n edgeNum = 0\n @source.values.each do |x|\n edgeNum += x.size()\n end\n return edgeNum/2\n end", "title": "" }, { "docid": "bd3b0cc53edec415a4c0ee38fc77424f", "score": "0.55695266", "text": "def num_outputs\n Tensorflow::TF_OperationNumOutputs(c)\n end", "title": "" }, { "docid": "4daefb0e0d88fc46c1933705b9e3bd92", "score": "0.55645883", "text": "def num_potential_pairs\n potential_pairs.size\n end", "title": "" }, { "docid": "3f3b25b3aaaf8ebd6f32bff32f8d2d81", "score": "0.5549298", "text": "def in_degree(node)\n @pred[node].length\n end", "title": "" }, { "docid": "61e23bc611f0f4a4fe98a0953df5b513", "score": "0.5537693", "text": "def bc_count\n \t@generic.size + @initial.size + @final.size + @cyclic.size\n end", "title": "" }, { "docid": "3742a301f3cb3a71b1d9d84b98782f1b", "score": "0.5518056", "text": "def count_signs\n # suskaiciuojami visi zenklai\n temp = 0\n @signs.size.times do |i|\n temp += 1 if @signs[i] != 0\n end\n temp\n end", "title": "" }, { "docid": "ce07dce3c94bf7228394124452385a5f", "score": "0.5456776", "text": "def size\n C.LLVMGetNumOperands(@user)\n end", "title": "" }, { "docid": "7bd9ac28ecc0937b64cd1c001b585853", "score": "0.543769", "text": "def out_degree(source)\n h = @pathway.graph[source]\n h ? h.size : 0\n end", "title": "" }, { "docid": "87993bf6d1183cd10edd7e49be5ace70", "score": "0.5430616", "text": "def get_number_of_states\n return @dfa.get_number_of_states\n end", "title": "" }, { "docid": "d377cab551e3122d453a778e31232377", "score": "0.54262567", "text": "def edge_count\n @adjacency_list.flatten.count / 2\n end", "title": "" }, { "docid": "0dfefd70bba206712da53728cc2284d9", "score": "0.54135185", "text": "def point_wh_count point\n point.layers.inject(0){|sum, lay| sum + lay.whs.size }\n end", "title": "" }, { "docid": "74bc149049ceb398d886ff588ced5ff9", "score": "0.5369361", "text": "def size\n C.LLVMCountParams(@fun)\n end", "title": "" }, { "docid": "6363ede7c4964ab76132f4d12574ebbb", "score": "0.5351971", "text": "def size\n @graphs.inject(0) {|memo, g| memo += g.size}\n end", "title": "" }, { "docid": "8f7fb2a21f27e8d98599a670ce71f81d", "score": "0.5348744", "text": "def test_counts\n assert_equal(14, @symbols.length, \"Symbols Length\")\n end", "title": "" }, { "docid": "bc8141da4ea92c564cb3121e0f14b6dc", "score": "0.53286606", "text": "def num_sulphur\n @num_sulphur ||= total_atoms :S\n end", "title": "" }, { "docid": "fc8f0c19a46cd8a6dc23ade2c30f4112", "score": "0.53224546", "text": "def num_states\n @state.size\n end", "title": "" }, { "docid": "fc8f0c19a46cd8a6dc23ade2c30f4112", "score": "0.53224546", "text": "def num_states\n @state.size\n end", "title": "" }, { "docid": "d885100aa711e4390ce647cf7fbc0f20", "score": "0.5318987", "text": "def count_flow_entries switch, spec=\"\"\n count = 0\n `trema dump_flows #{ switch }`.each_line do | line |\n next if line =~ /^NXST_FLOW/\n found = true\n spec.split(/[, ]+/).each do | param |\n found = false if not line.include?( param )\n end\n count += 1 if found\n end\n return count\nend", "title": "" }, { "docid": "1bfac0a8681ffa392819465b6211dbe7", "score": "0.53179", "text": "def densities\n\t\t\tmap { |n| count n }\n\t\t end", "title": "" }, { "docid": "cb76fca4ebb6a0258be2ef6dbf242f42", "score": "0.53140444", "text": "def n\n @reps.size\n end", "title": "" }, { "docid": "0274b8b6ebc7ef5fd2a2fc75c404bd59", "score": "0.5313801", "text": "def estimate_count\n -(m / k.to_f) * Math.log(1 - (filter.cardinality / m.to_f))\n end", "title": "" }, { "docid": "72c82fd1c802b457cafc7861b0bd57e5", "score": "0.531351", "text": "def sign_count; end", "title": "" }, { "docid": "6d4c8197a8927ff208bf87d8126e7d60", "score": "0.53088355", "text": "def expected_number_of_advice_invocations advice_kinds, n\n advice_kinds.size - after_raising_factor(advice_kinds, n)\n end", "title": "" }, { "docid": "7ec1182153db33e7b7a118a2331bf6a2", "score": "0.5296608", "text": "def positives\n @l.size - zeros - infs\n end", "title": "" }, { "docid": "b98c85ebb2fbe5de70b36518a4749fb5", "score": "0.52600944", "text": "def num_squares\n self.size ** 2\n end", "title": "" }, { "docid": "79c7748c102d32e4f708fca782c654fa", "score": "0.52440494", "text": "def n_steps(stairs)\n return 1 if stairs <= 1 \n count = 0\n count += n_steps(stairs - 1) + n_steps(stairs - 2)\nend", "title": "" }, { "docid": "6838565917b568d67c530290c4fe508e", "score": "0.5240985", "text": "def size\n\t\tpred_list.length\n\tend", "title": "" }, { "docid": "81868f7cd78b34709836791d60e28a9f", "score": "0.52353644", "text": "def estimate_layer_counts(board_size, max_exponent)\n num_cells = board_size**2\n i_max = max_exponent - 2\n max_sum = num_cells * 2**i_max\n table = count_compositions(max_sum, num_cells, 0, i_max)\n table.map.with_index do |row, index|\n sum = (index + 1) * 2\n counts = row.map.with_index do |count_k, i|\n k = i + 1\n count_k * choose(num_cells, k)\n end\n [sum, counts.sum]\n end\nend", "title": "" }, { "docid": "9f59ddd522b4ec6b4a33fe969c4b70b0", "score": "0.5229893", "text": "def num_ships\n @grid.reduce(0) { |acc, el| acc + el.count(:S) }\n end", "title": "" }, { "docid": "6bc945b3cfed8bf719766bcf78f0a71d", "score": "0.5224132", "text": "def out_degree\n @out_edges.length\n end", "title": "" }, { "docid": "9753dd80e1dd3dd35eba837429898299", "score": "0.52125883", "text": "def length\n @array_specs.spec_count\n end", "title": "" }, { "docid": "fed6fffbb2ea1a0a9e612f250ed03ee0", "score": "0.52100426", "text": "def variable_count\n variables.size\n end", "title": "" }, { "docid": "ef23c0069442d39dd58c5088b07d459b", "score": "0.52087", "text": "def in_degree\n @in_edges.length\n end", "title": "" }, { "docid": "cfc97a769696da22c5f95150be2e1c37", "score": "0.5188164", "text": "def get_max_interactions\n return @snps.length-1\n end", "title": "" }, { "docid": "532c7efad5359683389a4f67cd731478", "score": "0.51861876", "text": "def number_of_operating_rounds(phase)\n @config.fetch('operating_rounds').find do |round|\n round.fetch('phase').equal?(phase)\n end.fetch('count')\n end", "title": "" }, { "docid": "93452d6574d9347ed590414521ce5871", "score": "0.51764727", "text": "def object_shape_count\n ::RubyVM::YJIT.runtime_stats[:object_shape_count]\n end", "title": "" }, { "docid": "1f4d7a5ce64f3a4e297f36ee2a68cf60", "score": "0.51744723", "text": "def shape_count\n\t\treturn @shapes.length\n\tend", "title": "" }, { "docid": "644a920a35718480e4ea6cb2e7122b96", "score": "0.5167672", "text": "def number_of_edges\n @pathway.relations.size\n end", "title": "" }, { "docid": "2ba064eddfda93a772b146e883165fea", "score": "0.5167604", "text": "def count_sparsity\n (1 - count_edge.to_f/(count_user*count_item))*100\n end", "title": "" }, { "docid": "9ad44aff513b8b7324a521fe6c533ed3", "score": "0.51672184", "text": "def total_documented\n @methods.select {|b| b}.length +\n @classes.select {|b| b}.length +\n @modules.select {|b| b}.length +\n @attrs.select {|b| b}.length +\n @constants.select {|b| b}.length\n end", "title": "" }, { "docid": "5a8f29ca3b46dcc818d4ea1ee307c867", "score": "0.5165351", "text": "def count\n @forest.count(&:negative?)\n end", "title": "" }, { "docid": "34b3af2bffc408584db57631f93c3e7d", "score": "0.5162811", "text": "def number_of_presented_expressions(login=nil)\n count_by_frbr(login, :has_presented, :how_many_expressions?) \n end", "title": "" }, { "docid": "7abd7b6618936a079cb3d46d2800b9df", "score": "0.5161297", "text": "def number_of_happening_expressions(login=nil)\n count_by_frbr(login, :has_happening, :how_many_expressions?) \n end", "title": "" }, { "docid": "a3f8bec89107f351847a5a06a3276fa7", "score": "0.5160049", "text": "def opposite_count(nums)\n pairs = 0\n nums.each do |num1|\n nums.each do |num2|\n if num1 + num2 == 0\n pairs += 1\n end\n end\n end\n return pairs / 2\nend", "title": "" }, { "docid": "105475aa606d14347b26f3315af5aaec", "score": "0.5154605", "text": "def calc_iterations\n 2 * (2**(@premises.length - 1))\n end", "title": "" }, { "docid": "ea8f634b7848c9ca0b72ef95de246613", "score": "0.5153175", "text": "def num_states\n@state.size\nend", "title": "" }, { "docid": "9065a5e4a14ec8be8d062b365f09912e", "score": "0.51483965", "text": "def nclocks\n return @sig_waveforms[0][1].length\n end", "title": "" }, { "docid": "60f777035a4493ac398bc578f27ba914", "score": "0.51321906", "text": "def ad_hoc_mac_count() 4 end", "title": "" }, { "docid": "1485de10097456eea851e9aa51d2e2d4", "score": "0.51319367", "text": "def n\n x.size\n end", "title": "" }, { "docid": "2061af34010413be50f1156e43e3d834", "score": "0.5131386", "text": "def number_of_verts\n\t\t@number_of_verts ||= begin\n\t\t\tsize = 0\n\t\t\t@primitives.each do |primitive|\n\t\t\t\tprimitive[:verts].each do |index|\n\t\t\t\t\tvert = @verts[index]\n\t\t\t\t\tsize += vert[:vector].length\n\t\t\t\tend\n\t\t\tend\n\t\t\tsize\n\t\tend\n\tend", "title": "" }, { "docid": "ea09d6a8ab97be9b54110e64142d9959", "score": "0.5127653", "text": "def n_constant\n 1.0 / basis_functions.length\n end", "title": "" }, { "docid": "b8f2ebfc9f4f47bb167acd1f326921f0", "score": "0.5126017", "text": "def flow_count()\n @flows.size\n end", "title": "" }, { "docid": "04fb307d78c7f0bdb4cb6fd83fd8e9c1", "score": "0.51258814", "text": "def small_world\n freq = Hash.new(0)\n @graph.each_value do |v|\n freq[v.size] += 1\n end\n return freq\n end", "title": "" }, { "docid": "867738d6adfb94f22b8929b0408fdbad", "score": "0.5114925", "text": "def num_weights(); 0;end", "title": "" }, { "docid": "f330089b0b025f021871b29f2c265064", "score": "0.5108018", "text": "def trip_count()\n self.trips().length()\n end", "title": "" }, { "docid": "04d5436e15bb547d1e009cd775829e23", "score": "0.51052004", "text": "def out_degree(node)\n @adj[node].length\n end", "title": "" }, { "docid": "a50e2769db437c622abe3d5853175278", "score": "0.5101635", "text": "def wildcard_count\n @landmarks.flatten.select {|feature| feature.kind_of? Symbol}.size\n end", "title": "" }, { "docid": "6879d53c65417707ba54223cecd25f60", "score": "0.509959", "text": "def nb_opinions() opinion_ids.size end", "title": "" }, { "docid": "de7ed056346fbb992e5349911799b86f", "score": "0.5097299", "text": "def bit_shift_count_for(operand, size)\n\t\toperand.v_bit.zero? ? 1 : (@cx.low > size ? size : @cx.low)\n\tend", "title": "" }, { "docid": "9bf74972ae34105b88df5d21f3dd8256", "score": "0.50937706", "text": "def num_known\n @num_known ||= smart_count { count_known }\nend", "title": "" }, { "docid": "3a00a0874bd3bb2186cc5663f60a0568", "score": "0.5090338", "text": "def hamming_weight(n)\r\n count = 0\r\n for i in 0..31\r\n if (n & 1) == 1\r\n count = count + 1\r\n end\r\n n = n >> 1\r\n end\r\n \r\n return count\r\nend", "title": "" }, { "docid": "4ed89344820348b6d8135f81b5994451", "score": "0.5083843", "text": "def number_of_connected(graph)\n visited = Hash.new(false)\n res = 0\n graph.vertices.keys.each do |v|\n unless visited[v]\n dfu(graph, v, visited)\n res += 1\n end\n end\n res\n end", "title": "" }, { "docid": "6fb208864c022c251c3681f78ab1ff1f", "score": "0.50781226", "text": "def state_length\r\n @state.length\r\n end", "title": "" }, { "docid": "2a2e43c5fafbe8e4d0e44f84c38571bb", "score": "0.50713086", "text": "def who_often_takes\n\t \thash = Hash.new(0)\n\t\tres = @orders.each { |order| hash[order.name] += 1 } \n\t\thash.max{|a, b| a.length <=> b.length}\n\t end", "title": "" }, { "docid": "6e5dd686927c6f425a906af2420f1838", "score": "0.5063687", "text": "def state_count\n @states.size\n end", "title": "" }, { "docid": "65c8dd636d7531e8ec2c0a02868c5365", "score": "0.505905", "text": "def count_passing\n return self.passing_tests.size\n end", "title": "" }, { "docid": "e4339cc7cbafd62034a3fec4ca9861ef", "score": "0.50569177", "text": "def num_layers\n num_layers = 0\n # binding.pry\n while !nodes.where(net_id: id, layer: num_layers).empty?\n num_layers += 1\n end\n num_layers\n end", "title": "" }, { "docid": "09a0793f71b6e17b5ca60a4afbd1f865", "score": "0.5053655", "text": "def hard(input)\n input.map { |line| line.dump.length - line.length }.sum\nend", "title": "" }, { "docid": "2b7efb7dd91e425577e3fbfda541ce2d", "score": "0.5039054", "text": "def number_of_flipping_slots(integer1, integer2)\n (integer1 ^ integer2).to_s(2).count('1')\nend", "title": "" }, { "docid": "e0e939cb64f89a8fb92c2976525d20d7", "score": "0.5018308", "text": "def number_of_realisations(login=nil)\n count_by_frbr(login, :is_realised_through, :how_many_expressions?) \n end", "title": "" }, { "docid": "54e7c157bbdfec7425417030e0a9764a", "score": "0.5017408", "text": "def getNumberOfSolutions; @solutions.length; end", "title": "" }, { "docid": "b676e759a02bd1a89a9d4318252b8b3d", "score": "0.5010165", "text": "def calculate_query_depth\n query_depth = 0\n \n @object.vex_assignments.keys.select{ |a| a unless @object.vex_assignments[a].nil? or @object.vex_assignments[a][:through].nil? }.each do |key|\n query_depth = 1 if query_depth < 1\n eval = @object.vex_assignments[key][:through]\n if eval.is_a? Array\n eval.each do |through|\n unless @object.vex_assignments[through].nil? or @object.vex_assignments[through][:through].nil?\n query_depth = 2 if query_depth < 2\n test = @object.vex_assignments[through][:through]\n end\n end\n end\n end\n return query_depth\n end", "title": "" }, { "docid": "4528af0a05401f2410905dbbdad281e2", "score": "0.5010129", "text": "def n_support\n @model[:sv_indices].size\n end", "title": "" } ]
4b123e9691287aa5847120dad38e22f8
See: SQLite has an additional restriction on the ALTER TABLE statement
[ { "docid": "1695fa6c947916c11692e73cad8503a6", "score": "0.6040731", "text": "def valid_alter_table_options( type, options)\n type.to_sym != :primary_key\n end", "title": "" } ]
[ { "docid": "409f401667b2b3e16dc4104e665788e5", "score": "0.68100786", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n if (pk = op.delete(:primary_key)) || (ref = op.delete(:table))\n if pk\n op[:null] = false\n end\n\n sqls = [super(table, op)]\n\n if pk && (h2_version >= '1.4' || op[:type] != :identity)\n sqls << \"ALTER TABLE #{quote_schema_table(table)} ADD PRIMARY KEY (#{quote_identifier(op[:name])})\"\n end\n\n if ref\n op[:table] = ref\n sqls << \"ALTER TABLE #{quote_schema_table(table)} ADD FOREIGN KEY (#{quote_identifier(op[:name])}) #{column_references_sql(op)}\"\n end\n\n sqls\n else\n super(table, op)\n end\n when :rename_column\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} RENAME TO #{quote_identifier(op[:new_name])}\"\n when :set_column_null\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} SET#{' NOT' unless op[:null]} NULL\"\n when :set_column_type\n if sch = schema(table)\n if cs = sch.each{|k, v| break v if k == op[:name]; nil}\n cs = cs.dup\n cs[:default] = cs[:ruby_default]\n op = cs.merge!(op)\n end\n end\n sql = \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} #{type_literal(op)}\".dup\n column_definition_order.each{|m| send(:\"column_definition_#{m}_sql\", sql, op)}\n sql\n when :drop_constraint\n if op[:type] == :primary_key\n \"ALTER TABLE #{quote_schema_table(table)} DROP PRIMARY KEY\"\n else\n super(table, op)\n end\n else\n super(table, op)\n end\n end", "title": "" }, { "docid": "f72fca3d788c361273798be1ac31cf9a", "score": "0.6751254", "text": "def alter_table(*)\n clear_statement_caches\n super\n end", "title": "" }, { "docid": "e86fd6ed8ad71217813664633e8f5e16", "score": "0.67332494", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n if op[:primary_key]\n sqls = []\n sqls << alter_table_sql(table, op.merge(:primary_key=>nil))\n if op[:auto_increment]\n seq_name = default_sequence_name(table, op[:name])\n sqls << drop_sequence_sql(seq_name)\n sqls << create_sequence_sql(seq_name, op)\n sqls << \"UPDATE #{quote_schema_table(table)} SET #{quote_identifier(op[:name])} = #{seq_name}.nextval\"\n end\n sqls << \"ALTER TABLE #{quote_schema_table(table)} ADD PRIMARY KEY (#{quote_identifier(op[:name])})\"\n sqls\n else\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op)}\"\n end\n when :set_column_null\n \"ALTER TABLE #{quote_schema_table(table)} MODIFY #{quote_identifier(op[:name])} #{op[:null] ? 'NULL' : 'NOT NULL'}\"\n when :set_column_type\n \"ALTER TABLE #{quote_schema_table(table)} MODIFY #{quote_identifier(op[:name])} #{type_literal(op)}\"\n when :set_column_default\n \"ALTER TABLE #{quote_schema_table(table)} MODIFY #{quote_identifier(op[:name])} DEFAULT #{literal(op[:default])}\"\n else\n super(table, op)\n end\n end", "title": "" }, { "docid": "cadf1396f9346648bb6cb22ae13aee5a", "score": "0.6717693", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op)}\"\n when :drop_column\n \"ALTER TABLE #{quote_schema_table(table)} DROP #{column_definition_sql(op)}\"\n when :drop_constraint\n case op[:type]\n when :primary_key\n \"ALTER TABLE #{quote_schema_table(table)} DROP PRIMARY KEY\"\n when :foreign_key\n if op[:name] || op[:columns]\n name = op[:name] || foreign_key_name(table, op[:columns])\n if name\n \"ALTER TABLE #{quote_schema_table(table)} DROP FOREIGN KEY #{quote_identifier(name)}\"\n end\n end\n else\n super\n end\n when :rename_column\n \"ALTER TABLE #{quote_schema_table(table)} RENAME #{quote_identifier(op[:name])} TO #{quote_identifier(op[:new_name].to_s)}\"\n when :set_column_type\n \"ALTER TABLE #{quote_schema_table(table)} ALTER #{quote_identifier(op[:name])} #{type_literal(op)}\"\n when :set_column_null\n \"ALTER TABLE #{quote_schema_table(table)} ALTER #{quote_identifier(op[:name])} #{'NOT ' unless op[:null]}NULL\"\n when :set_column_default\n \"ALTER TABLE #{quote_schema_table(table)} ALTER #{quote_identifier(op[:name])} DEFAULT #{literal(op[:default])}\"\n else\n super(table, op)\n end\n end", "title": "" }, { "docid": "9457e216096c5838199ebeca50a65a49", "score": "0.66939956", "text": "def change_table(table_name, **options); end", "title": "" }, { "docid": "894e7ccf48152330b7e269a00725295d", "score": "0.66738605", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n if op[:primary_key] && op[:auto_increment] && op[:type] == Integer\n [\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op.merge(:auto_increment=>false, :primary_key=>false, :default=>0, :null=>false))}\",\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{literal(op[:name])} DROP DEFAULT\",\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{literal(op[:name])} SET #{auto_increment_sql}\"\n ]\n else\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op)}\"\n end\n when :drop_column\n \"ALTER TABLE #{quote_schema_table(table)} DROP #{column_definition_sql(op)}\"\n when :rename_column # renaming is only possible after db2 v9.7\n \"ALTER TABLE #{quote_schema_table(table)} RENAME COLUMN #{quote_identifier(op[:name])} TO #{quote_identifier(op[:new_name])}\"\n when :set_column_type\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} SET DATA TYPE #{type_literal(op)}\"\n when :set_column_default\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} SET DEFAULT #{literal(op[:default])}\"\n when :add_constraint\n if op[:type] == :unique\n sqls = op[:columns].map{|c| [\"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(c)} SET NOT NULL\", reorg_sql(table)]}\n sqls << super\n sqls.flatten\n else\n super\n end\n else\n super\n end\n end", "title": "" }, { "docid": "b86a613d5b2867188bd4f893477f417c", "score": "0.6623459", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n if op[:table]\n [super(table, op.merge(:table=>nil)),\n alter_table_sql(table, op.merge(:op=>:add_constraint, :type=>:foreign_key, :name=>op[:foreign_key_name], :columns=>[op[:name]], :table=>op[:table]))]\n else\n super\n end\n when :rename_column\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} RENAME TO #{quote_identifier(op[:new_name])}\"\n when :set_column_type\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} SET DATA TYPE #{type_literal(op)}\"\n when :set_column_null\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} SET #{op[:null] ? 'NULL' : 'NOT NULL'}\"\n else\n super\n end\n end", "title": "" }, { "docid": "b8578f1b88fecfd2eadf647bcc658114", "score": "0.6623208", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :rename_column\n \"RENAME COLUMN #{quote_schema_table(table)}.#{quote_identifier(op[:name])} TO #{quote_identifier(op[:new_name])}\"\n when :set_column_type\n # Derby is very limited in changing a columns type, so adding a new column and then dropping the existing column is\n # the best approach, as mentioned in the Derby documentation.\n temp_name = :x_sequel_temp_column_x\n [alter_table_sql(table, op.merge(:op=>:add_column, :name=>temp_name)),\n from(table).update_sql(temp_name=>::Sequel::SQL::Cast.new(op[:name], op[:type])),\n alter_table_sql(table, op.merge(:op=>:drop_column)),\n alter_table_sql(table, op.merge(:op=>:rename_column, :name=>temp_name, :new_name=>op[:name]))]\n when :set_column_null\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} #{op[:null] ? 'NULL' : 'NOT NULL'}\"\n else\n super\n end\n end", "title": "" }, { "docid": "8dc13dd12322b6ac64d2e88bc23d60ae", "score": "0.6489412", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op)}\"\n when :drop_column\n sqls = []\n add_drop_default_constraint_sql(sqls, table, op[:name])\n sqls << super\n when :rename_column\n \"sp_rename #{literal(\"#{quote_schema_table(table)}.#{quote_identifier(op[:name])}\")}, #{literal(op[:new_name].to_s)}, 'COLUMN'\"\n when :set_column_type\n sqls = []\n if sch = schema(table)\n if cs = sch.each{|k, v| break v if k == op[:name]; nil}\n cs = cs.dup\n add_drop_default_constraint_sql(sqls, table, op[:name])\n cs[:default] = cs[:ruby_default]\n op = cs.merge!(op)\n default = op.delete(:default)\n end\n end\n sqls << \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{column_definition_sql(op)}\"\n sqls << alter_table_sql(table, op.merge(:op=>:set_column_default, :default=>default)) if default\n sqls\n when :set_column_null\n sch = schema(table).find{|k,v| k.to_s == op[:name].to_s}.last\n type = sch[:db_type]\n if [:string, :decimal].include?(sch[:type]) && ![\"text\", \"ntext\"].include?(type) && (size = (sch[:max_chars] || sch[:column_size]))\n size = \"MAX\" if size == -1\n type += \"(#{size}#{\", #{sch[:scale]}\" if sch[:scale] && sch[:scale].to_i > 0})\"\n end\n \"ALTER TABLE #{quote_schema_table(table)} ALTER COLUMN #{quote_identifier(op[:name])} #{type_literal(:type=>type)} #{'NOT ' unless op[:null]}NULL\"\n when :set_column_default\n \"ALTER TABLE #{quote_schema_table(table)} ADD CONSTRAINT #{quote_identifier(\"sequel_#{table}_#{op[:name]}_def\")} DEFAULT #{literal(op[:default])} FOR #{quote_identifier(op[:name])}\"\n else\n super(table, op)\n end\n end", "title": "" }, { "docid": "740651efeec747ddd9e1acb2a76cfb17", "score": "0.645995", "text": "def test_table_properties\n assert_raises(ArgumentError) do\n @table.alter! :hello => :world\n end\n assert_raises(ArgumentError) do\n # Splits not allowed\n @table.alter! :readonly => :true, :splits => [1, 2, 3]\n end\n\n max_fs = 512 * 1024 ** 2\n mem_fs = 64 * 1024 ** 2\n\n progress = total = nil\n @table.alter!(\n :max_filesize => max_fs,\n :memstore_flushsize => mem_fs,\n :readonly => false\n ) do |p, t|\n progress = p\n total = t\n end\n assert_equal total, progress\n assert progress > 0\n\n assert_equal max_fs, @table.descriptor.get_max_file_size\n assert_equal mem_fs, @table.descriptor.get_mem_store_flush_size\n assert_equal false, @table.descriptor.is_read_only\n\n @table.drop!\n end", "title": "" }, { "docid": "8fc80eb5b2064475a2a8bd9f7e1fd745", "score": "0.6434579", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_index, :drop_index\n super\n when :add_column\n if op[:unique] || op[:primary_key]\n duplicate_table(table){|columns| columns.push(op)}\n else\n super\n end\n when :drop_column\n ocp = lambda{|oc| oc.delete_if{|c| c.to_s == op[:name].to_s}}\n duplicate_table(table, :old_columns_proc=>ocp){|columns| columns.delete_if{|s| s[:name].to_s == op[:name].to_s}}\n when :rename_column\n ncp = lambda{|nc| nc.map!{|c| c.to_s == op[:name].to_s ? op[:new_name] : c}}\n duplicate_table(table, :new_columns_proc=>ncp){|columns| columns.each{|s| s[:name] = op[:new_name] if s[:name].to_s == op[:name].to_s}}\n when :set_column_default\n duplicate_table(table){|columns| columns.each{|s| s[:default] = op[:default] if s[:name].to_s == op[:name].to_s}}\n when :set_column_null\n duplicate_table(table){|columns| columns.each{|s| s[:null] = op[:null] if s[:name].to_s == op[:name].to_s}}\n when :set_column_type\n duplicate_table(table){|columns| columns.each{|s| s.merge!(op) if s[:name].to_s == op[:name].to_s}}\n when :drop_constraint\n case op[:type]\n when :primary_key\n duplicate_table(table){|columns| columns.each{|s| s[:primary_key] = s[:auto_increment] = nil}}\n when :foreign_key\n if op[:columns]\n duplicate_table(table, :skip_foreign_key_columns=>op[:columns])\n else\n duplicate_table(table, :no_foreign_keys=>true)\n end\n else\n duplicate_table(table)\n end\n when :add_constraint\n duplicate_table(table, :constraints=>[op])\n when :add_constraints\n duplicate_table(table, :constraints=>op[:ops])\n else\n raise Error, \"Unsupported ALTER TABLE operation: #{op[:op].inspect}\"\n end\n end", "title": "" }, { "docid": "3c5be4ef001639ae49ff552836c3e642", "score": "0.6432336", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :add_column\n \"ALTER TABLE #{quote_schema_table(table)} ADD #{column_definition_sql(op)}\"\n when :drop_column\n \"ALTER TABLE #{quote_schema_table(table)} DROP #{column_definition_sql(op)}\"\n when :rename_column\n \"ALTER TABLE #{quote_schema_table(table)} ALTER #{quote_identifier(op[:name])} TO #{quote_identifier(op[:new_name])}\"\n when :set_column_type\n \"ALTER TABLE #{quote_schema_table(table)} ALTER #{quote_identifier(op[:name])} TYPE #{type_literal(op)}\"\n else\n super(table, op)\n end\n end", "title": "" }, { "docid": "d6f7b19fa25f8a706d902ef67c29521e", "score": "0.63894415", "text": "def apply(host, table)\n connection_manager.query(host,\n \"ALTER TABLE #{table} ADD COLUMN b INT NOT NULL\"\n )\n end", "title": "" }, { "docid": "14769168b83a48e094187b5a0d0d91c0", "score": "0.63584477", "text": "def apply_alter_table(table, ops)\n fks = fetch(\"PRAGMA foreign_keys\")\n run \"PRAGMA foreign_keys = 0\" if fks\n transaction do \n if ops.length > 1 && ops.all?{|op| op[:op] == :add_constraint}\n # If you are just doing constraints, apply all of them at the same time,\n # as otherwise all but the last one get lost.\n alter_table_sql_list(table, [{:op=>:add_constraints, :ops=>ops}]).flatten.each{|sql| execute_ddl(sql)}\n else\n # Run each operation separately, as later operations may depend on the\n # results of earlier operations.\n ops.each{|op| alter_table_sql_list(table, [op]).flatten.each{|sql| execute_ddl(sql)}}\n end\n end\n ensure\n run \"PRAGMA foreign_keys = 1\" if fks\n end", "title": "" }, { "docid": "7723ee001c94e87fb06e59cc196c476f", "score": "0.6303696", "text": "def alter_table(name, &block)\n g = Schema::AlterTableGenerator.new(self, &block)\n alter_table_sql_list(name, g.operations).each {|sql| execute(sql)}\n end", "title": "" }, { "docid": "8dc5872852764bdeb49852af586fff1a", "score": "0.6239661", "text": "def test_change_columns\n assert_nothing_raised { @connection.change_column_default(:group, :order, 'whatever') }\n #the quoting here will reveal any double quoting issues in change_column's interaction with the column method in the adapter\n assert_nothing_raised { @connection.change_column('group', 'order', :Int, :default => 0) }\n assert_nothing_raised { @connection.rename_column(:group, :order, :values) }\n end", "title": "" }, { "docid": "4f1f7ddaeb32483d6f11544265b7dbc3", "score": "0.6229958", "text": "def apply_alter_table(name, ops)\n alter_table_sql_list(name, ops).each do |sql|\n execute_ddl(sql)\n reorg(name)\n end\n end", "title": "" }, { "docid": "71a32670ea56a985ee4e79c05e1c0545", "score": "0.6228433", "text": "def change_table(table_name, options = {}, &block)\n transaction do\n\n # Add an empty proc to support calling change_table without a block.\n #\n block ||= proc { }\n\n if options[:temporal] == true\n if !is_chrono?(table_name)\n # Add temporal features to this table\n #\n if !primary_key(table_name)\n execute \"ALTER TABLE #{table_name} ADD __chrono_id SERIAL PRIMARY KEY\"\n end\n\n execute \"ALTER TABLE #{table_name} SET SCHEMA #{TEMPORAL_SCHEMA}\"\n _on_history_schema { chrono_create_history_for(table_name) }\n chrono_create_view_for(table_name, options)\n copy_indexes_to_history_for(table_name)\n\n TableCache.add! table_name\n\n # Optionally copy the plain table data, setting up history\n # retroactively.\n #\n if options[:copy_data]\n seq = _on_history_schema { serial_sequence(table_name, primary_key(table_name)) }\n from = options[:validity] || '0001-01-01 00:00:00'\n\n execute %[\n INSERT INTO #{HISTORY_SCHEMA}.#{table_name}\n SELECT *,\n nextval('#{seq}') AS hid,\n tsrange('#{from}', NULL) AS validity,\n timezone('UTC', now()) AS recorded_at\n FROM #{TEMPORAL_SCHEMA}.#{table_name}\n ]\n end\n end\n\n chrono_alter(table_name) { super table_name, options, &block }\n else\n if options[:temporal] == false && is_chrono?(table_name)\n # Remove temporal features from this table\n #\n execute \"DROP VIEW #{table_name}\"\n\n _on_temporal_schema do\n %w( insert update delete ).each do |func|\n execute \"DROP FUNCTION IF EXISTS #{table_name}_#{func}() CASCADE\"\n end\n end\n\n _on_history_schema { execute \"DROP TABLE #{table_name}\" }\n\n default_schema = select_value 'SELECT current_schema()'\n _on_temporal_schema do\n if primary_key(table_name) == '__chrono_id'\n execute \"ALTER TABLE #{table_name} DROP __chrono_id\"\n end\n\n execute \"ALTER TABLE #{table_name} SET SCHEMA #{default_schema}\"\n end\n\n TableCache.del! table_name\n end\n\n super table_name, options, &block\n end\n end\n end", "title": "" }, { "docid": "20d47a73e0aab0207c27d4022130952d", "score": "0.62089676", "text": "def alter_statement?(sql)\n sql =~ /\\Aalter table/i\n end", "title": "" }, { "docid": "20d47a73e0aab0207c27d4022130952d", "score": "0.62089676", "text": "def alter_statement?(sql)\n sql =~ /\\Aalter table/i\n end", "title": "" }, { "docid": "48eb03a31a21a205d4f671eb0d210bdc", "score": "0.617702", "text": "def alter(table_name, wait = true, *args)\n # Table name should be a string\n raise(ArgumentError, \"Table name must be of type String\") unless table_name.kind_of?(String)\n\n # Table should exist\n raise(ArgumentError, \"Can't find a table: #{table_name}\") unless exists?(table_name)\n\n # Table should be disabled\n # raise(ArgumentError, \"Table #{table_name} is enabled. Disable it first before altering.\") if enabled?(table_name)\n\n # There should be at least one argument\n raise(ArgumentError, \"There should be at least one argument but the table name\") if args.empty?\n\n # Get table descriptor\n htd = @admin.getTableDescriptor(table_name.to_java_bytes)\n\n # Process all args\n columnsToAdd = ArrayList.new()\n columnsToMod = ArrayList.new()\n columnsToDel = ArrayList.new()\n args.each do |arg|\n # Normalize args to support column name only alter specs\n arg = { NAME => arg } if arg.kind_of?(String)\n\n # Normalize args to support shortcut delete syntax\n arg = { METHOD => 'delete', NAME => arg['delete'] } if arg['delete']\n\n # No method parameter, try to use the args as a column definition\n unless method = arg.delete(METHOD)\n descriptor = hcd(arg, htd)\n column_name = descriptor.getNameAsString\n\n # If column already exist, then try to alter it. Create otherwise.\n if htd.hasFamily(column_name.to_java_bytes)\n columnsToMod.add(Pair.new(column_name, descriptor))\n else\n columnsToAdd.add(descriptor)\n end\n next\n end\n # Delete column family\n if method == \"delete\"\n raise(ArgumentError, \"NAME parameter missing for delete method\") unless arg[NAME]\n columnsToDel.add(arg[NAME])\n next\n end\n\n # Change table attributes\n if method == \"table_att\"\n # Table should be disabled\n raise(ArgumentError, \"Table #{table_name} is enabled. Disable it first before altering.\") if enabled?(table_name)\n htd.setMaxFileSize(JLong.valueOf(arg[MAX_FILESIZE])) if arg[MAX_FILESIZE]\n htd.setReadOnly(JBoolean.valueOf(arg[READONLY])) if arg[READONLY]\n htd.setMemStoreFlushSize(JLong.valueOf(arg[MEMSTORE_FLUSHSIZE])) if arg[MEMSTORE_FLUSHSIZE]\n htd.setDeferredLogFlush(JBoolean.valueOf(arg[DEFERRED_LOG_FLUSH])) if arg[DEFERRED_LOG_FLUSH]\n if arg[CONFIG]\n raise(ArgumentError, \"#{CONFIG} must be a Hash type\") unless arg.kind_of?(Hash)\n for k,v in arg[CONFIG]\n v = v.to_s unless v.nil?\n htd.setValue(k, v)\n end\n end\n @admin.modifyTable(table_name.to_java_bytes, htd)\n next\n end\n\n # Unknown method\n raise ArgumentError, \"Unknown method: #{method}\"\n end\n # now batch process alter requests\n @admin.alterTable(table_name, columnsToAdd, columnsToMod, columnsToDel)\n if wait == true\n puts \"Updating all regions with the new schema...\"\n alter_status(table_name)\n end\n end", "title": "" }, { "docid": "90dd822d4321bd31308ec0872d47587d", "score": "0.61729795", "text": "def update_version_1_table\n # Added in version 1.1.0\n connection.add_column(:revision_records, :trash, :boolean, :default => false)\n connection.add_index(:revision_records, :revisionable_id, :name => \"#{table_name}_id\")\n connection.add_index(:revision_records,\n [:revisionable_type, :created_at, :trash],\n :name => \"#{table_name}_type_and_created_at\")\n\n # Removed in 1.1.0\n connection.remove_index(:revision_records, :name => \"revisionable\")\n end", "title": "" }, { "docid": "b3bb86742f3324ce1e35442ac11d2489", "score": "0.6073608", "text": "def alter(table_name, *args)\n # Table name should be a string\n raise(ArgumentError, \"Table name must be of type String\") unless table_name.kind_of?(String)\n\n # Table should exist\n raise(ArgumentError, \"Can't find a table: #{table_name}\") unless exists?(table_name)\n\n # Table should be disabled\n raise(ArgumentError, \"Table #{table_name} is enabled. Disable it first before altering.\") if enabled?(table_name)\n\n # There should be at least one argument\n raise(ArgumentError, \"There should be at least one argument but the table name\") if args.empty?\n\n # Get table descriptor\n htd = @admin.getTableDescriptor(table_name.to_java_bytes)\n\n # Process all args\n args.each do |arg|\n # Normalize args to support column name only alter specs\n arg = { NAME => arg } if arg.kind_of?(String)\n\n # Normalize args to support shortcut delete syntax\n arg = { METHOD => 'delete', NAME => arg['delete'] } if arg['delete']\n\n # No method parameter, try to use the args as a column definition\n unless method = arg.delete(METHOD)\n descriptor = hcd(arg)\n column_name = descriptor.getNameAsString\n\n # If column already exist, then try to alter it. Create otherwise.\n if htd.hasFamily(column_name.to_java_bytes)\n @admin.modifyColumn(table_name, column_name, descriptor)\n else\n @admin.addColumn(table_name, descriptor)\n end\n next\n end\n\n # Delete column family\n if method == \"delete\"\n raise(ArgumentError, \"NAME parameter missing for delete method\") unless arg[NAME]\n @admin.deleteColumn(table_name, arg[NAME])\n next\n end\n\n # Change table attributes\n if method == \"table_att\"\n htd.setMaxFileSize(JLong.valueOf(arg[MAX_FILESIZE])) if arg[MAX_FILESIZE]\n htd.setReadOnly(JBoolean.valueOf(arg[READONLY])) if arg[READONLY]\n htd.setMemStoreFlushSize(JLong.valueOf(arg[MEMSTORE_FLUSHSIZE])) if arg[MEMSTORE_FLUSHSIZE]\n htd.setDeferredLogFlush(JBoolean.valueOf(arg[DEFERRED_LOG_FLUSH])) if arg[DEFERRED_LOG_FLUSH]\n @admin.modifyTable(table_name.to_java_bytes, htd)\n next\n end\n\n # Unknown method\n raise ArgumentError, \"Unknown method: #{method}\"\n end\n end", "title": "" }, { "docid": "51a3599bd34f8d40c66aaf4e65330e43", "score": "0.6071566", "text": "def alter_table_sql(table, op)\n case op[:op]\n when :drop_index\n \"#{drop_index_sql(table, op)} ON #{quote_schema_table(table)}\"\n when :drop_constraint\n if op[:type] == :primary_key\n if (pk = primary_key_from_schema(table)).length == 1\n return [alter_table_sql(table, {:op=>:rename_column, :name=>pk.first, :new_name=>pk.first, :auto_increment=>false}), super]\n end\n end\n super\n else\n super\n end\n end", "title": "" }, { "docid": "409f1437a9f5dda661ce2d44907388f4", "score": "0.60458964", "text": "def valid_alter_table_options( type, options)\n type.to_sym != :primary_key\n end", "title": "" }, { "docid": "409f1437a9f5dda661ce2d44907388f4", "score": "0.60458964", "text": "def valid_alter_table_options( type, options)\n type.to_sym != :primary_key\n end", "title": "" }, { "docid": "6ee38b95f4e28b1e9db4d54695edcf89", "score": "0.60442543", "text": "def change_primary_key(table, field)\n execute \"ALTER TABLE #{table} DROP PRIMARY KEY, ADD PRIMARY KEY(#{field_list(field)})\"\n end", "title": "" }, { "docid": "e113a0e02b2df0248c48ca8293ef37b2", "score": "0.60373354", "text": "def adapt_versioned_table\n not_versioned = [\"id\", \"action\", versioned_foreign_key.to_s]\n versioned_columns = []\n \n db_type = ActiveRecord::Base.configurations[Rails.env][\"adapter\"]\n if db_type == \"mysql2\"\n self.connection.execute(\"show columns from #{versioned_table_name}\").each { |col|\n versioned_columns << [col[0], col[1]] unless not_versioned.include?(col[0])\n }\n elsif db_type == \"postgresql\"\n self.connection.execute(\"select column_name, data_type from information_schema.columns where table_name = '#{versioned_table_name}'\").each { |col|\n versioned_columns << [col[\"column_name\"], col[\"data_type\"]] unless not_versioned.include?(col[\"column_name\"])\n }\n else\n raise \"This method doesn't support your database type ...\"\n end \n\n missing = []\n changed = []\n\n reset_columns = []\n self.columns.each do |col|\n reset_columns << [col.name, col.type] unless not_versioned.include?(col.name)\n end\n\n reset_columns.each do |rc|\n found = versioned_columns.detect{ |wc| wc.first == rc.first }\n unless found.blank?\n changed << rc if rc.last.to_s != found.last.to_s\n versioned_columns.delete_if { |k| k.first == rc.first }\n else\n missing << rc\n end\n end\n \n # Add new column\n missing.each do |m|\n self.connection.add_column versioned_table_name, m.first, m.last\n end\n\n # Change column\n changed.each do |c|\n self.connection.change_column versioned_table_name, c.first, c.last\n end\n \n # Remove column\n versioned_columns.each do |vc|\n self.connection.remove_column versioned_table_name, vc.first\n end\n end", "title": "" }, { "docid": "1c1fa3ee86bbcae7c6039a8aeebee7ed", "score": "0.59490645", "text": "def alter_table_sql(table_name, &block)\n generator = ::Sequel::Schema::AlterTableGenerator.new(self, &block)\n sqls = delegate.db.send(:alter_table_sql_list, table_name, generator.operations).flatten\n sqls.join(\"\\n\")\n end", "title": "" }, { "docid": "f2c36e5dc7ba03e70844c58fc87621fb", "score": "0.594839", "text": "def handle_schema_modification(t, tuple)\n # Handle table creation/deletion/truncation\n if drop_table\n t.drop_table(self.dataset) if t.has_table?(self.dataset)\n end\n if create_table\n heading = tuple_heading(tuple)\n heading = check_tuple_heading(heading, environment)\n t.create_table(self.dataset, heading)\n end\n if truncate_table\n t.delete(self.dataset, {})\n end\n end", "title": "" }, { "docid": "a5ebeade9fdf04ed82f871dccfeebb2f", "score": "0.5926249", "text": "def change_table(table_name, options = {}, &block)\n transaction do\n\n # Add an empty proc to support calling change_table without a block.\n #\n block ||= proc { }\n\n if options[:temporal] == true\n if !is_chrono?(table_name)\n # Add temporal features to this table\n #\n execute \"ALTER TABLE #{table_name} SET SCHEMA #{TEMPORAL_SCHEMA}\"\n _on_history_schema { chrono_create_history_for(table_name) }\n chrono_create_view_for(table_name)\n\n TableCache.add! table_name\n\n # Optionally copy the plain table data, setting up history\n # retroactively.\n #\n if options[:copy_data]\n seq = _on_history_schema { serial_sequence(table_name, primary_key(table_name)) }\n from = options[:validity] || '0001-01-01 00:00:00'\n\n execute %[\n INSERT INTO #{HISTORY_SCHEMA}.#{table_name}\n SELECT *,\n nextval('#{seq}') AS hid,\n timestamp '#{from}' AS valid_from,\n timestamp '9999-12-31 00:00:00' AS valid_to,\n timezone('UTC', now()) AS recorded_at\n FROM #{TEMPORAL_SCHEMA}.#{table_name}\n ]\n end\n end\n\n chrono_alter(table_name) { super table_name, options, &block }\n else\n if options[:temporal] == false && is_chrono?(table_name)\n # Remove temporal features from this table\n #\n execute \"DROP VIEW #{table_name}\"\n _on_history_schema { execute \"DROP TABLE #{table_name}\" }\n\n default_schema = select_value 'SELECT current_schema()'\n _on_temporal_schema do\n execute \"ALTER TABLE #{table_name} SET SCHEMA #{default_schema}\"\n end\n\n TableCache.del! table_name\n end\n\n super table_name, options, &block\n end\n end\n end", "title": "" }, { "docid": "587ea2398cd87ccc94b3d269dcb7d0bb", "score": "0.591901", "text": "def change_column(table_name, column_name, type, options = {})\n # null/not nulling is easy, handle that separately\n if options.include?(:null)\n # This seems to only work with 10.2 of Derby\n if options.delete(:null) == false\n execute \"ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} NOT NULL\"\n else\n execute \"ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} NULL\"\n end\n end\n\n # anything left to do?\n unless options.empty?\n begin\n execute \"ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} SET DATA TYPE #{type_to_sql(type, options[:limit])}\"\n rescue\n transaction do\n temp_new_column_name = \"#{column_name}_newtype\"\n # 1) ALTER TABLE t ADD COLUMN c1_newtype NEWTYPE;\n add_column table_name, temp_new_column_name, type, options\n # 2) UPDATE t SET c1_newtype = c1;\n execute \"UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(temp_new_column_name)} = CAST(#{quote_column_name(column_name)} AS #{type_to_sql(type, options[:limit])})\"\n # 3) ALTER TABLE t DROP COLUMN c1;\n remove_column table_name, column_name\n # 4) ALTER TABLE t RENAME COLUMN c1_newtype to c1;\n rename_column table_name, temp_new_column_name, column_name\n end\n end\n end\n end", "title": "" }, { "docid": "947e2e05a4e67c76f0364b8d040ab4b5", "score": "0.59074044", "text": "def table_modifier_in_create(o); end", "title": "" }, { "docid": "947e2e05a4e67c76f0364b8d040ab4b5", "score": "0.59074044", "text": "def table_modifier_in_create(o); end", "title": "" }, { "docid": "7ed1ec1f7c4463e4c3788e83352f4a31", "score": "0.58814776", "text": "def partition_table(name, scheme)\n raise InvalidSchemeError, scheme if scheme.blank?\n execute(\"ALTER TABLE #{quote_table_name(name)} #{scheme}\")\n end", "title": "" }, { "docid": "8782848b0a3fda5213f8399c58de911b", "score": "0.586535", "text": "def change(data)\n newdata = data.clone\n \n newdata[\"name\"] = self.name if !newdata.key?(\"name\")\n newdata[\"type\"] = self.type if !newdata.key?(\"type\")\n newdata[\"maxlength\"] = self.maxlength if !newdata.key?(\"maxlength\") and self.maxlength\n newdata[\"null\"] = self.null? if !newdata.key?(\"null\")\n newdata[\"default\"] = self.default if !newdata.key?(\"default\")\n newdata[\"primarykey\"] = self.primarykey? if !newdata.key?(\"primarykey\")\n \n @type = nil\n @maxlength = nil\n \n new_table = self.table.copy(\n \"alter_columns\" => {\n self.name.to_s => newdata\n }\n )\n end", "title": "" }, { "docid": "b8a49e0310edcf74846679e97b829296", "score": "0.5861489", "text": "def change(data)\n col_escaped = \"#{@args[:db].enc_col}#{@args[:db].esc_col(self.name)}#{@args[:db].enc_col}\"\n table_escape = \"#{@args[:db].enc_table}#{@args[:db].esc_table(self.table.name)}#{@args[:db].enc_table}\"\n newdata = data.clone\n \n newdata[\"name\"] = self.name if !newdata.key?(\"name\")\n newdata[\"type\"] = self.type if !newdata.key?(\"type\")\n newdata[\"maxlength\"] = self.maxlength if !newdata.key?(\"maxlength\") and self.maxlength\n newdata[\"null\"] = self.null? if !newdata.key?(\"null\")\n newdata[\"default\"] = self.default if !newdata.key?(\"default\") and self.default\n newdata.delete(\"primarykey\") if newdata.key?(\"primarykey\")\n \n type_s = newdata[\"type\"].to_s\n @args[:db].query(\"ALTER TABLE #{table_escape} CHANGE #{col_escaped} #{@args[:db].cols.data_sql(newdata)}\")\n end", "title": "" }, { "docid": "2a15885a8782d6467f6264c15579ce6c", "score": "0.5861124", "text": "def active_record_update_schema\n\t\t\tend", "title": "" }, { "docid": "63144847eb98b0893f40a6ca7f431476", "score": "0.5830742", "text": "def valid_alter_table_type?(type)\n type.to_sym != :primary_key\n end", "title": "" }, { "docid": "8ef352f95276a919e9dc0ce1d605bbe3", "score": "0.5779795", "text": "def change(data)\n newdata = data.clone\n\n newdata[:name] = name unless newdata.key?(:name)\n newdata[:type] = type unless newdata.key?(:type)\n newdata[:maxlength] = maxlength if !newdata.key?(:maxlength) && maxlength\n newdata[:null] = null? unless newdata.key?(:null)\n newdata[:default] = default if !newdata.key?(:default) && default\n newdata.delete(:primarykey) if newdata.key?(:primarykey)\n\n drop_add = true if name.to_s != newdata[:name].to_s\n\n table.__send__(:remove_column_from_list, self) if drop_add\n @db.query(\"ALTER TABLE #{@db.quote_table(table_name)} CHANGE #{@db.quote_column(name)} #{@db.columns.data_sql(newdata)}\")\n @name = newdata[:name].to_s\n reload\n table.__send__(:add_column_to_list, self) if drop_add\n end", "title": "" }, { "docid": "7c199bbbf1b83c32c263324267789f3f", "score": "0.57639897", "text": "def change_table(table_name, **options, &block)\n transaction do\n\n # Add an empty proc to support calling change_table without a block.\n #\n block ||= proc { }\n\n if options[:temporal]\n if !is_chrono?(table_name)\n chrono_make_temporal_table(table_name, options)\n end\n\n drop_and_recreate_public_view(table_name, options) do\n super table_name, **options, &block\n end\n\n else\n if is_chrono?(table_name)\n chrono_undo_temporal_table(table_name)\n end\n\n super table_name, **options, &block\n end\n\n end\n end", "title": "" }, { "docid": "c03d45bbd6ce8e52fe9403a4d468ab82", "score": "0.57621944", "text": "def update_table_sql(sql)\n sql << ' '\n source_list_append(sql, @opts[:from][0..0])\n end", "title": "" }, { "docid": "909742a21bbf0dd20882b8918f214d06", "score": "0.57417965", "text": "def before_create_table\n\t\t\t# No-op\n\t\tend", "title": "" }, { "docid": "bf59d6d83b2782bd649081d035b9ce8b", "score": "0.5740102", "text": "def migration_code_up\n # NOTE: Have to include a block in create_table, due to Rails bug #2221 (up through 2.3.5).\n result = table_exists? ? [] : [\" create_table(:#{table_name}) {}\"] # TODO: Determine if we need :id, :primary_key, or :options.\n result << added_columns.collect do |name|\n \" add_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << changed_columns.collect do |name|\n \" change_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << removed_columns.collect do |name|\n \" remove_column :#{table_name}, :#{name}\"\n end\n result.reject{|x| x.empty?}\n end", "title": "" }, { "docid": "37c3d9e2451ba83843fd56e745b5bc4c", "score": "0.5735024", "text": "def alter_table_sql( field_hash, &list_proc )\n # make a list of all the fields to include, using the appropriate syntax\n field_list = field_hash.collect( &list_proc )\n field_text = field_list.join\n # remove the final comma\n field_text.chop!\n return \"ALTER TABLE #{$options.schema}.#{shadow_name}#{field_text}\"\n end", "title": "" }, { "docid": "5cc258f192ac68e0491f19c51bf0b822", "score": "0.5728906", "text": "def proper_table_name(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "3de9137a6d2e2239f754014a66b601c2", "score": "0.57287973", "text": "def rotate_table(dbh, table)\n begin\n dbh.execute(\"DROP TABLE IF EXISTS #{table}_last\")\n dbh.execute(\"RENAME TABLE #{table} TO #{table}_last\") \n rescue \n end\nend", "title": "" }, { "docid": "1a0b99823f3a6b5eaee09f3d28297076", "score": "0.5721824", "text": "def enable_keys\n connection.execute(\"ALTER TABLE #{quoted_table_name} ENABLE KEYS\")\n end", "title": "" }, { "docid": "ebcb1c26170a46f394ac7e7bc6a98289", "score": "0.5705576", "text": "def update_versioned_table(create_table_options = {})\n \n self.reset_column_information\n self.versioned_class.reset_column_information\n @versioned_columns = nil #A hackish re-set of versioned columns\n \n create_versioned_table(create_table_options) unless connection.table_exists?(versioned_table_name)\n \n #Add newly created columns\n self.versioned_columns.each do |col| \n unless self.versioned_class.columns.detect{|c| c.name == col.name}\n self.versioned_class.connection.add_column versioned_table_name, col.name, col.type, \n :limit => col.limit, \n :default => col.default,\n :scale => col.scale,\n :precision => col.precision\n end\n end\n \n #I don't trust this enough to not clobber columns we need, so it puts out a list\n self.versioned_class.columns.each do |col|\n unless self.versioned_columns.detect{|c| c.name == col.name}\n if ![\"id\", version_column, versioned_foreign_key, version_column].include?(col.name) && !col.name.starts_with?(\"versioned_\")\n puts \"*** #{col.name} is in #{versioned_table_name} but no longer in the source table. Perhaps you want a migration to remove it?\"\n puts \"*** remove_column :#{versioned_table_name}, :#{col.name}\"\n end\n end\n end\n \n \n #Check the associated models\n versioned_column_names = self.versioned_class.columns.collect{|c| c.name}\n versioned_association_reflections.values.reject{|x| x.macro != :belongs_to}.each do |reflection|\n if reflection.options[:polymorphic]\n unless versioned_column_names.include?(versioned_association_foreign_key(reflection.foreign_key))\n self.connection.add_column versioned_table_name, versioned_association_foreign_key(reflection.foreign_key), :integer\n end\n unless versioned_column_names.include?(versioned_association_foreign_key(reflection.foreign_type))\n self.connection.add_column versioned_table_name, versioned_association_foreign_key(reflection.foreign_type), :string\n end\n else\n cname = versioned_association_foreign_key(reflection.foreign_key)\n unless versioned_column_names.include?(cname)\n self.connection.add_column versioned_table_name, cname, :integer\n end\n end\n end\n\n \n end", "title": "" }, { "docid": "6e704d9547f22907bd63de4b9e5c37c8", "score": "0.5700006", "text": "def change(column_name, type, **options); end", "title": "" }, { "docid": "a643589d093d4c9b93fddf2b5d2a92e8", "score": "0.5697797", "text": "def feature_3600\n @db.run 'DROP TABLE IF EXISTS old_acl;'\n @db.run 'ALTER TABLE acl RENAME TO old_acl;'\n\n create_table(:acl)\n\n @db.transaction do\n @db.fetch('SELECT * FROM old_acl') do |row|\n row[:userset] = row.delete(:user)\n\n @db[:acl].insert(row)\n end\n end\n\n @db.run \"DROP TABLE old_acl;\"\n end", "title": "" }, { "docid": "a643589d093d4c9b93fddf2b5d2a92e8", "score": "0.5697797", "text": "def feature_3600\n @db.run 'DROP TABLE IF EXISTS old_acl;'\n @db.run 'ALTER TABLE acl RENAME TO old_acl;'\n\n create_table(:acl)\n\n @db.transaction do\n @db.fetch('SELECT * FROM old_acl') do |row|\n row[:userset] = row.delete(:user)\n\n @db[:acl].insert(row)\n end\n end\n\n @db.run \"DROP TABLE old_acl;\"\n end", "title": "" }, { "docid": "238e4b1a6a8ee5ac3572755d255b717c", "score": "0.5659144", "text": "def truncate_sqlite3!\n ActiveRecord::Base.connection.execute(\"DELETE FROM #{table_name.to_s}\")\n ActiveRecord::Base.connection.execute(\"DELETE FROM sqlite_sequence WHERE name='#{table_name.to_s}'\")\n end", "title": "" }, { "docid": "80ad69d896e44fcdf42312c3f35c3f1c", "score": "0.56532276", "text": "def prepare_to_migrate\n if active_table_name != base_table_name\n connection.execute( \"truncate table #{base_table_name}\" )\n connection.execute( \"insert into #{base_table_name} select * from #{active_table_name}\" )\n end\n suffixed_table_names.each do |stn|\n connection.execute( \"drop table if exists #{stn}\" )\n end\n connection.execute( \"drop table if exists #{switch_table_name}\" )\n end", "title": "" }, { "docid": "ad4426f2237d5d9b004787ef573ffdc3", "score": "0.5649843", "text": "def rename_table_sql(name, new_name)\n \"ALTER TABLE #{quote_schema_table(name)} RENAME #{quote_schema_table(new_name)}\"\n end", "title": "" }, { "docid": "c49de14b84fd2949ece772f0959de820", "score": "0.5649258", "text": "def create_constraints_statement(storage_name, constraint_name, constraint_type, foreign_keys, reference_storage_name, reference_keys)\n <<-SQL.compress_lines\n ALTER TABLE #{quote_name(storage_name)}\n ADD CONSTRAINT #{quote_name(constraint_name)}\n FOREIGN KEY (#{foreign_keys.join(', ')})\n REFERENCES #{quote_name(reference_storage_name)} (#{reference_keys.join(', ')})\n ON DELETE #{constraint_type}\n ON UPDATE #{constraint_type}\n SQL\n end", "title": "" }, { "docid": "13722aaf1588ef60f6c4fa7801dee885", "score": "0.56435925", "text": "def change_column(name, definition)\n ddl('alter table `%s` modify column `%s` %s' % [@name, name, definition])\n end", "title": "" }, { "docid": "8a7262114f842100e13daf245a8d7de4", "score": "0.56432927", "text": "def rename_sql_table(_old, _new)\n info \"Rename table '#{_old}' to '#{_new}'\"\n query \"ALTER TABLE #{_old} RENAME #{_new}\"\n end", "title": "" }, { "docid": "be98b8c48faf1fec3e6a92c96303bf72", "score": "0.5642995", "text": "def add_constraint(table_name, column_name, constraint)\n raise 'Too many constraints to edit' if constraint.count > 1\n sql_table_arguments = \"ALTER TABLE #{table_name.to_s} ALTER COLUMN #{column_name.to_s} SET #{evaluate_constraints(constraint)}\"\n puts \"-- add_constraint(:#{constraint.key})\"\n before_migrate = Time.now\n\n self.execute_migration(sql_table_arguments)\n\n after_migrate = Time.now\n migrate_duration = after_migrate - before_migrate\n puts \" -> #{migrate_duration}s\"\n end", "title": "" }, { "docid": "a4e7e6e7dc7bb3044b1cfe34385f6ed1", "score": "0.5639865", "text": "def change_table_sql(to_table, delta)\n change_table = delta[:change_table]\n results = []\n change_table.each do |table_name, table_delta|\n unless table_delta[:remove_foreign_key].empty?\n results << alter_remove_foreign_keys_sql(table_name, table_delta[:remove_foreign_key].keys)\n end\n table_delta[:remove_index].each do |index_name, _index|\n results << alter_remove_index_sql(table_name, index_name)\n end\n unless table_delta[:remove_column].empty?\n results << alter_remove_columns_sql(table_name, table_delta[:remove_column].values)\n end\n unless table_delta[:add_column].empty?\n results << alter_add_columns_sql(table_name, table_delta[:add_column].values)\n end\n table_delta[:change_column].each do |column_name, column|\n results << alter_change_column_sql(table_name, column_name, column, to_table)\n end\n table_delta[:add_index].each do |_index_name, index|\n results << alter_add_index_sql(table_name, index)\n end\n unless table_delta[:add_foreign_key].empty?\n results << alter_add_foreign_keys_sql(table_name, table_delta[:add_foreign_key].values)\n end\n unless table_delta[:change_table_option].empty?\n results << alter_change_table_sql(table_name, table_delta[:change_table_option])\n end\n end\n results << '' unless results.empty?\n results\n end", "title": "" }, { "docid": "5e339dad9352b41a283f95554aa36516", "score": "0.5636436", "text": "def change_table(table_name, base = self, **options)\n if supports_bulk_alter? && options[:bulk]\n recorder = ActiveRecord::Migration::CommandRecorder.new(self)\n yield update_table_definition(table_name, recorder)\n bulk_change_table(table_name, recorder.commands)\n else\n yield update_table_definition(table_name, base)\n end\n end", "title": "" }, { "docid": "cb62a2a5fbb9ef28bc24edc0124fd5c0", "score": "0.56324697", "text": "def apply_schema_change options, temp_table\n Kernel.p \"+++++++++++++++++ options \"\n puts options\n VerticaLoader.create_table({:mysql_schema => options[:mysql_schema],\n :vertica_db => options[:vertica_db],\n :vertica_schema => options[:vertica_schema],\n :table => temp_table,\n :mysql_table => options[:table]})\n table = options[:table]\n export_id = options[:export_id]\n new_options = prepare_options options\n new_options[:file] = options[:filepath]\n new_options[:table] = temp_table\n new_options[:schema] = options[:vertica_schema]\n\n\n vertica_copy new_options\n\n Kernel.p \"+++++++++++++++++ new_options \"\n puts new_options\n options[:table] = table\n puts options\n g_options = {:db => options[:vertica_db], :schema => options[:vertica_schema], :table => options[:table]}\n grants = Myreplicator::VerticaUtils.get_grants g_options\n # drop the old table\n sql = \"DROP TABLE IF EXISTS #{options[:vertica_db]}.#{options[:vertica_schema]}.#{options[:table]} CASCADE;\"\n #VerticaDb::Base.connection.execute sql\n Myreplicator::DB.exec_sql(\"vertica\",sql)\n # rename\n sql = \"ALTER TABLE #{options[:vertica_db]}.#{options[:vertica_schema]}.#{temp_table} RENAME TO \\\"#{options[:table]}\\\";\"\n\n #VerticaDb::Base.connection.execute sql\n Myreplicator::DB.exec_sql(\"vertica\",sql)\n Myreplicator::VerticaUtils.set_grants(grants)\n end", "title": "" }, { "docid": "782206e81a302894bfe89f8259cd1150", "score": "0.56296235", "text": "def alter_table_add_column_statement(table_name, schema_hash)\n \"ALTER TABLE #{quote_table_name(table_name)} ADD COLUMN #{property_schema_statement(schema_hash)}\"\n end", "title": "" }, { "docid": "c1630d7b91e7cf3be3d3f2106dcd7220", "score": "0.56287724", "text": "def create_table(name, options = {})\n @logger.unknown(\"ODBCAdapter#create_table>\") if @trace\n @logger.unknown(\"args=[#{name}]\") if @trace\n #ALTER TABLE ADD COLUMN not allowed with default page size of 2K\n super(name, {:options => \"WITH PAGE_SIZE=8192\"}.merge(options))\n execute \"CREATE SEQUENCE #{name}_seq\"\n rescue Exception => e\n @logger.unknown(\"exception=#{e}\") if @trace\n raise ActiveRecord::ActiveRecordError, e.message\n end", "title": "" }, { "docid": "215a30e1255b33651ba5acc51274083b", "score": "0.56195945", "text": "def base_generate_migration_altered table, data\n\t\t\tres = \"\"\n\n\t\t\tdata.each do | key, val |\n\t\t\t\tval.each do | item |\n\t\t\t\t\tres << \"\\t\\t\\t\"\n\t\t\t\t\tres << \"#{key} \"\n\t\t\t\t\tres << \":#{item.shift(1)[0]}\"\n\t\t\t\t\tres << \", #{item[0]}\" unless item.empty?\n\t\t\t\t\tres << \"\\n\"\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tres = \"\\t\\talter_table(:#{table}) do\\n#{res}\\t\\tend\\n\"\n\t\tend", "title": "" }, { "docid": "1350df962a3dae5b43513faa3a5221b1", "score": "0.5616584", "text": "def schema_migration; end", "title": "" }, { "docid": "9138f5a2911fbf0a2b4fc1931260531b", "score": "0.5608437", "text": "def alter(options)\n Statements::AlterTable.new(context: self).alter(options)\n end", "title": "" }, { "docid": "27c7373c360337217e1986875b2cd8d6", "score": "0.56063443", "text": "def alter_table_add_column_statement(table_name, schema_hash)\n \"ALTER TABLE #{quote_table_name(table_name)} ADD COLUMN #{property_schema_statement(schema_hash)}\"\n end", "title": "" }, { "docid": "ded2ebf9025fc5e5bf41af1f2f1661df", "score": "0.5579179", "text": "def create_table_as(name, sql, options)\n sql = _no_auto_parameterize(sql)\n super\n end", "title": "" }, { "docid": "110372240cfaa17e4cf9ed13cdf356b7", "score": "0.557738", "text": "def rename_table(table_name, new_name); end", "title": "" }, { "docid": "787ebbe6086672ec88ee0c7f444aba21", "score": "0.55746216", "text": "def rename_table(name, new_name, options = {})\n execute \"ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_generic_ignore_scoped_schema(new_name)};\"\n end", "title": "" }, { "docid": "b86a0fa4acb1b8d02abd18ac6734707a", "score": "0.55604327", "text": "def advance_version\n switch_to(working_table_name)\n\n # ensure the presence of the new active and working tables. \n # happens after the switch table update, since this may commit a surrounding \n # transaction in dbs with retarded non-transactional ddl like, oh i dunno, MyFuckingSQL\n ensure_version_table(active_table_name)\n\n # recreate the new working table from the base schema. \n new_wtn = working_table_name\n if new_wtn != base_table_name\n dup_table_schema(base_table_name, new_wtn)\n else\n connection.execute( \"truncate table #{new_wtn}\" )\n end\n end", "title": "" }, { "docid": "09683ea10f8c27515d8f0f943f30e646", "score": "0.55566925", "text": "def create_table_sql\n <<-create\n CREATE TABLE #{options[:table_name]} (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n #{options[:filename_column]} TEXT UNIQUE,\n #{options[:compressed_column]} BOOLEAN,\n #{options[:contents_column]} BLOB\n );\n create\n end", "title": "" }, { "docid": "f55412d8174dd1e4a86073c296051688", "score": "0.5555966", "text": "def recreate_table(base_table_name, table_name)\n if table_name != base_table_name\n drop_table(table_name)\n create_table(base_table_name, table_name)\n end\n end", "title": "" }, { "docid": "7c5b23eda209b1400c374bfb820ffcd7", "score": "0.55297786", "text": "def remove_foreign_key(table_name, *args)\n case sql = remove_foreign_key_sql(table_name, *args)\n when String then execute \"ALTER TABLE #{quote_table_name(table_name)} #{sql}\"\n end\n end", "title": "" }, { "docid": "0067ffc6445b9aadd067884eaf05d099", "score": "0.55257684", "text": "def sql_create_tables\n <<-SQL\n PRAGMA foreign_keys=on;\n \n -- Create table only if named table does NOT exist.\n CREATE TABLE IF NOT EXISTS Authors (\n author_id INTEGER PRIMARY KEY,\n first_name VARCHAR(255),\n last_name VARCHAR(255),\n\n CONSTRAINT author_unique \n UNIQUE (first_name, last_name)\n );\n\n CREATE TABLE IF NOT EXISTS Publishers (\n pub_id INTEGER PRIMARY KEY,\n name VARCHAR(255),\n\n CONSTRAINT pub_unique\n UNIQUE (name)\n );\n\n CREATE TABLE IF NOT EXISTS Categories (\n cat_id INTEGER PRIMARY KEY,\n topic VARCHAR(255),\n\n CONSTRAINT cat_unique\n UNIQUE (topic)\n );\n\n CREATE TABLE IF NOT EXISTS Articles (\n article_id INTEGER PRIMARY KEY,\n title VARCHAR(255),\n author_id INTEGER,\n pub_id INTEGER,\n cat_id INTEGER,\n article_date DATE,\n url TEXT,\n read_status INTEGER,\n\n CONSTRAINT url_unique\n UNIQUE (url),\n\n -- Creates foreign key constraint, set to delete row if primary key deleted\n CONSTRAINT fk_authors\n FOREIGN KEY (author_id)\n REFERENCES Authors(author_id)\n ON DELETE CASCADE,\n\n CONSTRAINT fk_publishers\n FOREIGN KEY (pub_id)\n REFERENCES Publishers(pub_id)\n ON DELETE CASCADE,\n\n CONSTRAINT fk_categories\n FOREIGN KEY (cat_id)\n REFERENCES Categories(cat_id)\n ON DELETE CASCADE\n );\n SQL\nend", "title": "" }, { "docid": "5589e60cf58cd1ae2f89eaa05f256732", "score": "0.5522698", "text": "def test_rename_tables\n assert_nothing_raised { @connection.rename_table(:group, :order) }\n end", "title": "" }, { "docid": "8debde18f6fb023c0e77b123bb9e7927", "score": "0.5520409", "text": "def change_table(table_name, **options)\n table_name = \"#{options[:schema]}.#{table_name}\" if options[:schema].present?\n super table_name, **options\n end", "title": "" }, { "docid": "4972115a9d37990638423fdac59a78e4", "score": "0.55194503", "text": "def exterminate(table)\n DATABASE.execute(\"DROP TABLE #{table}\") \n end", "title": "" }, { "docid": "4972115a9d37990638423fdac59a78e4", "score": "0.55194503", "text": "def exterminate(table)\n DATABASE.execute(\"DROP TABLE #{table}\") \n end", "title": "" }, { "docid": "4972115a9d37990638423fdac59a78e4", "score": "0.55194503", "text": "def exterminate(table)\n DATABASE.execute(\"DROP TABLE #{table}\") \n end", "title": "" }, { "docid": "0010cc806727a9638dc420d6ca3e42a4", "score": "0.5515214", "text": "def invalid_alter_table_type?(type, options)\n type.to_sym == :primary_key || options[:primary_key] ||\n options[:null] == false && options[:default].nil?\n end", "title": "" }, { "docid": "ec2010ff56fc95a62451b9d309583187", "score": "0.5514408", "text": "def add_column( connection )\r\n validate # ensure sensible defaults\r\n #puts \"alter table #{@table_name} add #{self.to_sql}\"\r\n connection.execute_immediate( \"alter table #{@table_name} add #{self.to_sql}\" )\r\n end", "title": "" }, { "docid": "a88e0658ab92e1204d670488a73bc5c4", "score": "0.5513107", "text": "def reorg(table)\n execute_ddl(reorg_sql(table))\n end", "title": "" }, { "docid": "4ba1102ff6ff870ebff57f216dfa2524", "score": "0.5496982", "text": "def exec_update(sql, name, binds)\n if sql =~ /\\AUPDATE (.*) SET (.*)\\z/\n sql = \"ALTER TABLE #{$1} UPDATE #{$2}\"\n end\n exec_update_original(sql, name, binds)\n end", "title": "" }, { "docid": "4f0c93c0fe63d08b1b98020d869ee428", "score": "0.54930127", "text": "def to_sql\n \"ALTER TABLE #{qualified_table} ADD CONSTRAINT #@name FOREIGN KEY (%s) REFERENCES #{@references[0]}.#{@references[1]} (%s)%s%s;\" % [\n @links.map {|e| e[0]}.join(', '),\n @links.map {|e| e[1]}.join(', '),\n (\" ON DELETE #@delete_reconciliation\" if @delete_reconciliation),\n (\" ON UPDATE #@update_reconciliation\" if @update_reconciliation),\n ] + (\n @enabled ? '' : \"\\nALTER TABLE #{qualified_table} NOCHECK CONSTRAINT #@name;\"\n ) + extended_properties_sql.joined_on_new_lines\n end", "title": "" }, { "docid": "edca61390079d8226c793eaf72a368c3", "score": "0.5491437", "text": "def rename_table(table_name, new_name, **)\n raise NotImplementedError, \"rename_table is not implemented\"\n end", "title": "" }, { "docid": "a9f80590745898b7ae413688fb42402d", "score": "0.54837894", "text": "def update_sql; end", "title": "" }, { "docid": "eeb1702e477a0c24d07d40f0fda856b6", "score": "0.54813325", "text": "def change_table(table_name, options = {})\n if supports_bulk_alter? && options[:bulk]\n recorder = ActiveRecord::Migration::CommandRecorder.new(self)\n yield update_table_definition(table_name, recorder)\n bulk_change_table(table_name, recorder.commands)\n else\n yield update_table_definition(table_name, self)\n end\n end", "title": "" }, { "docid": "eeb1702e477a0c24d07d40f0fda856b6", "score": "0.54813325", "text": "def change_table(table_name, options = {})\n if supports_bulk_alter? && options[:bulk]\n recorder = ActiveRecord::Migration::CommandRecorder.new(self)\n yield update_table_definition(table_name, recorder)\n bulk_change_table(table_name, recorder.commands)\n else\n yield update_table_definition(table_name, self)\n end\n end", "title": "" }, { "docid": "468d95751b63a930f2a6bca18df05019", "score": "0.5478823", "text": "def rename_table(table_name, new_name)\n raise Error::PendingFeature\n end", "title": "" }, { "docid": "9106cb5ba06a8c6ebab9858f3d4ef9b4", "score": "0.5474269", "text": "def change_column(table_name, *)\n return super unless is_chrono?(table_name)\n chrono_alter(table_name) { super }\n end", "title": "" }, { "docid": "9106cb5ba06a8c6ebab9858f3d4ef9b4", "score": "0.5474269", "text": "def change_column(table_name, *)\n return super unless is_chrono?(table_name)\n chrono_alter(table_name) { super }\n end", "title": "" }, { "docid": "c9bb434e4de29aaa104450cc3da75bc2", "score": "0.54696196", "text": "def supports_create_table_if_not_exists?\n sqlite_version >= 30300\n end", "title": "" }, { "docid": "44fad83698ac3148e9a86ede37accb5d", "score": "0.54573154", "text": "def change_table_with_low_card_support(table_name, options = { }, &block)\n ::LowCardTables::ActiveRecord::Migrations.with_low_card_support(table_name, options) do |new_options|\n ar = method(:change_table_without_low_card_support).arity\n if ar > 1 || ar < -2\n change_table_without_low_card_support(table_name, **new_options, &block)\n else\n change_table_without_low_card_support(table_name, &block)\n end\n end\n end", "title": "" }, { "docid": "15c9de3884373727c673fe8a42a28192", "score": "0.5454371", "text": "def reset_locking_column; end", "title": "" }, { "docid": "4f1a124762c7fdae333ee5f4229c2ca7", "score": "0.54472417", "text": "def resizeFamily (size)\n command = \"\"\n command += \"ALTER TABLE fundsnew ALTER COLUMN family \"\n command += \"type varchar(\" + size.to_s() + \");\"\n @conn.exec(command)\n end", "title": "" }, { "docid": "0e9c310a4774825e67d622ac5e70d2cb", "score": "0.54461604", "text": "def add_column( table, name, primer )\n case primer\n when String\n \"ALTER TABLE #{table} ADD COLUMN #{name} text;\"\n when Integer\n \"ALTER TABLE #{table} ADD COLUMN #{name} integer;\"\n when Float, Numeric\n \"ALTER TABLE #{table} ADD COLUMN #{name} numeric;\"\n when Date, DateTime\n \"ALTER TABLE #{table} ADD COLUMN #{name} timestamp;\"\n when TrueClass, FalseClass\n \"ALTER TABLE #{table} ADD COLUMN #{name} boolean;\"\n #when Array\n # if ref_table = primer[0].class.record_table # one-to-many\n # \"ALTER TABLE #{ref_table} ADD COLUMN #{name}_id integer REFERENCES #{table} ( record_id );\"\n # else\n # ref_type = sql_type( primer[0] )\n # \"ALTER TABLE #{table} ADD COLUMN #{name} #{ref_type}[];\"\n # end\n else\n if primer.class.respond_to?( :table_class )\n table = primer.class.record_table # one-to-one reference\n \"ALTER TABLE #{table} ADD COLUMN #{name} integer REFERENCE #{table} ( record_id );\"\n else\n \"ALTER TABLE #{table} ADD COLUMN #{name} text;\" # serialized object\n end\n end\n end", "title": "" }, { "docid": "553529338916100baab9f1819bec4c59", "score": "0.5445759", "text": "def supports_combining_alter_table_ops?\n true\n end", "title": "" }, { "docid": "c4327c6193810db36f9a3c10df0204ed", "score": "0.5443584", "text": "def after_create_table\n\t\t\t# No-op\n\t\tend", "title": "" } ]
5e621fbdb61b942e019094f9f58b6dd0
GET /tankmen/1 GET /tankmen/1.xml
[ { "docid": "89ddb78e520589a8c50d0cc27501db62", "score": "0.0", "text": "def show\n @tankman = Tankman.find(params[:id])\n @history = History.where(:tankman_id => @tankman).paginate(:per_page => 15, :page => params[:page])\n\n\n\n end", "title": "" } ]
[ { "docid": "e9f5aee37cfb803b5383d65841ca38dd", "score": "0.62914646", "text": "def apiindex\n #TODO authentication\n tree = Item.tree\n xml = XmlSimple.xml_out({'items'=>tree}, \n \"RootName\"=>'itemtree', \n 'NoAttr'=>true, \n 'SuppressEmpty'=>nil)\n xmlresponse(xml)\n end", "title": "" }, { "docid": "4a3dd5e5ae2c4e253ea0fe3d61342ffe", "score": "0.6198756", "text": "def show\n @loot = Loot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loot }\n end\n end", "title": "" }, { "docid": "4a3dd5e5ae2c4e253ea0fe3d61342ffe", "score": "0.6198756", "text": "def show\n @loot = Loot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loot }\n end\n end", "title": "" }, { "docid": "84b7c220e13f05bb573277a7561451f2", "score": "0.61638796", "text": "def menu\n render xml: handler.response_text\n end", "title": "" }, { "docid": "f049ca5e5ab4a4ccec1c6823f0bc5f5e", "score": "0.61321795", "text": "def show\n @klant = Klant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @klant }\n end\n end", "title": "" }, { "docid": "1a362d14276a5c978e9ef5ecd032f00f", "score": "0.6080164", "text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "1a362d14276a5c978e9ef5ecd032f00f", "score": "0.6080164", "text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "b96bf460efc70c90646602432b44489d", "score": "0.60372233", "text": "def show\n @l1_node = L1Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @l1_node }\n end\n end", "title": "" }, { "docid": "b8ab209504a830ffa8aaa29cdfa53006", "score": "0.6035703", "text": "def show\n @tattoo = Tattoo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tattoo }\n end\n end", "title": "" }, { "docid": "84f350c84d410d734715805c98d03c95", "score": "0.60208106", "text": "def show\n @tanki_shien_mokuhyo = TankiShienMokuhyo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tanki_shien_mokuhyo }\n end\n end", "title": "" }, { "docid": "69ec50d8a7e87d4080826164dbf75565", "score": "0.6007556", "text": "def show\n authorize! :menage, :all\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @tag }\n end\n end", "title": "" }, { "docid": "75cbcf56e70b6f05f18bf63abd4293fd", "score": "0.6007477", "text": "def index\n self.class.get(\"/cards/index.xml\");\n end", "title": "" }, { "docid": "f5c90108fab09e5666134a1937e26ad9", "score": "0.60046226", "text": "def show\n @hat = Hat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hat }\n end\n end", "title": "" }, { "docid": "3026b39249a2b992308082d3e3b2ec18", "score": "0.5978954", "text": "def index\n @liens = Lien.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @liens }\n end\n end", "title": "" }, { "docid": "95b3f89872f992925cd5b1b2ea84ebe8", "score": "0.5974369", "text": "def show\n @memories = Memories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @memories }\n end\n end", "title": "" }, { "docid": "bca6fbed7d292b81f62897d6778defcb", "score": "0.5936965", "text": "def get_menu_items \n doc = Hpricot::XML(request.raw_post)\n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc)\n @main_menu = Admin::MenuCrud.find_menu_items(doc)\n if @main_menu \n respond_to do |wants|\n wants.html\n wants.xml \n end \n end\n end", "title": "" }, { "docid": "11b424c04d5067adbf66c5f73b2289d4", "score": "0.59242356", "text": "def show\n @monstertome = Monstertome.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @monstertome }\n end\n end", "title": "" }, { "docid": "c5f731e5aa5a191198c07140316a41e9", "score": "0.59047216", "text": "def show\n @menu = Menu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @menu }\n end\n end", "title": "" }, { "docid": "c5f731e5aa5a191198c07140316a41e9", "score": "0.59047216", "text": "def show\n @menu = Menu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @menu }\n end\n end", "title": "" }, { "docid": "c5f731e5aa5a191198c07140316a41e9", "score": "0.59047216", "text": "def show\n @menu = Menu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @menu }\n end\n end", "title": "" }, { "docid": "c5f731e5aa5a191198c07140316a41e9", "score": "0.59047216", "text": "def show\n @menu = Menu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @menu }\n end\n end", "title": "" }, { "docid": "30d8949072a4eef8047fff1f00c6fc3f", "score": "0.5880148", "text": "def show\n @menu_items=TextNode.find_by_url(\"/sektionen\").menu[:items]\n @functionary = Functionary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @functionary }\n end\n end", "title": "" }, { "docid": "24d26ebc3e2f076c93ecc5a6b549694c", "score": "0.5877178", "text": "def show\n @m_tank = MTank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @m_tank }\n end\n end", "title": "" }, { "docid": "3b7f0dec5d47b2de522c85e55deff97f", "score": "0.58671844", "text": "def query_menu_list\n doc = Hpricot::XML(request.raw_post)\n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc) \n @menus = Admin::MenuCrud.list_of_menu_items(doc)\n respond_to do |wants|\n wants.html\n wants.xml \n end\n end", "title": "" }, { "docid": "c93985a43be8d0c9fcaa258e860ae1d3", "score": "0.5864354", "text": "def show\n @entree = Entree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @entree }\n end\n end", "title": "" }, { "docid": "dd2c31fd38900f850333dfef171045a2", "score": "0.5849313", "text": "def show\n @tiket = Tiket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tiket }\n end\n end", "title": "" }, { "docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2", "score": "0.583778", "text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end", "title": "" }, { "docid": "e37dc0caa0331187693b1fe638bd5da3", "score": "0.58301926", "text": "def show\n @loom = Loom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loom }\n end\n end", "title": "" }, { "docid": "5aae989bb34322b26113bd38db979e89", "score": "0.5826844", "text": "def show\n @tem = Tem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tem }\n end\n end", "title": "" }, { "docid": "fe4bb97a5033b232891d727861eb8fcd", "score": "0.5822427", "text": "def show\n @imovel = Imovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @imovel }\n end\n end", "title": "" }, { "docid": "92c2fcbfb3b7225ffcad0a6e8ed20b5a", "score": "0.5821523", "text": "def show\n @inventorylevel1master = Inventorylevel1master.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inventorylevel1master }\n end\n end", "title": "" }, { "docid": "5405a0f9eb996c9db9daa121bd4a211d", "score": "0.5805022", "text": "def index\n @menus = Menu.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @menus }\n end\n end", "title": "" }, { "docid": "9ed5321765652b0df9be52251ca61ca6", "score": "0.5794432", "text": "def index\n @hats = Hat.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.xml { render :xml => @hats }\n end\n end", "title": "" }, { "docid": "2a9905f4972b8f0d848c3b0906969879", "score": "0.57933843", "text": "def show\n @speciman = Speciman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @speciman }\n end\n end", "title": "" }, { "docid": "020aa2f36067179561c8017e19dd5596", "score": "0.5790275", "text": "def index\n @trees = Tree.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trees }\n end\n end", "title": "" }, { "docid": "313badd60c52bc844f90a007e8b75969", "score": "0.57818514", "text": "def index\n @needs = @venture.needs.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @needs }\n end\n end", "title": "" }, { "docid": "2138663da3b999093a49bbba02c1bcb3", "score": "0.5780294", "text": "def show\n @norbi_meleg = NorbiMeleg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @norbi_meleg }\n end\n end", "title": "" }, { "docid": "b0acfb14d4b549f2b9b430d79ef0d361", "score": "0.577875", "text": "def show\n @inventorylevel2master = Inventorylevel2master.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inventorylevel2master }\n end\n end", "title": "" }, { "docid": "e41ef28f38dcd71f23ee7106a111b1ef", "score": "0.5767991", "text": "def show\n @bottle = Bottle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bottle }\n end\n end", "title": "" }, { "docid": "d8d537515bf18d3ac9194f9a7995325f", "score": "0.57655275", "text": "def beaches\n p \"surf_alarm beach action\"\n respond_to do |format|\n format.text\n format.xml\n end\n end", "title": "" }, { "docid": "1fac45c88750c518632cb1104925e49c", "score": "0.576274", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @metros }\n end\n end", "title": "" }, { "docid": "5272d35856666461720ba323646d7bba", "score": "0.5761117", "text": "def index\n redirect_to @level\n #@vocabs = Vocab.all\n\n #respond_to do |format|\n #format.html # index.html.erb\n #format.xml { render :xml => @vocabs }\n #end\n end", "title": "" }, { "docid": "44ff0192ee49fa4d2a19bf03891a6aeb", "score": "0.5759014", "text": "def index\n \n @menu_items = @menu.menu_items\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @menu_items }\n end\n end", "title": "" }, { "docid": "b6f3144339b39fb9e4530997530cf323", "score": "0.5753404", "text": "def show\n @lien = Lien.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lien }\n end\n end", "title": "" }, { "docid": "cb880a45f76177ab876c27a041bede62", "score": "0.57517576", "text": "def index\n @gyms = Gym.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @gyms }\n end\n end", "title": "" }, { "docid": "b5e6a5471211510b39b3dbd45783a31c", "score": "0.57493347", "text": "def show\n @reef_tank = ReefTank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end", "title": "" }, { "docid": "7283a713a0c80724d796b0e22700b885", "score": "0.57472104", "text": "def index\n @rentables = Rentable.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rentables }\n end\n end", "title": "" }, { "docid": "764de76443daf13beda61b14a266ea71", "score": "0.57447535", "text": "def get_xml\n end", "title": "" }, { "docid": "db85380aeb0dbf7161f782f831bb76f3", "score": "0.574316", "text": "def show\n @anketa = Anketa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @anketa }\n end\n end", "title": "" }, { "docid": "27519824b67207bccfba0de28d5b2919", "score": "0.57383925", "text": "def url; \"http://localhost:3000/sdn.xml\"; end", "title": "" }, { "docid": "bf7ba0aac3023b35e8727e367783492b", "score": "0.57361484", "text": "def show\n @batman = Batman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @batman }\n end\n end", "title": "" }, { "docid": "0f28fd73eecd01cf12a70815231c9da8", "score": "0.57290024", "text": "def index\n @kites = Kite.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @kites}\n format.json { render json: @kites}\n end\n\n end", "title": "" }, { "docid": "f3a28f194c144c7639fa14ace97b6538", "score": "0.5728161", "text": "def index\n @page_title = \"Meters\"\n @meters = Meter.all\n add_crumb(\"Admin\", '/admin')\n add_crumb(\"Meters\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meters }\n end\n end", "title": "" }, { "docid": "b08e371906247d58b5939fc85fdc6d8f", "score": "0.5721922", "text": "def show\n @loan_sector = LoanSector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loan_sector }\n end\n end", "title": "" }, { "docid": "066fe9feab3eca4e27e110e81797844f", "score": "0.57215345", "text": "def index\n\t@kontak = Kontak.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @kontak }\n end\n \n end", "title": "" }, { "docid": "2df477fe3d7445a17c9c882902749cef", "score": "0.5721354", "text": "def show\n respond_to do |format|\n format.html\n format.xml { render :xml => @rent }\n end\n end", "title": "" }, { "docid": "e6fabcd58eb6904f9621a13076dd2b43", "score": "0.5713377", "text": "def index\n @matters = Matter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @matters }\n end\n end", "title": "" }, { "docid": "714a095e13a824b09b8e06fc11d1dda8", "score": "0.5711737", "text": "def index\n @memories = current_user.memories\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @memories }\n end\n end", "title": "" }, { "docid": "dd767ae59a8412d5bf88bc0a8b41a8c9", "score": "0.5703347", "text": "def index\n @novels = Novel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @novels }\n end\n end", "title": "" }, { "docid": "130ecbf64ad64e717d34cb72cbd58854", "score": "0.5700563", "text": "def show\n @tank = Tank.find( params[:id] )\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tank }\n end\n end", "title": "" }, { "docid": "a6dd6241b0cce7ec58bbc82e9c4aa6d5", "score": "0.5699178", "text": "def show\n @lexique = Lexique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lexique }\n end\n end", "title": "" }, { "docid": "f1940087f878d855aeb5d48aaa90b6f5", "score": "0.5698456", "text": "def show\n @incomelevel = Incomelevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @incomelevel }\n end\n end", "title": "" }, { "docid": "14dde3f3d036a93b0c670a468fad60b9", "score": "0.5688634", "text": "def show\n @tuan = Tuan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tuan }\n end\n end", "title": "" }, { "docid": "3095b5c6b47b5100eeedf088c8c59119", "score": "0.5687871", "text": "def show\n @menu_bar = MenuBar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @menu_bar }\n end\n end", "title": "" }, { "docid": "0129199f841a84bf6167c4cd3483b67d", "score": "0.5684971", "text": "def show\n @manid = Manid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @manid }\n end\n end", "title": "" }, { "docid": "308912cf7c03e1b920edd2edfe1452ea", "score": "0.5681735", "text": "def show\n @randomtesss = Randomtesss.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @randomtesss }\n end\n end", "title": "" }, { "docid": "101846681c83aad0e9c6be0aa760a023", "score": "0.5679207", "text": "def show #DESC: Ver detalles de un talento.\n @talento = Talento.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @talento }\n end\n end", "title": "" }, { "docid": "3787a191e5b7a75b500a654e923d1a31", "score": "0.5676178", "text": "def index\n @rents = Rent.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rents }\n end\n end", "title": "" }, { "docid": "a378256ce3d6338af7180ff544f22b3c", "score": "0.56757665", "text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "9d8e9f4135711165ab85baf37d69ee20", "score": "0.5675292", "text": "def show\n @tst1 = Tst1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tst1 }\n end\n end", "title": "" }, { "docid": "cee2abdc2ef04224fe8c3a1213263234", "score": "0.56721026", "text": "def show\n @rentable = Rentable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rentable }\n end\n end", "title": "" }, { "docid": "86f414cf236b7f5f6fa5f3037d13ea8a", "score": "0.56710315", "text": "def show\n @liga = Liga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga }\n end\n end", "title": "" }, { "docid": "c92676cb01f04992dc9c605966790a89", "score": "0.56704617", "text": "def new\n @klant = Klant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @klant }\n end\n end", "title": "" }, { "docid": "632b741f6674241c76025f68754b3986", "score": "0.5666594", "text": "def index\n @liabilities = Liability.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @liabilities.to_xml }\n end\n end", "title": "" }, { "docid": "6beda8b1d50bc6f8dbba6c86f24c56fa", "score": "0.56663865", "text": "def show\n @tipo_mant = TipoMant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_mant }\n end\n end", "title": "" }, { "docid": "3a5c9be35fddd3e536378d18f24783a2", "score": "0.56624407", "text": "def index\n @nodes = @nodes.page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "title": "" }, { "docid": "cece99b93ad9f96852507712b5e48e12", "score": "0.56620944", "text": "def show\n @loan = Loan.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @loan }\n end\n end", "title": "" }, { "docid": "28f0ff4fde735870b3ee55f6997fc9bd", "score": "0.5654266", "text": "def show\n @tribunal = Tribunal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tribunal }\n end\n end", "title": "" }, { "docid": "a7d1829f0cdb2876832474c2a22eb5ca", "score": "0.56492543", "text": "def show\n @liga_guilty = LigaGuilty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga_guilty }\n end\n end", "title": "" }, { "docid": "3f5c31b68b9c9be33b0df1ed6a3b8c66", "score": "0.56479484", "text": "def request_xml url\n response = Net::HTTP.get_response(URI.parse(url.to_s))\n\t\t\tresponse.body if response.is_a?(Net::HTTPSuccess)\n end", "title": "" }, { "docid": "5dd170e131d9460ce9e5413da90f6e0f", "score": "0.5644574", "text": "def index\n @weapons = Weapon.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @weapons }\n end\n end", "title": "" }, { "docid": "bcd6f52d06bc1f3ace88ba58bec1c8ce", "score": "0.56402755", "text": "def index\n @knodes = Knode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @knodes }\n end\n end", "title": "" }, { "docid": "3507950ed5d93675a52a6be2d7c3dd86", "score": "0.5639327", "text": "def index\n @tools = Tool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tools }\n end\n end", "title": "" }, { "docid": "b8dc839d2eb55f5dce9ce8a2840ff0c2", "score": "0.5639125", "text": "def show\n @leg = Legislator.find(params[:id])\n\n respond_to do |format|\n format.html { render :action => \"show\" }\n format.xml { render :xml => @leg }\n end\n end", "title": "" }, { "docid": "c821eb679fbe08ea86a5f7a13e8c4919", "score": "0.563611", "text": "def index\n @turmas = Turma.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @turmas }\n end\n end", "title": "" }, { "docid": "5287660ffc1da7d33d5de8abe3f2ebbf", "score": "0.5636", "text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "8f0c2a56d3fc351d42268683d626401f", "score": "0.56353474", "text": "def show\n @kitaitoi = Kitaitoi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kitaitoi }\n end\n end", "title": "" }, { "docid": "02b655a5c8672940f71790da65a941c9", "score": "0.5634219", "text": "def show\n @mebel = Mebel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mebel }\n end\n end", "title": "" }, { "docid": "74f828af558de07addb7d55072e13ee9", "score": "0.56327015", "text": "def show\n @tumbon = Tumbon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tumbon }\n end\n end", "title": "" }, { "docid": "b97d76ad6e2fdf879c352e2d9d791df5", "score": "0.5629458", "text": "def show\n @sense = Sense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @sense }\n end\n end", "title": "" }, { "docid": "3ca1cddd20d93106708f3292cdf0dbe3", "score": "0.562224", "text": "def index\n @men = Man.all\n end", "title": "" }, { "docid": "3ca1cddd20d93106708f3292cdf0dbe3", "score": "0.562224", "text": "def index\n @men = Man.all\n end", "title": "" }, { "docid": "7046787db45a222cc4baa40023c674cd", "score": "0.56220543", "text": "def xml = \"docs/index.xml\"", "title": "" }, { "docid": "e398a845125c4b9ec9a4c24323942c72", "score": "0.5621244", "text": "def index\n @tapesters = Tapester.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tapesters }\n end\n end", "title": "" }, { "docid": "b2e585fcf6c42596ba065375bf05c111", "score": "0.56206685", "text": "def index\n @attacks = Attack.all\n \n @title = \"Attacks\" \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attacks }\n end\n end", "title": "" }, { "docid": "3542aa491c412f7525f4c4741bd14e24", "score": "0.5618966", "text": "def index\n @playerlevels = @player.playerlevels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playerlevels }\n end\n end", "title": "" }, { "docid": "c80c77a1862be501e3895a4cb657799b", "score": "0.5618243", "text": "def show\n @lister = Lister.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lister }\n end\n end", "title": "" }, { "docid": "1cb6a2420c577dadcedd24006b987475", "score": "0.5617476", "text": "def index\n @matkas = Matka.all\n\t\n\t#http://api.rubyonrails.org/classes/ActionController/MimeResponds.html\n\trespond_to do |format|\n format.html\n format.xml {render :xml => @matkas}\n\tformat.json {render :json => @matkas}\n\tend\n end", "title": "" }, { "docid": "a4d7c41163a55fcf8f955576c675c1b5", "score": "0.56167555", "text": "def show\n @legislation = Legislation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @legislation }\n end\n end", "title": "" }, { "docid": "dd5b3ec21d76abacdb176c040322cb81", "score": "0.5616666", "text": "def new\n @tanki_shien_mokuhyo = TankiShienMokuhyo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tanki_shien_mokuhyo }\n end\n end", "title": "" }, { "docid": "092b32fe7594ec690d3f9d37342b58aa", "score": "0.56133467", "text": "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @story }\n end\n end", "title": "" } ]
ae313af791e4f836221249c442ef37ab
Custom equality operator for this class.
[ { "docid": "3dff2895fd2de31cc1e6c10a0eabbcee", "score": "0.0", "text": "def ==(other)\n @config_key == other.config_key &&\n @config_section == other.config_section &&\n @prompt_text == other.prompt_text\n end", "title": "" } ]
[ { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.7778943", "text": "def ==(other); end", "title": "" }, { "docid": "38fa321e0d51418297e8f8177b0564ce", "score": "0.77660936", "text": "def ===(other); end", "title": "" }, { "docid": "7a58df0e80244efab5faf6610c86eb1a", "score": "0.75822127", "text": "def ==\n end", "title": "" }, { "docid": "2c3a9d7d1f03a42c3bffb7abd5efad8b", "score": "0.754537", "text": "def ==(other); false; end", "title": "" }, { "docid": "76e02b93d68162b070a88de631d8e820", "score": "0.74519676", "text": "def ==(other)\n end", "title": "" }, { "docid": "b30da7dcac64c9d3d33950e39817b993", "score": "0.74193716", "text": "def eql?(*) end", "title": "" }, { "docid": "91e0499550d4a810b86d3ed347e7fcfd", "score": "0.73941755", "text": "def ==(other)\n super\n end", "title": "" }, { "docid": "91e0499550d4a810b86d3ed347e7fcfd", "score": "0.73941755", "text": "def ==(other)\n super\n end", "title": "" }, { "docid": "83b7f053c4b18617ae9369dae0621ad7", "score": "0.7296234", "text": "def eql?(other); self == other; end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.7288322", "text": "def ==(*) end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.7288322", "text": "def ==(*) end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.7288322", "text": "def ==(*) end", "title": "" }, { "docid": "b866df3f867912ff8522a039e3858a96", "score": "0.728484", "text": "def ==(ct); end", "title": "" }, { "docid": "b866df3f867912ff8522a039e3858a96", "score": "0.728484", "text": "def ==(ct); end", "title": "" }, { "docid": "0f0696af7e3b8c1c8c0b0396ec4b3423", "score": "0.7276372", "text": "def eq=(value)\n self === value\n end", "title": "" }, { "docid": "e9ff242de27e2052de88ef37e9f485a7", "score": "0.7266241", "text": "def ===(other)\n \treturn self.equal?(other)\n end", "title": "" }, { "docid": "ed1f9a313c0476e7d522fac1cfb1ad5f", "score": "0.7265524", "text": "def ==(other)\n super\n end", "title": "" }, { "docid": "ca5a25b076c72f90be07e3e1eaeede45", "score": "0.72630155", "text": "def equal?(other); end", "title": "" }, { "docid": "5f8567f7cf520383495a26b72ffabbea", "score": "0.72375464", "text": "def ==(other)\n `return self.valueOf() === other.valueOf() ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "5f8567f7cf520383495a26b72ffabbea", "score": "0.72375464", "text": "def ==(other)\n `return self.valueOf() === other.valueOf() ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "61086c135028e492872940a0cd15a58c", "score": "0.72345036", "text": "def ==(other)\n raise NotImplementedError\n end", "title": "" }, { "docid": "0c5acbc493700fb7e24aeff222ec4de9", "score": "0.72341096", "text": "def ==(other)\n\t\t\tcase other.kind_of? \n\t\t\t when Expression, Variable, Numeric\n\t\t\t return Constrait.new(self, Constraint.EQ, other)\n\t\t\t else\n\t\t\t\t\treturn NotImplemented\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.7197912", "text": "def eql?(other); end", "title": "" }, { "docid": "3c21f9251a54806ba6a7b1a3b23428c0", "score": "0.7196602", "text": "def eql?(other)\n super\n end", "title": "" }, { "docid": "3c21f9251a54806ba6a7b1a3b23428c0", "score": "0.7196602", "text": "def eql?(other)\n super\n end", "title": "" }, { "docid": "c976ad0d9a8688569058c0f5681e39a4", "score": "0.71873575", "text": "def eq\n @ole.EQ\n end", "title": "" }, { "docid": "b25d924bf5652eecbc1743480ea3c114", "score": "0.71511686", "text": "def eql?(ct); end", "title": "" }, { "docid": "b25d924bf5652eecbc1743480ea3c114", "score": "0.71511686", "text": "def eql?(ct); end", "title": "" }, { "docid": "d47e3d57ab6df484a6188f775fe85a3f", "score": "0.7138425", "text": "def ===(other)\n return false unless (self == other)\n end", "title": "" }, { "docid": "75625a01b95b7d454f5af84faca41759", "score": "0.7135074", "text": "def eql?(other)\n self==other\n end", "title": "" }, { "docid": "2aca512031b7e5929b7ceeb54c28432c", "score": "0.7129202", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "2aca512031b7e5929b7ceeb54c28432c", "score": "0.7129202", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "fb5361e3a711c58c986d8c14b14ea353", "score": "0.7086123", "text": "def ===(other)\n equal? other\n end", "title": "" }, { "docid": "fb5361e3a711c58c986d8c14b14ea353", "score": "0.7086123", "text": "def ===(other)\n equal? other\n end", "title": "" }, { "docid": "8ef598b62fee5a4992716ffe8722e1a8", "score": "0.7070189", "text": "def ==(rhs)\n self.class == rhs.class\n end", "title": "" }, { "docid": "695c79a1a4b18ec27e9cb13fdf78d70a", "score": "0.70700157", "text": "def eql? other\n self == other\n end", "title": "" }, { "docid": "28dd4ed4ae1427f2d7d18bea3b25213f", "score": "0.7046579", "text": "def ==(other)\n other.instance_of?(self.class) && eql?(other)\n end", "title": "" }, { "docid": "7752ce760683da1a6fd15e0e3bf129f9", "score": "0.70382935", "text": "def eql?(other)\n\t\tself == other\n\tend", "title": "" }, { "docid": "2f7325820ca0d3a6fcb072e997432646", "score": "0.7035977", "text": "def === other\n self.to_sym === other.to_sym || super(other)\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.7023179", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.7023179", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.7023179", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.7023179", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "bbfa82dc9d83576e8b3a048ade584649", "score": "0.70164686", "text": "def ==(x)\n self.equal? x\n end", "title": "" }, { "docid": "efc962be1f2a1879e8c78e2edc45b6a0", "score": "0.70080054", "text": "def eql?(t)\n self == t\n end", "title": "" }, { "docid": "ab2b3aa68b8299c6301afdeb2393de81", "score": "0.7004781", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "63a68675e1bfa17b39bafcc7aa4dc142", "score": "0.70000434", "text": "def eq(_obj)\n raise NotImplementedError\n end", "title": "" }, { "docid": "10dc587f7777e03fa299e0bf8d4ca11c", "score": "0.6986927", "text": "def eql?(other)\n `return self == other ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "10dc587f7777e03fa299e0bf8d4ca11c", "score": "0.6986927", "text": "def eql?(other)\n `return self == other ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "0da645c1be25f10b82f7a68b60d90e71", "score": "0.6982244", "text": "def eql?(other)\n self == (other)\n end", "title": "" }, { "docid": "4b5d9ba07c4efdc7895f20e35bf7440e", "score": "0.6977403", "text": "def ==(expr2)\n Operator.new(S_EQ, self, expr2)\n end", "title": "" }, { "docid": "f434d25f889f762ac370e3d1a021610b", "score": "0.6961343", "text": "def ==(other)\n if equal?(other)\n return true\n end\n\n unless [ :repository, :model, :fields, :links, :conditions, :order, :offset, :limit, :reload?, :unique?, :add_reversed? ].all? { |method| other.respond_to?(method) }\n return false\n end\n\n cmp?(other, :==)\n end", "title": "" }, { "docid": "8c75697ab793de2b38a90e96df734d4c", "score": "0.6957587", "text": "def eql?(other)\n\n end", "title": "" }, { "docid": "10ab2033999c3ca99a4df2fcbd0a4b13", "score": "0.695637", "text": "def eql?(other)\n other.class == self.class &&\n other.id == self.id &&\n other.operands.sort_by(&:to_s) == self.operands.sort_by(&:to_s)\n end", "title": "" }, { "docid": "b4bec98aa3cab3789f0d91de23b465fa", "score": "0.69535875", "text": "def == other\n self.id == other.id\n end", "title": "" }, { "docid": "6caf0b7e3c1a4bcd4b94b1a700495c64", "score": "0.6940729", "text": "def ===(other)\n if other.is_a?(right_class)\n value === other.value\n else\n super\n end\n end", "title": "" }, { "docid": "a851aebbe40c04bf2f38977a61087129", "score": "0.69253176", "text": "def equality\n expr = comparison\n\n while match?(:bang_equal, :equal_equal)\n operator = previous\n right = comparison\n expr = Ringo::Binary.new(expr, operator, right)\n end\n\n expr\n end", "title": "" }, { "docid": "186c7450766105a0a84c55416cd644d6", "score": "0.6913528", "text": "def ==(other)\n return false unless other.class == self.class\n\n return identity == other.identity\n end", "title": "" }, { "docid": "d8a3a2b4a10cd4df4febcb7e0c6cc456", "score": "0.6875989", "text": "def eql?(c)\n self == c\n end", "title": "" }, { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.6875312", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.6875312", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.6875312", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.6875312", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.6875312", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "17b4791b4f46d0eff54b201108551dc4", "score": "0.68689716", "text": "def ==(other)\n super || object == other\n end", "title": "" }, { "docid": "6a9906046945e372df6779a38440e4af", "score": "0.68689585", "text": "def eq(v)\n Equal.new(v)\n end", "title": "" }, { "docid": "2146a6457bb8a78598366b56f72b5576", "score": "0.6865719", "text": "def ==(other)\n return false unless super\n true\n end", "title": "" }, { "docid": "f947fc58f68684dff4e4443e05852f85", "score": "0.6859644", "text": "def ==(*)\n true\n end", "title": "" }, { "docid": "8751e9ee9b1d109c8d41aebaf375f72e", "score": "0.6854899", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "55e3c1c5c63a4eb81c71454da7c9b693", "score": "0.6847539", "text": "def ===(other)\n self.object_id == other.object_id\n end", "title": "" }, { "docid": "ae34ee54f58c5766b0c6ee0dbd5f9d03", "score": "0.6832055", "text": "def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end", "title": "" }, { "docid": "8f5ea601b7dc54540f6b90e7008949b1", "score": "0.68166316", "text": "def ==(other)\n self.id == other.id\n end", "title": "" }, { "docid": "465a9cf6e7cd88943d92f1b584382539", "score": "0.6813438", "text": "def eql?(obj)\n self == obj\n end", "title": "" } ]
76016e02d182dee4378accd5c31d1abe
Generates a URL based on the given name and passed options. Used with named routes and resources: url(:users) => "/users" url(:admin_permissons) => "/admin/permissions"
[ { "docid": "1af623bca90adba79c6380ba15169c19", "score": "0.6763325", "text": "def url(name, *args)\n unless Symbol === name\n args.unshift(name)\n name = :default\n end\n \n unless route = Halcyon::Application::Router.named_routes[name]\n raise ArgumentError.new(\"Named route #{name.inspect} not found\")\n end\n \n route.generate(args, {:controller => controller_name, :action => method})\n end", "title": "" } ]
[ { "docid": "f33b347770f88d58d79ff4be73792998", "score": "0.70750386", "text": "def url(*names)\n params = names.extract_options! # parameters is hash at end\n name = names.join(\"_\").to_sym # route name is concatenated with underscores\n if params.is_a?(Hash)\n params[:format] = params[:format].to_s if params.has_key?(:format)\n params.each { |k,v| params[k] = v.to_param if v.respond_to?(:to_param) }\n end\n url = router.generator.generate(name, params)\n url = uri_root + url if defined?(uri_root) && uri_root != \"/\"\n url\n rescue Usher::UnrecognizedException\n route_error = \"route mapping for url(#{name.inspect}) could not be found!\"\n raise Padrino::Routing::UnrecognizedException.new(route_error)\n end", "title": "" }, { "docid": "ff8d14975d77f28d37aa8cd9ed464f06", "score": "0.7049282", "text": "def url_for(options)\n ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?\n ActionController::Routing::Routes.generate(options, {})\n end", "title": "" }, { "docid": "032d7206819f8f4d4304b0837108d35e", "score": "0.695945", "text": "def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end", "title": "" }, { "docid": "5a7a1d1c59ce51c2e6d1494c22dd11a0", "score": "0.6876881", "text": "def url(name, *args)\n if name.is_a?(Route)\n route = name\n else\n unless name.is_a?(Symbol)\n args.unshift(name)\n name = :default\n end\n\n unless route = Merb::Router.named_routes[name]\n raise Merb::Router::GenerationError, \"Named route not found: #{name}\"\n end\n end\n \n defaults = args.pop\n \n route.generate(args, defaults)\n end", "title": "" }, { "docid": "590e9a4ea0b9465e32867da202bb9518", "score": "0.686448", "text": "def url(name, *args)\n options = args.last.is_a?(String) || args.last.is_a?(Numeric) ? nil : args.pop\n match, needs = self.class.route_names[name.to_sym]\n raise RuntimeError, \"Can't seem to find named route #{name.inspect}!\", caller if match.nil? && needs.nil?\n needs = needs.dup\n match = match.source.sub(/^\\^/,'').sub(/\\$$/,'')\n while match.gsub!(/\\([^()]+\\)/) { |m|\n # puts \"M: #{m}\"\n if m == '([^/?&#]+)'\n key = needs.shift\n # puts \"Needs: #{key}\"\n if options.is_a?(Hash)\n # puts \"Hash value\"\n options[key.to_sym] || options[key.to_s] || args.shift\n else\n if options.respond_to?(key)\n # puts \"Getting value from object\"\n options.send(key)\n else\n # puts \"Shifting value\"\n args.shift\n end\n end\n elsif m =~ /^\\(\\?[^\\:]*\\:(.*)\\)$/\n # puts \"matched #{m}\"\n m.match(/^\\(\\?[^\\:]*\\:(.*)\\)$/)[1]\n else\n raise \"Could not generate route :#{name} for #{options.inspect}: need #{args.join(', ')}.\" if args.empty?\n args.shift\n end\n }\n end\n match.gsub(/\\\\(.)/,'\\\\1') # unescapes escaped characters\n end", "title": "" }, { "docid": "c19af6a88b10197404932d0278b141fa", "score": "0.6769805", "text": "def generate_url\n\t\tself.url ||= name.parameterize\n\tend", "title": "" }, { "docid": "4d14ee4da6daa107bbacd1ff547e64b4", "score": "0.6752414", "text": "def url(name, *args)\n generator = url_generators[name]\n generator ? generator.url(*args) : raise(\"Generator for #{name} doesn't exist\")\n end", "title": "" }, { "docid": "b8969f429c1867b7d4b0f7044dd7df0a", "score": "0.67471105", "text": "def url(name, *params)\n params.map! do |param|\n if param.is_a?(Hash)\n param[:format] = param[:format].to_s if param.has_key?(:format)\n param.each { |k,v| param[k] = v.to_param if v.respond_to?(:to_param) }\n end\n end\n url = router.generator.generate(name, *params)\n uri_root != \"/\" ? uri_root + url : url\n end", "title": "" }, { "docid": "547e3c5c6d47714626a4505aa786fa4a", "score": "0.64955306", "text": "def resources_url options={}\n r=request.path\n options = case params[:action]\n when 'create','update','delete','destroy'; \"\"\n else resource_options(options)\n end\n return \"%s%s\" % [r,options] if r.match \"#{resource.class.to_s.tableize}$\"\n \"%s%s%s\" % [ r.split( resource.class.to_s.tableize)[0],resource.class.to_s.tableize, options]\n rescue Exception => e\n scoop_from_error e\n end", "title": "" }, { "docid": "444819d970197f946d88bd41809389cb", "score": "0.6450763", "text": "def url_for(options, route_name = nil, url_strategy = UNKNOWN, method_name = nil, reserved = RESERVED_OPTIONS)\n options = default_url_options.merge options\n\n user = password = nil\n\n if options[:user] && options[:password]\n user = options.delete :user\n password = options.delete :password\n end\n\n recall = options.delete(:_recall) { {} }\n\n original_script_name = options.delete(:original_script_name)\n script_name = find_script_name options\n\n if original_script_name\n script_name = original_script_name + script_name\n end\n\n path_options = options.dup\n reserved.each { |ro| path_options.delete ro }\n\n route_with_params = generate(route_name, path_options, recall)\n path = route_with_params.path(method_name)\n\n if options[:trailing_slash] && !options[:format] && !path.end_with?(\"/\")\n path += \"/\"\n end\n\n params = route_with_params.params\n\n if options.key? :params\n if options[:params]&.respond_to?(:to_hash)\n params.merge! options[:params]\n else\n params[:params] = options[:params]\n end\n end\n\n options[:path] = path\n options[:script_name] = script_name\n options[:params] = params\n options[:user] = user\n options[:password] = password\n\n url_strategy.call options\n end", "title": "" }, { "docid": "bcb4c370a1d2cbb2c4054167bf7a238d", "score": "0.64459187", "text": "def url(*args)\n named_route, params, recall, options = extract_params!(*args)\n\n options[:parameterize] ||= lambda { |name, param| Utils.escape_uri(param) }\n\n unless result = generate(:path_info, named_route, params, recall, options)\n return\n end\n\n uri, params = result\n params.each do |k, v|\n if v\n params[k] = v\n else\n params.delete(k)\n end\n end\n\n uri << \"?#{Utils.build_nested_query(params)}\" if uri && params.any?\n uri\n end", "title": "" }, { "docid": "97435db0c1aae004b733d9c62a47e8a9", "score": "0.64251405", "text": "def url(name, variables = {})\n @url_helpers.url(name, variables)\n end", "title": "" }, { "docid": "fa5d2fc9069fba61cc684c39e9ed1d33", "score": "0.6405798", "text": "def resource_url options={}\n r=request.path\n id=params[:id]\n options = case params[:action]\n when 'create','update','delete','destroy'; \"\"\n else resource_options(options)\n end\n return \"%s%s\" % [r,options] if r.match \"#{resource.class.to_s.tableize}\\/#{id}$\"\n \"%s%s\" % [ r.split(\"/#{params[:action]}\")[0], options]\n rescue Exception => e\n scoop_from_error e\n end", "title": "" }, { "docid": "2ba578a13eb5df8cc767069ed901378a", "score": "0.63813186", "text": "def url_for(*args)\n options = {}\n options = args.pop if args.last.kind_of?(Hash)\n\n segments = []\n segments << url_options[:base_path] if url_options[:base_path]\n segments << prefix if prefix\n segments << version\n segments += args.collect {|part| part.respond_to?(:to_param) ? part.to_param : part.to_s }\n\n url = \"\"\n url << url_options.fetch(:protocol, \"http\").to_s << \"://\"\n url << url_options.fetch(:host, env[\"SERVER_NAME\"])\n\n port = url_options.fetch(:port, env[\"SERVER_PORT\"]).to_i\n url << \":\" << port.to_s if port.nonzero? && port != 80\n\n url << Rack::Mount::Utils.normalize_path(segments.join(\"/\"))\n url << \"?\" << options.to_param if options.any?\n url\n end", "title": "" }, { "docid": "1e4075e2925a17a64e3a7d715581dbfc", "score": "0.63584554", "text": "def url_for(options = {})\n options ||= {}\n url = case options\n when String\n options\n when Hash\n options = options.symbolize_keys\n if request.host[Regexp.new(@@retailer_server)] \n# route = options[:use_route]\n options = options.merge!({:only_path => false})\n# debugger\n# options = options.merge!({:use_route => \"proxy\", :extra_data => route}) if route\n elsif (request.domain && request.domain(4)[Regexp.new(@@embedded_optemo_server)]) \n options = options.merge!({:only_path => false}) # reverse merge host and port here as necessary\n else\n options = options.reverse_merge!(:only_path => options[:host].nil?)\n end\n super\n when :back\n controller.request.env[\"HTTP_REFERER\"] || 'javascript:history.back()'\n else\n polymorphic_path(options)\n end\n url\n end", "title": "" }, { "docid": "fb15942754f111588180d9c55772cc45", "score": "0.6283632", "text": "def inquests_url(options)\n url_for({:controller => :inquests, :action => :create}.merge(options))\n end", "title": "" }, { "docid": "f6c137b0b9a57648d76dfaa48ac3df50", "score": "0.62755764", "text": "def url_for options = {}\n return \"/#{options[:controller].downcase}/#{options[:action]}/#{options[:id]}\" if options[:id].present?\n \"/#{options[:controller.downcase]}/#{options[:action]}\"\nend", "title": "" }, { "docid": "a0873534b5e66e86452f01f4fa3a113b", "score": "0.61761713", "text": "def route_for(options)\n ensure_that_routes_are_loaded\n ActionController::Routing::Routes.generate(options)\n end", "title": "" }, { "docid": "06cf3a012414bde37169b52397979bd2", "score": "0.6167349", "text": "def url(style_name = default_style, options = {})\n if options == true || options == false # Backwards compatibility.\n @url_generator.for(style_name, default_options.merge(timestamp: options))\n else\n @url_generator.for(style_name, default_options.merge(options))\n end\n end", "title": "" }, { "docid": "ef0f640001cc5d1e389adbda2666a157", "score": "0.61552465", "text": "def generate_path_from options\n options.path || view_model_path\n end", "title": "" }, { "docid": "8e539c4e8dd0623df91e133990e44265", "score": "0.6131772", "text": "def url(name, *params)\n self.class.url(name, *params)\n end", "title": "" }, { "docid": "e2e232b901f3113db6ee8df2b20c72e7", "score": "0.6118594", "text": "def url(name, params={})\n Merb::Router.generate(name, params)\n end", "title": "" }, { "docid": "f0808608132ded047e347f719a077d3f", "score": "0.61074346", "text": "def url_for options = {}\n @controller.url_for options\n end", "title": "" }, { "docid": "1a0b9e80fd36f8ef2f0410a0990ac95a", "score": "0.60743046", "text": "def generate_template_path_from options\n File.join generate_path_from(options), options.name\n end", "title": "" }, { "docid": "3d16956682378848e8108d85652ae4eb", "score": "0.60714436", "text": "def _generate_path_from_options(options)\n path = ''\n\n path = path + \"/#{options[:resource] || 'gallery'}\"\n if options[:section]\n path = path + \"/#{options[:section]}\"\n elsif options[:subreddit]\n path = path + \"/r/#{options[:subreddit]}\"\n else\n # can't have sort without section\n return path\n end\n\n # can't have page without sort\n return path unless options[:sort]\n\n path + \"/#{options[:sort]}/#{options[:page] || 0}.json\"\n end", "title": "" }, { "docid": "eaef681a85dbd6662839d9abbcbf3baf", "score": "0.60647863", "text": "def generate_url(template); end", "title": "" }, { "docid": "e8523f221983cf9bfb3e6daa0597e374", "score": "0.60616016", "text": "def path(name, *args)\n generator = url_generators[name]\n generator ? generator.path(*args) : raise(\"Generator for #{name} doesn't exist\")\n end", "title": "" }, { "docid": "9ed853489821d73e94f5a13528f6ffd1", "score": "0.6004058", "text": "def route_from_engine_or_main_app(engine_name, url_options)\n if engine_name.present?\n eval(engine_name).url_for(url_options) # rubocop:disable Security/Eval\n else\n main_app.url_for(url_options)\n end\n end", "title": "" }, { "docid": "022eaa89bd1fbba488d66fbd11f7bb58", "score": "0.59799266", "text": "def url(*names)\n self.class.url(*names)\n end", "title": "" }, { "docid": "884fb035ba1188aa07a656983392d5d3", "score": "0.59445006", "text": "def url(name, *args)\n return base_controller.url(name, *args) if base_controller\n super\n end", "title": "" }, { "docid": "32417fe4f36064df0252a23df94434f4", "score": "0.5931297", "text": "def url_for(options = T.unsafe(nil)); end", "title": "" }, { "docid": "32417fe4f36064df0252a23df94434f4", "score": "0.5931297", "text": "def url_for(options = T.unsafe(nil)); end", "title": "" }, { "docid": "32417fe4f36064df0252a23df94434f4", "score": "0.5931297", "text": "def url_for(options = T.unsafe(nil)); end", "title": "" }, { "docid": "80efbfc3dd3027a9bab851e62298ebbe", "score": "0.59190506", "text": "def rest_url_for(*args)\n options = args.at(0)\n case options\n when Hash\n action = options[:action]\n action ||= 'show'\n controller = options[:controller]\n key = ''\n if options[:entity] then\n entity = options[:entity]\n controller ||= entity.model_name\n key = entity.key\n end\n if action && action.include?('/') then\n action = action.split('/')\n controller = action[0]\n action = action[1]\n end\n\n url = \"#{controller}/#{key}\" \n url << \"/#{action}\" if action\n get_params = options.dup\n get_params.delete(:action)\n get_params.delete(:controller)\n get_params.delete(:entity)\n url << get_params.to_get_params if get_params.size > 0\n when Aurita::Model\n entity = args.at(0)\n options = args.at(1)\n options ||= {}\n controller = options[:controller]\n controller ||= entity.model_name\n action = options[:action]\n key = entity.key.values.first\n url = \"#{controller}/#{key}\"\n url << \"/#{action}\" if action\n get_params = options.dup\n get_params.delete(:action)\n get_params.delete(:controller)\n get_params.delete(:entity)\n url << '/' << get_params.to_get_params if get_params.size > 0\n else\n entity = args.at(0)\n options = args.at(1)\n options ||= {}\n controller ||= entity.model_name\n action = options[:action]\n url = \"#{controller}\"\n url << \"/#{action}\" if action\n get_params = options.dup\n get_params.delete(:action)\n url << '/' << get_params.to_get_params if get_params.size > 0\n end\n url\n end", "title": "" }, { "docid": "597324039f025ef5f66568389bd2fde3", "score": "0.59103566", "text": "def url_for(*args)\n options = args.extract_options!.with_indifferent_access\n # leading colon\n port = options[:port].blank? ? nil : \":#{options[:port]}\"\n # leading question mark\n query = options[:query].blank? ? nil : \"?#{options[:query]}\"\n # leading octothorpe\n fragment = options[:fragment].blank? ? nil : \"##{options[:fragment]}\"\n URI(\"#{url_scheme}://#{fqdn}#{port}#{app_root}#{options[:path]}#{query}#{fragment}\")\n end", "title": "" }, { "docid": "8e86a811b8413594643912544a692a5f", "score": "0.58742964", "text": "def link_to(name, url, options = {}); end", "title": "" }, { "docid": "42997a3900b833a6ae7ea2beed95db42", "score": "0.5855985", "text": "def build_uri(action, options)\n case action\n when 'sale'\n \"/ens/service/page/#{options[:page_id]}/process\"\n when 'auth'\n '/ens/service/authenticate'\n end\n end", "title": "" }, { "docid": "1a59184349f1fb3163a3ba8b51501e85", "score": "0.58451056", "text": "def route_for(name, *args); end", "title": "" }, { "docid": "2f9f975a8b71557e33c34cf122f5b07c", "score": "0.58348125", "text": "def url_for_options_paramdef_hash\n {\n :anchor => nil,\n :escape => nil,\n :host => nil,\n :only_path => nil,\n :password => nil,\n :port => nil,\n :protocol => nil,\n :skip_relative_url_root => nil,\n :trailing_slash => nil,\n :user => nil,\n\n :enable_optional_keys => true\n }.merge(routes_generate_options)\n end", "title": "" }, { "docid": "6e49b1709a97a6f3feab145d27cc319e", "score": "0.58270323", "text": "def auto_url_for(resource)\n config = active_admin_resource_for(resource.class)\n return unless config\n\n if config.controller.action_methods.include?(\"show\") &&\n authorized?(ActiveAdmin::Auth::READ, resource)\n url_for config.route_instance_path resource, url_options\n elsif config.controller.action_methods.include?(\"edit\") &&\n authorized?(ActiveAdmin::Auth::EDIT, resource)\n url_for config.route_edit_instance_path resource, url_options\n end\n end", "title": "" }, { "docid": "c117d9e3ebe69b363dbdafa08cfc1c58", "score": "0.5800908", "text": "def url(name, *args)\n return web_controller.url(name, *args) if web_controller\n super\n end", "title": "" }, { "docid": "5e7fcde97767f4fd5ee6cf9a8df8c3bf", "score": "0.5783057", "text": "def url_for base, options = nil\n return base unless options.is_a? Hash\n \"#{base}\" + ((\"?#{options.map { |key, value| \"#{CGI::escape(key.to_s)}=#{CGI::escape(value.to_s)}\"}.join(\"&\") }\" if options and not options.empty?) || '')\n end", "title": "" }, { "docid": "f1eddcda1028c3f09c89b1e8f3dbb543", "score": "0.5778924", "text": "def auto_url_for(resource)\n\n\n\n config = active_admin_resource_for(resource.class)\n\n\n\n return unless config\n\n\n\n\n\n\n\n if config.controller.action_methods.include?(\"show\") &&\n\n\n\n authorized?(ActiveAdmin::Auth::READ, resource)\n\n\n\n url_for config.route_instance_path resource\n\n\n\n elsif config.controller.action_methods.include?(\"edit\") &&\n\n\n\n authorized?(ActiveAdmin::Auth::UPDATE, resource)\n\n\n\n url_for config.route_edit_instance_path resource\n\n\n\n end\n\n\n\n end", "title": "" }, { "docid": "ccb6af1ba43d6e9bd9e7ef759f5f7e03", "score": "0.5770305", "text": "def url_template; end", "title": "" }, { "docid": "ccb6af1ba43d6e9bd9e7ef759f5f7e03", "score": "0.5770305", "text": "def url_template; end", "title": "" }, { "docid": "aadd159aab75084a3ee9b0c5e8640b6d", "score": "0.57702965", "text": "def do_url (name)\n name.to_s.downcase.gsub(' ', '_')\n end", "title": "" }, { "docid": "102eeacaf5895f4d4ce047563daa76c3", "score": "0.57683146", "text": "def build_uri_path(options)\n case options[:source]\n when 'chef'\n build_uri_path_chef(options)\n else\n raise \"Unrecognised profile source #{options[:source]}\"\n end\n end", "title": "" }, { "docid": "1336459d4bfc0593c96c7949406e815c", "score": "0.5764944", "text": "def url_for(option)\n host = SermepaWebTpv.response_host\n path = SermepaWebTpv.send(option)\n\n return if !host.present? || !path.present?\n URI.join(host, path).to_s\n end", "title": "" }, { "docid": "b2e63d8be74736db42debcc03b739346", "score": "0.5747858", "text": "def url_to(*args, **options)\n\t\t\t\tpath = build_path_for_url(*args, **options)\n\t\t\t\tAddressable::URI.join(request.base_url, path).to_s\n\t\t\tend", "title": "" }, { "docid": "30af9bcee474a98ea2c6b087562a733d", "score": "0.57356864", "text": "def url_for(options={})\n if institution_param.present? and options.is_a? Hash\n options[institution_param_name] ||= institution_param\n end\n if institute_param.present? and options.is_a? Hash\n options[:institute] ||= institute_param\n end\n super options\n end", "title": "" }, { "docid": "2d2435b8a6e43d9b78de95b9bab447e7", "score": "0.5732073", "text": "def new_resource_url\n send route_prefix_to_method_name(\"new_#{class_name.model_name.singular_route_key}_url\")\n end", "title": "" }, { "docid": "8939ea6bf81dea4e1c6788b77d1415a8", "score": "0.5707981", "text": "def url_for(option)\n host = SermepaWebTpv.response_host\n path = SermepaWebTpv.send(option)\n\n if host.present? && path.present?\n URI.join(\"http://#{host}\", path).to_s\n end\n end", "title": "" }, { "docid": "64f204aeeec91aecf6724b774bba9a5a", "score": "0.5702965", "text": "def url\n return permalink if permalink\n\n @url ||= (ext == '.html') ? template.gsub(':name', basename) : \"/#{name}\"\n end", "title": "" }, { "docid": "9632fec297495b9fe14167694d92ec26", "score": "0.5695393", "text": "def url(route, *args)\n case route\n when Symbol then url(@named_routes[route], *args)\n when Route then route.url(*args)\n when nil then @handle_unavailable_route.call(:url, *args)\n else \n end\n end", "title": "" }, { "docid": "98dd3499f3a830c2dc9f9f3ebf71e1be", "score": "0.5692886", "text": "def build_url(provider, resource_type, resource_name, resource_group, options)\n url = File.join(\n base_url,\n 'resourceGroups',\n resource_group,\n 'providers',\n provider,\n resource_type,\n resource_name,\n 'metricDefinitions'\n )\n\n url << \"?api-version=2014-04-01\"\n url << \"&$filter=#{options[:filter]}\" if options[:filter]\n\n url\n end", "title": "" }, { "docid": "a2853e88dc767ca6cf999bf0479d7cf3", "score": "0.5689052", "text": "def define_url_helper(mod, name, helper, url_strategy)\n mod.define_method(name) do |*args|\n last = args.last\n options = \\\n case last\n when Hash\n args.pop\n when ActionController::Parameters\n args.pop.to_h\n end\n helper.call(self, name, args, options, url_strategy)\n end\n end", "title": "" }, { "docid": "8fb13348e717a4b2cfe8330d85d097be", "score": "0.5672064", "text": "def build_url(product, options = nil)\n \"#{BASE_URL}#{product}#{build_query_string(options)}\"\n end", "title": "" }, { "docid": "a51643a7ca0c448133e4417baa3bb50b", "score": "0.56388676", "text": "def generate_seo_option_name\n self.name = self.name.to_url\n end", "title": "" }, { "docid": "5ffdf630d6c2eb836190a518a39362af", "score": "0.5634925", "text": "def foreign_url_for(obj, opt={})\n host, path = nil, nil\n text, target = opt.values_at(:text, :target)\n case obj\n when IcuPlayer\n host = \"www.icu.ie\"\n path = \"admin/players/#{obj.id}\"\n text ||= obj.id\n target ||= \"_icu_ie\"\n when FidePlayer\n host = \"ratings.fide.com\"\n path = \"card.phtml?event=#{obj.id}\"\n text ||= obj.id\n target ||= \"_fide_com\"\n end\n return nil unless host && path\n link_to text, \"http://#{host}/#{path}\", target: target, class: \"external\"\n end", "title": "" }, { "docid": "3eed8b40bc3fe53dddba48abb70db42a", "score": "0.56195074", "text": "def routes_generate_options\n {\n :action => action_ref(:class => :controller),\n #TODO named root params\n :controller => controller_ref,\n :generate_all => nil,\n :method => link_to_methods,\n :use_route => nil,\n\n }\n end", "title": "" }, { "docid": "097e262ee744ad6ae641961c29f451c6", "score": "0.56013334", "text": "def href_url_helper(options={})\n if represented_url.nil?\n options = options.except(:format)\n result = url_for(options.merge(only_path: true)) rescue nil\n if represented.parent\n result ||= polymorphic_path([:api, represented.parent, represented.item_class], options) rescue nil\n end\n result ||= polymorphic_path([:api, represented.item_class], options) rescue nil\n return result\n end\n\n if represented_url.respond_to?(:call, true)\n instance_exec(options, &represented_url)\n elsif respond_to?(represented_url, true)\n send(represented_url, options)\n else\n represented_url.to_s\n end\n end", "title": "" }, { "docid": "8431111241510e255da0eca040c78bc1", "score": "0.5600732", "text": "def create_url\n #we trim away all periods and break apart the name by spaces to use to acquire the url of the poet in the Poetry Foundation website\n name_no_periods = @name.tr(\".\", \"\")\n name_no_periods = name_no_periods.split(\" \")\n\n #we use name_no_periods to generate the url for the poet (example url: \"https://www.poetryfoundation.org/poets/ben-jonson\")\n url = \"https://www.poetryfoundation.org/poets/\"\n name_no_periods.each { |part| url = \"#{url}#{part}-\"}\n\n #this leaves an extra hyphen at the end, but we can just cut that off in the return.\n url = url.chop\n end", "title": "" }, { "docid": "06ff8ea7bdba401dfc1fef464d1027cc", "score": "0.5588889", "text": "def admin_basica_url(o, format)\n n = self.nombreobj_admin(o, !o.id) + \"_url\"\n send(n.to_sym, o, format)\n end", "title": "" }, { "docid": "e02fe4f369965c5ea4f013c57917421a", "score": "0.5584899", "text": "def create_url(api, options)\n options = options.symbolize_keys\n \n path = APIS[api].dup\n variable_regex = /\\$\\{(.+?)\\}/m\n \n while match = variable_regex.match(path)\n variable_name = $1.to_sym\n \n if options.has_key?(variable_name)\n path.sub!(variable_regex, options.delete(variable_name).to_s)\n else\n raise ArgumentError.new(\"Required argument missing: #{variable_name}\")\n end\n end\n \n url = self.base_url + '/' + path\n url + '?' + options.to_query\n end", "title": "" }, { "docid": "393230a4764d769e2d1f2cf8e461732c", "score": "0.5583389", "text": "def url_for(options={})\n if institution_param.present? and options.is_a? Hash\n options[institution_param_key] ||= institution_param\n end\n super options\n end", "title": "" }, { "docid": "fb700031bb48de62ecbeebec45bcca9f", "score": "0.5565183", "text": "def path(name, variables = {})\n @url_helpers.path(name, variables)\n end", "title": "" }, { "docid": "3ae0732b825d98bd3dbc4ab87f0113f2", "score": "0.55617774", "text": "def url_for_event(type, options)\n options.reverse_merge!(:type => type)\n \n apotomo_event_path(apotomo_request_processor.address_for(options))\n end", "title": "" }, { "docid": "5a6a013db127622f5446f112ea9123e3", "score": "0.5557746", "text": "def view_url(name, parameters = {})\n\t\t\tpath = (name =~ /^([^_].+?)\\/(.*)$/ ? \"_design/#{$1}/_view/#{$2}\" : name)\n\t\t\t\n\t\t\tClient.encode_url(\"#{@root}/#{path}\", parameters)\n\t\tend", "title": "" }, { "docid": "204bc130c1c82277ebe0bc695ee6a2a8", "score": "0.5549682", "text": "def route_url(route_name)\n \"#{request.base_url}#{rails_route_path(route_name)}\"\n end", "title": "" }, { "docid": "c690c856003a3af4a8e1cf3d5b39821f", "score": "0.55469555", "text": "def url_for(func, params = {})\n ::Plezi::Base::Router.url_for self, func, params\n end", "title": "" }, { "docid": "febef8a921750982fe1773226e8f1077", "score": "0.5546152", "text": "def to_url\n url = name.demodulize.underscore.downcase.pluralize\n url = \"#{namespace}/#{url}\" if respond_to?(:namespace)\n url\n end", "title": "" }, { "docid": "feeb122df8be22256f2c575b065a6c2b", "score": "0.55244315", "text": "def generate_uri(url, options)\n uri = API_URL + url\n options.each do |key,value|\n uri += uri.include?(\"?\") ? \"&#{key}=#{value}\" : \"?#{key}=#{value}\"\n end\n URI.parse uri\n end", "title": "" }, { "docid": "e5034055233ea3d6d3cb9b6d63b83226", "score": "0.5522767", "text": "def url(*args, &block)\n \"#{_base_url}#{path(*args, &block)}\"\n end", "title": "" }, { "docid": "6c3d2240ef3cb9caaf6d6184a9da4d1d", "score": "0.551948", "text": "def path opts = {}\n context.url_for(opts)\n end", "title": "" }, { "docid": "b7805a709ee1f4a707cb1cad57a81243", "score": "0.55171293", "text": "def url_for_project_named(name)\n eval project_path\n end", "title": "" }, { "docid": "119a19fadfdeb837284f0a43803c4b35", "score": "0.55140364", "text": "def collection_url\n send route_prefix_to_method_name(\"#{class_name.model_name.route_key}_url\")\n end", "title": "" }, { "docid": "9f69c3ff2335850f7b406d9e11b8c5d3", "score": "0.5503836", "text": "def url_generator\n\t\t@page_name = PAGE_NAME_PART_1 + @movie_type + PAGE_NAME_PART_2 + @page_num.to_s + PAGE_NAME_PART_3\n\tend", "title": "" }, { "docid": "d020143751e1aebab221af2e760b5b14", "score": "0.5492959", "text": "def url(route, *args)\n case route\n when Symbol\n url(@named_routes[route], *args)\n when nil\n raise UngeneratableRouteException.new\n else\n route.url(*args)\n end\n end", "title": "" }, { "docid": "682841027d0fc7b9511f7020687ba567", "score": "0.5489435", "text": "def uri(options = {})\n options[\"uri\"] || build_uri(options)\n end", "title": "" }, { "docid": "f56cd48b776e76ed379a5263fc856ed1", "score": "0.5484668", "text": "def url_for(route_name = nil, new_params = {})\n if route_name.kind_of?(String)\n return route_name\n end\n\n route_name.delete(:escape) if route_name.class.to_s == \"Hash\" && route_name.key?(:escape)\n new_params.delete(:escape) if new_params.class.to_s == \"Hash\" && new_params.key?(:escape)\n return url(route_name, new_params)\n end", "title": "" }, { "docid": "c140c052f13b8eb89d4983fd9b19a34a", "score": "0.54764557", "text": "def url_for(options={})\n if institution_param.present? and options.is_a? Hash\n options[:institute] ||= institution_param\n end\n super options\n end", "title": "" }, { "docid": "648ba275e7d7515f63f13ae102dca0bb", "score": "0.5476207", "text": "def generate_action_url(main_controller, action_name)\n get main_controller + '/' + action_name, to: main_controller + '#' + action_name\n end", "title": "" }, { "docid": "3f30c47cb74daece5bbc07b7b42822fb", "score": "0.5467683", "text": "def url_for_path path, options = {}\n unless options.delete :no_prefix\n url = ActionController::Base.relative_url_root + path\n else\n url = path.dup\n end\n \n options = default_url_options.merge options\n \n # Delete 'nil' parameters\n to_delete = []\n options.each{|k, v| to_delete << k if v.nil?}\n to_delete.each{|k| options.delete k}\n \n host = options.delete(:host) || options.delete('host')\n port = options.delete(:port) || options.delete('port')\n \n delimiter = path.include?('?') ? '&' : '?'\n \n url << \"#{delimiter}#{options.to_query}\" unless options.empty?\n url._url_format = options[:format] if options[:format] # hack for links with ajax support\n url\n \n if host.blank?\n url\n else\n %{http://#{host}#{\":#{port}\" unless port.blank?}#{url}}\n end\n end", "title": "" }, { "docid": "4e9963d59cf1adf894f7bdc5e74fedb7", "score": "0.54533285", "text": "def url_for(options = {})\n url = super options\n if params[:popup] == \"true\"\n if url.include? \"?\"\n url + \"&popup=true\"\n else\n url + \"?popup=true\"\n end\n else\n url\n end\n end", "title": "" }, { "docid": "66f7cd06fdb10df791c10567a7246cb7", "score": "0.54468536", "text": "def create_subscription_routes(options = {}, resources_options = [])\n self.resources options[:model], resources_options do\n collection do\n get :find unless ignore_path?(:find, options)\n get :optional_target_names if options[:api_mode] && !ignore_path?(:optional_target_names, options)\n end\n member do\n put :subscribe unless ignore_path?(:subscribe, options)\n put :unsubscribe unless ignore_path?(:unsubscribe, options)\n put :subscribe_to_email unless ignore_path?(:subscribe_to_email, options)\n put :unsubscribe_to_email unless ignore_path?(:unsubscribe_to_email, options)\n put :subscribe_to_optional_target unless ignore_path?(:subscribe_to_optional_target, options)\n put :unsubscribe_to_optional_target unless ignore_path?(:unsubscribe_to_optional_target, options)\n end\n end\n end", "title": "" }, { "docid": "9de28cdb35d08ef0ef0befab9fc7e3aa", "score": "0.5445741", "text": "def _url path = request.path, options = {}\n\t\tstr = path\n\t\tunless options.empty?\n\t\t\tstr += '?'\n\t\t\toptions.each do | k, v |\n\t\t\t\tstr = str + k.to_s + '=' + v.to_s + '&'\n\t\t\tend\n\t\tend\n\t\tstr\n\tend", "title": "" }, { "docid": "bb99a59e2d02f3fcc9c181f61b1175ef", "score": "0.5438993", "text": "def url\n @current_controller.url_for :controller => @controller_name, :action => @action_name\n end", "title": "" }, { "docid": "a9ead7297a30502cc2fb4d84a850fead", "score": "0.5434866", "text": "def generate_url_name\n self.url_name ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end", "title": "" }, { "docid": "a9ead7297a30502cc2fb4d84a850fead", "score": "0.5434866", "text": "def generate_url_name\n self.url_name ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end", "title": "" }, { "docid": "b1581946caceb8ccd1ed564d19c09aa0", "score": "0.5432738", "text": "def admin_basicas_url(o)\n n = self.nombreobj_admin(o, true) + \"_url\"\n send(n.to_sym)\n end", "title": "" }, { "docid": "bedf4c38d7c435d6f54439613b8bc134", "score": "0.54290575", "text": "def url_for(name, bucket = nil, options = {})\n connection.url_for(path!(bucket, name, options), options) # Do not normalize options\n end", "title": "" }, { "docid": "8ef5c3038bbffa76052be56b32dd4193", "score": "0.54263794", "text": "def gen_url(url, text)\n if url =~ /([A-Za-z]+):(.*)/ then\n type = $1\n path = $2\n else\n type = \"http\"\n path = url\n url = \"http://#{url}\"\n end\n\n if type == \"link\" then\n url = if path[0, 1] == '#' then # is this meaningful?\n path\n else\n self.class.gen_relative_url @from_path, path\n end\n end\n\n if (type == \"http\" or type == \"link\") and\n url =~ /\\.(gif|png|jpg|jpeg|bmp)$/ then\n \"<img src=\\\"#{url}\\\" />\"\n else\n \"<a href=\\\"#{url}\\\">#{text.sub(%r{^#{type}:/*}, '')}</a>\"\n end\n end", "title": "" }, { "docid": "de1346b673b16c56e110abac1ad29b12", "score": "0.5416463", "text": "def url\n options[:url]\n end", "title": "" }, { "docid": "dc9836610a89e3bec18e9b11749f56ac", "score": "0.5410733", "text": "def url_for(arg)\n arg\n end", "title": "" }, { "docid": "086fa6e79dd946d03a816707442f410a", "score": "0.5410731", "text": "def url(id, **options)\n if subdirectory\n File.join(host || \"\", subdirectory, id)\n else\n if host\n File.join(host, path(id))\n else\n path(id).to_s\n end\n end\n end", "title": "" }, { "docid": "064622238218c392540fe6c3d6714e3f", "score": "0.54092956", "text": "def url_to(*args, **options)\n\t\t\t\tfirst_arg = args.first\n\t\t\t\tpath =\n\t\t\t\t\tif first_arg.is_a?(String) || first_arg.is_a?(Flame::Path)\n\t\t\t\t\t\tfind_static(first_arg).path(with_version: options[:version])\n\t\t\t\t\telse\n\t\t\t\t\t\tpath_to(*args, **options)\n\t\t\t\t\tend\n\t\t\t\tAddressable::URI.new(\n\t\t\t\t\tscheme: request.scheme, host: request.host_with_port, path: path\n\t\t\t\t).to_s\n\t\t\tend", "title": "" }, { "docid": "3348d5f1319eeb9e8f660b1097f6598a", "score": "0.5407878", "text": "def url(**options)\n if uploaded_file = get\n uploaded_file.url(**options)\n else\n default_url(**options)\n end\n end", "title": "" }, { "docid": "dc987bda64d680d3a53cad20e6af8d15", "score": "0.5407216", "text": "def to_param\n name_for_url\n end", "title": "" }, { "docid": "d4706174c30ffc4c8b1ee7f27341ea71", "score": "0.5404521", "text": "def define_url_helper(mod, name, helper, url_strategy); end", "title": "" }, { "docid": "ddd99671914abbf0985a9eb07d01ee1c", "score": "0.5401226", "text": "def url\n if self.controller and self.action and self.page_id\n return \"/#{self.controller}/#{self.action}/#{self.page_id}\"\n end\n if self.controller and self.action\n return \"/#{self.controller}/#{self.action}\"\n end\n if self.controller\n return \"/#{self.controller}\"\n end\n return \"/#{self.shortcut}\"\n end", "title": "" } ]
fc73509090b4adb8b389035ba2fc9d99
Makes a POST call
[ { "docid": "97c64e8c84d29c71c3433ccf33de4e57", "score": "0.0", "text": "def post(api_version, resource, payload, query_parameters = nil,\n headers = nil)\n make_rest_call(:post, uri_builder(api_version, resource,\n query_parameters), payload, headers)\n end", "title": "" } ]
[ { "docid": "24f67a01fbe3bcea4a2a538b2446ac56", "score": "0.80418414", "text": "def post(data = {})\n call data, method: :post\n end", "title": "" }, { "docid": "818a668461eacd121f2fc6d20b8482b0", "score": "0.7997587", "text": "def post endpoint, data\n do_request :post, endpoint, data\n end", "title": "" }, { "docid": "918a7ada32610ca460a5c1c482ad38df", "score": "0.791948", "text": "def post(url, body = {})\n call(url: url, action: :post, body: body)\n end", "title": "" }, { "docid": "c840df2b574d7e45c9a87240d8f7c240", "score": "0.7873155", "text": "def post\n resource.post(request, response)\n end", "title": "" }, { "docid": "a73d9fb9cfc34b33df32623a5793dbfc", "score": "0.7732127", "text": "def post!\n request! :post\n end", "title": "" }, { "docid": "0962039645fba192bc9f2348f47798fb", "score": "0.773055", "text": "def post(*args)\n request(:post, *args)\n end", "title": "" }, { "docid": "1ca5f2c21af5ddfbbcd53b4ca31817a0", "score": "0.773029", "text": "def post(*args)\n request :post, *args\n end", "title": "" }, { "docid": "e6bef7b96def970ca471ce7b86a0bee2", "score": "0.76793927", "text": "def make_post_request url, body, headers = []\n make_request url, method: ::Rack::POST, body: body, headers: headers\n end", "title": "" }, { "docid": "8d244c8e93c271a7e92ea1ee63d3dddc", "score": "0.7631289", "text": "def POST; end", "title": "" }, { "docid": "06c37c00cce4fb350d732d3c1a09b3c4", "score": "0.7606799", "text": "def post(url, post_vars={})\n send_request url, post_vars, 'POST'\n end", "title": "" }, { "docid": "12da03e4d01fe52727840ae01cac47dc", "score": "0.7595262", "text": "def post url, object = nil\n request url, HTTP::Post, object\n end", "title": "" }, { "docid": "36e6cc7878758c106e43b0048ed4c051", "score": "0.7554341", "text": "def post(url, args = {})\r\n make_request(:post, url, args)\r\n end", "title": "" }, { "docid": "2ca7e387087b28eec31a72d7a23e02da", "score": "0.7529407", "text": "def post\n RestClient.post(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "title": "" }, { "docid": "c2c6d2f572b3f112dc8d5daacbdeb33c", "score": "0.7528105", "text": "def post; end", "title": "" }, { "docid": "d150a70b29ba6a251519dff4d7479c13", "score": "0.74821395", "text": "def post(path, **args); end", "title": "" }, { "docid": "a807eff7d2023bc833bc75bf2fe18248", "score": "0.7452685", "text": "def post url, body, headers = {}\n http_request(url, Net::HTTP::Post, body, headers)\n end", "title": "" }, { "docid": "b4e29c9c8fae41cc5eb646dfe7c8b937", "score": "0.74500835", "text": "def post(request)\n request.method = :post\n request.call\n end", "title": "" }, { "docid": "223cde455faacd2a7a556f079ffc6a33", "score": "0.7441051", "text": "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end", "title": "" }, { "docid": "50effd5588ad114ba31dfe294442639f", "score": "0.7421633", "text": "def post(data = \"\")\n submit :Post, data\n end", "title": "" }, { "docid": "b937668031da726f019cd2c84320d287", "score": "0.7413424", "text": "def post\r\n end", "title": "" }, { "docid": "b5e15ea979644ed0b0e79d52768a0923", "score": "0.74056613", "text": "def post(*args)\n Request.post(*args)\n end", "title": "" }, { "docid": "a67385052bfa0fe7f6b0813c3af81382", "score": "0.7322687", "text": "def post(url, headers, body)\n request(:post, url, headers, body)\n end", "title": "" }, { "docid": "caa9683d96adc60331711afe7eeb3c44", "score": "0.73171395", "text": "def post(data = nil, options = nil)\n options ||= {}\n options[:method] = :post\n call data, options\n end", "title": "" }, { "docid": "5db4c793f3de047d3710a30e33db5bd7", "score": "0.73113704", "text": "def post(path, params = {})\n\t\trequest(path, :post, params)\n\tend", "title": "" }, { "docid": "bdfca5eeba9a75af9eb8be0d7b526a1b", "score": "0.73059", "text": "def post_request(path, params={}, options={})\n request(:post, path, params, options)\n end", "title": "" }, { "docid": "d81eaa69ed4e5fa36ba6932d3cee3ee6", "score": "0.7305776", "text": "def api_post(action, data)\n api_request(action, data, 'POST')\n end", "title": "" }, { "docid": "d7e298593bb15e524d436b4cfd9b8088", "score": "0.72777534", "text": "def post(params = nil)\n request.method = :post\n execute(params)\n end", "title": "" }, { "docid": "2d3df01a57fe6c14a730377cb6110122", "score": "0.72752315", "text": "def post payload, path = \"\" \n make_request(path, \"post\", payload)\n end", "title": "" }, { "docid": "3e095d64e50d1d68104822a4e641e3ae", "score": "0.72564745", "text": "def post\n end", "title": "" }, { "docid": "5a2516e98c1cc06ddba8020bd27f19bf", "score": "0.7240783", "text": "def post()\n return @http.request(@req)\n end", "title": "" }, { "docid": "2fd3f979fbbb53746dcb971bc94ebc2d", "score": "0.7238801", "text": "def post(path, **options)\n execute :post, path, options\n end", "title": "" }, { "docid": "d56350715966270be6c3f5806f86133b", "score": "0.7213505", "text": "def post(*args)\n execute(:post, *args)\n end", "title": "" }, { "docid": "76e1993b81f68b9058ee3af5ae79e217", "score": "0.72015333", "text": "def post(url, body, headers = {})\n do_request Net::HTTP::Post, url, headers, body\n end", "title": "" }, { "docid": "770b1a40e50c95a87f917aa60b990d5e", "score": "0.7193958", "text": "def post\n if phase.has_key?('post')\n execute(\"post\", phase['post'])\n end\n end", "title": "" }, { "docid": "2f62a30e6aa37c7ddfde377481e1a165", "score": "0.71577346", "text": "def http_post(path, data, content_type = 'application/json')\n http_methods(path, :post, data, content_type)\n end", "title": "" }, { "docid": "b46c554e29ab42c3eda748bc31fb437b", "score": "0.7156688", "text": "def http_post(uri, data)\n RestClient.post uri, data\n end", "title": "" }, { "docid": "93bcf6b2ae499a90832ca64832d1508f", "score": "0.7142466", "text": "def post!\n self.https.request self.http_request # Net::HTTPResponse object\n end", "title": "" }, { "docid": "21e5c6716dc5f8a688dbdaa47abfd3d2", "score": "0.7137209", "text": "def post(path, data={})\n request(:post, path, data)\n end", "title": "" }, { "docid": "12e9e5fd505d46e3d7be25da1aa096c6", "score": "0.71358216", "text": "def post(path, options={})\n request :post, path, options\n end", "title": "" }, { "docid": "b6807f4c925a8983c012713e79f9e3a3", "score": "0.71297234", "text": "def post\n Rentlinx.client.post(self)\n end", "title": "" }, { "docid": "6ffdcb2af8e874b04c43a49752fd6aa5", "score": "0.71209455", "text": "def post(path, params={})\n request(:post, path, params)\n end", "title": "" }, { "docid": "6ffdcb2af8e874b04c43a49752fd6aa5", "score": "0.71209455", "text": "def post(path, params={})\n request(:post, path, params)\n end", "title": "" }, { "docid": "6ffdcb2af8e874b04c43a49752fd6aa5", "score": "0.71209455", "text": "def post(path, params={})\n request(:post, path, params)\n end", "title": "" }, { "docid": "64e0653c8763272f715ae350325f1ed6", "score": "0.7120318", "text": "def post(url, req_hash={})\n res = nil\n res = perform_op(:post, req_hash) do\n res = @wrapper.post(url, req_hash)\n end\n return res\n end", "title": "" }, { "docid": "4dbd9aacf8296627db183bdb51112e49", "score": "0.7108182", "text": "def post(path, options={})\n send_request 'post', path, options\n end", "title": "" }, { "docid": "250f267afbe27bbddb0d6bab1366e844", "score": "0.7100824", "text": "def post_request(url,args)\n uri = URI.parse(url)\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data(args)\n request(uri,req)\n end", "title": "" }, { "docid": "4e9fc3b152fbc23a9e74a9e7e2c44741", "score": "0.709014", "text": "def post(request)\n _request(request) { |client, options| client.post options }\n end", "title": "" }, { "docid": "f23cf765517032e9cfcc34bf0846c55e", "score": "0.7089152", "text": "def post(request)\n do_request(request) { |client| client.http_post request.body }\n end", "title": "" }, { "docid": "17f47102be4bf3632a51f488a6fe4e0d", "score": "0.7088895", "text": "def post_http(args)\n\t\t return(Net::HTTP.post_form @uri, args)\t\t\t\n \tend", "title": "" }, { "docid": "e5d087b1c7bcb89bc44b16d237cd668e", "score": "0.7079744", "text": "def exec_post(req, data, exit_on_fail = false)\n response_hash = exec_api_call('POST', req, data, exit_on_fail)\n response_hash[:response]\n end", "title": "" }, { "docid": "273a9ac4303d0327d27fae9b9860544c", "score": "0.7078733", "text": "def post(url, options = {}, &block)\n request HttpPost, url, options, &block\n end", "title": "" }, { "docid": "6cb5280c37f10f7a6a2d9b46350d2fd2", "score": "0.70617664", "text": "def post(url, data, headers = {})\n request(:post, url, headers, :data => data)\n end", "title": "" }, { "docid": "aca5768cc7d1f0837c20d137de5f302d", "score": "0.70603615", "text": "def post(payload)\n post_like payload, Net::HTTP::Post.new(@uri.path)\n end", "title": "" }, { "docid": "a7ea9728e97975036f442a3d28c0db20", "score": "0.70595616", "text": "def post(options = {})\n url = build_url(options)\n ret = post_response(url, options)\n ret\n end", "title": "" }, { "docid": "4bdb4b32e0481a42657073d9ced3ae64", "score": "0.70507765", "text": "def perform_post(path, options = {})\n perform_request(:post, path, options)\n end", "title": "" }, { "docid": "4480d67e930b8828057eabce64647bb7", "score": "0.70126104", "text": "def post_with_curl\n url = @settings.webhook_url\n `curl -is -X POST -H \"Content-Type:application/json\" -d '#{get_body}' '#{url}'`\n end", "title": "" }, { "docid": "977ad066591f2c3ba3c17479f17b4cc0", "score": "0.701158", "text": "def post_data; end", "title": "" }, { "docid": "ca80c7feea6a365b1a8a3bdc5ab339ca", "score": "0.70098096", "text": "def post(path, headers, body, &callback)\n request('POST', path, headers, body, &callback)\n end", "title": "" }, { "docid": "1f98a2b419133a1dd43c37e6e7f5d156", "score": "0.70072156", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "4180d858de91da8e62a829b4a5577430", "score": "0.7001945", "text": "def post(action, **args); end", "title": "" }, { "docid": "1f7f610803db35f2d54fe711db8578eb", "score": "0.69970536", "text": "def post(path, data=nil)\n request(:post, path, data)\n end", "title": "" }, { "docid": "68e18c67559ee270f8313474a5cf786d", "score": "0.6996166", "text": "def http_post(*args)\n url = args.shift\n c = Curl::Easy.new url\n yield c if block_given?\n c.http_post *args\n c\n end", "title": "" }, { "docid": "306e207592c63ee38bbb74333395bf19", "score": "0.6994605", "text": "def post(uri, params = {})\n send_request(uri, :post, params)\n end", "title": "" }, { "docid": "ad47e0bca48d3b19c8a255626e6b6d45", "score": "0.69891655", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "ad47e0bca48d3b19c8a255626e6b6d45", "score": "0.69891655", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "ad47e0bca48d3b19c8a255626e6b6d45", "score": "0.69891655", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "ad47e0bca48d3b19c8a255626e6b6d45", "score": "0.69891655", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "ad47e0bca48d3b19c8a255626e6b6d45", "score": "0.69891655", "text": "def post(path, params = {})\n request(:post, path, params)\n end", "title": "" }, { "docid": "a0f482e58cb7c7ba90f884d99055a881", "score": "0.6980975", "text": "def post(path:, params: {})\n request(method: :post, path: path, params: params)\n end", "title": "" }, { "docid": "2bfcd6ed2b0b145dd9281301f9850e56", "score": "0.69666207", "text": "def submit\n\t\tset_post_data\n get_response @url\n parse_response\n\tend", "title": "" }, { "docid": "814fb66a8e859c6ee5266337fe7e533d", "score": "0.69485974", "text": "def post(url, params = {})\n client.post(url, params).body\n end", "title": "" }, { "docid": "f3c29eea8ac1404d17ac7731a0fa5a6b", "score": "0.69480604", "text": "def do_request\n\t\t\tself.response = post_request(options)\n\t\tend", "title": "" }, { "docid": "25fd07166cab95b938b718482a8691f0", "score": "0.69470245", "text": "def post(action, params={}, options={})\n request(:post, action, params, options)\n end", "title": "" }, { "docid": "d0ca5747e3acaf6c97a9f3afa26e587d", "score": "0.6945756", "text": "def post(uri, request_headers, body)\n request('post', uri, request_headers, body)\n end", "title": "" }, { "docid": "f9d29aad203280426d3e60e424bd9e9f", "score": "0.693773", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "f9d29aad203280426d3e60e424bd9e9f", "score": "0.693773", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "f9d29aad203280426d3e60e424bd9e9f", "score": "0.693773", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "8fd3a7f00c347481307f239dd1ed8347", "score": "0.69336146", "text": "def post(path, params)\n request(:post, path, params)\n end", "title": "" }, { "docid": "a43158b6086fd6fc472ecb6e532b838f", "score": "0.693347", "text": "def post(path, query_string, data)\n # ...and delegate to the Faraday connection we created on initilization\n @conn.post \"#{path}?#{query_string}\", data\n end", "title": "" }, { "docid": "73a1320730ebae7cd49087d6dc711816", "score": "0.69293845", "text": "def post(path, query_params={}, opts={})\n request(:post, path, query_params, opts)\n end", "title": "" }, { "docid": "c59bd074a760dd39339bd5143798d9f0", "score": "0.6929132", "text": "def post(url, body, headers)\n conn = create_connection_object(url)\n\n http = conn.post(:body => body,\n :head => add_authorization_to_header(headers, @auth))\n\n action = proc do\n response = Response.new(http.response.parsed, http)#.response.raw)\n yield response if block_given?\n end\n\n http.callback &action\n http.errback &action \n end", "title": "" }, { "docid": "80e078be40d328f9ecab58f652301b07", "score": "0.69277203", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "80e078be40d328f9ecab58f652301b07", "score": "0.69277203", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "80e078be40d328f9ecab58f652301b07", "score": "0.69277203", "text": "def post(path, options = {})\n request(:post, path, options)\n end", "title": "" }, { "docid": "a0dc98a969b7b4b8b9f8b3731fede058", "score": "0.6927036", "text": "def post(data)\n uri = URI(@host)\n res = Net::HTTP.post_form(uri, {shell: data})\n # puts res.body\nend", "title": "" }, { "docid": "063509f091b41f2c8b239169d06bdb8d", "score": "0.6925749", "text": "def post\n uri = URI.parse(self.url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.open_timeout = 10\n http.read_timeout = 10\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n data = self.params.collect { |k, v| \"#{k}=#{CGI.escape(v.to_s)}\" }.join(\"&\")\n Freemium.log_test_msg(\"POST\\n url: #{self.url}\\n query: #{data}\")\n http.post(uri.request_uri, data).body\n end", "title": "" }, { "docid": "dd3853dc64ec5b1946a10c8da5ec8822", "score": "0.6921649", "text": "def post\n @response_body = make_request(\"#{api_url}#{endpoint}\", request_body.to_json)\n puts \"GLIMR POST: #{endpoint} - #{request_body.to_json}\" if ENV.key?('GLIMR_API_DEBUG')\n end", "title": "" }, { "docid": "24929e6eb33a88047a7e1b265cabbfdb", "score": "0.6921054", "text": "def post url, payload\n RestClient::Request.execute(:method => :post, :url => url, :payload => payload, :headers => lbaas_headers, :timeout => @timeout, :open_timeout => @open_timeout)\n end", "title": "" }, { "docid": "e1ee11c53bc7351a76410faa8e54bb5d", "score": "0.69110984", "text": "def do_post(uri = \"\", body = \"\")\n @connection.post do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n req.body = body\n end\n rescue Faraday::Error::ConnectionFailed => e\n $lxca_log.error \"XClarityClient::XclarityBase do_post\", \"Error trying to send a POST to #{uri}\"\n $lxca_log.error \"XClarityClient::XclarityBase do_post\", \"Request sent: #{body}\"\n Faraday::Response.new\n end", "title": "" }, { "docid": "40a6ed192210dfecf952eda411900ed8", "score": "0.6910221", "text": "def post\n request_object.post_query\n end", "title": "" }, { "docid": "4a4bf1c775759afe982d1a6d3318522e", "score": "0.6904263", "text": "def api_post(action, data, binary_key = nil)\n api_request(action, data, 'POST', binary_key)\n end", "title": "" }, { "docid": "b6e8ab8800619de71953106c2011868a", "score": "0.68849385", "text": "def api_post(path, data = {})\n api_request(:post, path, :data => data)\n end", "title": "" }, { "docid": "ccbe993cec79489b3c2a8eaf7a887bb9", "score": "0.6883811", "text": "def post(path, data = {})\n request 'POST', path, body: data.to_json\n end", "title": "" }, { "docid": "53342147d826735abe8335ce2a4e7e78", "score": "0.6881496", "text": "def make_post_request(route:, headers: nil, body: nil)\n post route, params: body, headers: headers\nend", "title": "" }, { "docid": "5eca2123386a696aacdf350397f6c7de", "score": "0.68768793", "text": "def post(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :POST)\n end", "title": "" }, { "docid": "3ba47138e15194b3a88c5997ff500392", "score": "0.68744093", "text": "def http_post(url, data)\n\turi = URI(url)\n\treq = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})\n req.body = data.to_json\n response = Net::HTTP.new(uri.host, uri.port).start {|http| http.request(req) }\n return response\nend", "title": "" }, { "docid": "12e30280f3bed554c2b72c22f3bcb9c8", "score": "0.68728167", "text": "def make_post_call(endpoint)\n make_call(endpoint, Putio::HTTP::POST)\n end", "title": "" }, { "docid": "ceacdd95ce04e9a0d215fe0d136856e0", "score": "0.6858119", "text": "def post(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'post'}.merge(authentication))\n end", "title": "" }, { "docid": "8ae4e361fc5cadd7ea0823d7b04007d3", "score": "0.6836773", "text": "def post(object, url, headers={})\n do_request(\"post\", url, object, headers)\n end", "title": "" }, { "docid": "28e63deae62d42ca9f3c486715bfc865", "score": "0.683526", "text": "def post(path, data, params = {}, request_options = {})\n request(:post, path, data, params)\n end", "title": "" }, { "docid": "4f6e4d871c2874037442951c288a3ba6", "score": "0.6829694", "text": "def post(url, key)\n _request(url, :POST, key)\n end", "title": "" } ]
4bf680cf28b1ef29a2019d135556b140
PUT /id_cards/1 PUT /id_cards/1.xml
[ { "docid": "5d0d1cfea9478340e4d23adcbca29d81", "score": "0.689513", "text": "def update\n @id_card = IdCard.find(params[:id])\n\n respond_to do |format|\n if @id_card.update_attributes(params[:id_card])\n format.html { redirect_to(@id_card, :notice => 'Id card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @id_card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "6c684a9c1a01de9d30d2c281c848ca0a", "score": "0.70389926", "text": "def update\n @card = @stage.cards.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to(@project, :notice => 'Card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e3f2712511dbb57eea1f37155b982e", "score": "0.6998236", "text": "def update\n \n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n flash[:notice] = 'Card was successfully updated.'\n format.html { redirect_to(@card) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "272219232a9edf4720f8e830e6c80e53", "score": "0.68121505", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to(@card, :notice => 'Card was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f4204c0a7607882cd4acb2074a5f23b", "score": "0.6798768", "text": "def update\n @card = Card.find(params[:id])\n\n add_edition()\n @card.attributes = params[:card]\n\n respond_to do |format|\n if @card.save\n add_to_deck()\n\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a96d4e1e3526a68b90c901a484193e8d", "score": "0.67584425", "text": "def update\n @card = @deck.cards.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to [@deck,@card], notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b3a1876e86db33ef5cf1c2b34c73e88", "score": "0.66868776", "text": "def update\n @card = @deck.cards.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to deck_cards_path(@deck), notice: 'card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b630389e084fee3ea4a2bf006cecf32f", "score": "0.6557478", "text": "def update\n @deck_card = DeckCard.find(params[:id])\n\n respond_to do |format|\n if @deck_card.update_attributes(params[:deck_card])\n flash[:notice] = 'DeckCard was successfully updated.'\n format.html { redirect_to(@deck_card) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @deck_card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33b4b52ea17491921331ecc11f200183", "score": "0.64695716", "text": "def update\n @card = Card.find(params[:id])\n \n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, :notice => 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6a4145453c619b4b2325dd000e03944", "score": "0.6441682", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a77cca7432037b1d4490c10e45186cf", "score": "0.6438153", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, :notice => 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a5dceefca34a24e4ef4235ad3bf489f", "score": "0.6434551", "text": "def update\n #@card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to cards_url, :notice => 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1d63ce77f43aa1dac816659e98a0a23", "score": "0.6420589", "text": "def update\n @cardset = Cardset.find(params[:id])\n\n respond_to do |format|\n if @cardset.update_attributes(params[:cardset])\n flash[:notice] = 'Cardset was successfully updated.'\n format.html { redirect_to(@cardset) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cardset.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b0c8454efa706fa84d90b35b1c250c", "score": "0.64198077", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ffcd5f8c8e88fac5b7d8623ae1c58fc", "score": "0.64073175", "text": "def update\n @vcard = Vcard.find(params[:id])\n\n respond_to do |format|\n if @vcard.update_attributes(params[:vcard])\n flash[:notice] = 'Vcard was successfully updated.'\n format.html { redirect_to(@vcard) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vcard.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2b2759a0c3c00c2728bb81092bef986", "score": "0.64010423", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update(params[:card])\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "237ced133f8a96e06ee3c6275a29776b", "score": "0.6372367", "text": "def update\n @card.update(card_params)\n end", "title": "" }, { "docid": "239c2436f09709e79adf97df3d341635", "score": "0.635403", "text": "def update\n @card = Card.find(params[:id])\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n flash[:notice] = 'Bingobrickan ändrades.'\n format.html { redirect_to(@card) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa0bb9c913ea907641d212018bfbb089", "score": "0.6350951", "text": "def update\n #espond to user request for specific card id, to both edit & save it, then redirect to card index page\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to cards_path, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eaf55be6522743ee603f40936d1ffcbd", "score": "0.631526", "text": "def update\n respond_to do |format|\n if @api_v1_card.update(api_v1_card_params)\n format.html { render :show, status: :ok, location: @api_v1_card }\n format.json { render :show, status: :ok, location: @api_v1_card }\n else\n format.html { render json: @api_v1_card.errors, status: :unprocessable_entity }\n format.json { render json: @api_v1_card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9ef0859cc0fbaf3368b87ae9f4441c4", "score": "0.631521", "text": "def update\n @card = Card.find(params[:id])\n #Rails.logger.info(\">>>card Controller>>UPDATE: #{params.inspect}\")\n\n respond_to do |format|\n if @card.update_attributes(params[:card])\n format.html { redirect_to root_url}\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "91b0d3dfaa9b72e42c6ceb5709b29aac", "score": "0.63147306", "text": "def update\n if @card.update(card_params)\n render json: @card, status: :ok, serializer: CardSerializer\n else\n render json: @card.errors, status: :unprocessable_entity \n end\n end", "title": "" }, { "docid": "ff2b6aadb23b2cd7bff61948e0dd9da1", "score": "0.6314332", "text": "def update\n @cardholder = Cardholder.find(params[:id])\n\n respond_to do |format|\n if @cardholder.update_attributes(params[:cardholder])\n flash[:notice] = 'Cardholder was successfully updated.'\n format.html { redirect_to(@cardholder) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cardholder.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8f328a53f9a56e367d5eab300e2a646", "score": "0.6305177", "text": "def set_card\n @card = Voc.find(params[:voc_id]).cards.find(params[:id])\n end", "title": "" }, { "docid": "6d1fd53bd036287926f7b820d61767b5", "score": "0.63034326", "text": "def set_api_v1_card\n @api_v1_card = Card.find(params[:id])\n end", "title": "" }, { "docid": "02362a1dc4241d1d0dea01dc2ed2c807", "score": "0.6293208", "text": "def update\n @deck = Deck.find(params[:id])\n\n respond_to do |format|\n if @deck.update_attributes(params[:deck])\n flash[:notice] = 'Deck was successfully updated.'\n format.html { redirect_to(@deck) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @deck.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2109b0815a19211c594837e1cdd16d76", "score": "0.6290073", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "382f197c4bf9ed3196f41884faa7ede6", "score": "0.62876827", "text": "def change(cardnum, text)\n options = {:query => {:card => {:name => text}}}\n self.class.get(\"/cards/#{cardnum}/store.xml\", options)\n end", "title": "" }, { "docid": "b9dcf1f61c5d090240bcda0704d7ab90", "score": "0.62766665", "text": "def update\n @index_card = IndexCard.find(params[:id])\n\n respond_to do |format|\n if @index_card.update_attributes(params[:index_card])\n format.html { redirect_to @index_card, notice: 'Index card was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @index_card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19b8088fa1cc0f1fe7266e0932413ca2", "score": "0.62677205", "text": "def update\n if @card.update(card_update_params)\n respond_ok \"card\", @card\n else\n respond_err \"card\", @card, @card.errors\n end\n end", "title": "" }, { "docid": "4bc73e40498992467e36cf506a6ad1f3", "score": "0.6266969", "text": "def update\n if @card.update card_params\n render :show, status: :ok, location: @card\n else\n render json: @card.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a4040ab2d2dfb51390427be11aef8041", "score": "0.626404", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card}\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4bb27e1379dd28e05b3605baeb6036a", "score": "0.62545085", "text": "def change(name, newname, new_home_phone = nil, new_office_phone = nil)\r\n id = name_to_id(name)\r\n options = { :name => newname }\r\n options[:home_phone] = new_home_phone unless new_home_phone.nil?\r\n options[:office_phone] = new_office_phone unless new_office_phone.nil?\r\n options = { :body => {:card => options} }\r\n self.class.put(\"/cards/#{id}.xml\", options)\r\n end", "title": "" }, { "docid": "d95713d70ccf3d8f42891f93a6a14bc1", "score": "0.6236295", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Карточка успешно отредактирована' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc46f82f173ef94757989346ee8cd8e7", "score": "0.62310886", "text": "def update\n @deck = Deck.find(params[:id])\n\n respond_to do |format|\n if @deck.update_attributes(params[:deck])\n format.html { redirect_to(@deck, :notice => 'Deck was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @deck.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ebf13d6221b263396a262d8120602bb1", "score": "0.6223273", "text": "def update\n @recipe_card = RecipeCard.find(params[:id])\n\n respond_to do |format|\n if @recipe_card.update_attributes(params[:recipe_card])\n format.html { redirect_to(@recipe_card, :notice => 'RecipeCard was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recipe_card.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5240308f9c702e7814e8851c28c4bbb0", "score": "0.6210876", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f7114309442d822552436fdd2e878f9", "score": "0.6201435", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: \"Card was successfully updated.\" }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "745fd7b8c1ca9439fe0b33bd40487043", "score": "0.6199151", "text": "def update(name, newname, new_home_phone = nil, new_office_phone = nil)\n id = name_to_id(name)\n card_opts = { :name => newname }\n card_opts[:home_phone] = new_home_phone unless new_home_phone.nil?\n card_opts[:office_phone] = new_office_phone unless new_office_phone.nil?\n\n options = { :body => {:card => card_opts} }\n self.class.put(\"/cards/#{id}.xml\", options)\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "594d38662e36a95f13efe45f88b8233d", "score": "0.61973614", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20aada2bb996c51cac8b9c452eb91e1b", "score": "0.6195143", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: \"Card was successfully updated.\" }\n format.json { render :show, status: :ok, location: @card }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4308e5c0bae0b81b18778b73bdb99506", "score": "0.6193473", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @card }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "809bd2d9cf71bfe7496bfd5ebb07f510", "score": "0.61893475", "text": "def update\n @card_item = CardItem.find(params[:id])\n\n respond_to do |format|\n if @card_item.update_attributes(params[:card_item])\n format.html { redirect_to(@card_item, :notice => 'Card item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "668bf3e0678e40179075d1fc45e535b1", "score": "0.61742985", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to cards_path, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39495969e55420355dc2655adaeb8bb5", "score": "0.61737937", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39495969e55420355dc2655adaeb8bb5", "score": "0.61737937", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39495969e55420355dc2655adaeb8bb5", "score": "0.61737937", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39495969e55420355dc2655adaeb8bb5", "score": "0.61737937", "text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4f3f37288d8401c0114bd1a04b280ca", "score": "0.616824", "text": "def update\n @scorecard = Scorecard.find(params[:id])\n\n respond_to do |format|\n if @scorecard.update_attributes(params[:scorecard])\n format.html { redirect_to(@scorecard, :notice => 'Scorecard was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scorecard.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "e64739662314198d4bc60dbcc59bd4e1", "score": "0.6166277", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "5fb82c9badfb903349448eef4eb4cdbd", "score": "0.6130557", "text": "def set_card\n\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "65c9f51e2970b7fe19a4be190c3090ad", "score": "0.6120829", "text": "def move_card(card)\n id = card['id']\n HTTParty.put(\"https://api.trello.com/1/cards/#{id}/55fe79ff6286c04f8ee97091&key=#{@key}&token=#{@token}\")\n end", "title": "" }, { "docid": "b2be780273c007568d46c0b3f4f84e5c", "score": "0.60812795", "text": "def set_card\n # @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "b8848f3501c612156cd9a660dc56c54b", "score": "0.6061403", "text": "def update\n @cardset = Cardset.find(params[:id])\n\n respond_to do |format|\n if @cardset.update_attributes(params[:cardset])\n format.html { redirect_to @cardset, notice: 'Cardset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cardset.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba168d7451f281e635e43bff8c82f2df", "score": "0.60613614", "text": "def update\n card = @card.update(card_params)\n if card.save\n render json: card\n else\n # render json: card.errors, status: 447\n end\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" }, { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.6046852", "text": "def set_card\n @card = Card.find(params[:id])\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "cb6f5a0f7d223a87bac1047fd8080e9a", "score": "0.0", "text": "def event_params\n params.require(:event).permit(:event_name, :event_start_date, :event_end_date, :expected_pax, :last_pax, :post_code, :city, :country, :comment, :cuptwenty, :cuptwentyfive, :cupforty, :cupfifty, :cuplitre, :cupwine, :cupcava, :cupshot, :creator_id, :creatorganizer, :organizer_id, :party, :dinner, :last_consumption, :address, :delivery_date, :return_date, :contact, :phone, :is_complete, :bar, :beertap, :is_lln, :lln_year, :is_bep, :deposit_on_site)\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": "" } ]
9cfe976a09e4d663eac065ff8d893e92
POST /cats POST /cats.xml
[ { "docid": "b5a10d3518f815771d806dffe073b30d", "score": "0.6217732", "text": "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to(@cat, :notice => 'Cat was successfully created.') }\n format.xml { render :xml => @cat, :status => :created, :location => @cat }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cat.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "fcacca3ec6e1e26fc8bb189b55a4e306", "score": "0.600589", "text": "def postCategoryMappings( category_id, type, id, name)\n params = Hash.new\n params['category_id'] = category_id\n params['type'] = type\n params['id'] = id\n params['name'] = name\n return doCurl(\"post\",\"/category/mappings\",params)\n end", "title": "" }, { "docid": "66771ff1f9cb93294ef897326d4398a7", "score": "0.59876", "text": "def test_find_categories\n @request.env[\"RAW_POST_DATA\"] = \"act\"\n xhr :post, :find_categories, :type => 1, :name => 'genre'\n assert_success\n assert @response.body.include?('add_genre(\\'' + categories(:action).id.to_s + '\\');')\n end", "title": "" }, { "docid": "75a6f511b1b6ade8a93ed190dd860a4e", "score": "0.5959186", "text": "def create\n #...\n params[:cat].permit(...:tag_ids: []) #allow tag_ids and expect it to be an Array\n end", "title": "" }, { "docid": "99f67928e9fa07382be2f2adada5a099", "score": "0.586425", "text": "def create\n @catena = Catena.new(params[:catena])\n\n respond_to do |format|\n if @catena.save\n format.html { redirect_to(catenas_path, :notice => 'Catena was successfully created.') }\n format.xml { render :xml => @catena, :status => :created, :location => @catena }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @catena.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dea002749a7f0ee37cc404558c98338", "score": "0.5839763", "text": "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd04cad782e17deb6294287283d89a1d", "score": "0.5814253", "text": "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n _update_topics \n format.html { redirect_to action: \"new\", notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e413155a54df8bd90ccd162b27efc30", "score": "0.5787878", "text": "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end", "title": "" }, { "docid": "5c31cb8d65d41faf9067ab847d5b2c8a", "score": "0.5781219", "text": "def create\n\t\t@cat = Cat.new(cat_params)\n\n\t\tif @cat.save\n\t\t\t# cat_url(@cat) == /cat/{@cat.id}\n\t\t\tredirect_to cat_url(@cat)\n\t\telse\n\t\t\trender :new\n\t\t\t# render json: @cat.errors.full_messages, status: :unprocessable_entity\n\t\tend \n\tend", "title": "" }, { "docid": "8fb11c432a8bb2c5fc11d5fb6181b5b5", "score": "0.5742315", "text": "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end", "title": "" }, { "docid": "de1019d3d161e462915d4ceb82ed94b7", "score": "0.57292527", "text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend", "title": "" }, { "docid": "7f7094198250528d00572ee5c7cc180c", "score": "0.569796", "text": "def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend", "title": "" }, { "docid": "84a39273f98a31fd0fd478fd5bf03d17", "score": "0.55288076", "text": "def create\r\n @ccategory = Ccategory.new(params[:ccategory])\r\n @titles = ptitles\r\n\r\n respond_to do |format|\r\n if @ccategory.save\r\n format.html { redirect_to(@ccategory, :notice => 'Ccategory was successfully created.') }\r\n format.xml { render :xml => @ccategory, :status => :created, :location => @ccategory }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @ccategory.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5a11e4328eef30f6dfb07b98998dd87f", "score": "0.552406", "text": "def postEntityCategory( entity_id, category_id, category_type)\n params = Hash.new\n params['entity_id'] = entity_id\n params['category_id'] = category_id\n params['category_type'] = category_type\n return doCurl(\"post\",\"/entity/category\",params)\n end", "title": "" }, { "docid": "d353cd6c6c9b10f85574f5801dd4e03c", "score": "0.55201644", "text": "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end", "title": "" }, { "docid": "23d9b930031d711da870cc61f054a432", "score": "0.55103797", "text": "def list_customer_categories\n doc = Hpricot::XML(request.raw_post) \n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc)\n @customer_categories = Customer::CustomerCrud.list_customer_categories(doc)\n render_view( @customer_categories,'customer_categories','L')\n end", "title": "" }, { "docid": "bd5b0a98c00abc8378e6abdd4cae66d7", "score": "0.549919", "text": "def create\n @cat = Cat.new(catparams)\n if @cat.save\n redirect_to @cat\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "a9bb0b95827db9fc30498aa9e54e8945", "score": "0.5488652", "text": "def create\n @taxonomy_category = TaxonomyCategory.new(params[:taxonomy_category])\n\n respond_to do |format|\n if @taxonomy_category.save\n format.html { redirect_to @taxonomy_category, notice: 'Taxonomy category was successfully created.' }\n format.json { render json: @taxonomy_category, status: :created, location: @taxonomy_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taxonomy_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7dab79b3abe8d39b4de5b8098e9bf4bb", "score": "0.54762715", "text": "def catses\n REXML::XPath.match(@xml, './app:categories', Names::XmlNamespaces)\n end", "title": "" }, { "docid": "9eaa8c47bf1217eac58a330c4442e8c3", "score": "0.5472575", "text": "def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc5957732f647552965a384894e5cba8", "score": "0.5445988", "text": "def create\n @recipe_category = RecipeCategory.new(params[:recipe_category])\n\n respond_to do |format|\n if @recipe_category.save\n flash[:notice] = l(:flash_notice_recipe_category_created)\n format.html { redirect_to RecipeCategory.new }\n format.xml { render :xml => @recipe_category, :status => :created, :location => @recipe_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recipe_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "119aabd37cadd5396993e00a9812a122", "score": "0.54439265", "text": "def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to(@categoria, :notice => 'Categoria was successfully created.') }\n format.xml { render :xml => @categoria, :status => :created, :location => @categoria }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categoria.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1120e906df8a6d0ffba23eb5c91d43f5", "score": "0.54357386", "text": "def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end", "title": "" }, { "docid": "7f18d0878b39613ea3903b2c9e620f66", "score": "0.54352915", "text": "def create\n @sotto_categoria = SottoCategoria.new(params[:sotto_categoria])\n\n respond_to do |format|\n if @sotto_categoria.save\n format.html { redirect_to(@sotto_categoria, :notice => 'Sotto categoria was successfully created.') }\n format.xml { render :xml => @sotto_categoria, :status => :created, :location => @sotto_categoria }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sotto_categoria.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97ab837a7343edc4ae330d9b0ca96040", "score": "0.54329985", "text": "def create\n @category_collection = CategoryCollection.new(params[:category_collection])\n @collection = @category_collection.collection\n\n respond_to do |format|\n if @category_collection.save\n flash[:notice] = 'CategoryCollection was successfully created.'\n format.html { redirect_to(@collection) }\n format.xml { render :xml => @category_collection, :status => :created, :location => @category_collection }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category_collection.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "193fa8957bac44d7ba1671c823f4f5d2", "score": "0.5430716", "text": "def postCategorySynonym( category_id, synonym, language)\n params = Hash.new\n params['category_id'] = category_id\n params['synonym'] = synonym\n params['language'] = language\n return doCurl(\"post\",\"/category/synonym\",params)\n end", "title": "" }, { "docid": "965879c70bef3cea20f844b089752022", "score": "0.5427495", "text": "def create\n @recipe_category = RecipeCategory.new(params[:recipe_category])\n\n respond_to do |format|\n if @recipe_category.save\n flash[:notice] = 'RecipeCategory was successfully created.'\n format.html { redirect_to(@recipe_category) }\n format.xml { render :xml => @recipe_category, :status => :created, :location => @recipe_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recipe_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ab916db170aa021a7e290152dc877b5", "score": "0.5420475", "text": "def create\n @server = Server.new(server_params)\n @server.user_id = current_user.id\n cats = params[:server][:category_id]\n\n respond_to do |format|\n if @server.save\n\n cats.each do |c|\n unless c.empty?\n stc = ServersToCategories.new\n stc.category_id = c\n stc.server_id = @server.id\n\n stc.save\n end\n end\n\n format.html { redirect_to @server, notice: 'Server was successfully created.' }\n format.json { render :show, status: :created, location: @server }\n else\n format.html { render :new }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d3340f10629ceeb09bcf1518dfca0c8", "score": "0.54186887", "text": "def create\n @list_cat = ListCat.new(params[:list_cat])\n\n respond_to do |format|\n if @list_cat.save\n flash[:notice] = 'ListCat was successfully created.'\n format.html { redirect_to(:controller => 'list_cats', :action => 'edit', :id => @list_cat.id) }\n format.xml { render :xml => @list_cat, :status => :created, :location => @list_cat }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_cat.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e879b9cfb615f214e38ba85595e9092a", "score": "0.54173374", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1dceb1e271c0a3e442f5a546e78f85a", "score": "0.54011875", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to(@category, :notice => 'Category was successfully created.') }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1dceb1e271c0a3e442f5a546e78f85a", "score": "0.54011875", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to(@category, :notice => 'Category was successfully created.') }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d0ecd6be5bbc235ce2a851c0a0f314f", "score": "0.53986734", "text": "def create\n @cat = Cat.new(cat_params)\n @cat.user = current_user\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render :show, status: :created, location: @cat }\n else\n format.html { redirect_to new_cat_path }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbf361aa29cb942ab7f96ea18467fb0f", "score": "0.5392642", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n flash[:notice] = 'Category was successfully created.'\n format.html { redirect_to(@category) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea8230ffe1169921b39e7252ab242c08", "score": "0.5391353", "text": "def create\n @tag = @category.tags.new(params[:tag])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to([@category,@tag], :notice => 'Tag was successfully created.') }\n format.xml { render :xml => @tag, :status => :created, :location => [@category,@tag] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04779fc6a7223751fb3e79f2b7a6f82c", "score": "0.5376505", "text": "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "title": "" }, { "docid": "58f100bd42ad2dfd121248de83b2fbc9", "score": "0.5372416", "text": "def create\n json_create(category_params, Category)\n end", "title": "" }, { "docid": "e94a7b33cf0f87fb69068040edf9f4a0", "score": "0.53663707", "text": "def create\n @categories = Category.all\n\n @category = Category.create(category_params)\n flash[:notice]=\"Catégorie créer avec succès!!!\"\n end", "title": "" }, { "docid": "386c9c8830cc2962e6b1b517081098eb", "score": "0.53623813", "text": "def create_category(cat_name)\n category = Spree::Taxonomy.where(name: 'Categories').first\n category = Spree::Taxonomy.create(name: 'Categories') if category.nil?\n taxon = Spree::Taxon.find_by(name: cat_name, taxonomy_id: category.id)\n if taxon.present?\n spree_taxons.append(taxon)\n else\n taxon = Spree::Taxon.new(name: cat_name, taxonomy_id: category.id, parent_id: category.root.id)\n if taxon.save\n spree_taxons.append(taxon)\n else\n Rails.logger.info \"Error! #{taxon.errors.full_messages}\"\n end\n end\n end", "title": "" }, { "docid": "44f72e4f8cccf2c35b145f5bb0512dee", "score": "0.53573483", "text": "def create\n @articlecat = Articlecat.new(articlecat_params)\n\n respond_to do |format|\n if @articlecat.save\n format.html { redirect_to @articlecat, notice: 'Articlecat was successfully created.' }\n format.json { render :show, status: :created, location: @articlecat }\n else\n format.html { render :new }\n format.json { render json: @articlecat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02f5619cc7b03717a3c4ed3bed11900f", "score": "0.53447866", "text": "def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "title": "" }, { "docid": "3ac3a522ec69e25deb08d229dab77353", "score": "0.53416", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n flash[:notice] = 'Category was successfully created.'\n format.html { redirect_to(admin_categories_path) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b1a71b6d91d01d972acf5af68de7701", "score": "0.5329285", "text": "def create\n @post = Post.new(params[:post])\n @categoria = Categorium.find(:all, :order => 'nombre ASC').collect {|m| [m.nombre, m.id]}\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Un nuevo post creado.') }\n format.xml { render :xml => [@post, @categoria], :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => [@post.errors, @categoria], :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d74d827de00bd4ea5be49c0d5cb96221", "score": "0.532101", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n flash[:notice] = 'Kategoria została stworzona poprawnie.'\n format.html { redirect_to([:admin, @category]) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2b996c04540904f8ce0a2b7bdaf3760", "score": "0.53204507", "text": "def create\n @category = Category.create(params[:category])\n respond_with(@category, location: categories_url)\n end", "title": "" }, { "docid": "746e3d5701bc0b7723de093201d7bbef", "score": "0.5319163", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n flash[:success] = 'Category was successfully created.'\n format.html { redirect_to(admin_categories_url) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n flash[:error] = 'Category could not be created. See errors below.'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95b9fdc489b9755dbea1bd33dfea57fa", "score": "0.53139037", "text": "def create\n @cover_cat = CoverCat.new(params[:cover_cat])\n\n respond_to do |format|\n if @cover_cat.save\n format.html { redirect_to @cover_cat, notice: 'Cover cat was successfully created.' }\n format.json { render json: @cover_cat, status: :created, location: @cover_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cover_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b35aec93ae8d0606144c97a0ec4b9ad6", "score": "0.52981657", "text": "def create\n @categorization = Categorization.new(params[:categorization])\n @categories = category_list\n respond_to do |format|\n if @categorization.save\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully created.') }\n format.xml { render :xml => @categorization, :status => :created, :location => @categorization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c8e4a61039992ca1239bdee537d9d3e", "score": "0.52970946", "text": "def create\n @recipe = Recipe.new(params[:recipe])\n\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render json: @recipe, status: :created, location: @recipe }\n format.xml { render :xml => @recipes}\n\n else\n @categories=RecipeCategory.all\n format.html { render action: \"new\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n format.xml { render :xml => @recipe.errors}\n end\n end\n end", "title": "" }, { "docid": "11db7a1535d2c4ddc117a0c1f122eb2d", "score": "0.5292133", "text": "def create\n @categorie = Categorie.new(params[:categorie])\n\n if @categorie.save\n redirect_to :action => :index\n else\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorie.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3098b9e3a2657f63a350eea38334012a", "score": "0.5287249", "text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c78e0b38d566040be49ce816aa8db91e", "score": "0.5271948", "text": "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "title": "" }, { "docid": "d804792b7a29302e702bc47ef1bbe72e", "score": "0.5270607", "text": "def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cat }\n end\n end", "title": "" }, { "docid": "5a869b3d2508721d058c686a7a6853bb", "score": "0.5257706", "text": "def create\n @mytag = Mytag.new(mytag_params)\n\n respond_to do |format|\n if @mytag.save\n format.html { redirect_to root_path, success: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @mytag }\n else\n format.html { render :new }\n format.json { render json: @mytag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2072b982936b82e41160197c4c62409e", "score": "0.524225", "text": "def index\n @tags = @category.tags.all\n\n respond_to do |format|\n format.html { redirect_to @category }\n format.xml { render :xml => @tags }\n end\n end", "title": "" }, { "docid": "fc8500b141bddcc2149490a1693eb553", "score": "0.5232637", "text": "def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend", "title": "" }, { "docid": "7cd57850e5f6508847c06550a08e746b", "score": "0.5217224", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "588ab1dcad0be13cc779b5b8d5dc8d53", "score": "0.5213912", "text": "def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67bbc31f29a89329f9d6204538c44273", "score": "0.5206603", "text": "def create\n cat = Category.find(params[:category_id])\n act = Activity.find(params[:activity_id])\n \n cat.save\n notice = { notice: 'Relation created'}\n\n redirect_to root_path, notice\n end", "title": "" }, { "docid": "10d53ba001c242765be34270bc5a72b8", "score": "0.52036345", "text": "def cat_params\n if [\"index\", \"destroy\"].include?(params[:action])\n # Workaround when dealing with JSON:\n params.permit(:cat)\n else\n params.require(:cat).permit(:name, :city, :offset)\n end\n end", "title": "" }, { "docid": "3dd1e5685272bdab9bb6c37950823557", "score": "0.5200251", "text": "def create\n @mk_categoria = MkCategoria.new(mk_categoria_params)\n\n respond_to do |format|\n if @mk_categoria.save\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully created.' }\n format.json { render :show, status: :created, location: @mk_categoria }\n else\n format.html { render :new }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2398a142df0082d2299652ce0ea677ac", "score": "0.5175611", "text": "def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b02651bcc04b80273c9cee16edc2278f", "score": "0.5174161", "text": "def create\n #@server = Server.new(params[:server])\n @category = Category.find(params[:category_id])\n @server = @category.servers.build(params[:server])\n\n respond_to do |format|\n if @server.save\n flash[:notice] = 'Server was successfully created.'\n format.html { redirect_to(@server) }\n format.xml { render :xml => @server, :status => :created, :location => @server }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b4ff95349946396edfc9c428ca77b1c", "score": "0.5172824", "text": "def create\n @otml_category = OtrunkExample::OtmlCategory.new(params[:otml_category])\n\n respond_to do |format|\n if @otml_category.save\n flash[:notice] = 'OtrunkExample::OtmlCategory was successfully created.'\n format.html { redirect_to(@otml_category) }\n format.xml { render :xml => @otml_category, :status => :created, :location => @otml_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @otml_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46831a8036a47bfa237ea04759f361dc", "score": "0.5161816", "text": "def create\n @post_category = PostCategory.new(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n flash[:notice] = 'PostCategory was successfully created.'\n format.html { redirect_to(@post_category) }\n format.xml { render :xml => @post_category, :status => :created, :location => @post_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d09064b92365df6aed979e5b0a92ec77", "score": "0.51578754", "text": "def post_category(category_name, options={ })\n self.post('/categories.json',\n options.merge(\n :body => { :category => {\n :name => category_name\n } }.to_json\n )\n )['category']\n end", "title": "" }, { "docid": "b6e1c12a5d6fa6cd32118183589dd786", "score": "0.51549333", "text": "def create\n @post_category = PostCategory.new(params[:post_category])\n \n respond_to do |format|\n if @post_category.save\n format.html { redirect_to(@post_category, :notice => 'Category was successfully created.') }\n format.xml { render :xml => @post_category, :status => :created, :location => @post_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccf017f3f5ddbc96e26fb2ca064a9bd8", "score": "0.5153503", "text": "def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "7753d14f1c901d99f6df28f05517791e", "score": "0.5150707", "text": "def create_avail_category\n file = ::File.new(\"#{node['opennms']['conf']['home']}/etc/categories.xml\", \"r\")\n doc = REXML::Document.new file\n file.close\n cg_el = doc.elements[\"/catinfo/categorygroup[name[text()[contains(.,'#{new_resource.category_group}')]]]/categories\"]\n cat_el = cg_el.add_element 'category'\n label_el = cat_el.add_element 'label'\n label_el.add_text(REXML::CData.new(new_resource.label))\n comment_el = cat_el.add_element 'comment'\n comment_el.add_text new_resource.comment\n normal_el = cat_el.add_element 'normal'\n normal_el.add_text \"#{new_resource.normal}\" # really ruby? really?\n warning_el = cat_el.add_element 'warning'\n warning_el.add_text \"#{new_resource.warning}\"\n new_resource.services.each do |s|\n s_el = cat_el.add_element 'service'\n s_el.add_text s\n end\n rule_el = cat_el.add_element 'rule'\n rule_el.add_text(REXML::CData.new(new_resource.rule))\n out = \"\"\n formatter = REXML::Formatters::Pretty.new(2)\n formatter.compact = true\n formatter.write(doc, out)\n ::File.open(\"#{node['opennms']['conf']['home']}/etc/categories.xml\", \"w\"){ |file| file.puts(out) }\nend", "title": "" }, { "docid": "d162d77b125929a351932359fe76bbc5", "score": "0.5148795", "text": "def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end", "title": "" }, { "docid": "8eb8b1b86851cb0f5085232a561a9493", "score": "0.51327103", "text": "def create\n @categorium = Categorium.new(categorium_params)\n\n respond_to do |format|\n if @categorium.save\n format.html { redirect_to @categorium, notice: 'Categoría fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @categorium }\n else\n format.html { render :new }\n format.json { render json: @categorium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8ee28a2e5517198d9215b564172b362", "score": "0.5130581", "text": "def create\n @xcategory = Xcategory.new(xcategory_params)\n\n respond_to do |format|\n if @xcategory.save\n format.html { redirect_to @xcategory, notice: 'Xcategory was successfully created.' }\n format.json { render :show, status: :created, location: @xcategory }\n else\n format.html { render :new }\n format.json { render json: @xcategory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ce32d6ecb41b820cc019a66b4d9136d", "score": "0.51294386", "text": "def create\n @trip = Trip.new(trip_params)\n @trip.category_id = params[:category_id]\n @trip.author = current_user\n @categories = Category.all.map{|c| [ c.name, c.id ] }\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: \"L'itinéraire a été crée.\" }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20d662ec2a96b5329020c0c882fc4027", "score": "0.51289886", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_url, notice: 'Category was successfully created.' }\n end\n end\n end", "title": "" }, { "docid": "a31d32d9a258e2d5bdbca497dd373068", "score": "0.5127349", "text": "def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end", "title": "" }, { "docid": "86c877fcf57fac89c1161f1ad8145fcf", "score": "0.5114243", "text": "def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "44963b4c1415027e927e9e151ac319aa", "score": "0.5111047", "text": "def create\n @space_cat = SpaceCat.new(space_cat_params)\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space_cat }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c86cbdd7f18ac151bda43cf237ec599", "score": "0.5109465", "text": "def index\n redirect_to category_child_url(@main_category,@category)\n #@descriptions = @category.descriptions\n #respond_to do |format|\n # format.xml\n #end\n end", "title": "" }, { "docid": "8940277746780d481f822c450e2856cf", "score": "0.51054", "text": "def new\n @tag = @category.tags.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tag }\n end\n end", "title": "" }, { "docid": "fa8fcc23911ab0c33dc007eceacc29f5", "score": "0.5103218", "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": "0f77fb611dba595ff3c08fb70b23822c", "score": "0.5101532", "text": "def create\n @category = CategoryService.create\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "459f19cfec7b89b5edcca83afdd24fb6", "score": "0.5099302", "text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n flash[:notice] = 'Category was successfully created.'\n format.html { redirect_to(categories_url) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fb59e54d11b6b7621b77b63965591b3", "score": "0.5095625", "text": "def create\n @user = current_user\n @fatcat = @user.fatcats.new(fatcat_params)\n\n respond_to do |format|\n if @fatcat.save\n format.html { redirect_to @fatcat, notice: 'Fatcat was successfully created.' }\n format.json { render :show, status: :created, location: @fatcat }\n else\n format.html { render :new }\n format.json { render json: @fatcat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b883c7b3bb7ca91a8a059c7d23b9c186", "score": "0.5094927", "text": "def create\n @catalog_category = CatalogCategory.new(catalog_category_params)\n\n respond_to do |format|\n if @catalog_category.save\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :created, location: @catalog_category }\n else\n format.html { render :new }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67cabf744ea2399ddfab891ac800b706", "score": "0.50928575", "text": "def create\n @category = Category.new(params[:category]) \n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:created_category_success)}\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbeda129a02e042d34c608b028e3c1f9", "score": "0.50861514", "text": "def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3538585e5d73039e93cbfadff0b0f626", "score": "0.5085077", "text": "def create\n @ocat = Ocat.new(params[:ocat])\n\n respond_to do |format|\n if @ocat.save\n format.html { redirect_to @ocat, notice: 'Ocat was successfully created.' }\n format.json { render json: @ocat, status: :created, location: @ocat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ocat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3593e923f64c1454c5309b87f95d9e4a", "score": "0.5082552", "text": "def create\n Category.create\n\n redirect_to admin_ads_path\n end", "title": "" }, { "docid": "58bd61ae0c18c7bcf39f7b9bdf998e12", "score": "0.5082081", "text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_categories_url, notice: 'Добавлена новая категоря.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "76f3bf4a28a43aff7248ea1d0db449d2", "score": "0.5079134", "text": "def save(category = nil)\n params = { id: read_attribute(:name) }\n params[:category] = category if category\n client.post('/api/save', params)\n end", "title": "" }, { "docid": "7323bc9616e4b9244172cb241b5ca5f2", "score": "0.50756097", "text": "def create\n @books_category = BooksCategory.new(params[:books_category])\n\n respond_to do |format|\n if @books_category.save\n format.html { redirect_to(@books_category, :notice => 'BooksCategory was successfully created.') }\n format.xml { render :xml => @books_category, :status => :created, :location => @books_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @books_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc68ce979e2c83a6ce154e2105a9e736", "score": "0.5069184", "text": "def index\n @roots = Category.roots\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @categories }\n end\n end", "title": "" }, { "docid": "c4d078905cf5a6d41f3e269997d7cf84", "score": "0.50662416", "text": "def create\n @recipe = Recipe.new(params[:recipe])\n #@recipe.ingrediences = Ingredience.find(@params[:ingredience_ids]) if @params[:ingredience_ids]\n respond_to do |format|\n if @recipe.save\n flash[:notice] = 'Recipe was successfully created.'\n format.html { redirect_to(@recipe) }\n format.xml { render :xml => @recipe, :status => :created, :location => @recipe }\n else\n format.html { render :action => \"new\" }\n @ingrediences = Ingredience.find(:all, :order => 'title')\n @categories = Category.find(:all, :conditions => [\"food = ?\", true])\n format.xml { render :xml => @recipe.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b24df73fd0da3459fb488581f06c564", "score": "0.50639516", "text": "def create\n @maincat = Maincat.new(maincat_params)\n\n respond_to do |format|\n if @maincat.save\n format.html { redirect_to @maincat, notice: 'Maincat was successfully created.' }\n format.json { render :show, status: :created, location: @maincat }\n else\n format.html { render :new }\n format.json { render json: @maincat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cf96f38dc025371acec30fef5762fc2", "score": "0.50632614", "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": "c54dd40403b7c61f2384ed218f430ce4", "score": "0.50586545", "text": "def new\n @categorization = Categorization.new\n @categories = category_list\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @categorization }\n end\n end", "title": "" }, { "docid": "9e2e958155ed14b35c75a91a56fa43a3", "score": "0.50583696", "text": "def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end", "title": "" }, { "docid": "03450c9ba816dfd45069e9ccdcc8e641", "score": "0.5056873", "text": "def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e5ead5d98f655201d475d664fff8f1a", "score": "0.50560915", "text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно создана\" }\n format.json { render :show, status: :created, location: adminpanel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afabd80cc7dfdc059c7c8742e7bfaaea", "score": "0.50548613", "text": "def create\n @p_cat = PCat.new(p_cat_params)\n\n respond_to do |format|\n if @p_cat.save\n format.html { redirect_to @p_cat, notice: 'P cat was successfully created.' }\n format.json { render :show, status: :created, location: @p_cat }\n else\n format.html { render :new }\n format.json { render json: @p_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cea915c3a5d8f255c499593a6285dda5", "score": "0.50539404", "text": "def category_params\n params.require(:category).permit(:name, :alias, :note, :node_id)\n end", "title": "" } ]
55ba27cb37d5fd61c8d7754dde5adacc
Get SubjectAltName field of a certificate
[ { "docid": "24ca8a10946499544d5f99199804f7e4", "score": "0.64030737", "text": "def get_san_hash(cert)\n subject_alt_name = cert.extensions.find { |e| e.oid == \"subjectAltName\" }\n return { error: 1 } unless subject_alt_name\n\n asn_san = OpenSSL::ASN1.decode(subject_alt_name)\n asn_san_sequence = OpenSSL::ASN1.decode(asn_san.value[1].value)\n\n # Ruby OpenSSL library does not unfortunately have constants for the DNS\n # altnames versus IP based altnames\n # See verify_certificate_identity in\n # https://github.com/ruby/openssl/blob/master/lib/openssl/ssl.rb\n\n # There are actually 9 types, as defined by RFC5280 :\n # ( https://tools.ietf.org/html/rfc5280#section-4.2.1.6 )\n # DNS string hostnames are type 2 ( dNSName )\n # Both ipv4 and ipv6 addresses are type 7 ( iPAddress )\n # Email addresses are stored as type 1 ( rfc822Name )\n\n altnames = []\n ip_altnames = []\n asn_san_sequence.each do |altname|\n val = altname.value\n case altname.tag\n when 2\n altnames << val\n when 7\n # Pushes IP address string in canonical format\n ip_altnames << IPAddr.new(IPAddr.ntop(val)).to_string\n end\n end\n\n { error: 0, altnames: altnames, ip_altnames: ip_altnames }\n end", "title": "" } ]
[ { "docid": "8e20f19c994336cfac0c033b5ad5cd6d", "score": "0.8566005", "text": "def find_subjectAltName\n find_attr(OpenSSL::ASN1::ObjectId.new(\"subjectAltName\"))\n end", "title": "" }, { "docid": "8e20f19c994336cfac0c033b5ad5cd6d", "score": "0.8566005", "text": "def find_subjectAltName\n find_attr(OpenSSL::ASN1::ObjectId.new(\"subjectAltName\"))\n end", "title": "" }, { "docid": "d4a5886c4cc8bdf64c530667fd0a207e", "score": "0.728977", "text": "def subject_alternative_names\n names_string = read_extension_by_oid('subjectAltName')\n names_string ? names_string.scan(%r{DNS:([^,]+)}).flatten : []\n end", "title": "" }, { "docid": "4607b3137bad0ad2e06793e986e2d8a6", "score": "0.7044332", "text": "def find_subjectAltName\n extReq = find_extReq\n return [] unless extReq\n return [] unless extReq.is_a? OpenSSL::ASN1::Constructive # Set/Sequence\n\n san_list = []\n # this could get refactored when another thing needs to search for extensions\n extReq.value.each { |exten|\n if exten.is_a? OpenSSL::ASN1::Sequence\n if exten.value[0].is_a? OpenSSL::ASN1::ObjectId and\n exten.value[0].oid == subjectAltNameOid.oid\n\n # found it, return entire structure\n san_list << exten\n end\n end\n }\n return san_list\n end", "title": "" }, { "docid": "320d10e13bafcf60d3afbcaa3f62494d", "score": "0.67678624", "text": "def subject\n @certificate.subject\n end", "title": "" }, { "docid": "897b25232c997aec15141d8fa1ec45fc", "score": "0.6726774", "text": "def subject_alt_names\n @sans\n end", "title": "" }, { "docid": "2be7e8f929219a15fd4b7cd115d7edb8", "score": "0.6629843", "text": "def public_certificate_subject\n @attributes[:public_certificate_subject]\n end", "title": "" }, { "docid": "2be7e8f929219a15fd4b7cd115d7edb8", "score": "0.6629843", "text": "def public_certificate_subject\n @attributes[:public_certificate_subject]\n end", "title": "" }, { "docid": "6a16898123bad96b99ca3d5fa1f6021b", "score": "0.64862967", "text": "def subject_certificate(*) end", "title": "" }, { "docid": "517b85971193baed678e6886299dc226", "score": "0.64117825", "text": "def certificate_email_address\n @attributes[:certificate_email_address]\n end", "title": "" }, { "docid": "bbc627535003d00cf25978355da45af1", "score": "0.6397683", "text": "def ca_name\n result = shell_out('certutil -getconfig').stdout\n return nil unless result.include?('command completed successfully')\n result.split(/\\n/)[0].split(': ')[1].delete('\"').chomp\n end", "title": "" }, { "docid": "d5f321b0c231a51af15652a02b82b8d1", "score": "0.63674057", "text": "def subject_alternative_names=(alt_names)\n raise \"alt_names must be an Array\" unless alt_names.is_a?(Array)\n\n factory = OpenSSL::X509::ExtensionFactory.new\n name_list = alt_names.map{|m| \"DNS:#{m}\"}.join(\",\")\n ext = factory.create_ext(\"subjectAltName\",name_list,false)\n ext_set = OpenSSL::ASN1::Set([OpenSSL::ASN1::Sequence([ext])])\n attr = OpenSSL::X509::Attribute.new(\"extReq\", ext_set)\n @attributes << attr\n end", "title": "" }, { "docid": "1ea8ca4e6d4ce80dfeb28bbca5fd93f3", "score": "0.6359113", "text": "def servernames_from_csr(csr)\n server_names = []\n\n # get common name\n cn = csr.subject.to_a.find{ |key,val,type| key=='CN' }\n server_names << cn[1] \n\n # try finding SubjectAltName\n extreq = csr.attributes.find { |attr| attr.oid == 'extReq' }\n return server_names unless extreq\n\n asnext = extreq.value\n return server_names unless asnext.value.is_a?(Array)\n\n asnext.value.each do |asnseq1|\n next unless asnseq1.is_a?(OpenSSL::ASN1::Sequence)\n next unless asnseq1.value.is_a?(Array)\n\n asnseq1.value.each do |asnseq2|\n next unless asnseq2.is_a?(OpenSSL::ASN1::Sequence)\n next unless asnseq2.value.is_a?(Array)\n\n ary = asnseq2.value.map{ |asn|\n asn.value if asn.is_a?(OpenSSL::ASN1::Primitive)\n }\n ext = nil\n case ary.size\n when 2\n # extension oid , extension value\n ext = OpenSSL::X509::Extension.new(ary[0], ary[1])\n when 3\n # extension oid , critical, extension value\n ext = OpenSSL::X509::Extension.new(ary[0], ary[2], ary[1])\n end\n\n if ext && ext.oid == 'subjectAltName' then\n # subjectAltName extension found\n ext.value.split(',').each do |san|\n # san = \"DNS:host.example.com\" etc.\n san.strip!\n type,host = san.split(':')\n if type == 'DNS' then\n server_names << host.strip\n end\n end\n end\n end\n end\n server_names.uniq\nend", "title": "" }, { "docid": "b0f3d55bd52c3058e696415c222f8651", "score": "0.6206908", "text": "def certificate_issuer\n certificate.issuer.to_s.split(/\\//).reject{|n| n.to_s.empty?}.join(',')\n end", "title": "" }, { "docid": "b88ead4bfc35af9f3ad62beef1d65b71", "score": "0.62063485", "text": "def common_name\n unless x509.subject.to_a.blank?\n x509.subject.to_a.find{|x| x[0] == \"CN\"}[1]\n end\n end", "title": "" }, { "docid": "3bbe8a9846faff189e0351f30c43a1f7", "score": "0.6170708", "text": "def issuer_certificate(*) end", "title": "" }, { "docid": "ece7c75c15c8bd1a6c2327c581965f18", "score": "0.61530834", "text": "def get_cert_cn (url)\n\t\tputs \"Extract the common name field from a X509 cert: #{cert}\" if @verbose\n\t\tbegin\t\t\t\n\t\t\tcert=get_certificate(url)\n\t\t\tsubject, cn = \"\"\n\t\t\tif cert =~ /\\n(.+)Subject\\:(.+)\\n/i\n\t\t\t\tsubject=$2\n\t\t\tend\n\t\t\tif subject =~/CN\\=(.+)/i\n\t\t\t\tcn=$1\n\t\t\tend\n\t\t\treturn cn\t\t\n\t\trescue Exception => ee\n\t\t\tputs \"Error on method #{__method__} from #{cert}: #{ee}\" if @verbose\n\t\tend\t\n\t\treturn nil\n\tend", "title": "" }, { "docid": "f3293b86631ae8fd94b5f3274d56d7f4", "score": "0.61500555", "text": "def get_cert_cn (url)\n\t\tputs \"Extract the common name field from a X509 cert: #{cert}\" if @verbose\n\t\tcert=get_certificate(url)\n\t\tsubject, cn = \"\"\n\t\tif cert =~ /\\n(.+)Subject\\:(.+)\\n/i\n\t\t\tsubject=$2\n\t\tend\n\t\tif subject =~/CN\\=(.+)/i\n\t\t\tcn=$1\n\t\tend\n\t\treturn cn\n\trescue Exception => ee\n\t\tputs \"Error on method #{__method__} from #{url}: #{ee}\" if @verbose\n\t\treturn nil\n\tend", "title": "" }, { "docid": "6f8c45a89fc0b51a525f3f5fad86b34e", "score": "0.60965294", "text": "def certificate_domain\n @attributes[:certificate_domain]\n end", "title": "" }, { "docid": "bbf2424bbd5251df5dcc5fe208db3c44", "score": "0.608126", "text": "def x509_certificate_field\n return @x509_certificate_field\n end", "title": "" }, { "docid": "ad5c4b550b2bf71a0ea3b8bb7415448e", "score": "0.6079722", "text": "def return_cn(options,cert_file)\n STDERR.puts \"Grabbing cert CN..\"\n verify_csr_cmd = \"#{options['openssl_cmd']} req -in #{cert_file} -noout -text\"\n stdout, stderr, exit_status = Open3.capture3(verify_csr_cmd)\n\n # capture our CN\n match = stdout.match(/CN=[^\\n]+/)\n if match.nil? || match.size < 4\n return \"\"\n else\n return match.to_s[3..-1]\n end\nend", "title": "" }, { "docid": "9e14ea80301814e51c9dae978de336ee", "score": "0.6060976", "text": "def issuer\n @certificate.issuer\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.60295266", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "923dd126dd5ad018f313b34e14f6dcfc", "score": "0.5984155", "text": "def ret_ca_cert\n cert = Net::HTTP.get(@ca_issuer_uri)\n cert = OpenSSL::X509::Certificate.new(cert)\n cert\n end", "title": "" }, { "docid": "e7f567bdbe7b84f1268f7d04d2aa5b46", "score": "0.59184086", "text": "def certificate\n @attributes[:certificate]\n end", "title": "" }, { "docid": "ba28f6d899905ffc4a6a37c6b2ed2993", "score": "0.5913092", "text": "def warning_subjectaltname(cert, warning_messages, required_san_array, service_name)\n cent_san_hash = get_san_hash(cert)\n altnames = cent_san_hash[:altnames] || []\n ip_altnames = cent_san_hash[:ip_altnames] || []\n cert_san_array = altnames + ip_altnames\n missing_hostnames = []\n\n # Convert all IP addresses to canonical form\n required_san_array.each do |i|\n temp_san = case i\n when Resolv::IPv4::Regex\n IPAddr.new(i).to_string\n when Resolv::IPv6::Regex\n # :nocov:\n # We aren't using IPv6 in production so we are skipping tests for this\n IPAddr.new(i).to_string\n # :nocov:\n else\n i\n end\n missing_hostnames << i unless cert_san_array.include?(temp_san)\n end\n\n return if missing_hostnames.empty?\n warning_messages.push(\"Warning, #{service_name} is missing the following hostnames in its \" \\\n \"certificate: #{missing_hostnames.join(\" \")}\")\n end", "title": "" }, { "docid": "b07ffabe69e7accb942a5c346e3fe851", "score": "0.59122616", "text": "def issuer\n unless x509.issuer.to_a.blank?\n x509.issuer.to_a.find{|x| x[0] == \"CN\"}[1]\n end\n end", "title": "" }, { "docid": "73e4937460041a399823e508c900f5a9", "score": "0.58995956", "text": "def get_common_name(file)\n raw = File.read file\n cert = OpenSSL::X509::Certificate.new raw\n cert.subject.to_a.assoc('CN')[1]\n end", "title": "" }, { "docid": "9b4e04a1b88fb161bb3c5eb359f80f5b", "score": "0.58880115", "text": "def public_certificate_issuer\n @attributes[:public_certificate_issuer]\n end", "title": "" }, { "docid": "9b4e04a1b88fb161bb3c5eb359f80f5b", "score": "0.58880115", "text": "def public_certificate_issuer\n @attributes[:public_certificate_issuer]\n end", "title": "" }, { "docid": "da9189dd2c6bba22e0633ce87a8d60d7", "score": "0.5873038", "text": "def root_certificate\n @ca_cert\n end", "title": "" }, { "docid": "505ff9dcd1b1d5582ff6a40be92afbd1", "score": "0.5871432", "text": "def quickcertmaker(hostname, altnames=nil)\n cert = OpenSSL::X509::Certificate.new\n cert.version = 2\n cert.subject = OpenSSL::X509::Name.parse(\"C=US, CN=#{hostname}\")\n ef = OpenSSL::X509::ExtensionFactory.new\n ef.subject_certificate = cert\n cert.add_extension(ef.create_ext_from_string(\"subjectAltName = #{altnames}\")) if altnames\n cert\nend", "title": "" }, { "docid": "0d214ce6c70e5f2f96c759e4cff712c7", "score": "0.58655506", "text": "def subject\n fetch('educator.subject')\n end", "title": "" }, { "docid": "3c3745c89f8341ceeeb4a9164539b5d5", "score": "0.5839571", "text": "def cert_info\n end", "title": "" }, { "docid": "76e410896ff0dc69460ab2cd226971d9", "score": "0.5813747", "text": "def certificate_arn\n data.certificate_arn\n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5813476", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5813476", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5813476", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "25344c982752c1189a85d381a85e9cf1", "score": "0.5805961", "text": "def subject_description\n lookup_ref_data_value(:subject_code, @subject_code)\n end", "title": "" }, { "docid": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.57994133", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "0971d74e895891e9980c31b18fef2f61", "score": "0.57539505", "text": "def subject_certificate=(p0) end", "title": "" }, { "docid": "9a7a09d0c6f4dea2654110033996cf92", "score": "0.5719186", "text": "def ssl_certificate\n @attributes[:ssl_certificate]\n end", "title": "" }, { "docid": "df923c8a8a8c675c47f1db6490818316", "score": "0.56820446", "text": "def cert_get_name_args(pcert_context, cert_name, search_type)\n [pcert_context, search_type, CERT_NAME_ISSUER_FLAG, nil, cert_name, 1024]\n end", "title": "" }, { "docid": "207ee8f3c6737b74dc3e8b790f89c383", "score": "0.566403", "text": "def certname_from_callerid(id)\n if id =~ /^cert=([\\w\\.\\-]+)/\n return $1\n else\n raise(\"Received a callerid in an unexpected format: '#{id}', ignoring\")\n end\n end", "title": "" }, { "docid": "c84aef800891a203a27f443076830c08", "score": "0.56421304", "text": "def certificate\n _get_certificate\n end", "title": "" }, { "docid": "9424b3e4970ef2ca3f8bbc6291d5c4bb", "score": "0.562666", "text": "def get_cert_id(cert)\r\n Digest::SHA1.digest(cert.issuer.to_s + cert.serial.to_s(2))[0...4].unpack('L<')[0]\r\n end", "title": "" }, { "docid": "c983af3326988e0c147d846ee9986a84", "score": "0.56009233", "text": "def to_x509()\n @cert\n end", "title": "" }, { "docid": "191c89b7e0a877290e2448fc89bad413", "score": "0.55939114", "text": "def get_cert_property(pcert_context)\n property_value = memory_ptr\n property_list = []\n property_list[0] = \"\"\n (1..8).to_a.each do |property_type|\n CertGetNameStringW(pcert_context, property_type, CERT_NAME_ISSUER_FLAG, nil, property_value, 1024)\n property_list << property_value.read_wstring\n end\n property_list\n end", "title": "" }, { "docid": "3e1425a9bedfe6a65d651b5d5841dbf2", "score": "0.558308", "text": "def sns_subject\n return default_sns_subject unless subject\n context = self\n eruby = Erubis::Eruby.new(fix_subject_encoding(subject))\n fix_subject_encoding(eruby.evaluate(context))[0..99]\n end", "title": "" }, { "docid": "b4358cb8e3019abf218a3c730e495eb6", "score": "0.55715114", "text": "def subject_hash\n # get the array from the name\n dataArray = self.root_certificate.to_x509.subject.to_a\n\n # create the result hash\n dataHash = Hash.new()\n\n # go through\n dataArray.each do |item|\n dataHash[item[0]] = item[1]\n end\n\n # emit\n dataHash\n end", "title": "" }, { "docid": "7964b9f3532e1017c1d907f19fbf62cd", "score": "0.5568603", "text": "def [](key)\n @certificate.subject.to_a.each do |name, value, type|\n return value if name == key\n end; nil\n end", "title": "" }, { "docid": "cf38a7b0c25cdaf4caa7f669a2c81211", "score": "0.5568094", "text": "def subject_raw\n self.header('subject')\n end", "title": "" }, { "docid": "55a18f14875201defb0b85a548e40dec", "score": "0.55588526", "text": "def certificate\n @http.certificate\n end", "title": "" }, { "docid": "2ca0e08f37a2a453821ac3419c197bd3", "score": "0.55483913", "text": "def client_dn\n request.headers['puma.peercert'].subject.to_s\n end", "title": "" }, { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.5540168", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "6637d7d22ef39c55d01e1ef8160048a8", "score": "0.5533992", "text": "def short_name\n alt_names.map { |n| self.class.filter_ccss_standards(n, subject) }.compact.try(:first) || name\n end", "title": "" }, { "docid": "0d75e98734f05f1cafc194f32ad632b7", "score": "0.55256075", "text": "def certificate\n move_down 50\n text I18n.t(\"certificates.speaker.certifies\"), size: 18, style: :bold, align: :center\n\n move_down 30\n text I18n.t(\"certificates.speaker.speaker_info\", name: @speaker.name, conference_title: @conference.title, month: I18n.l(@conference.start_date, format: :month_only), year: @conference.start_date.year), align: :center\n\n move_down 40\n text \"#{@event.title}\", size: 16, style: :italic, align: :center\n\n move_down 40\n text I18n.t(\"certificates.speaker.i_sign\"), align: :center\n end", "title": "" }, { "docid": "128d7b5cdc1fc37055ac3972bf66bce4", "score": "0.55227166", "text": "def certificate\n @certificate\n end", "title": "" }, { "docid": "128d7b5cdc1fc37055ac3972bf66bce4", "score": "0.55227166", "text": "def certificate\n @certificate\n end", "title": "" }, { "docid": "18d89800d8316df0c06b39e781ad067b", "score": "0.55065966", "text": "def certificate\n return @certificate\n end", "title": "" }, { "docid": "18d89800d8316df0c06b39e781ad067b", "score": "0.55065966", "text": "def certificate\n return @certificate\n end", "title": "" }, { "docid": "b84c4aa5763d4d35e2dafa566fa1c966", "score": "0.5501644", "text": "def get_certificate(certname)\n result = get('certificate', certname)\n\n case result.code\n when '200'\n return result\n when '404'\n @logger.err 'Error:'\n @logger.err \" Signed certificate #{certname} could not be found on the CA\"\n return nil\n else\n @logger.err 'Error:'\n @logger.err \" When attempting to download certificate '#{certname}', received:\"\n @logger.err \" code: #{result.code}\"\n @logger.err \" body: #{result.body.to_s}\" if result.body\n return nil\n end\n end", "title": "" }, { "docid": "4736787548a4fd24819ff708f38d2136", "score": "0.54941213", "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": "29c58ce77aeb6e5a52d1d15ff900f6b2", "score": "0.5488345", "text": "def get_requester\n peer_cert_s = @request.env['rack.peer_cert']\n raise \"Missing peer cert\" unless peer_cert_s\n\n peer_cert = OpenSSL::X509::Certificate.new(peer_cert_s)\n# puts (peer_cert.methods - Object.new.methods).sort.join(\"\\n\")\n# puts peer_cert.extensions[0].oid\n requester = nil\n peer_cert.extensions.each do |e|\n requester = e.value if e.oid == 'subjectAltName'\n end\n unless requester\n raise \"Missing 'subjectAltName' extension missing in credentials\"\n end\n# puts \"requester: '#{requester}'\"\n requester\n end", "title": "" }, { "docid": "3a17874932d259034942e0504756b6fe", "score": "0.54810566", "text": "def alt_email\n attrs['asf-altEmail'] || []\n end", "title": "" }, { "docid": "0e8956934743ab0cea9b227e86070b39", "score": "0.5469869", "text": "def subject_name\n [name, code].join(' ')\n end", "title": "" }, { "docid": "b101a000874152a9d9bf0e7b92eda96f", "score": "0.54697335", "text": "def own_signing_certificate\n application_response = extract_application_response(NORDEA_PKI)\n at = 'xmlns|Certificate > xmlns|Certificate'\n node = Nokogiri::XML(application_response).at(at, xmlns: NORDEA_XML_DATA)\n\n return unless node\n\n cert_value = process_cert_value node.content\n cert = x509_certificate cert_value\n cert.to_s\n end", "title": "" }, { "docid": "89f62317fae85a25cd01cc47a38ae632", "score": "0.54567516", "text": "def master_issued_by_agent_ca\n<<-BAD_SSL_CERT\n-----BEGIN CERTIFICATE-----\nMIICZjCCAhCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl\ncm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt\ncGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy\ndmVyIE9wZXJhdGlvbnMwHhcNMTMwMzMwMDU1MDQ4WhcNMzMwMzI1MDU1MDQ4WjAe\nMRwwGgYDVQQDDBNtYXN0ZXIxLmV4YW1wbGUub3JnMFwwDQYJKoZIhvcNAQEBBQAD\nSwAwSAJBAPnCDnryLLXWepGLqsdBWlytfeakE/yijM8GlE/yT0SbpJInIhJR1N1A\n0RskriHrxTU5qQEhd0RIja7K5o4NYksCAwEAAaOB2TCB1jBbBgNVHSMEVDBSoU2k\nSzBJMRAwDgYDVQQDDAdSb290IENBMRowGAYDVQQLDBFTZXJ2ZXIgT3BlcmF0aW9u\nczEZMBcGA1UECgwQRXhhbXBsZSBPcmcsIExMQ4IBATAMBgNVHRMBAf8EAjAAMAsG\nA1UdDwQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwPQYDVR0R\nBDYwNIITbWFzdGVyMS5leGFtcGxlLm9yZ4IHbWFzdGVyMYIGcHVwcGV0ggxwdXBw\nZXRtYXN0ZXIwDQYJKoZIhvcNAQEFBQADQQA841IzHLlnn4RIJ0/BOZ/16iWC1dNr\njV9bELC5OxeMNSsVXbFNeTHwbHEYjDg5dQ6eUkxPdBSMWBeQwe2Mw+xG\n-----END CERTIFICATE-----\nBAD_SSL_CERT\n end", "title": "" }, { "docid": "080ff87d639c90e7b55dd36cc98978fe", "score": "0.545509", "text": "def subject( keep_subscript: false )\n\t\tsubjlink = self.links.find {|link| link.llabel[0] == ?S } or return nil\n\t\treturn with_subscript( subjlink.lword, keep_subscript )\n\tend", "title": "" }, { "docid": "324f783315a1601873e7d695f7a659a0", "score": "0.54386127", "text": "def certificate\n Cproton.pn_messenger_get_certificate(@impl)\n end", "title": "" }, { "docid": "542885bb44aabef24a05ce9d9749449c", "score": "0.5427051", "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": "80d5fa595480d12757a2c519884f7b3f", "score": "0.5420873", "text": "def subject\n first_element_text('subject')\n end", "title": "" }, { "docid": "dd7f6b08810f01a5c9cee8904af718e7", "score": "0.5402516", "text": "def certid(*) end", "title": "" }, { "docid": "519f685ed317139cbea72085c30086ef", "score": "0.5397658", "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": "ad0575f7d16d306690044882140dc16b", "score": "0.5376978", "text": "def ca_file\n @http.ca_file\n end", "title": "" }, { "docid": "24adba842d3241ad9630fbdce6f1e107", "score": "0.53769106", "text": "def ssl_ca\n connection_data.fetch(:sslca, nil)\n end", "title": "" }, { "docid": "eee1a6e52f27b5533b821ef3f1ed3f87", "score": "0.53727376", "text": "def certificate\n Cproton.pn_messenger_get_certificate(@impl)\n end", "title": "" }, { "docid": "90c6732368de3042690459d8bd443970", "score": "0.5365559", "text": "def parse_subject(mail)\n decode_jp(mail.subject, nil)\n end", "title": "" }, { "docid": "cbbf43413afee995461df9e3d432f4f7", "score": "0.5359135", "text": "def private_dns_name\n data[:private_dns_name]\n end", "title": "" }, { "docid": "f01cc018ebd8008c38d7c9121ea7d8fd", "score": "0.5352986", "text": "def current_cert(*) end", "title": "" }, { "docid": "3540487396ebe3438c733f6a4bba5b91", "score": "0.53527844", "text": "def subject_name\n nil unless @subject\n subject_class.name\n end", "title": "" }, { "docid": "efb9ec499b81d5677954bcc460780f98", "score": "0.53482044", "text": "def issuer_certificate=(p0) end", "title": "" }, { "docid": "5c71106a9c57767384726d14d4542ca5", "score": "0.5341022", "text": "def subject\n descMetadata.topical_subject\n end", "title": "" }, { "docid": "bc79726768dd430d66ec33af4bcc5166", "score": "0.531772", "text": "def certname\n if Process.uid == 0\n certname = @config.identity\n else\n certname = \"%s.mcollective\" % [env_fetch(\"USER\") || @config.identity]\n end\n\n env_fetch(\"MCOLLECTIVE_CERTNAME\") || certname\n end", "title": "" }, { "docid": "9d98928a7336e464d47917060b21e25f", "score": "0.530938", "text": "def print(name)\n (cert = Puppet::SSL::Certificate.indirection.find(name)) ? cert.to_text : nil\n end", "title": "" }, { "docid": "73f1d0498607c8c740d65d4db685dc7e", "score": "0.53075874", "text": "def get_cert(cert)\n return nil if cert.nil? || cert.empty?\n #decoded_content = Base64.decode64(File.read(cert))\n formatted_cert = Spid::Saml::Utils.format_cert(cert)\n OpenSSL::X509::Certificate.new(File.read(cert))\n end", "title": "" }, { "docid": "41ddd9785c8fba505899ca9c528aed89", "score": "0.53061235", "text": "def get_issuer(did_token)\n decode(did_token).last[\"iss\"]\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.5305516", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.5305516", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.5305516", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "aac6ae5330d136857c35a3794c19bef8", "score": "0.5300272", "text": "def read_cert\n File.read(cert)\n end", "title": "" }, { "docid": "9068999f2365a9a5a4e684054eb06868", "score": "0.5293677", "text": "def get_first_verification_cert\n return read_cert_file(\"test/resources/cert_sign_internal_AAA.pem\")\nend", "title": "" }, { "docid": "5de047fd69059e664d1e63f6869d4cd3", "score": "0.52921784", "text": "def getSubjectTags(dcCollectionEntry, skosCollection)\n # Get the subjects from the dcCollectionEntry\n subjects = dcCollectionEntry['dc:subject']\n \n # If they're defined\n if subjects\n # Convert the subject links to subject labels\n strings = subjects.collect { |subj|\n # Look up the object in the skos block and extract the label\n skosCollection[subj]['skos:prefLabel']\n }\n # Make it look nice\n strings.join(\", \")\n else\n \"\"\n end\nend", "title": "" }, { "docid": "bce6234e4e04dc20ecf7421e9678e160", "score": "0.52880645", "text": "def topical_subject\n descMetadata.topical_subject\n end", "title": "" }, { "docid": "6238c349ba6e7c138c0f9a3cd054f1b6", "score": "0.5287491", "text": "def master_issued_by_master_ca\n<<-GOOD_SSL_CERT\n-----BEGIN CERTIFICATE-----\nMIICZzCCAhGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MSQwIgYDVQQDExtJbnRl\ncm1lZGlhdGUgQ0EgKG1hc3Rlci1jYSkxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhh\nbXBsZS5vcmcxGTAXBgNVBAoTEEV4YW1wbGUgT3JnLCBMTEMxGjAYBgNVBAsTEVNl\ncnZlciBPcGVyYXRpb25zMB4XDTEzMDMzMDA1NTA0OFoXDTMzMDMyNTA1NTA0OFow\nHjEcMBoGA1UEAwwTbWFzdGVyMS5leGFtcGxlLm9yZzBcMA0GCSqGSIb3DQEBAQUA\nA0sAMEgCQQDACW8fryVZH0dC7vYUASonVBKYcILnKN2O9QX7RenZGN1TWek9LQxr\nyQFDyp7WJ8jUw6nENGniLU8J+QSSxryjAgMBAAGjgdkwgdYwWwYDVR0jBFQwUqFN\npEswSTEQMA4GA1UEAwwHUm9vdCBDQTEaMBgGA1UECwwRU2VydmVyIE9wZXJhdGlv\nbnMxGTAXBgNVBAoMEEV4YW1wbGUgT3JnLCBMTEOCAQIwDAYDVR0TAQH/BAIwADAL\nBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMD0GA1Ud\nEQQ2MDSCE21hc3RlcjEuZXhhbXBsZS5vcmeCB21hc3RlcjGCBnB1cHBldIIMcHVw\ncGV0bWFzdGVyMA0GCSqGSIb3DQEBBQUAA0EAo8PvgLrah6jQVs6YCBxOTn13PDip\nfVbcRsFd0dtIr00N61bCqr6Fa0aRwy424gh6bVJTNmk2zoaH7r025dZRhw==\n-----END CERTIFICATE-----\nGOOD_SSL_CERT\n end", "title": "" }, { "docid": "65f0bbfe172cad5e7017f3b123219c93", "score": "0.5276826", "text": "def agent_certname\n if clone?\n \"vm%s\" % macaddress.delete(\":\").downcase\n else\n ASM::Util.hostname_to_certname(hostname)\n end\n end", "title": "" }, { "docid": "6c8b6e6981b948d9d6dbdabec077c2a0", "score": "0.526895", "text": "def fetch_le_intermediate_cert\n return nil unless @bundle\n\n # Fetch intermediate certificate from LetsEncrypt\n OpenSSL::X509::Certificate.new URI.parse(LE_INTERMEDIATE_URL).read\n end", "title": "" }, { "docid": "79e74831ba9f58adda682a987fb14e73", "score": "0.526696", "text": "def caption\n image.attributes.fetch('alt')\n end", "title": "" }, { "docid": "e8d85f6c7ddba78df98d44f0ec95bfcd", "score": "0.5260596", "text": "def extract_cn(dn)\n dn.split(',').select { |p| p.match(/^CN=/) }.first.gsub('CN=', '')\n end", "title": "" }, { "docid": "d465d552e8616674213a6431b26f63b2", "score": "0.52562994", "text": "def subjects_name_as_string(key=:parent_subjects_string)\n self.send(key).split(';').collect do |subject_string|\n subject_name, subject_slug = subject_string.split(':')\n subject_name\n end\n end", "title": "" } ]
6bf59b3d2caac307860b8d4f13a2cddf
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb113
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "8b278d7b35a8a23e42139997b520811f", "score": "0.65141314", "text": "def raw_list_addons_str\n \"addons\"\n end", "title": "" }, { "docid": "5fdb2d51f9ab53c70d57d2d9e41366a6", "score": "0.6223198", "text": "def name\n 'Extended API Extension'\n end", "title": "" }, { "docid": "3cadd6181703d9a87316d9230f10d8b1", "score": "0.6064732", "text": "def addons()\n header(\"oF - Installed addons...\")\n \n @disponible.each do |d|\n if @installed.index(d.name) != nil\n puts \" -> #{d.name} - Installed\"\n else\n puts \" -> #{d.name} - Not installed\"\n end\n end\n\n puts \"\"\n\n end", "title": "" }, { "docid": "3a87129ee1f0debd7cef93ea785ed922", "score": "0.599889", "text": "def add_ons\n \"\"\n end", "title": "" }, { "docid": "35e07d221f66d3943adce5e99bc37bab", "score": "0.59646654", "text": "def my_add_on\n @addons = @current_app.my_add_ons\n res = AddOnBlueprint.render_as_json(@addons, root: :add_ons, view: :my_add_on)\n json_response(res)\n # render json: res\n end", "title": "" }, { "docid": "1777011f4ac60b832a3e95c5a44a7cfa", "score": "0.5929224", "text": "def extension_info\n msg = \"Extension: IBM WebShpere Rich-URL Decoder\\n\" +\n \"Author: KING SABRI | @KINGSABRI\\n\" +\n \"Github: https://github.com/TechArchSA/BurpSuite\\n\"\n puts msg\n end", "title": "" }, { "docid": "211312a152d12adfcf1deec26a4b8542", "score": "0.5839599", "text": "def show\n res = AddOnBlueprint.render_as_json(@addon, root: :add_on, view: :detail)\n json_response(res)\n end", "title": "" }, { "docid": "1c60122dd0e6d0b2fc45a4d1ffb7e335", "score": "0.5762206", "text": "def addon\n data = {\n name: @addon.name,\n icon: @addon.icon,\n description: @addon.tagline\n }\n\n render component: 'Addon', props: data\n end", "title": "" }, { "docid": "dfc358485ac632a3764f221bf939d392", "score": "0.55512214", "text": "def installed_AUR()\n\tprint \">> \".magenta\n\tputs \"Installed AUR packages\"\n\tputs \"#{AUR_pkgs}\"\nend", "title": "" }, { "docid": "ce56737e2cc99bb04d00282c3c85b0c1", "score": "0.5538129", "text": "def extension\n @extension ||= NWN::Resources::Extensions.key(@res_type)\n end", "title": "" }, { "docid": "d62c7a68e22174c3e0e24ea8fd240082", "score": "0.55251324", "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": "48e0ba37f8a5f798258e44e7b2ae7b7d", "score": "0.548622", "text": "def description\n return calmapp_name_with_version\n end", "title": "" }, { "docid": "451cb358c58bf2d12faa659854a2ee19", "score": "0.54850143", "text": "def app_extensions(json: {})\n return {} unless json.present? && json[:extension].present?\n\n app = ::ApplicationService.application_name.split('-').first.downcase\n ext = json[:extension].select { |item| item[app.to_sym].present? }\n ext.first.present? ? ext.first[app.to_sym] : {}\n end", "title": "" }, { "docid": "7e56019ae4c9566565a8fd8732a33365", "score": "0.54558545", "text": "def installed?() true end", "title": "" }, { "docid": "337d75b6d6d1fee0092f82d8f2277103", "score": "0.54156196", "text": "def custom_extension\n return @custom_extension\n end", "title": "" }, { "docid": "6fd283065572d2383c2004326a170fdc", "score": "0.5410124", "text": "def wix_light_extensions\n @wix_light_extensions ||= []\n end", "title": "" }, { "docid": "6fd283065572d2383c2004326a170fdc", "score": "0.5410124", "text": "def wix_light_extensions\n @wix_light_extensions ||= []\n end", "title": "" }, { "docid": "935e03966a74d05210f4a3ab003d2f26", "score": "0.5403857", "text": "def linked_to_service() ; ext_info[:linked_to_service] ; end", "title": "" }, { "docid": "4a0776d421b7a57cb4d8c27489cc92de", "score": "0.5402654", "text": "def notify_install(user_id, opts = {}) \n path = \"/api/v1/#{api_key}/#{MESSAGES_TYPES[:application_installed]}/?s=#{user_id}\"\n path += \"&u=#{opts[:unique_tracking_tag]}\" if opts[:unique_tracking_tag]\n path += \"&su=#{opts[:short_tracking_tag]}\" if opts[:short_tracking_tag]\n call_api(path)\n end", "title": "" }, { "docid": "32be149cdaef6f3f982079085500107d", "score": "0.5401142", "text": "def installed_path\n @install + @name if @install\n end", "title": "" }, { "docid": "e2938d20f5834320dd7d5ad44e0f9ac4", "score": "0.537787", "text": "def linked_from_service() ; ext_info[:linked_from_service] ; end", "title": "" }, { "docid": "62e5d4f1bb0401679b85aedf82f34ad0", "score": "0.5339417", "text": "def installed_version\n if !new_resource.source.nil? && ::File.exist?(new_resource.source)\n logger.trace(\"#{new_resource} getting product code for package at #{new_resource.source}\")\n product_code = get_product_property(new_resource.source, \"ProductCode\")\n logger.trace(\"#{new_resource} checking package status and version for #{product_code}\")\n get_installed_version(product_code)\n else\n if uninstall_entries.count != 0\n uninstall_entries.map(&:display_version).uniq\n end\n end\n end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.53330773", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.53330773", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.53330773", "text": "def extension; end", "title": "" }, { "docid": "49b761ba4cbc05bf38b800ef30d0fa76", "score": "0.53330773", "text": "def extension; end", "title": "" }, { "docid": "add05ced0ee1be4c9b21105f73d91004", "score": "0.5332484", "text": "def wix_light_extension(extension)\n unless extension.is_a?(String)\n raise InvalidValue.new(:wix_light_extension, \"be an String\")\n end\n\n wix_light_extensions << extension\n end", "title": "" }, { "docid": "ba0683cf7ccc2d0ab71e498df3b2b7bf", "score": "0.53215784", "text": "def installed_instruments; end", "title": "" }, { "docid": "d06bf0b885b56482216821a29804b316", "score": "0.5317509", "text": "def wix_light_extension(extension)\n unless extension.is_a?(String)\n raise InvalidValue.new(:wix_light_extension, 'be an String')\n end\n\n wix_light_extensions << extension\n end", "title": "" }, { "docid": "8f5216cf46b46d3b5a2986b51eb3a5d7", "score": "0.5316978", "text": "def notify_install(user_id, opts = {}) \n path = \"/api/v1/#{api_key}/#{MESSAGES_TYPES[:application_installed]}/?s=#{user_id}&\"\n path += opts.to_query\n call_api(path)\n end", "title": "" }, { "docid": "337ba374aacfb7987c5c67e20ec37955", "score": "0.5316864", "text": "def to_s\n \"Halite gems\"\n end", "title": "" }, { "docid": "2143f091b7172f9682a905750d3f3413", "score": "0.5312385", "text": "def add\n unless addon = args.shift\n error(\"Usage: heroku addons:add ADDON\\nMust specify ADDON to add.\")\n end\n addon = addon.dup.sub('@', '')\n\n msg = options[:name] ?\n \"Adding #{addon} as #{options[:name]} to #{app}\" :\n \"Adding #{addon} to #{app}\"\n\n display(\"#{msg}... \", false)\n\n response = api.request(\n :body => json_encode({\n \"app\" => {\"name\" => app},\n \"addon\" => {\"name\" => addon},\n \"confirm\" => options[:confirm],\n \"name\" => options[:name]\n }),\n :expects => [201, 422],\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :post,\n :path => \"/addon-attachments\"\n )\n\n case response.status\n when 201\n display(\"done\")\n action(\"Setting #{response.body[\"name\"]} vars and restarting #{app}\") do\n @status = api.get_release(app, 'current').body['name']\n end\n when 422 # add-on resource not found, should probably be 404\n display(\"failed\")\n output_with_bang(\"Add-on resource `#{addon}` not found.\")\n output_with_bang(\"List available resources with `heroku addons`.\")\n output_with_bang(\"Provision a new add-on resource with `heroku addons:create #{options[:name]}`.\")\n end\n end", "title": "" }, { "docid": "6d722c3a4915b01fd8cf1843aacd9147", "score": "0.5307014", "text": "def install_marker_file_name_prefix\n \"#{File.basename(installer_file_path)}.installed_with_version.\"\n end", "title": "" }, { "docid": "dff189b2657069b36f10450f6cfa6083", "score": "0.52994967", "text": "def extension(type, version, location = @location, publisher = @publisher)\n check_for_location_and_publisher(location, publisher)\n\n url = build_url(\n location, 'publishers', publisher, 'artifacttypes',\n 'vmextension', 'types', type, 'versions', version\n )\n\n response = rest_get(url)\n Azure::Armrest::ExtensionType.new(response)\n end", "title": "" }, { "docid": "ff854b3a986d40112f01b1c543347790", "score": "0.5296087", "text": "def find_app_installations(options = T.unsafe(nil)); end", "title": "" }, { "docid": "4dc5ee007dbfd439f41df519c2a3ffec", "score": "0.52848375", "text": "def get_extension_args; end", "title": "" }, { "docid": "4dc5ee007dbfd439f41df519c2a3ffec", "score": "0.52848375", "text": "def get_extension_args; end", "title": "" }, { "docid": "4dc5ee007dbfd439f41df519c2a3ffec", "score": "0.52848375", "text": "def get_extension_args; end", "title": "" }, { "docid": "8a57a2c274b4de3a04e060f12e54b117", "score": "0.5284309", "text": "def run_install_hook_with_add_info(*args)\n run_install_hook_without_add_info(*args)\n File.open(info_yml, 'w') do |f|\n info = {\n :uri => @uri,\n :installed_at => Time.now,\n :revision => self.class.repository_revision(@uri),\n :checksum => self.class.checksum(install_dir)\n }\n f.write info.to_yaml\n end\n end", "title": "" }, { "docid": "c7eb52e6786e49af097460ba2addc950", "score": "0.5281962", "text": "def calmapp_name_with_version\n return calmapp_name + \" version \" + version.to_s\n end", "title": "" }, { "docid": "86d1cf198805b2bfa322af43822db641", "score": "0.5267824", "text": "def get_augmented_service_add_ons\n get_objs_helper(:aug_service_add_ons_from_instance, :service_add_on, augmented: true)\n end", "title": "" }, { "docid": "d39b416a4d407af745d7646dd90215be", "score": "0.52628124", "text": "def add_extension(extension_request); end", "title": "" }, { "docid": "6cb6c49d935205bad31888e93807660c", "score": "0.52594453", "text": "def info_url\n MAC_UPDATE_PACKAGE_URL + \"#{web_id}\"\n end", "title": "" }, { "docid": "e9d53ec385dd0ff4e4be81d1100249a0", "score": "0.5258414", "text": "def default_addons\n {}\n end", "title": "" }, { "docid": "ee5bcb77315f6293353a180fa0c6667e", "score": "0.5258366", "text": "def wix_extension_switches(arr)\n \"#{arr.map { |e| \"-ext '#{e}'\" }.join(\" \")}\"\n end", "title": "" }, { "docid": "841f86f628db12ec4ca3bd9e4d6e6795", "score": "0.52402854", "text": "def jnlp_installer_vendor\n \"ConcordConsortium\"\n end", "title": "" }, { "docid": "841f86f628db12ec4ca3bd9e4d6e6795", "score": "0.52402854", "text": "def jnlp_installer_vendor\n \"ConcordConsortium\"\n end", "title": "" }, { "docid": "c66da0d0cbed1ccecce93a85ce661ae7", "score": "0.5235862", "text": "def custom_extension_id\n return @custom_extension_id\n end", "title": "" }, { "docid": "6c2a64101a259c0a502f522d9ecdde95", "score": "0.52339727", "text": "def calmapp_name_with_version\n return calmapp.name.humanize + \" Version:\" + version.to_s\n end", "title": "" }, { "docid": "92cc596a5326a1229ba965f711254184", "score": "0.5230846", "text": "def install_extend_commands; end", "title": "" }, { "docid": "92cc596a5326a1229ba965f711254184", "score": "0.5230846", "text": "def install_extend_commands; end", "title": "" }, { "docid": "674f90eec4be3d4ecee8510eba484c5a", "score": "0.5227487", "text": "def info(addon_id_or_addon_name)\n @client.addon.info(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "c7751810c001ea0d6260a3048448ab10", "score": "0.52256036", "text": "def package_name\n script = 'powershell \"(Get-ItemProperty HKLM:\\\\\\\\Software\\\\\\\\Microsoft\\\\\\\\'\\\n 'Windows\\\\\\\\CurrentVersion\\\\\\\\Uninstall\\\\\\\\* | Select-Object DisplayName,'\\\n 'Publisher | Where-Object {$_.Publisher -like '\\\n '\\'R Development Core Team\\'}).DisplayName'\n package_name = shell_out(script).stdout.strip\n package_name.empty? ? 'AlteryxRTools' : package_name\nend", "title": "" }, { "docid": "8b1e2ee7d6d0d0141c3ea0e22c589886", "score": "0.5224024", "text": "def installed_components\n return @installed_components if defined?(@installed_components)\n res = get(\"installed_components\", nil, {\"filters\" => \"filters[app_name]=#{url_encode(app[\"name\"])}\"})\n @installed_components = res[\"data\"]\n end", "title": "" }, { "docid": "78d3e9d3b949ed624eecf3d73d9f95f4", "score": "0.5219592", "text": "def wix_extension_switches(arr)\n \"#{arr.map {|e| \"-ext '#{e}'\"}.join(' ')}\"\n end", "title": "" }, { "docid": "fb1cc508bfb5f73e6ff8867111ed0b49", "score": "0.5214712", "text": "def to_install_string\n \"#{name} -v#{version.version} --source #{source}\"\n end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52124095", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "42a819db1ac5834d5de56324b5077ae3", "score": "0.52095443", "text": "def extensions; end", "title": "" }, { "docid": "8610c2a32b8eb641de722d5e8f5154a1", "score": "0.52069056", "text": "def check_installed\n @install_array = Array.new\n cmd = \"\\\"#{webpicmd}\\\" /List /ListOption:Installed\"\n cmd << \" /XML:#{node['webpi']['xmlpath']}\" if node['webpi']['xmlpath']\n cmd_out = shell_out(cmd, {:returns => [0,42]})\n unless cmd_out.stderr.empty?\n Chef::Log.Info(cmd_out.stderr)\n @install_array = @new_resource.product_id\n else\n @new_resource.product_id.split(\",\").each do |p|\n #Example output\n #HTTPErrors IIS: HTTP Errors\n #Example output returned via grep\n #\\r \\rHTTPErrors IIS: HTTP Errors\\r\\ns\n if cmd_out.stdout.lines.grep(/^\\s{6}#{p}\\s.*$/i).empty?\n @install_array << p\n end\n end\n end\n @install_list = @install_array.join(\",\")\nend", "title": "" }, { "docid": "4b046cfa21eb722af1b38e42713cd4cc", "score": "0.5206432", "text": "def installs_plist\n plist_virtual_attribute_get(:installs)\n end", "title": "" }, { "docid": "4b046cfa21eb722af1b38e42713cd4cc", "score": "0.5206432", "text": "def installs_plist\n plist_virtual_attribute_get(:installs)\n end", "title": "" }, { "docid": "69b776cfae242aaf36776f40c687bafc", "score": "0.5200988", "text": "def extname\n INTERNAL_LITERATE_EXTENSION_NAME\n end", "title": "" }, { "docid": "5aff70259eca816aeede91a9e1d5383b", "score": "0.519711", "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": "742ba66f21e7a61332031aa54d72ddb6", "score": "0.5194304", "text": "def parse_installation_payload(webhook_data)\n if webhook_data[\"action\"] == \"created\" || webhook_data[\"action\"] == \"added\"\n # installation_id = webhook_data[\"installation\"][\"id\"]\n installation_id = get_installation_id(webhook_data)\n\n # Get JWT for App and get access token for an installation\n jwt_client = Octokit::Client.new(:bearer_token => get_jwt_token)\n jwt_client.default_media_type = \"application/vnd.github.machine-man-preview+json\"\n app_token = jwt_client.create_app_installation_access_token(installation_id)\n\n # Create octokit client that has access to installation resources\n @client = Octokit::Client.new(access_token: app_token[:token] )\n @client.default_media_type = \"application/vnd.github.machine-man-preview+json\"\n\n #TODO LET THEM KNOW IT WORKED\n end\n end", "title": "" }, { "docid": "9114c666c323b5525a0fbd69a3d3e68f", "score": "0.51937073", "text": "def extension\n self.class::EXTENSION\n end", "title": "" }, { "docid": "da18705a3504af2b2b40ce5706fb74a3", "score": "0.5193055", "text": "def install_addon(type, name, src, options = {})\n params = { \n addon: {\n type: type,\n name: name,\n src: src\n }\n }\n response = post \"/addons\", options.merge(params)\n response[:addon]\n end", "title": "" }, { "docid": "f8a677c3a89e34e5c63f9209483bc192", "score": "0.5190224", "text": "def action_install\n # This space left intentionally blank.\n end", "title": "" }, { "docid": "f8a677c3a89e34e5c63f9209483bc192", "score": "0.5190224", "text": "def action_install\n # This space left intentionally blank.\n end", "title": "" }, { "docid": "f8a677c3a89e34e5c63f9209483bc192", "score": "0.5190224", "text": "def action_install\n # This space left intentionally blank.\n end", "title": "" }, { "docid": "91f04f9f328996d304211537a3cfaba5", "score": "0.51797605", "text": "def installed?\n info[:installed] == true\n end", "title": "" }, { "docid": "924f4d835e94233d5f835647a8d93662", "score": "0.51782864", "text": "def managed_installs\n USING_PRECEDENT_ITEMS ? create_item_array(\"install_items\") : create_item_array(\"install_items\", false)\n end", "title": "" }, { "docid": "7fd762240e8565949b12c48472fbe72a", "score": "0.51586014", "text": "def export_as_jsonld\n self['manifest']\n end", "title": "" }, { "docid": "20150c4010154fce17ff045934fcd7a1", "score": "0.5146616", "text": "def install_date\n if object.date_installed\n object.date_installed.strftime(\"%m/%d/%Y\")\n else\n \"Not installed\"\n end\n end", "title": "" }, { "docid": "9fffd0f11384f5593c69097abf26a9bc", "score": "0.5144832", "text": "def installer\n platform_service(:installer)\n end", "title": "" }, { "docid": "fc09ee0ef4ac3ccacb0b002489cefe68", "score": "0.5140921", "text": "def name\n\t\t\"Standard extension\"\n\tend", "title": "" }, { "docid": "cc0de024ef9e17660927f8fc4e14075c", "score": "0.5137625", "text": "def list\n @installed\n end", "title": "" }, { "docid": "74314f923c6486c93f85871d65d51b58", "score": "0.51370627", "text": "def installed?(_name = nil, _version = nil)\n return false if info.nil?\n info[:installed]\n end", "title": "" }, { "docid": "246f59123b395f7cb5eb1f122d833c49", "score": "0.51144546", "text": "def testDetailedListShort\n executeInstall(['-e'])\n end", "title": "" }, { "docid": "a72dd79d6f8178c7ee0abb8ab126c65d", "score": "0.5110483", "text": "def extension\n @attributes[:extend]\n end", "title": "" }, { "docid": "f8df8ec83af2e25a38e8c45788d3c949", "score": "0.51077545", "text": "def addon(id, options = {})\n response = get \"/addons/#{id}\", options\n response[:addon]\n end", "title": "" }, { "docid": "989e469919355e9c5a56e3b7ab991255", "score": "0.5106038", "text": "def get_xb_install_service(options)\n return options['service']\nend", "title": "" }, { "docid": "3284597701a019284fde85b886ecd912", "score": "0.5101549", "text": "def getInstallFileName(iComponentName)\n return \"#{@WEACEInstallDir}/InstalledComponents/#{get_valid_file_name(iComponentName)}.inst.rb\"\n end", "title": "" }, { "docid": "da96d6a408f72660f49cc164dbb8b198", "score": "0.50962037", "text": "def install kexts\n if !kexts.empty?\n oh1 \"Installing Extensions\"\n kexts.each { |kext|\n kext_url = File.join(@extensions, File.basename(kext))\n if File.exist? kext_url\n system(\"/usr/bin/env\", \"ditto\", kext, kext_url)\n puts \"Overwrote: #{kext_url}\"\n else\n kext_url = File.join(@extra_extensions, File.basename(kext)) if File.exist? @extra_extensions\n system(\"/usr/bin/env\", \"ditto\", kext, kext_url)\n puts \"Installed: #{kext_url}\"\n end\n }\n end\n end", "title": "" }, { "docid": "e30ad7ac1bcd4720c2bf4aafb66764c8", "score": "0.5096111", "text": "def external_tools_list\n external_tools_response[:body]\n end", "title": "" }, { "docid": "c27c9317fc27e314cf5e785461bec636", "score": "0.5089679", "text": "def extended_name\n if has_version?\n return name + '-' + ((drupal?) ? version.short : version.long)\n else\n return name + '-' + core.to_s\n end\n end", "title": "" }, { "docid": "1d50afb26f88739fdbf6fa7fb5dadf1e", "score": "0.50889236", "text": "def extensions\n end", "title": "" }, { "docid": "98f71d0b255fcabda62f0b39d8cca843", "score": "0.50851285", "text": "def package_file_extension\n '.msi'\n end", "title": "" }, { "docid": "f93e629a13690974c176ac77222b106c", "score": "0.50815576", "text": "def full_installer_url\n install_url % {\n version: install_version,\n arch: case node['kernel']['machine']\n when 'i386'\n 'i686'\n else\n node['kernel']['machine']\n end,\n }\n end", "title": "" }, { "docid": "9cc35087e09a0a90a559bec5f8cd289d", "score": "0.50814635", "text": "def enable_extension(name); end", "title": "" }, { "docid": "0684b36b1105d1ac9d52880905e1bdaa", "score": "0.50812596", "text": "def install\n record_installed if Shell.execute(@post_install_cmd)\n \n end", "title": "" }, { "docid": "2a0ea7b498c8aee0b09e1fd2b83ccfc1", "score": "0.5075491", "text": "def user_installs\n user_install_items.collect(&:package)\n end", "title": "" }, { "docid": "96201d9d2234df7008c8d166d43287a0", "score": "0.5070647", "text": "def ibm_installed?(install_dir, offering_id, offering_version = '', user = 'root')\n Chef::Log.debug \"ibm_installed? params: install_dir: #{install_dir}, offering_id: #{offering_id}, offering_version: #{offering_version}, user: #{user}\"\n cmd = \"#{install_dir}/eclipse/tools/imcl listInstalledPackages | grep #{offering_id}_#{offering_version} || true\"\n cmd_out = run_shell_cmd(cmd, user)\n cmd_out.stderr.empty? && (cmd_out.stdout =~ /^#{offering_id}_#{offering_version}/)\n end", "title": "" }, { "docid": "867c2c355d0ba2e89cfc17f6653e894f", "score": "0.5067973", "text": "def AddOnMode(source_id)\n all_products = Pkg.ResolvableProperties(\"\", :product, \"\")\n\n check_add_on = {}\n\n # Search for an add-on using source ID\n Builtins.foreach(all_products) do |one_product|\n if Ops.get_integer(one_product, \"source\", -1) == source_id\n check_add_on = deep_copy(one_product)\n raise Break\n end\n end\n\n ret = \"installation\"\n\n supported_statuses = [:installed, :selected]\n already_found = false\n\n # Found the\n if check_add_on != {} && Builtins.haskey(check_add_on, \"replaces\")\n product_replaces = Ops.get_list(check_add_on, \"replaces\", [])\n\n # Run through through all products that the add-on can replace\n Builtins.foreach(product_replaces) do |one_replaces|\n raise Break if already_found\n # Run through all installed (or selected) products\n Builtins.foreach(all_products) do |one_product|\n # checking the status\n if !Builtins.contains(\n supported_statuses,\n Ops.get_symbol(one_product, \"status\", :unknown)\n )\n next\n end\n # ignore itself\n next if Ops.get_integer(one_product, \"source\", -42) == source_id\n # check name to replace\n if Ops.get_string(one_product, \"name\", \"-A-\") !=\n Ops.get_string(one_replaces, \"name\", \"-B-\")\n next\n end\n # check version to replace\n if Ops.get_string(one_product, \"version\", \"-A-\") !=\n Ops.get_string(one_replaces, \"version\", \"-B-\")\n next\n end\n # check version to replace\n if Ops.get_string(one_product, \"arch\", \"-A-\") !=\n Ops.get_string(one_replaces, \"arch\", \"-B-\")\n next\n end\n Builtins.y2milestone(\n \"Found product matching update criteria: %1 -> %2\",\n one_product,\n check_add_on\n )\n ret = \"update\"\n already_found = true\n raise Break\n end\n end\n end\n\n ret\n end", "title": "" }, { "docid": "22a595389efc2ef9cda85569ab486662", "score": "0.5067266", "text": "def installed_extensions\n execute_sql 'SELECT * FROM pg_available_extensions WHERE installed_version IS NOT NULL;'\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c811f0b4f5423055b41b8508f7486b01", "score": "0.0", "text": "def shift_params\n params.require(:shift).permit(:assignment_id, :date, :start_time, :end_time, :notes)\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": "" } ]
ae6396a56dd5a56ff69274da5c56e2f2
before_action :configure_sign_in_params, only: [:create] GET /resource/sign_in def new super end POST /resource/sign_in
[ { "docid": "4e6a8de261e60d4cbf4a1e64dd88352d", "score": "0.0", "text": "def create\n username = \"Endura\\\\#{params[:user][:email]}\"\n ldap = Net::LDAP.new \n ldap.host = \"192.168.1.37\"\n ldap.port = 389\n ldap.base = \"CN=Administrator,CN=Users,DC=endura,DC=enduraproducts,DC=com\"\n ldap.auth username, params[:user][:password]\n\n if ldap.bind\n @user = User.find_by_email(\"#{params[:user][:email]}@enduraproducts.com\")\n if @user.nil?\n flash[:error] = \"Username or Password is incorrect.\"\n redirect_to new_user_session_path\n elsif @user.terminated == true\n flash[:error] = \"This user has been terminated and cannot log into the system.\"\n redirect_to new_user_session_path\n else\n flash[:notice] = \"Welcome #{params[:user][:email]}!\"\n sign_in(:user, @user)\n redirect_to user_portal_index_path\n end\n else\n flash[:error] = \"#{ldap.get_operation_result.message}\"\n redirect_to new_user_session_path\n end\n #super\n end", "title": "" } ]
[ { "docid": "3d4398f7a251ac98ea7349e34fc0d33d", "score": "0.731359", "text": "def new\n self.resource = resource_class.new(sign_in_params)\n store_location_for(resource, params[:redirect_to])\n super\n end", "title": "" }, { "docid": "5ab60b21a090c1ee367152562ab4679a", "score": "0.72724557", "text": "def resource_params\n params.require(:sign_in).permit(:login, :password)\n end", "title": "" }, { "docid": "2880667c6b51c08a5a0755dcb982fbdb", "score": "0.7248155", "text": "def create\n super do |resource|\n @after_sign_in_path = after_sign_in_path_for(resource)\n end\n end", "title": "" }, { "docid": "c18bf8d6db417642bc865363f39bc381", "score": "0.71378934", "text": "def sign_in; end", "title": "" }, { "docid": "f5f3b02f0da130f426a6771c51e9028a", "score": "0.7113898", "text": "def new\n @user_sign_in = UserSignIn.new\n end", "title": "" }, { "docid": "9a0ef9e443acfd57850d92c2b43cc32b", "score": "0.70888865", "text": "def sign_in(*_)\n super.tap { controller.current_comable_user.after_set_user }\n end", "title": "" }, { "docid": "9a0ef9e443acfd57850d92c2b43cc32b", "score": "0.70888865", "text": "def sign_in(*_)\n super.tap { controller.current_comable_user.after_set_user }\n end", "title": "" }, { "docid": "4bc9a8abda8cf4a5d086a2a8a2e92de8", "score": "0.70099145", "text": "def create\n resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in, user: resource) if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "b4cc98ef3ce99065230c737d5b562501", "score": "0.69970465", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n respond_to do |format|\n format.html { redirect_to(after_sign_in_path_for(resource)) }\n format.json { render json: resource.from_json(on_page: params[:on_page]) }\n end\n end", "title": "" }, { "docid": "1479f79c30738f4453d4ec8cf411f955", "score": "0.69889206", "text": "def new\n # 查测到是微信登录,则跳过登录,\n return if before_login_by_wx_pub # TODO:还要考虑强制非微信登录的情况\n # super\n # session[:user_return_to] = request.referer unless request.referer && (request.referer.include?(\"/sign_in\"))\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n end", "title": "" }, { "docid": "ef3000192755b0792dcc104c35775548", "score": "0.6968473", "text": "def signin\n end", "title": "" }, { "docid": "90297fc315d3307d4e0b42edc6d9669f", "score": "0.694976", "text": "def create\n @signin = Signin.new(signin_params)\n\n respond_to do |format|\n if @signin.save\n format.html { redirect_to @signin, notice: 'Signin was successfully created.' }\n format.json { render :show, status: :created, location: @signin }\n else\n format.html { render :new }\n format.json { render json: @signin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c090e3716c7dda46ecac690c2c06982", "score": "0.6947221", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:success, :signed_in) if is_navigational_format?\n sign_in(resource_name, resource)\n if !session[:return_to].blank?\n redirect_to session[:return_to]\n session[:return_to] = nil\n else\n respond_with resource, :location => after_sign_in_path_for(resource)\n end\n end", "title": "" }, { "docid": "49a26fe2b2090e7452a0a5dcb49e8677", "score": "0.69246083", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n sign_in @user\n redirect_to '/'\n else\n render 'new'\n end\n\n end", "title": "" }, { "docid": "d1586abd8cb3cea528415fe3034076d0", "score": "0.6862707", "text": "def create\n respond_to do |format|\n format.html { super }\n format.json do\n sign_in_via_api\n end\n end\n end", "title": "" }, { "docid": "54ba362d0120666f6bdce6fa55bcf6ff", "score": "0.6860954", "text": "def create\n sign_in_params = get_sign_in_params\n result = do_sign_in(sign_in_params)\n\n if result.nil?\n response_wrapper(\n :unauthorized,\n nil,\n 'Incorrect user name, email, or password. Alternatively, you may need to confirm your account or it may be locked.',\n [:confirm, :reset_password, :resend_unlock]\n )\n else\n response_wrapper(\n :ok,\n {\n auth_token: sign_in_params[:resource].authentication_token,\n #email: sign_in_params[:resource].email,\n user_name: sign_in_params[:resource].user_name,\n message: I18n.t('devise.sessions.signed_in')\n }\n )\n end\n end", "title": "" }, { "docid": "8703e5fd1a00700471eb2666e954d1cd", "score": "0.6850138", "text": "def new\n # self.resource = resource_class.new(sign_up_params)\n # store_location_for(resource, params[:redirect_to])\n super\n end", "title": "" }, { "docid": "a1f0ec6ed1cc0bd08bfd60f8831b6426", "score": "0.6786523", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n sign_in(resource_name, resource)\n if resource.errors.empty?\n render json: payload(resource)\n else\n render json: {errors: resource.errors}, status: :unauthorized\n end\n end", "title": "" }, { "docid": "e9df1eaa55dca094b802cc03dd15fafb", "score": "0.67769057", "text": "def sign_in\n post auth_session_path({ session: { email: users(:regular_user).email, password: '12345678' } })\n end", "title": "" }, { "docid": "c4731dd83e82cfce6efcd77e2dbd2f2a", "score": "0.6762412", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "3e2c0bf20a756c573c9def8dd68002a3", "score": "0.67616296", "text": "def new\n super # no customization, simply call the devise standard implementation\n end", "title": "" }, { "docid": "cf935aa81ca16e76b365390ad238bf6e", "score": "0.6736356", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n # render text: \"HAI\"\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: profile_path\n end", "title": "" }, { "docid": "a9b4eb0d4f8f9d435e46eaa458633235", "score": "0.6708425", "text": "def create\n sign_out(:user) if current_user\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "7cca2d668fb9e3151cc9bd559658b0b9", "score": "0.66929007", "text": "def configure_sign_in_params\n params.permit(:email, :password)\n end", "title": "" }, { "docid": "2d4d41ac6e424b4812e06975351b9c8f", "score": "0.6679596", "text": "def sign_up(resource_name, resource)\n # sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "45fc994a8af8ee47c0d8b39dbdeba502", "score": "0.6678012", "text": "def signin_params\n puts \"******* signin_params *******\"\n params.permit(:username, :password)\n end", "title": "" }, { "docid": "e443b95a13dec43f40e6e1d3291eae20", "score": "0.6676641", "text": "def create\n if params[:email] \n signin_with_signin_form\n else\n signin_with_facebook\n end\n end", "title": "" }, { "docid": "be65b33f5cde62fe80258784ddcce6a6", "score": "0.6654252", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in, :username => resource.full_name) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "02535cda4b8ea1b6ced66ba72e483192", "score": "0.6647581", "text": "def new\n render Devise::Pages::SignIn\n end", "title": "" }, { "docid": "3750904b26d4c6d0331f3892c708baa5", "score": "0.66271144", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource_json, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "cc9bec6d6ac957f3d621315c3d813787", "score": "0.6617231", "text": "def create\n @user = User.new(params[:user])\n if @user.save\n sign_in @user\n redirect_to @user\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "31a033b817f1ad62a073f038673b79df", "score": "0.6614119", "text": "def create\n # super\n respond_to do |format|\n format.html {\n\n super\n }\n format.json {\n resource = User.find_for_database_authentication(:email=>params[:email])\n return invalid_login_attempt unless resource\n\n if resource.valid_password?(params[:password])\n sign_in(\"user\", resource)\n render :json=> {:success=>true}\n return\n end\n invalid_login_attempt\n\n }\n end\n end", "title": "" }, { "docid": "a4e3da0afc5d620e2e72462c54c2cc98", "score": "0.65828776", "text": "def sign_in\n @user = User.new\n render \"login\"\n end", "title": "" }, { "docid": "f68179854943ffcdb8040628c6541ec1", "score": "0.65661854", "text": "def create\n resource = warden.authenticate!(scope: resource_name, recall: \"#{controller_path}#failure\")\n sign_in_without_redirect(resource_name, resource)\n @after_sign_in_path = after_sign_in_path(resource)\n end", "title": "" }, { "docid": "db9c4506812f41bed4607ed77da4b8a7", "score": "0.6556203", "text": "def sign_up(resource_name, resource)\n # angular is doing the login on its own\n #sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "1456badb09b298e4ef2b60278ee0da3c", "score": "0.6555328", "text": "def signIn\n @user = User.new\n end", "title": "" }, { "docid": "b552903da497f691c24a57beac2dcd08", "score": "0.6549928", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n \n if (params[:user][:password] == Rails.configuration.ofx[:default_password])\n flash[:alert] = \"Please change your password.\"\n redirect_to edit_user_registration_path(resource)\n else\n respond_with resource, location: after_sign_in_path_for(resource)\n end\n end", "title": "" }, { "docid": "e72d822806c46d9d11254ddf1153f22b", "score": "0.65485454", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in)\n end", "title": "" }, { "docid": "197009171c157d2edac9ac26cb7a6aed", "score": "0.6545882", "text": "def sign_in\n @user = User.new\n end", "title": "" }, { "docid": "197009171c157d2edac9ac26cb7a6aed", "score": "0.6545882", "text": "def sign_in\n @user = User.new\n end", "title": "" }, { "docid": "3ab833dd0028a048398e4f9d33375169", "score": "0.6532405", "text": "def sign_in\n post login_path, params: { user_name: \"User\" }\n end", "title": "" }, { "docid": "d4e6ef9665c8985b54b91b44c23341fd", "score": "0.6521175", "text": "def sign_up(resource_name, resource) #para que no se auto sign_in cuando se sign up\n end", "title": "" }, { "docid": "bd1617fa0977678f04abed2c50898c3e", "score": "0.6516367", "text": "def create\n person = Person.authenticate(params[:session][:email],params[:session][:password])\n if person.nil?\n @title = \"sign in\"\n flash.now[:error] = 'username or password are incorrect'\n \n render 'new' \n else\n sign_in(person)\n redirect_to(person)\n \n end\n end", "title": "" }, { "docid": "f9faf8644d2e0cadf045e870c9943753", "score": "0.6515841", "text": "def signin\n signin_get if request.get?\n signin_post if request.post?\n end", "title": "" }, { "docid": "22c391e0065205e3f8bf22d1b29de4d9", "score": "0.651203", "text": "def new\n self.resource = resource_class.new(sign_in_params)\n logger.debug(\"SSSSSSSSSSSSSSSSS\" + \"ssss\")\n logger.debug(resource)\n clean_up_passwords(resource)\n yield resource if block_given?\n respond_with(resource, serialize_options(resource))\n end", "title": "" }, { "docid": "3961a6f51f94645aec58716dc5250f1a", "score": "0.6506933", "text": "def sign_up(resource_name, resource)\n super\n end", "title": "" }, { "docid": "6ec21db9372f786460850d4d6d3244f3", "score": "0.6506265", "text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n sign_in @user\n format.html { redirect_to @user, notice: 'Logged in correctly' }\n format.json { render action: 'show', status: :created, location: @user }\n else\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c67631f18ee715d256a27920e64b0191", "score": "0.6504215", "text": "def create\n build_resource(sign_up_params)\n\n resource.profile_type = session[:user_type]\n # byebug\n if resource.save\n if resource.active_for_authentication?\n set_flash_message :notice, :signed_up if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_up_path_for(resource)\n else\n set_flash_message :notice, :\"signed_up_but_#{resource.inactive_message}\" if is_navigational_format?\n expire_session_data_after_sign_in!\n respond_with resource, :location => after_inactive_sign_up_path_for(resource)\n end\n else\n clean_up_passwords resource\n render 'users/registrations/new_'.concat(session[:user_type])\n end\n end", "title": "" }, { "docid": "bbdaae45ba1c0f9580c9a5fdcbf7f5b0", "score": "0.6489088", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n # debugger\n if !session[:return_to].blank?\n redirect_to session[:return_to]\n else\n respond_with resource, location: after_sign_in_path_for(resource)\n end\n session.delete(:return_to)\n end", "title": "" }, { "docid": "e344ac5a39ebff66d15ad1b728dbd828", "score": "0.6488134", "text": "def sign_in(resource_name, user, *args)\n create_token(user)\n session['api_token'] = token ? token['token'] : nil\n super\n end", "title": "" }, { "docid": "6cc94082ff344d5f159626f56f6170fe", "score": "0.64879316", "text": "def create\n @user = User.new(user_params)\n if @user.save\n sign_in @user\n redirect_to @user\n else\n render :new\n end\n end", "title": "" }, { "docid": "db0d1269d0b48c855eaf2b18c009c7fd", "score": "0.64861894", "text": "def sign_in #Use this if you need a user to be logged in\n post login_path, params: { session: { email: @fixer.email,\n password: 'password' } }\n end", "title": "" }, { "docid": "9ff8910a51a810f09c68b341eb8a4580", "score": "0.6485657", "text": "def create\n #Checks to see if request is coming from JSON\n if request.headers[\"ACCEPT\"] == \"application/json\"\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n\n # Generate auth_token and render JSON after authenticating\n token = AuthToken.issue_token({ user: resource.id })\n respond_with resource, location: after_sign_in_path_for(resource) do |format|\n format.json { render json: { user: resource.email, token: token } }\n end\n else\n super\n end\n end", "title": "" }, { "docid": "2e45b933eb2476d64617745bb9d4ab76", "score": "0.6476504", "text": "def set_signin\n @signin = Signin.find(params[:id])\n end", "title": "" }, { "docid": "41cb52179dc561016dd465106d20a9c9", "score": "0.64667493", "text": "def sign_up(resource_name, resource)\n\t\tsign_in(resource_name, resource)\n\tend", "title": "" }, { "docid": "e8db1169ec57dfd70e7def1c6223cdd6", "score": "0.64560753", "text": "def new\n redirect_to(signed_in? ? home_path : idp_sign_in_path)\n end", "title": "" }, { "docid": "e08a57699b9f77b18614efabcefe87f2", "score": "0.64538324", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:login_id, :password, :authenticity_token])\n end", "title": "" }, { "docid": "0dcf58f8d8f9c2d5b4c5c17c251cd6fd", "score": "0.6443981", "text": "def create\n # 소셜 로그인 콜백 요청인지?\n if params[:auth].present?\n auth = JSON.parse(auth_params.to_json, object_class: OpenStruct)\n @user = User.find_for_oauth(auth, current_user)\n\n case params[:level]\n when 'seller' then @user.update(is_seller: true)\n end\n\n # super 내의 warden.authenticate! 메소드를 무시하기 위해\n # super 를 override 했습니다.\n self.resource = @user # 원래 self.resource = warden.authenticate!(auth_options) 였습니다.\n sign_in(resource_name, resource)\n respond_with resource, location: after_sign_in_path_for(resource)\n else\n super\n end\n end", "title": "" }, { "docid": "b274311f8565209cd4effe85e03a333d", "score": "0.64403033", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n if resource.nil?\n render json: {\n error: 'User not found'\n }, status: 441\n else\n render json: {\n name: current_user.name,\n phone: current_user.phone,\n id: current_user.id,\n role: current_user.role,\n token: current_user.token,\n meteors: current_user.meteors\n }\n end\n end", "title": "" }, { "docid": "d58ca37f80c858ed220acf633b20ad37", "score": "0.64399207", "text": "def new\n\t\tif (session[:request_format].present? && session[:request_format] == \"json\")\n\n\t\telse\n\t\t\tself.resource = resource_class.new(sign_in_params)\n\t \tclean_up_passwords(resource)\n\t\tend\n\n\t\tyield resource if block_given?\t\n\t\trespond_to do |format|\n\t\t\tformat.json {\n\n\t\t\t\trender json: {:status => 200, :success => true, :info => \"Logged in\"}\n\t\t\t}\n\t\t\tformat.html {respond_with resource, location: serialize_options(resource)}\n\t\tend\n\t\t#respond_with(resource, serialize_options(resource))\n\tend", "title": "" }, { "docid": "0b451ece58f92001822d2f93f122570b", "score": "0.6433838", "text": "def sign_in_form\n @user = User.new\n end", "title": "" }, { "docid": "0b7063bf3ca972acd9b48a5240616d6e", "score": "0.64188117", "text": "def create\n user = User.find_by(email: params[:email].downcase)\n if user && user.authenticate(params[:password])\n # Call to the included (via ApplicationController) sign_in method\n sign_in user\n redirect_back_or \"/sessions/#{current_user.id}\"\n else\n flash.now[:error] = 'Invalid email/password combination'\n render 'new', layout: 'login'\n end\n end", "title": "" }, { "docid": "10eaf49fcebb6c28626f3572f230f9b5", "score": "0.6412749", "text": "def create\n\n warden.authenticate!(:scope => resource_name, :recall => \"#{controller_path}#new\")\n respond_to do |format|\n format.html { super }\n format.json {\n warden.authenticate!(:scope => resource_name, :recall => \"#{controller_path}#new\")\n render :status => 200, :json => { :success => true,\n :info => \"Logged in\",\n :user_id => current_user.id,\n :data => { :auth_token => current_user.authentication_token }\n }\n }\n end\n\n end", "title": "" }, { "docid": "ea8a6aac5c2915d16ab43fee43cc21cd", "score": "0.6411771", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :login\n end", "title": "" }, { "docid": "7d38649c31e6ff6455af5766d3f2840b", "score": "0.6411277", "text": "def create\n session_resource_name = controller_name.singularize\n\n respond_to do |format|\n # Remap the session information to the Devise scope name, which will be picked up on for authentication purposes.\n format.json do\n request.params[resource_name] = request.params[session_resource_name]\n request.params.delete(session_resource_name)\n end\n\n format.all {}\n end\n\n # Copied from `Devise::SessionsController`.\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n redirect_path = after_sign_in_path_for(resource_name)\n sign_in(resource_name, resource)\n yield resource if block_given?\n\n respond_to do |format|\n format.any(*navigational_formats) { redirect_to redirect_path }\n\n format.json do\n render json: session_resource(0, find_message(:signed_in), resource)\n end\n\n format.all { head :no_content }\n end\n end", "title": "" }, { "docid": "1c802cbe20c1785c7faba678629fd760", "score": "0.6401709", "text": "def devise_create\n build_resource\n\n if resource.save\n if resource.active_for_authentication?\n set_flash_message :notice, :signed_up if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_up_path_for(resource)\n else\n set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?\n expire_session_data_after_sign_in!\n respond_with resource, :location => after_inactive_sign_up_path_for(resource)\n end\n else # resource had errors ...\n prep_devise_new_view( @tenant, resource )\n end\n end", "title": "" }, { "docid": "ec10c20d25b680acce362156cfbc06dd", "score": "0.63975585", "text": "def create\n\n if(request.format == \"text/html\")\n super\n return\n else\n resource = warden.authenticate!(:scope => resource_name, :recall => \"#{controller_path}#failure\")\n sign_in_and_redirect(resource_name, resource)\n end\n end", "title": "" }, { "docid": "95cb5829391b8bef021530d7005c5055", "score": "0.6397516", "text": "def create\n if @user.valid_password?(sign_in_params[:password])\n sign_in \"user\", @user\n render json: {\n messages: \"Signed In Successfully\",\n is_success: true,\n data: {user: @user}\n }, status: :ok\n else\n render json: {\n messages: \"Signed In Failed - Unauthorized\",\n is_success: false,\n data: {}\n }, status: :unauthorized\n end\n end", "title": "" }, { "docid": "99725e9f73d97c73c4e30912abc6b7a7", "score": "0.639422", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:login_id])\n end", "title": "" }, { "docid": "fe7312e85dfb0970dba04647393b4dda", "score": "0.6393551", "text": "def create\n respond_to do |format|\n format.html { super }\n format.json do\n self.resource = warden.authenticate!(auth_options)\n resource.reset_authentication_token\n sign_in(resource_name, resource)\n data = {\n user_token: resource.authentication_token,\n user_email: resource.email\n }\n render json: data, status: 201\n end\n end\n end", "title": "" }, { "docid": "0118ef88b5bc57c574d0cfc635475ff8", "score": "0.639264", "text": "def resource_for_signin\n @user_for_signin ||= User.new_with_session({}, session)\n end", "title": "" }, { "docid": "7c9b2fab8551a9035c6333ae83eb0bd9", "score": "0.6386446", "text": "def create\n if params.fetch(:user).fetch(:facebook_id, nil)\n facebook_sign_in!\n else\n super\n end\n end", "title": "" }, { "docid": "84c7aadedad17bd1fcea1c37e6bae1ee", "score": "0.63860637", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n if self.resource.deleted_flg?\n set_flash_message!(:danger, :deleted_account)\n redirect_to root_path and return\n end\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "f94c4a916139fc4c9204445653c8fa49", "score": "0.63760835", "text": "def login\n before do \n @request.env[\"devise.mapping\"] = Devise.mappings[:user]\n @user = FactoryGirl.create(:user)\n sign_in @user\n end\n end", "title": "" }, { "docid": "9c21bf67e62f613c13cd3de47a29e1ad", "score": "0.63742864", "text": "def signin_params\n params.require(:signin).permit(:name, :company, :purpose)\n end", "title": "" }, { "docid": "e94007344824e869e843506f87dfbbd6", "score": "0.63714486", "text": "def before_POST(req)\n super\n @errors = validate_signin(@posted)\n get_signin(req) if has_errors?\n end", "title": "" }, { "docid": "050cacc09314fb03df1ecb4f7a9c151d", "score": "0.63669264", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << sign_in_params\n end", "title": "" }, { "docid": "ec76030f5169cc1b47732516f5504bba", "score": "0.63657856", "text": "def admin_sign_in\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n yield resource if block_given?\n respond_with(resource, serialize_options(resource))\n end", "title": "" }, { "docid": "9d4ea90e83baf26cbb48d177ad0061d8", "score": "0.6360924", "text": "def create \n @user = User.new(params[:user]) \n if @user.save \n sign_in @user\n flash[:success] = \"Welcome to the Sample App!\"\n redirect_to @user \n else \n render 'new' \n end \n end", "title": "" }, { "docid": "88e1559342b55c04f3b9d32e63da5105", "score": "0.636066", "text": "def configure_sign_in_params\n added_attrs = [:email, :username, :password, :password_confirmation, :remember_me]\n devise_parameter_sanitizer.permit :sign_in, keys: added_attrs\n end", "title": "" }, { "docid": "6cc6ab767d08efb69f07b3d82788d6b7", "score": "0.6357592", "text": "def create\n @user = User.new(user_params) # Not the final implementation!\n if @user.save\n sign_in @user\n redirect_to admin_stories_path\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "0f8bff8d4ebbd421464012df12f12423", "score": "0.6356865", "text": "def create\n super #Jala todas las clases de devise\n end", "title": "" }, { "docid": "e031551f6ce66f2539049b0e75186501", "score": "0.63546085", "text": "def after_sign_up_path_for(resource)\n super(resource)\n \"/users/sign_in\"\n end", "title": "" }, { "docid": "0f6b43e0bcfcb59bc94fe2552fa2845d", "score": "0.6353332", "text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n sign_in @user\n redirect_to user_path(current_user), notice: 'User was successfully created.'\n else\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "5969ddd84cd01732ff41b4e8ed63bc59", "score": "0.6345917", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n if !self.resource.role.admin?\n Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n return render :action => :new\n end\n sign_in(resource_name, resource)\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "12cce3bdf9eb56ea5ce65fe4c3a777eb", "score": "0.634313", "text": "def create\n # resource = warden.authenticate!(auth_options)\n resource = warden.authenticate!({:scope => :customer})\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "f70affd04864e61cf9f0e9d225d0286e", "score": "0.63383526", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "title": "" }, { "docid": "a85050d56822e099a64a508cb1c4703f", "score": "0.63334024", "text": "def new\n @user = User.new(email: sign_in_params[:email])\n end", "title": "" }, { "docid": "ec1ce07c74d2756f037eda78bddedf1e", "score": "0.63307035", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n \n current_user.update authentication_token: nil\n \n render :json => current_user, \n :meta => { :auth_token => current_user.authentication_token }\n end", "title": "" }, { "docid": "8862219e45e021e2c5df81399d8f6a21", "score": "0.63238084", "text": "def create\n build_resource\n\n if resource.save\n if resource.active_for_authentication?\n set_flash_message :notice, :signed_up if is_navigational_format?\n #sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_up_path_for(resource)\n else\n set_flash_message :notice, :\"signed_up_but_#{resource.inactive_message}\" if is_navigational_format?\n expire_session_data_after_sign_in!\n respond_with resource, :location => after_inactive_sign_up_path_for(resource)\n end\n else\n clean_up_passwords resource\n respond_with resource\n end\n end", "title": "" }, { "docid": "2c2fdd370da973cebf3e6d6062025c31", "score": "0.63177127", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource do |format|\n format.html { redirect_to after_sign_in_path_for(resource) }\n format.json do\n render json: {\n user: JWTWrapper.encode(resource.user_hash),\n token: JWTWrapper.encode({id: resource.id}),\n vessels_type: VesselType.all.as_json\n }\n end\n end\n end", "title": "" }, { "docid": "289b82eda97e74e8780b2dde9410347e", "score": "0.63113046", "text": "def custom_sign_up\n\t #Intancia al modelo User y llama al metodo from_omniauth y pasa los\n\t #parametros que requiere\n\t\t@user = User.from_omniauth(session[\"devise.auth\"])\n\t\t#Pregunta si existen los parametros\n\t\tif @user.update(user_params)\n\t\t \n\t\t\tsign_in_and_redirect @user, event: :authentication\n\t\telse\n\t\t\trender :edit\n\t\tend\n\tend", "title": "" }, { "docid": "fe1911feb331ad62bffea4c714f4bdf2", "score": "0.6309611", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys:[:email, :password, :remember_me])\n end", "title": "" }, { "docid": "ac84bad0f8945780c1701ae82dd60380", "score": "0.63031286", "text": "def sign_in\n User.delete_all\n User.create({name: 'MyString', email: 'MyString', password: '1234567a'})\n post login_url, params: { session: {email: 'MyString', password: '1234567a'} }\n end", "title": "" }, { "docid": "a87d6843786cfe854f7c5f478902b1dc", "score": "0.6299986", "text": "def create\n identity = Identity.authenticate(params[:session][:login],\n params[:session][:password])\n \n if identity.nil?\n logSigninFailure(params[:session][:login], current_identity)\n flash.now[:error] = I18n.translate('sessions.signin.flash.invalid')\n @title = I18n.translate('sessions.signin.title')\n render 'new'\n elsif identity.banned?\n logSigninFailure(params[:session][:login], current_identity)\n @title = I18n.translate('sessions.signin.title')\n flash.now[:error] = 'Der Account ist gesperrt.' #I18n.translate('sessions.signin.flash.invalid')\n render 'new'\n else\n logSigninSuccess(params[:session][:login], identity)\n sign_in identity\n redirect_back_or (staff? ? dashboard_path : identity)\n end\n end", "title": "" }, { "docid": "017227e88ba733a6b8a76cb3917d9fa2", "score": "0.62989223", "text": "def create\n # byebug\n super\n send_notification_log_in current_user\n end", "title": "" }, { "docid": "07cd2516375132250d63defdd3b61b89", "score": "0.62982756", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:login, :password])\n end", "title": "" }, { "docid": "bafba2e412718aa297861e527ac6bd37", "score": "0.6294759", "text": "def create\n @user = User.new(params[:user])\n \n\n respond_to do |format|\n if @user.save\n sign_in @user\n \n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcce0a37ef18061a6c07205aa7bf65cf", "score": "0.6290123", "text": "def create\n if verify_recaptcha\n # If verified then init devise create method as if nothing happened...\n super\n else\n # Otherwise send the student back to the new registration form.\n self.resource = resource_class.new sign_up_params\n respond_with_navigational(resource) { render :new }\n end\n end", "title": "" }, { "docid": "e2ff5cc3a96d1fa18bc87928c5d66ec1", "score": "0.6287759", "text": "def create\n @user = User.find_by(email: params[:email])\n if @user and @user.authenticate(params[:password])\n log_in(@user)\n redirect_to root_path\n else\n render :new # re-renders the sign in page\n end\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.62816364", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" } ]
a6216c8735e143a6fc455c8275e85897
Gets executed in child process to clean up file handles and pipes that the master holds.
[ { "docid": "a815c11722088d301e6d083a75d3b94d", "score": "0.7483118", "text": "def cleanup\n # Children dont need the parents signal handler\n unregister_signals\n \n # The child doesn't need the control pipe for now.\n control_pipe.each { |io| io.close }\n end", "title": "" } ]
[ { "docid": "fbe72b6b4616e7b3830f26483ee5061c", "score": "0.6883729", "text": "def clean_parent_file_descriptors\n ObjectSpace.each_object(File) {|f| f.close unless f.closed? rescue nil}\n return\n\n # Don't clean $stdin, $stdout, $stderr (0-2) or our own pipes\n keep = [ @child_write.to_i, @out.last.to_i, @err.last.to_i ]\n keep += @liveness_checker.fds if @liveness_checker\n\n 3.upto(8192) do |n|\n if !keep.include? n then\n begin\n fd = IO.for_fd(n)\n fd.close if fd\n rescue\n end\n end\n end\n end", "title": "" }, { "docid": "12ba06e8b52420a9fbe7335e2cf1bf0f", "score": "0.6856419", "text": "def cleanup\n stop unless @pipe_io.nil?\n FileUtils.rm_rf DATA_DIR\n end", "title": "" }, { "docid": "28c3a56e4fb803d4c89962643f4a741c", "score": "0.6805952", "text": "def freeResources() \n begin\n slave.close();\n if (interactIn != nil) \n interactIn.stopProcessing();\n end\n if (interactOut != nil) \n interactOut.stopProcessing();\n end\n if (interactErr != nil) \n interactErr.stopProcessing();\n end\n if (stderrSelector != nil) \n stderrSelector.close();\n end\n if (@stdoutSelector != nil)\n @stdoutSelector.close();\n end\n if (@toStdin != nil)\n @toStdin.close();\n end\n rescue\n # Cleaning up is a best effort operation, failures are\n # logged but otherwise accepted.\n log(\"Failed cleaning up after spawn done\");\n end\n end", "title": "" }, { "docid": "3bc319feb064fba4f1c0a0d808c93c27", "score": "0.67708415", "text": "def cleanup\n # Stop external processes etc.\n end", "title": "" }, { "docid": "d65f3cd7f2ed7c3305d081025a4d788b", "score": "0.65472066", "text": "def cleanup\n\t\tif @main_loop_thread\n\t\t\t@main_loop_thread_lock.synchronize do\n\t\t\t\t@graceful_termination_pipe[1].close rescue nil\n\t\t\tend\n\t\t\t@main_loop_thread.join\n\t\tend\n\t\t@server_sockets.each_value do |value|\n\t\t\taddress, type, socket = value\n\t\t\tsocket.close rescue nil\n\t\t\tif type == 'unix'\n\t\t\t\tFile.unlink(address) rescue nil\n\t\t\tend\n\t\tend\n\t\t@owner_pipe.close rescue nil\n\tend", "title": "" }, { "docid": "3da37adb0441f782249bb34db8251962", "score": "0.6541623", "text": "def close_pipes; end", "title": "" }, { "docid": "8fcdd39720b4925d8a4a783ff5fef81d", "score": "0.65134114", "text": "def cleanup\n @output_handle.close if @output_handle\n end", "title": "" }, { "docid": "e28db214100dd3238bf3cda41c873792", "score": "0.6494511", "text": "def cleanup\n handle.free\n end", "title": "" }, { "docid": "e28db214100dd3238bf3cda41c873792", "score": "0.6494511", "text": "def cleanup\n handle.free\n end", "title": "" }, { "docid": "996ac2acef6446b2abfeb55dfe129f59", "score": "0.64814806", "text": "def shutdown!\n Process.kill(\"TERM\", self.pid)\n rescue Errno::ESRCH\n # Already dead - do nothing\n nil\n ensure\n @pid = nil\n self.cleanup_files \n end", "title": "" }, { "docid": "39c7eff85e5259e2012f069719a2a919", "score": "0.6320113", "text": "def cleanup\n $stdout.puts \"Cleaning up...\\n\" if @is_debug\n @inotify.close\n exit 0\n end", "title": "" }, { "docid": "3a8a8078a82e8fca7191ebf8c2cf6de0", "score": "0.6277806", "text": "def close_pipes\n read.close unless read.closed?\n write.close unless write.closed?\n end", "title": "" }, { "docid": "3ae14e69139bbc6ae6519b61214e568a", "score": "0.6274386", "text": "def close\n @pipes.each { |pipe| pipe.close }\n @pipes = []\n @commands = {}\n end", "title": "" }, { "docid": "cc3ca29b5ee513806c3e87e17a84bba6", "score": "0.62378836", "text": "def cleanup_on_terminate\n child_processes.each { |pid| Process.kill('TERM', pid) if running?(pid) }\n end", "title": "" }, { "docid": "9ed347c4cfdd4008478bfca01c67289a", "score": "0.6203427", "text": "def notify_result\n result.process_died if result\n\n # The child is now officially dead, so we don't need these anymore: \n @master_pipe.close\n @child_pipe.close\n end", "title": "" }, { "docid": "0b2c16d37e3da4d6e8e59a2b1c4fa8ff", "score": "0.61774856", "text": "def run\n @inbound, @outbound = IO.pipe\n Signal.trap('CHLD') { dead_child }\n Signal.trap('INT') { interrupt }\n Signal.trap('TERM') { shutdown }\n Signal.trap('QUIT') { core_dump_quit }\n master_loop\n end", "title": "" }, { "docid": "0f5bcbff21ad15abca85a77efcfd150b", "score": "0.61744016", "text": "def close\n FlushFileBuffers(@pipe)\n DisconnectNamedPipe(@pipe)\n super\n end", "title": "" }, { "docid": "8ad23a3a6398c16bc9a1d59df3b94b85", "score": "0.6151414", "text": "def destroy\n @destroyed = true\n @stdout.close if @stdout && !@stdout.closed?\n @stdin.close if @stdin && !@stdin.closed?\n @stderr.close if @stderr && !@stderr.closed?\n\n # Respond to any waiting queues to avoid locking those threads.\n return unless @responses\n\n @responses.each_values do |queue|\n queue.push(::PhpProcess::DestroyedError.new)\n end\n end", "title": "" }, { "docid": "c834739df0b652e0183536dd5551c999", "score": "0.6149226", "text": "def cleanup\n\t\tif @main_loop_thread\n\t\t\t@main_loop_thread.raise(Interrupt.new(\"Cleaning up\"))\n\t\t\t@main_loop_thread.join\n\t\tend\n\t\t@socket.close rescue nil\n\t\t@owner_pipe.close rescue nil\n\t\tFile.unlink(@socket_name) rescue nil\n\tend", "title": "" }, { "docid": "3dd21173861a7828c008afbf91c8d1bf", "score": "0.6131802", "text": "def close\n if @pipe\n @pipe.close\n @pipe = nil\n elsif @pid # only when parent has forked the plot handler\n Process.kill(\"TERM\", @pid)\n Process.wait(@pid)\n @pid = nil\n else\n raise \"can't close plot\"\n end\n @files = nil # let tempfiles be GC-ed and deleted\n end", "title": "" }, { "docid": "b08c5dad6d80e1e26fb74cfad360cc6a", "score": "0.61263937", "text": "def manage_process!\n unless(@process_manager)\n unless(@io_callbacks.empty?)\n io_stdout = @stdout\n io_stderr = @stderr\n @stdout = @stderr = :managed_io\n end\n @process_manager = Thread.new do\n if(io_stdout && io_stderr)\n while(waiter.alive?)\n IO.select([io_stdout, io_stderr])\n [io_stdout, io_stderr].each do |io|\n begin\n content = io.read_nonblock(102400)\n type = io == io_stdout ? :stdout : :stderr\n @cached_output[type] << content\n content = content.split(\"\\n\")\n @io_callbacks.each do |callback|\n content.each do |line|\n callback.call(line, type)\n end\n end\n rescue IO::WaitReadable, EOFError\n # ignore\n end\n end\n end\n end\n result = waiter.value\n @complete_callbacks.each do |callback|\n callback.call(result, self)\n end\n MiasmaTerraform::Stack.deregister_action(self)\n result\n end\n end\n end", "title": "" }, { "docid": "026a21269ddbef2003401f7191853969", "score": "0.60874057", "text": "def setup_cleanup\n at_exit do\n utils.logger.info 'Exiting'\n SubprocessLoop.kill_all\n end\n end", "title": "" }, { "docid": "782b203579e7e84951aa9570d68d7b55", "score": "0.6052581", "text": "def clean\n FileUtils.rm_f(cli.options[:pid]) if cli.options[:pid]\n end", "title": "" }, { "docid": "0a00030e356d930051e1bc72756b802c", "score": "0.60257834", "text": "def cleanup\n process_ids = File.read(\"#{Rails.root.to_s}/tmp/pids/active_forks.csv\").split(\"\\n\").map(&:to_i)\n left = []\n if process_ids\n process_ids.each do |id|\n left = kill_process(id, left)\n end\n else\n puts \"Could not find processes to kill!\"\n end\n File.open(\"#{Rails.root.to_s}/tmp/pids/active_forks.csv\", \"w\") do |f|\n left.each do |l|\n f.write \"#{l}\\n\"\n end\n end \n end", "title": "" }, { "docid": "168b19240c9af0928fa9b308f5e453f6", "score": "0.6023888", "text": "def clean\n # unlock files \n end", "title": "" }, { "docid": "afe50fe10b83b8217858a93744341ec5", "score": "0.6019227", "text": "def close\n pipe.close\n end", "title": "" }, { "docid": "42f6e0c55b1a5efa76811232052d5ccd", "score": "0.5992222", "text": "def cleanup_defunct\n loop do\n begin\n Process.wait 0\n rescue Errno::ECHILD\n sleep 10\n retry\n end\n end\n end", "title": "" }, { "docid": "9c484006b664e71bf6179721c9a15a16", "score": "0.5974948", "text": "def finalize()\n\t\t\t\t\tif @file_open\n\t\t\t\t\t\t@hndl.close()\n\t\t\t\t\tend\n\t\t\t\tend", "title": "" }, { "docid": "cc94bcf55d132dd7a8ac65ddecd0933f", "score": "0.5964573", "text": "def execute\n ctrl_read, ctrl_write, fork_read, parent_write, parent_read, fork_write = nil\n\n fork_read, parent_write = binary_pipe if @flags[:to_fork]\n parent_read, fork_write = binary_pipe if @flags[:from_fork]\n ctrl_read, ctrl_write = binary_pipe if @flags[:ctrl]\n\n @alive = true\n\n pid = Process.fork do\n @parent = false\n parent_write.close if parent_write\n parent_read.close if parent_read\n ctrl_read.close if ctrl_read\n complete!(Process.pid, fork_read, fork_write, ctrl_write)\n\n child_process\n end\n\n fork_write.close if fork_write\n fork_read.close if fork_read\n ctrl_write.close if ctrl_write\n complete!(pid, parent_read, parent_write, ctrl_read)\n\n self\n end", "title": "" }, { "docid": "ea56cf82b858e2bd5c83bbb153956742", "score": "0.5954452", "text": "def cleanup\n File.delete(@pidFile) if File.exists? @pidFile\n @pid = nil\n end", "title": "" }, { "docid": "aeeb522731d03094ca1e17cbfa26fbfc", "score": "0.59233713", "text": "def cleanup\n # Remove temp files? Or is this ONLY called in destroy (in which case those files will go anyway...)\n end", "title": "" }, { "docid": "50c7bc5c42a11cb0e2efd5bfd02cbff0", "score": "0.59185636", "text": "def close_on_exec(file); end", "title": "" }, { "docid": "da78f0611a3f258f40a55c404487df1c", "score": "0.59063", "text": "def finalize\n\t\t@log.close\n\t\t@temp_handle.unlink\n\tend", "title": "" }, { "docid": "3c48db4e7da0dfec603310250722442e", "score": "0.58664685", "text": "def clean_up_signal_handling( reactor )\n\t\treactor.unregister( @self_pipe[:reader] )\n\n\t\t@self_pipe[:writer].options.linger = 0\n\t\t@self_pipe[:writer].close\n\t\t@self_pipe[:reader].options.linger = 0\n\t\t@self_pipe[:reader].close\n\n\t\tThread.main[ SIGNAL_QUEUE_KEY ].clear\n\tend", "title": "" }, { "docid": "4054a42892774fb9267aa8dbc13d09ce", "score": "0.5856925", "text": "def cleanup_files\n FileUtils.rm(pid_path)\n FileUtils.rm_rf(db_path)\n end", "title": "" }, { "docid": "5d8828b949248a5bfac9988c3b6285dd", "score": "0.5849333", "text": "def finalize\n\t\treturn if @handle.nil?\n\n\t\tCorosync.cs_send(:quorum_finalize, @handle)\n\n\t\t@handle = nil\n\t\t@fd = nil\n\tend", "title": "" }, { "docid": "235bb795223712878a615019e4ae0b19", "score": "0.5844556", "text": "def cleanup\n @reader.join if @reader\n @io.close if @io && !@io.closed?\n end", "title": "" }, { "docid": "aeb9c5682d24b55b73bb73877a593c19", "score": "0.58410233", "text": "def cleanup; end", "title": "" }, { "docid": "aeb9c5682d24b55b73bb73877a593c19", "score": "0.58410233", "text": "def cleanup; end", "title": "" }, { "docid": "aeb9c5682d24b55b73bb73877a593c19", "score": "0.58410233", "text": "def cleanup; end", "title": "" }, { "docid": "aeb9c5682d24b55b73bb73877a593c19", "score": "0.58410233", "text": "def cleanup; end", "title": "" }, { "docid": "273b5f7678efaef7b64bd38aefd8b813", "score": "0.58395356", "text": "def remove_all_children\n process_is :running do\n Process.kill('WINCH', pid)\n end\n end", "title": "" }, { "docid": "3a62a500808c6095871d824aaea39fd3", "score": "0.58347684", "text": "def cleanup\n\t\t@spawners.cleanup\n\tend", "title": "" }, { "docid": "3a62a500808c6095871d824aaea39fd3", "score": "0.58347684", "text": "def cleanup\n\t\t@spawners.cleanup\n\tend", "title": "" }, { "docid": "b7c0359c4b35bd86aaad94d85ce0cf0f", "score": "0.5833043", "text": "def cleanup(*) end", "title": "" }, { "docid": "394548a416e5a8e784c2439b423f6155", "score": "0.5831173", "text": "def clean\n CommandProcessor.command(\"rm -rf dist\")\nend", "title": "" }, { "docid": "1072735002f428f2e5a73b0247935609", "score": "0.58259445", "text": "def cleanup!; end", "title": "" }, { "docid": "1072735002f428f2e5a73b0247935609", "score": "0.58259445", "text": "def cleanup!; end", "title": "" }, { "docid": "1072735002f428f2e5a73b0247935609", "score": "0.58259445", "text": "def cleanup!; end", "title": "" }, { "docid": "d8cc8eb9381856940eb117057396ac0f", "score": "0.5812616", "text": "def cleanup\n log(:info, \"#{self.class}, Cleanup called, exiting reactor loop.\")\n @proc_queue_mutex.synchronize { @proc_queue.clear }\n\n # work on a dup since #close_socket deletes from @sockets\n @sockets.dup.each { |sock| close_socket sock }\n @context.terminate unless shared_context?\n @running = false\n end", "title": "" }, { "docid": "56880dd6ef8e2d94c8f0ded07ef08e6e", "score": "0.5802566", "text": "def close!\n _close\n @clean_proc.call\n ObjectSpace.undefine_finalizer(self)\n @data = @tmpname = nil\n end", "title": "" }, { "docid": "c7e05c748c4bca69806c371f3f2dae67", "score": "0.58003944", "text": "def cleanup\n @tempfiles = nil\n end", "title": "" }, { "docid": "c8cebb4a08f7e66c72c84a6f3d0eb9a9", "score": "0.58002245", "text": "def fork_and_unshare\n io_in, io_out = IO.pipe\n\n LibC.prctl(FrrCliFuzzer::LibC::PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0)\n\n pid = Kernel.fork do\n LibC.unshare(LibC::CLONE_NEWNS | LibC::CLONE_NEWPID | LibC::CLONE_NEWNET)\n\n # Fork again to use the new PID namespace.\n # Need to supress a warning that is irrelevant for us.\n warn_level = $VERBOSE\n $VERBOSE = nil\n pid = Kernel.fork do\n # HACK: kill when parent dies.\n trap(:SIGUSR1) do\n LibC.prctl(LibC::PR_SET_PDEATHSIG, 15, 0, 0, 0)\n trap(:SIGUSR1, :IGNORE)\n end\n LibC.prctl(LibC::PR_SET_PDEATHSIG, 10, 0, 0, 0)\n\n mount_propagation(LibC::MS_REC | LibC::MS_PRIVATE)\n mount_proc\n yield\n end\n $VERBOSE = warn_level\n io_out.puts(pid)\n exit(0)\n end\n\n @pid = io_in.gets.to_i\n Process.waitpid(pid)\n rescue SystemCallError => e\n warn \"System call error:: #{e.message}\"\n warn e.backtrace\n exit(1)\n end", "title": "" }, { "docid": "537c3debc5e17c985bf788c4813d2a32", "score": "0.578765", "text": "def stop\n wait_for_the_end # do all our waiting outside the sync loop\n Shrimple.processes._remove(self) do\n _cleanup\n end\n end", "title": "" }, { "docid": "b038bd70e024c431c8c8918a1a32ddad", "score": "0.57840323", "text": "def finalize_streams\n [@stdin, @stdout, @stderr].each { |s| s.close }\n @stdin = nil\n @stdin_io = nil\n @stdout = nil\n @stderr = nil\n end", "title": "" }, { "docid": "fc4a431ecd8a12aadd49a6a6a8078255", "score": "0.57673484", "text": "def nfs_cleanup\n end", "title": "" }, { "docid": "f4df929f3f3db1a9223595ea94d772f3", "score": "0.5748694", "text": "def daemonize\n fork do\n Process.setsid\n exit if fork\n Dir.chdir('/tmp')\n STDIN.reopen('/dev/null')\n STDOUT.reopen('/dev/null', 'a')\n STDERR.reopen('/dev/null', 'a')\n\n yield\n end\nend", "title": "" }, { "docid": "bd21389b89b9c43c9fc6552d061c002f", "score": "0.57481295", "text": "def finalize\n if @done\n $log.debug { \"Finalize called on #{@package_id}\" }\n IsaacUploader::TaskHolder.instance.delete(@package_id) #no memory leaks, no race conditions!\n #this relinquishes all handles to our tasks. There should be no memory leaks.\n end\n end", "title": "" }, { "docid": "aaae47f93a9eee1fc495d21f6c03fab8", "score": "0.57448345", "text": "def close()\n if (spawnErrToSystemErr != nil) \n spawnErrToSystemErr.stopProcessing();\n end\n if (spawnOutToSystemOut != nil)\n spawnOutToSystemOut.stopProcessing();\n end\n if (systemOut != nil) \n begin\n systemOut.sink().close();\n rescue\n puts \"Closing stdout sink failed\"\n end\n begin\n systemOut.source().close();\n rescue\n puts \"Closing stdout source failed\"\n end\n end\n if (@systemErr != nil) \n begin\n @systemErr.sink().close();\n rescue\n puts \"Closing stderr sink failed\"\n end\n begin\n @systemErr.source().close();\n rescue\n puts \"Closing stderr source failed\"\n end\n end\n end", "title": "" }, { "docid": "8277d2bcb74c930552b795b703ef6a79", "score": "0.5742236", "text": "def cleanup\n end", "title": "" }, { "docid": "8277d2bcb74c930552b795b703ef6a79", "score": "0.5742236", "text": "def cleanup\n end", "title": "" }, { "docid": "cd8d3a034512a1ad2ec7a9729ac72801", "score": "0.5741965", "text": "def destroy_connection\r\n begin\r\n #kill the CDB process\r\n @stdin.close\r\n @stdout.close\r\n @stderr.close\r\n Process.kill( 9, @pid )\r\n rescue\r\n nil\r\n end\r\n end", "title": "" }, { "docid": "c7af80f1f68720c8484de404777cb415", "score": "0.57389915", "text": "def cleanup\n return unless File.exist?(pid_file_path)\n File.delete(pid_file_path)\n end", "title": "" }, { "docid": "fb04dd4728d4840586576ec1319843ed", "score": "0.5727974", "text": "def cleanup_ssh\n self.fs.sftp.cleanup unless self.fs.nil? or self.fs.sftp.nil?\n ext.aliases.each_value do | extension |\n\t\t\textension.cleanup if extension.respond_to?( 'cleanup' )\n\t\tend\n self.thread.kill\n self.ssh.close\n\n\tend", "title": "" }, { "docid": "e5986e520de5cd1818605417e6b306c5", "score": "0.5723333", "text": "def stop\n @reader.exit\n @engine.close_write # tork-engine(1) exits when its STDN is closed\n @engine.close # wait for process to exit and reap its zombie\n end", "title": "" }, { "docid": "970faf0c4501895c6c446575cc812c5e", "score": "0.5719319", "text": "def on_cleanup; end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "43f80604a4d9537a487e7d3d08fe9646", "score": "0.5714832", "text": "def cleanup\n end", "title": "" }, { "docid": "e54b8a530c1b8812cc893bc3e59c0d37", "score": "0.5706179", "text": "def close\n return if @closed\n\n run_command\n @output_stream.close\n @closed = true\n @file_name\n end", "title": "" }, { "docid": "1d3444aa931c27609b16cda6fe199283", "score": "0.5701303", "text": "def cleanup\r\n\t\tsuper\r\n\r\n\t\t# Kill FTP\r\n\t\tstop_service()\r\n\r\n\t\t# clear my resource, deregister ref, stop/close the HTTP socket\r\n\t\tbegin\r\n\t\t\t@http_service.remove_resource(datastore['URIPATH'])\r\n\t\t\t@http_service.deref\r\n\t\t\t@http_service.stop\r\n\t\t\t@http_service.close\r\n\t\t\t@http_service = nil\r\n\t\trescue\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "0e5fac0fb31bba0e32a33d12094038dd", "score": "0.5696919", "text": "def cleanup\n stop if @started\n FileUtils.rm_rf(@temp_dir)\n @prepared = false\n end", "title": "" }, { "docid": "fd005ebb014749b102ee85f0390e3419", "score": "0.569688", "text": "def fork_and_unshare\n begin\n io_in, io_out = IO.pipe\n\n pid = Kernel.fork do\n unshare(LibC::CLONE_NEWNS | LibC::CLONE_NEWPID | LibC::CLONE_NEWNET)\n\n # Fork again to use the new PID namespace.\n # Need to supress a warning that is irrelevant for us.\n warn_level = $VERBOSE\n $VERBOSE = nil\n pid = Kernel.fork do\n # HACK: kill when parent dies\n trap(:SIGUSR1) do\n LibC.prctl(LibC::PR_SET_PDEATHSIG, 15, 0, 0, 0)\n trap(:SIGUSR1, :IGNORE)\n end\n LibC.prctl(LibC::PR_SET_PDEATHSIG, 10, 0, 0, 0)\n\n mount_propagation(LibC::MS_REC | LibC::MS_PRIVATE)\n mount_proc\n yield\n end\n $VERBOSE = warn_level\n io_out.puts \"#{pid}\"\n exit(0)\n end\n\n @pid = io_in.gets.to_i\n Process.waitpid(pid)\n rescue SystemCallError => e\n $stderr.puts \"System call error:: #{e.message}\"\n $stderr.puts e.backtrace\n exit(1)\n end\n end", "title": "" }, { "docid": "54935c2590c6a93b4fce9c057d5466b9", "score": "0.5672663", "text": "def cleanup()\n stop(nil, nil)\n end", "title": "" }, { "docid": "8317285284654e8e288a1191cc6c3e7d", "score": "0.5666985", "text": "def detach\n for drb_process in @druby_process_list\n drb_process.latch_write_io.close\n end\n\n nil\n end", "title": "" }, { "docid": "1b56a0af0e31d6f080f08defc991c218", "score": "0.56604", "text": "def cleanup\n # Unmount image file.\n if self.is_disk_image?\n unmount('%s/sys' % IMG_MNT)\n unmount('%s/proc' % IMG_MNT)\n unmount('%s/dev' % IMG_MNT)\n end\n\n unmount(IMG_MNT)\n if self.is_disk_image? and @diskdev\n diskname = File.basename(@diskdev)\n execute('kpartx -d %s' % @diskdev)\n execute('dmsetup remove %s' % diskname)\n execute('losetup -d %s' % @diskloop)\n end\n end", "title": "" }, { "docid": "66b121922d051f37d189e8fdf89ac368", "score": "0.5659286", "text": "def unix_cleanup\n pre_step 'mount proc -t proc /mnt/migration_target/proc'\n pre_step 'mount /dev /mnt/migration_target/dev -o rbind'\n pre_step 'mount /sys /mnt/migration_target/sys -o rbind'\n\n chroot_step 'find /var/run -type f -exec rm {} \\;'\n\n post_step 'umount /mnt/migration_target/sys'\n post_step 'umount /mnt/migration_target/dev'\n post_step 'umount /mnt/migration_target/proc'\n end", "title": "" }, { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.56566447", "text": "def cleanup\n end", "title": "" }, { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.56566447", "text": "def cleanup\n end", "title": "" }, { "docid": "4ebaeccf74d873259df9d9262957f0ba", "score": "0.56485605", "text": "def close\n super\n @read_pool = nil\n @secondary_pools.each do |pool|\n pool.close\n end\n @secondaries = []\n @secondary_pools = []\n @arbiters = []\n @nodes_tried = []\n @nodes_to_try = []\n end", "title": "" }, { "docid": "bd2427c1aa066459bd12ea7b554fe176", "score": "0.56476", "text": "def cleanup\n shutdown\n close_log\n unlink_log\n end", "title": "" }, { "docid": "1eb111843e87aaab841f9f6e876d97ad", "score": "0.5637998", "text": "def on_child_exit( pid, status )\n\t\tself.workers.delete( pid )\n\t\tself.adjust_throttle( status.success? ? -1 : 1 )\n\tend", "title": "" }, { "docid": "c39ece5bda9374108c9d8e937793e64f", "score": "0.5636149", "text": "def cleanup\n entry.close\n logger.info \"Job cleaned up\"\n end", "title": "" }, { "docid": "e78bb282ad478711a6b4be4d893ad677", "score": "0.56351024", "text": "def reset\n @server = nil\n @children.each { |pid, child| child.heartbeat_file.close}\n @children.clear\n end", "title": "" }, { "docid": "fc8f94a674cb4429023bd856c3b88af8", "score": "0.5622175", "text": "def cleanup()\n @command_array.clear\n @command_array = nil\n @copy_targets.clear\n @copy_targets = nil\n @mkdir_targets.clear\n @mkdir_targets = nil\n @permission_targets.clear\n @permission_targets = nil\n end", "title": "" }, { "docid": "2b87175c5f0e37da23c6906395184d1d", "score": "0.56220263", "text": "def dealloc()\n\n\t\t# and disconnect\n\t\t@oSerial.dealloc() if !@oSerial.nil?\n\t\t@oSerial = nil\n\n\t\tputs 'OK:Serial disconnected'\n\n\t\t@oEthernet.dealloc() if !@oEthernet.nil?\n\t\t@oEthernet = nil\n\n\t\t@oIOframeHandler.dealloc() if !@oIOframeHandler.nil?\n\t\t@oIOframeHandler = nil\n\n\t\tputs 'OK:Ethernet disconnected'\n\n\t\t@aPipes.each { |oPipe| oPipe.dealloc() } if !@aPipes.nil?\n\t\t@aPipes = nil\n\n\t\tputs 'OK:Triggers halted'\n\n\t\t# remove output log?\n\n\t\t# shutdown EventMachine\n\t\tEM::stop_event_loop()\n\n\t\t# remove pid file\n\t\tsPathFilePID = self.get(:pathFilePID, @@_defaultPathFilePID)\n\t\tFile.delete(sPathFilePID) if File.exists? sPathFilePID\n\n\t\tputs 'OK:PID file removed from ' << sPathFilePID\n\n\t\tputs 'Good Bye - Enjoy Life'\n\n\t\t# and quit\n\t\texit! true\n\n\t\tnil\n\n\tend", "title": "" }, { "docid": "360df957fc17632a6cccb88153549bae", "score": "0.5618809", "text": "def cleanup(host)\n @logger.debug { \"Cleaning up: #{host.name}\" }\n stop_drb_server(host)\n cleanup_files(host)\n end", "title": "" }, { "docid": "ebd3876fea067cb6118c1329d78eafb5", "score": "0.5610287", "text": "def cleanup\n @host.cleanup\n communicate.execute(\"test -f #{tmp_path} && rm #{tmp_path}\", :error_check => false) do |type, data|\n env.ui.error(data.chomp, :prefix => false)\n end\n end", "title": "" }, { "docid": "4da3b95688305a80964a8f45146b2e0a", "score": "0.5604912", "text": "def cleanup\n\t\t@capture_thread.kill if @capture_thread && @capture_thread.alive?\n\t\t@capture_file.close if @capture_file.respond_to? :close\n\t\tremove_console_dispatcher('PcapLog')\n\tend", "title": "" }, { "docid": "33190acaabdbe522b49026d2bf0d29a3", "score": "0.56006575", "text": "def destroy\n @process.send(\"obj\" => {\"type\" => \"exit\"})\n @err_thread.kill if @err_thread\n @process.destroy\n \n begin\n Process.kill(\"TERM\", @pid)\n rescue Errno::ESRCH\n #Process is already dead - ignore.\n end\n \n begin\n sleep 0.1\n process_exists = Knj::Unix_proc.list(\"pids\" => [@pid])\n raise \"Process exists.\" if !process_exists.empty?\n rescue => e\n raise e if e.message != \"Process exists.\"\n \n begin\n Process.kill(9, pid) if process_exists\n rescue Errno::ESRCH => e\n raise e if e.message.index(\"No such process\") == nil\n end\n \n #$stderr.print \"Try to kill again...\\n\"\n #retry\n end\n \n @process = nil\n @stdin = nil\n @stdout = nil\n @stderr = nil\n @objects = nil\n @args = nil\n end", "title": "" }, { "docid": "caaa82b911d260b8ef5500f5cb117b34", "score": "0.55972505", "text": "def cleanup\n end", "title": "" }, { "docid": "caaa82b911d260b8ef5500f5cb117b34", "score": "0.55972505", "text": "def cleanup\n end", "title": "" }, { "docid": "c0cecf6a1ab03df50c571d95245a0612", "score": "0.5595638", "text": "def cleanup\n stop\n end", "title": "" }, { "docid": "39a2b3db2cefaa1af1c4ece29d2b5026", "score": "0.55890596", "text": "def cleanup\r\n puts \"standard cleanup\"\r\n end", "title": "" }, { "docid": "39a2b3db2cefaa1af1c4ece29d2b5026", "score": "0.55890596", "text": "def cleanup\r\n puts \"standard cleanup\"\r\n end", "title": "" }, { "docid": "39a2b3db2cefaa1af1c4ece29d2b5026", "score": "0.55890596", "text": "def cleanup\r\n puts \"standard cleanup\"\r\n end", "title": "" }, { "docid": "497d5b7bc48ca9446fae4af6ac0e7d79", "score": "0.55840456", "text": "def close_files\n end", "title": "" } ]
8330910e3a886ec9685d5aeb359664a1
PUT /admin/news/1 PUT /admin/news/1.xml
[ { "docid": "46d36975e087f64d9be46001adf10410", "score": "0.67729366", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to([:admin, @news], notice: 'News was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated news: #{@news.title}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "0a87d45871c7a2d224ddb55f3536c546", "score": "0.6790157", "text": "def update\n respond_to do |format|\n if @news.update_attributes(news_params)\n format.html { redirect_to([:admin, @news], notice: 'News was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated news: #{@news.title}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47cac41732e724c77a57528ed7990816", "score": "0.6704138", "text": "def update\n @admin_news = Admin::News.find(params[:id])\n\n respond_to do |format|\n if @admin_news.update_attributes(params[:admin_news])\n format.html { redirect_to @admin_news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a144919827996127339e00fb1722bae", "score": "0.6599649", "text": "def update\n @az_news = AzNews.find(params[:id])\n\n respond_to do |format|\n if @az_news.update_attributes(params[:az_news])\n flash[:notice] = 'Новость успешно обновлена.'\n format.html { redirect_to(@az_news) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @az_news.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe950b8b0fce145fd66896d080e7f72f", "score": "0.6576198", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2dd413232b53158cc7eaf57b6aa6897", "score": "0.65292966", "text": "def update\n respond_to do |format|\n if @news_article.update_attributes(params[:news_article])\n flash[:notice] = 'NewsArticle was successfully updated.'\n format.html { redirect_to(admin_news_article_path(@news_article)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_article.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.6517865", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "fe9358f2cb16d8fdf5d5820de0ee0050", "score": "0.6449806", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to admin_news_path(@news), flash: { success: 'Новость была успешно обновлена' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd8fb7347e287d89bbe29d2cfabb09c8", "score": "0.64045036", "text": "def update\n @new = News.find(params[:id])\n\n respond_to do |format|\n if @new.update_attributes(params[:news])\n format.html { redirect_to [:admin,@new], notice: t(\"helpers.notice.update\") }\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "30fe84b4371fff11a99c4fb077a1321f", "score": "0.6353382", "text": "def update\n respond_to do |format|\n if @admin_news.update(admin_news_params)\n format.html { redirect_to @admin_news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_news }\n else\n format.html { render :edit }\n format.json { render json: @admin_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e69dbf70ab9181cf791084395a165735", "score": "0.63492763", "text": "def update\n respond_to do |format|\n if @admin_news.update(admin_news_params)\n format.html { redirect_to [:admin, @admin_news], notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_news }\n else\n format.html { render :edit }\n format.json { render json: @admin_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3a79c886d6db0be610531d244ef57a1", "score": "0.63401526", "text": "def update\n respond_to do |format|\n if @news.update(admin_news_params)\n format.html { redirect_to admin_news_index_url, notice: 'news was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8c23e378b7d129d565a2f75257de8a1", "score": "0.6331485", "text": "def update\n respond_to do |format|\n if @admin_news.update(admin_news_params)\n format.html { redirect_to @admin_news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24a287a5b449ea04d141602547d717ab", "score": "0.6321468", "text": "def update\n @newsarticle = Newsarticle.find(params[:id])\n\n respond_to do |format|\n if @newsarticle.update_attributes(params[:newsarticle])\n format.html { redirect_to(@newsarticle, :notice => 'Newsarticle was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @newsarticle.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11e75f755fee3dc527cb82fb281b6779", "score": "0.630545", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to news_index_url, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "512109168d1fe5e6db51078dde2a09a6", "score": "0.6304369", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to admin_news_index_path, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f43d79cb8ce757f5e82d8476fd01962", "score": "0.628719", "text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.6260469", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "624ad5405210ea447c656245d3274b8d", "score": "0.62491715", "text": "def update\n @news = News.find(params[:id])\n if authorized_for @news\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to :back, :notice => 'Nemate dovoljno prava za ovu akciju.'\n end\n end", "title": "" }, { "docid": "3f327c53e6ce951b05557a9af55b6454", "score": "0.6245167", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d74eb2f67bf22bcaa7207f574d56e85", "score": "0.6242589", "text": "def update\n @news_item = current_district.administers.news.find(params[:id])\n @news_item.attributes = params[:news_item]\n\n respond_to do |format|\n if @news_item.save\n flash[:notice] = 'NewsItem was successfully updated.'\n format.html { redirect_to(root_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61246828e0f9e844035d527e99278bbe", "score": "0.6239684", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61246828e0f9e844035d527e99278bbe", "score": "0.6239684", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61246828e0f9e844035d527e99278bbe", "score": "0.6239684", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05ef978fb120fc85eabf35df4ae204a1", "score": "0.62350774", "text": "def changeinfo\n\n @news = SiteInfo.find_by(id: params[:id])\n @news.update_attribute(:title , params[:news][:title])\n @news.update_attribute(:subtitle , params[:news][:subtitle])\n @news.update_attribute(:description , params[:news][:description])\n @news.update_attribute(:image , params[:news][:image])\n @news.update_attribute(:image2 , params[:news][:image2])\n @news.update_attribute(:position , params[:news][:position])\n \n redirect_to \"/admin\"\n end", "title": "" }, { "docid": "1b4f3137254454eabba627a1c17575e1", "score": "0.62345344", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to :action => 'index', notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e734e4d0e5d8b870b6ce4303620906e4", "score": "0.6218122", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to admin_news_path(@news), notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.news', count: 1)) }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.6206227", "text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "title": "" }, { "docid": "6cd135c7d040bde7b1f68a867ae05091", "score": "0.6202658", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to news_path, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2de77309be75036400fbed43ec337382", "score": "0.61880404", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to @news, notice: 'Новость изменена.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73a94935414faefa0720336b9e1e29a8", "score": "0.6175109", "text": "def update\n respond_to do |format|\n if @admin_news.update(news_params)\n format.html { redirect_to [:admin, @admin_news], notice: 'News was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.61609614", "text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "title": "" }, { "docid": "568bab295dea1d19a9883fa97ba3fd9b", "score": "0.61392754", "text": "def update\n \n set_publishable_params(params[:news], @news)\n \n @news.assign_attributes(news_params)\n \n respond_to do |format|\n if @news.save\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa432dce1e81b35b23249d0e49c2dd51", "score": "0.6133678", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n flash[:success] = 'Новость успешно обновлена!'\n format.html { redirect_to root_path }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f568f5eae1b91f8faf1e229d11877f4e", "score": "0.61111355", "text": "def changenews\n\n@news = News.find_by(id: params[:id])\n@news.update_attribute(:title , params[:news][:title])\n@news.update_attribute(:description , params[:news][:description])\n@news.update_attribute(:image1 , params[:news][:image1])\n@news.update_attribute(:image2 , params[:news][:image2])\n@news.update_attribute(:position , params[:news][:position])\n\nredirect_to \"/admin\"\nend", "title": "" }, { "docid": "db0807154c308eaa8f64a7dd246ea649", "score": "0.60988027", "text": "def update\n @news_item = NewsItem.find(params[:id])\n\n respond_to do |format|\n if @news_item.update_attributes(params[:news_item])\n flash[:notice] = 'News item was successfully updated.'\n format.html { redirect_to(news_path(@news_item)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7a0172fcdc068ffaab48df297de8ff6", "score": "0.6090621", "text": "def update\n @new = New.find(params[:id])\n\n respond_to do |format|\n if @new.update_attributes(params[:new])\n flash[:notice] = 'New was successfully updated.'\n format.html { redirect_to(admin_news_index_path) }\n #format.html { redirect_to(@new) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @new.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.6084993", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "12764b11bf209b1112adf0e9276f8df4", "score": "0.60788786", "text": "def update\n @news = news.find(params[:id])\n\n if @news.update_attributes(params[:news])\n redirect_to news_index_path, notice: '动态信息更新成功.'\n else\n render action: \"edit\"\n end\n end", "title": "" }, { "docid": "229772518530ccb21f2f9037951475e3", "score": "0.6069498", "text": "def update\n respond_to do |format|\n if @manage_news.update(manage_news_params)\n format.html { redirect_to @manage_news, notice: 'Manage news was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @manage_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e291907414aa8a00dfcced97dc51e35e", "score": "0.60669434", "text": "def set_news\n @admin_news = News.find(params[:id])\n end", "title": "" }, { "docid": "9ddf960eb3f437e62b9b99d34992bc0f", "score": "0.605732", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "2db8510634a8588feaf130b0ace4c384", "score": "0.6053268", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "03f41c3e7a60cb19911822987d06b9e6", "score": "0.6042548", "text": "def update\n respond_to do |format|\n if @new.update(news_params)\n format.html { redirect_to [:admin, @new], notice: '新闻更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @new.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03f41c3e7a60cb19911822987d06b9e6", "score": "0.6042548", "text": "def update\n respond_to do |format|\n if @new.update(news_params)\n format.html { redirect_to [:admin, @new], notice: '新闻更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @new.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6868b02f1df4f742b25bb5f12639eca8", "score": "0.6037669", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: t('update_success') }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b31f30c4a6d8f92f9aef6c923b8cb0d1", "score": "0.6035836", "text": "def set_admin_news\n @admin_news = ::News.find(params[:id])\n end", "title": "" }, { "docid": "6894cf242dfd880f7a5cb072fe70d351", "score": "0.6033515", "text": "def update\n @News = News.find(params[:id])\n\n if @News.update(tl_params)\n head :no_content\n else\n render json: @News.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "81f34cd4b1d4585e39c794960ce5310e", "score": "0.602422", "text": "def set_admin_news\n @admin_news = News.find(params[:id])\n end", "title": "" }, { "docid": "9909f4cf723382e67b3ba2fa7e49ef45", "score": "0.6021187", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(news_params)\n format.html do\n redirect_to @news,\n notice: 'News was successfully updated.'\n end\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: 'show' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27096800d14893529f640b6cf4566aba", "score": "0.6010033", "text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end", "title": "" }, { "docid": "2fce2c94105654684f58611b39c888f3", "score": "0.5995754", "text": "def update\n respond_to do |format|\n if @create_news.update(create_news_params)\n format.html { redirect_to @create_news, notice: 'Create new was successfully updated.' }\n format.json { render :show, status: :ok, location: @create_news }\n else\n format.html { render :edit }\n format.json { render json: @create_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bdfe58277f848fa5037ab8051d40cf6", "score": "0.598033", "text": "def update\n @news_feed = NewsFeed.find(params[:id])\n\n respond_to do |format|\n if @news_feed.update_attributes(params[:news_feed])\n format.html { redirect_to(@news_feed, :notice => 'News feed was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_feed.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16df32641b11d77b5df868a1db4cb650", "score": "0.5979224", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16df32641b11d77b5df868a1db4cb650", "score": "0.5979224", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a2facee27f69dc96cc0dd9dd024b58f", "score": "0.59770095", "text": "def update\n @news = News.find(params[:id])\n if @news.update_attributes(params[:news])\n redirect_to :action => 'edit', :id => params[:id]\n else\n render :action => 'edit'\n end\n end", "title": "" }, { "docid": "13e38b02c7d73d543aa4376871404306", "score": "0.59658253", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13e38b02c7d73d543aa4376871404306", "score": "0.59658253", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13e38b02c7d73d543aa4376871404306", "score": "0.59658253", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13e38b02c7d73d543aa4376871404306", "score": "0.59658253", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'News was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b1c0c09cd1d3b4da7c795e0970cd468", "score": "0.5965064", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n\t\t\t\tmsg = I18n.t('app.msgs.success_updated', :obj => I18n.t('app.common.news'))\n\t\t\t\tsend_status_update(msg)\n format.html { redirect_to admin_news_index_path, notice: msg }\n format.json { head :ok }\n else\n\t\t\t\t# turn the datetime picker js on\n\t\t\t\t# have to format dates this way so js datetime picker read them properly\n\t\t\t\tgon.edit_news = true\n\t\t\t\tgon.date_posted = @news.date_posted.strftime('%m/%d/%Y %H:%M') if !@news.date_posted.nil?\n\t\t\t\tgon.data_archive = @news_types[:data_archive]\n\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "885be1ca30b2dd7088e2c62b599259cd", "score": "0.5955759", "text": "def set_admin_news\n @admin_news = Admin::News.find(params[:id])\n end", "title": "" }, { "docid": "389f684e40d7c3997a5178a06af82bb3", "score": "0.59549296", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n f_html format @news, t('news.update.success')\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0101cdfc32b18ff4aeeb202f15ded6cc", "score": "0.5952037", "text": "def update\n @newsfeed = Newsfeed.find(params[:id])\n\n respond_to do |format|\n if @newsfeed.update_attributes(params[:newsfeed])\n flash[:notice] = 'Newsfeed was successfully updated.'\n format.html { redirect_to(@newsfeed) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @newsfeed.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0fba1bf3c5e1dc0008c27994e1dabe4", "score": "0.5941207", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "3454e8e310ae0986f34e952ec8df6057", "score": "0.59372926", "text": "def update\n respond_to do |format|\n if @unisys_news.update(unisys_news_params)\n format.html { redirect_to @unisys_news, notice: 'Unisys news was successfully updated.' }\n format.json { render :show, status: :ok, location: @unisys_news }\n else\n format.html { render :edit }\n format.json { render json: @unisys_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "512eae9a58ba12156124112be64a8489", "score": "0.5934429", "text": "def update\n @especial_news = EspecialNew.find(params[:id])\n\n respond_to do |format|\n if @especial_news.update_attributes(params[:especial_news])\n format.html { redirect_to @especial_news, notice: 'Especial new was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @especial_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d4a0b3fbc896c1b39221e219fc71ff6", "score": "0.5932686", "text": "def edit\n return unless has_permission :can_post_news\n @page_title = 'Edit News Article'\n @document = NewsArticle.find(params[:id])\n if params[:version]!=nil\n @document = @document.get_version params[:version]\n end\n if request.method == :post\n @document.last_updated_by = current_user \n if @document.update_attributes(params[:document])\n flash[:notice] = 'Document was successfully updated.'\n end\n end\n @versions = @document.versions\n end", "title": "" }, { "docid": "0e1707f76ff8159a12d21b92d0ceeae7", "score": "0.5923577", "text": "def update\n @tnews = Tnews.find(params[:id])\n\n respond_to do |format|\n if @tnews.update_attributes(params[:tnews])\n format.html { redirect_to @tnews, notice: 'Tnews was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tnews.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ee36dd837ce84230033578b498954c9", "score": "0.59194916", "text": "def update\n @news_post = NewsPost.find(params[:id])\n\n respond_to do |format|\n if @news_post.update_attributes(params[:news_post])\n flash[:notice] = 'Successfully Updated.'\n format.html { redirect_to(:action => \"index\", :controller => \"user\" ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_post.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0de604cbff6b890c010b280333fd540", "score": "0.59117746", "text": "def update\n @news_category = NewsCategory.find(params[:id])\n\n respond_to do |format|\n if @news_category.update_attributes(params[:news_category])\n format.html { redirect_to([:admin,@news_category], :notice => 'News category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_category.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5658baa03b6e0ff09c22685b5f55ab61", "score": "0.59044373", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to request.referer, notice: \"#{@news.url}を更新しました。\" }\n format.json { render :show, status: :ok, location: @news }\n else\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "675744765f9b99ae5229e265a0f5869a", "score": "0.59009486", "text": "def set_admin_news\n @admin_news = AdminNews.find(params[:id])\n end", "title": "" }, { "docid": "0246033ec5a5fed24a6fc482c370f184", "score": "0.5880936", "text": "def update\n @article = Article.find(params[:id])\n\n respond_to do |format|\n if @article.update_attributes(params[:article])\n flash[:notice] = 'Article was successfully updated.'\n format.html { redirect_to(admin_articles_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @article.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db71512a8c4b986bcebb546b06dc243e", "score": "0.5867482", "text": "def update\n @new = New.find(params[:id])\n\n respond_to do |format|\n if @new.update_attributes(params[:new])\n flash[:notice] = 'Новость успешно отредактирована.'\n format.html { redirect_to(news_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @new.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbd6365255d8ef83228d315e2c51b8f8", "score": "0.58609664", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to @news, notice: 'خبر با موفقیت بهروز شد.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "455e08e2bee7362cd2f4d6151177a204", "score": "0.58486325", "text": "def update\n @news = News.find(params[:id])\n\n @news.assign_attributes(params[:news])\n\n add_missing_translation_content(@news.news_translations)\n\n # add published fields to translations so can create permalink\n @news.news_translations.each do |trans|\n trans.is_published = @news.is_published\n trans.published_at = @news.published_at\n end\n\n\n respond_to do |format|\n if @news.save\n format.html { redirect_to admin_news_path(@news), notice: t('app.msgs.success_updated', :obj => t('activerecord.models.news')) }\n format.json { head :ok }\n else\n gon.news_form = true\n \t\tgon.published_date = @news.published_at.strftime('%m/%d/%Y') if !@news.published_at.nil?\n format.html { render action: \"edit\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02579b1977bbac33450f50b85d2a8115", "score": "0.5848324", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to user_news_url, notice: 'News was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41cb42c410dcc2a22311c0aaf90fce9d", "score": "0.58312917", "text": "def update\n respond_to do |format|\n if @ces_news.update(ces_news_params)\n format.html { redirect_to @ces_news, notice: 'Ces news was successfully updated.' }\n format.json { render :show, status: :ok, location: @ces_news }\n else\n format.html { render :edit }\n format.json { render json: @ces_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a48b3229e830876ae619b936301400b2", "score": "0.58305806", "text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end", "title": "" }, { "docid": "48742efea8fdc298f647c0c380a0ab51", "score": "0.5830056", "text": "def update\n @news_entry = NewsEntry.find(params[:id])\n\n respond_to do |format|\n if @news_entry.update_attributes(params[:news_entry])\n flash[:notice] = 'News Item was successfully updated.'\n format.html { redirect_to(news_list_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_entry.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b35ccd7aed9ae30c5377e17cd8771ee5", "score": "0.58183956", "text": "def update\n respond_to do |format|\n if @news.update(news_params)\n format.html { redirect_to authors_news_path(@news), notice: 'News post was successfully updated.' }\n format.json { render :show, status: :ok, location: @news }\n else\n format.html { render :edit }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55aff6a91b5af50cf1d62f461fedd945", "score": "0.58094937", "text": "def update\n respond_to do |format|\n if @type_news.update(type_news_params)\n format.html { redirect_to @type_news }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @type_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71e5bdd027febd28527c76bda9672030", "score": "0.5805916", "text": "def update\n respond_to do |format|\n if @news_product.update(news_product_params)\n format.html { redirect_to([:admin, @news_product], notice: 'News Product was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @news_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c4524f5224dc76eacdce99496484898", "score": "0.5777428", "text": "def update\n respond_to do |format|\n if @manage_news.update(manage_news_params)\n format.html { redirect_to @manage_news, notice: '资讯更新成功.' }\n format.json { render :show, status: :ok, location: @manage_news }\n else\n format.html { render :edit }\n format.json { render json: @manage_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2858c39d53cb25ecc085998d50035ae8", "score": "0.57642245", "text": "def update\n respond_to do |format|\n if @latest_news.update(latest_news_params)\n format.html { redirect_to @latest_news, notice: 'Latest news was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @latest_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82d411c29a3b840aadd8975ff649d06c", "score": "0.57449365", "text": "def create\n @news = News.new(params[:news])\n @news.user_id = current_user.id\n\n unless admin?\n @news.status = 'suggested'\n end\n\n respond_to do |format|\n if @news.save\n format.html { redirect_to(@news, :notice => 'News was successfully created.') }\n format.xml { render :xml => @news, :status => :created, :location => @news }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d82bbbc821c7b52e47a711606854911", "score": "0.57437116", "text": "def update\n @news_cate = NewsCate.find(params[:id])\n\n respond_to do |format|\n if @news_cate.update_attributes(params[:news_cate])\n format.html { redirect_to @news_cate, notice: 'News cate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news_cate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98ffabeedc7f4e9cb7bb79c8933e2ab7", "score": "0.57414454", "text": "def editnews\n @newsx = params[:id]\n @newsf = News.find_by(id: params[:id]) \n\n @title = @newsf.title\n @description = @newsf.description\n @image1 = @newsf.image1\n @image2 = @newsf.image2\n @on = @newsf.on\n @position = @newsf.position\n\n\n end", "title": "" }, { "docid": "35f58f2fe5af061beb687f474934a3de", "score": "0.57340914", "text": "def edit_metadata\n not_authorized if Revs::Application.config.disable_editing == true\n @document=SolrDocument.find(params[:id])\n updates=params[:document]\n updates.each {|field,value| @document.send(\"#{field}=\",value)}\n if @document.save(:user=>current_user)\n @message = t('revs.messages.saved')\n flash[:success] = @message\n else\n @message = \"A problem occurred. \"\n @message += \"#{@document.errors.join('. ')}.\"\n flash[:error] = @message\n end\n end", "title": "" }, { "docid": "aa0b87a16ede7353758305dbbaf57c22", "score": "0.57316273", "text": "def put(*a) route 'PUT', *a end", "title": "" }, { "docid": "15cee045de3204fa0c0baac25363d488", "score": "0.57303387", "text": "def update\n @news_feed = NewsFeed.find(params[:id])\n\n respond_to do |format|\n if @news_feed.update_attributes(params[:news_feed])\n format.html { redirect_to @news_feed, notice: 'News feed was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news_feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "238fd956be713471aa406c76bf19254a", "score": "0.57278025", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "58be41ea25beb7f603fa7627676f7981", "score": "0.57189924", "text": "def update\n respond_to do |format|\n if @event_news.update(event_news_params)\n # format.html { redirect_to @event_news, notice: 'Event new was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_news }\n else\n # format.html { render :edit }\n format.json { render json: @event_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2e55a6ecb4c00b7fe18a670cc021207", "score": "0.57040215", "text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end", "title": "" }, { "docid": "9df31b11f6fd245da7a8fca7e4643b58", "score": "0.57023966", "text": "def update\n respond_to do |format|\n if @news_type.update(news_type_params)\n format.html { redirect_to [:admin, @news_type], notice: '新闻类型更新成功!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @news_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86c6777d0a2bbfd39174c60eac482c10", "score": "0.56949645", "text": "def update\n respond_to do |format|\n if @news2.update(news2_params)\n format.html { redirect_to @news2, notice: 'News2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @news2 }\n else\n format.html { render :edit }\n format.json { render json: @news2.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3f02110b6d2be37d493b903a0bb32e0", "score": "0.56890696", "text": "def update\n respond_to do |format|\n if @another_news.update(another_news_params)\n format.html { redirect_to @another_news, notice: 'Another new was successfully updated.' }\n format.json { render :show, status: :ok, location: @another_news }\n else\n format.html { render :edit }\n format.json { render json: @another_news.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64a0f81f6fc395921058ff7ab480bf3f", "score": "0.5685954", "text": "def update\n @article = Article.find(params[:id])\n respond_to do |format|\n if @article.update_attributes(params[:article])\n flash[:notice] = 'Article was successfully updated.'\n format.html { redirect_to(@article) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @article.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b58dcb674745e5d70f3957b6c801fb4a", "score": "0.5685349", "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": "8e18db431964c254de53caa41795b702", "score": "0.5681152", "text": "def put *args\n make_request :put, *args\n end", "title": "" } ]
9582e0753cc516effeadb579c171a54e
handle the new filter input and return the new conditions for the db query
[ { "docid": "589f46ac86693f76b4855686ed5ef036", "score": "0.0", "text": "def build_filter(action, filter_num, column, value)\n if action == :add\n if not session[:num_filters].nil?\n session[:num_filters] += 1\n session[:filter_index] += 1\n else\n session[:num_filters] = 1\n session[:filter_index] = 1\n end\n filter_num = session[:filter_index]\n end\n \n if action == :delete\n operand = sql_value = nil\n session[:num_filters] -= 1 unless session[:num_filters].nil? \n else \n operand, sql_value = get_operand_and_value(column, value)\n end\n \n store_filter(filter_num, column, sql_value, operand)\n conditions = rebuild_filter_conditions\n end", "title": "" } ]
[ { "docid": "eecbe36b49119bcefa498ca8a2eb6d00", "score": "0.72206265", "text": "def build_filter_conditions\n return nil\n end", "title": "" }, { "docid": "b76c9174831b7a8906186b9266969f61", "score": "0.7110785", "text": "def filter_conditions\n if params[:filter]\n generate_filter_conditions\n else\n []\n end\n end", "title": "" }, { "docid": "89de188004cb1cf1aa7204e86caebabc", "score": "0.70684606", "text": "def generate_conditions\n if @params[:search]\n @params[:search][:filter].each do |key, val|\n filter = @data_filters[key]\n if filter['id_filter']\n client_ids = send(filter['id_query_method'], val['input'])\n condition = client_ids.any? ? \"clients.id in ( #{client_ids.join(',')} )\" : \"\"\n else\n condition = filter['query_string']\n next if val['input'].values.include?(\"\")\n val['input'].each do |index, val|\n parsed_val = parse_input_val(filter['input_type'], filter['query_input_type'], val, condition)\n condition.gsub!(\"{{input_#{(index.to_i)}}}\", parsed_val.to_s)\n end\n end\n @filter_conditions << condition unless condition.blank?\n @join_conditions << filter['join_condition']\n @join_tables << filter['join_tables']\n end\n end\n end", "title": "" }, { "docid": "37c3b083285eff9c511b50b4de4b11d6", "score": "0.69870013", "text": "def filter_conditions\n f = self.filter\n if (f.is_a? String)\n # plain Jane string, set by admin no doubt, return as is\n # and hope they know what they are doing!\n return [\"( \" + f + \")\" ]\n elsif (f.is_a? Hash)\n # TODO - implement Hash version of filter\n end\n return nil\n end", "title": "" }, { "docid": "7cef90456c8a85d24949aa52a99fee1b", "score": "0.69416064", "text": "def generate_filter_conditions\n filters = params[:filter]\n conditions = filters.keys.map do |key|\n filter = filters[key]\n filterType = filter[:data][:type]\n filterValue = filter[:data][:value]\n filterField = 'users.' + filter[:field]\n case filterType\n when 'string'\n [ filterField + ' LIKE ?', filterValue + '%']\n when 'list'\n sex = (filterValue == I18n.t('users.male')) ? 'm' : 'f'\n [ filterField + ' = ?', sex]\n when 'date'\n comparison = filter[:data][:comparison]\n date = DateTime.strptime(filterValue, \"%m/%d/%Y\")\n if comparison == 'gt'\n [ filterField + ' > ?', date ]\n elsif comparison == 'lt'\n [ filterField + ' < ?', date ]\n elsif comparison == 'eq'\n [ filterField + ' BETWEEN ? AND ? ', date, date + 1.days]\n end\n else\n [ filterField + ' = ?', filterValue ]\n end\n end\n\n [conditions.map { |condition| condition.first }.join(' AND ')] + conditions.map { |condition| condition.last(condition.size - 1) }.flatten\n end", "title": "" }, { "docid": "bc345fdbc7e8a957b7f5b4dd97321ffe", "score": "0.68586236", "text": "def where conditions\n spawn.tap do |proxy|\n proxy.current_params[:filters] ||= {}\n proxy.current_params[:filters].merge! conditions\n end\n end", "title": "" }, { "docid": "99bbcc6101a9e521313cf04f280f4583", "score": "0.6734682", "text": "def potential_filters\n [:date_filter,:classroom_filter, :sort_by]\n end", "title": "" }, { "docid": "09962bd18d4fc699e7d54f00768e0964", "score": "0.67233896", "text": "def build_conditions_from_filters(supplied_filters = {})\n \t filters = supplied_filters.clone\n # Process the filters a bit\n filters.each do |key,val|\n \t # Automatically wrap '%%' around filter values where that filter is using LIKE\n if self::FILTER_MAPPINGS[key] =~ /LIKE/\n filters[key] = \"%#{filters[key]}%\"\n end\n # If an active record object is passed in as a filter value, use its id instead\n if val.kind_of? ActiveRecord::Base\n filters[key] = val.id\n end\n # Allow price search in pounds etc. rather than cents/pence\n if key == :price_from or key == :price_to\n filters[key] = val.to_f * 100\n end\n end\n sql_filters = filters.map {|key,val| self::FILTER_MAPPINGS[key]}\n [(['1=1'] + sql_filters).join(' AND '), filters] \n end", "title": "" }, { "docid": "17ef82f5e4e6454d3d994e6516ebca46", "score": "0.6717394", "text": "def adv_search_conditions(filters)\n conditions = \"\"\n unless filters.nil? || filters.empty?\n filters_data = ActiveSupport::JSON.decode(filters)\n\t groupOp = filters_data[\"groupOp\"]\n\t filters_data[\"rules\"].each do |search_row|\n data = \"#{search_row[\"data\"]}\"\n\t operator = case search_row[\"op\"]\n when \"eq\" then \" = \"\n when \"ne\" then \" <> \"\n when \"lt\" then \" < \"\n when \"le\" then \" <= \"\n when \"gt\" then \" > \"\n when \"ge\" then \" >= \"\n end\n conditions << \"#{search_row[\"field\"]}#{operator}#{data} AND \"\n end\n end\n conditions.chomp(\"AND \")\n end", "title": "" }, { "docid": "869ddab25e9f5346fc6bb292d53c59c7", "score": "0.6692544", "text": "def where conditions\n spawn.tap do |proxy|\n proxy.current_params[:filters] ||= {}\n proxy.current_params[:filters].merge! identifize_filters(conditions)\n end\n end", "title": "" }, { "docid": "4ae2da404f8785d61c85ef2a641a4ce2", "score": "0.66918904", "text": "def parse_filter\n @conditions ||= []\n %w( name ).each do |column|\n param_key = ( column + \"_filter\" ).to_sym\n if params[ param_key ] && params[ param_key ].length > 0 \n field = field_of_interest( column )\n @conditions << ActiveRecord::Base.send( :sanitize_sql_array, [ \"LOWER(#{ column.pluralize }.#{ field }) LIKE ?\", '%' + params[ param_key ].clean_query_string + '%' ] ) if ( !field.nil? && params[ param_key ].clean_query_string.length > 0 )\n end\n end\n end", "title": "" }, { "docid": "4d37d3783617ec8214cbbe2d925e5728", "score": "0.6673834", "text": "def filter(resource, filterable_fields: [], ignore_unknown_fields: true)\n # parse the request parameter\n if params[:filter].is_a?(Hash) ||\n defined?(Rails) && Rails.version.to_i >= 5 && params[:filter].is_a?(ActionController::Parameters)\n @filter = params[:filter]\n filterable_fields = filterable_fields.map(&:to_s)\n\n # deal with each condition\n @filter.each_pair do |field, condition|\n # bypass fields that aren't be abled to filter with\n next if filterable_fields.present? && !filterable_fields.include?(field)\n\n # escape string to prevent SQL injection\n field = resource.connection.quote_string(field)\n\n next if ignore_unknown_fields && resource.columns_hash[field].blank?\n field_type = resource.columns_hash[field] && resource.columns_hash[field].type || :unknown\n\n # if a function is used\n if func = condition.match(/(?<function>[^\\(\\)]+)\\((?<param>.*)\\)/)\n\n db_column_name = begin\n raise if ActiveRecord::Base.configurations[Rails.env]['adapter'] != 'mysql2'\n \"`#{resource.table_name}`.`#{field}`\"\n rescue\n \"\\\"#{resource.table_name}\\\".\\\"#{field}\\\"\"\n end\n\n case func[:function]\n when 'not'\n values = func[:param].split(',')\n values.map!(&:to_bool) if field_type == :boolean\n resource = resource.where.not(field => values)\n\n when 'greater_than'\n resource = resource\n .where(\"#{db_column_name} > ?\",\n func[:param])\n\n when 'less_than'\n resource = resource\n .where(\"#{db_column_name} < ?\",\n func[:param])\n\n when 'greater_than_or_equal'\n resource = resource\n .where(\"#{db_column_name} >= ?\",\n func[:param])\n\n when 'less_than_or_equal'\n resource = resource\n .where(\"#{db_column_name} <= ?\",\n func[:param])\n\n when 'between'\n param = func[:param].split(',')\n resource = resource\n .where(\"#{db_column_name} BETWEEN ? AND ?\",\n param.first, param.last)\n\n when 'like'\n resource = resource\n .where(\"lower(#{db_column_name}) LIKE ?\",\n func[:param].downcase)\n\n when 'contains'\n resource = resource\n .where(\"lower(#{db_column_name}) LIKE ?\",\n \"%#{func[:param].downcase}%\")\n\n when 'null'\n resource = resource.where(field => nil)\n\n when 'blank'\n resource = resource.where(field => [nil, ''])\n end\n\n # if not function\n else\n values = condition.split(',')\n values.map!(&:to_bool) if field_type == :boolean\n resource = resource.where(field => values)\n end\n end\n end\n\n return resource\n end", "title": "" }, { "docid": "b87360249f946be07c09900ff13a5020", "score": "0.66691715", "text": "def conditions\r\n unless self.empty?\r\n @filters.inject([\"\"]) do |condition,filter|\r\n filter = filter.dup\r\n condition.first << \" AND \" unless condition.first.empty?\r\n condition.first << filter.shift\r\n condition += filter\r\n end\r\n end\r\n end", "title": "" }, { "docid": "9fea64c93b98eb72c3b796fc66e8c62f", "score": "0.66392756", "text": "def set_conditions\n\n condition = init_condition\n condition = add_customer_filter_condition(condition)\n condition = add_user_filter_condition(condition)\n\n end", "title": "" }, { "docid": "ca0738b14101c2d459a2b987cdbf1641", "score": "0.6557999", "text": "def process_filter\n # TODO\n end", "title": "" }, { "docid": "bbf0eb01c331852fa8b71de5bd326f20", "score": "0.6546952", "text": "def query\n process_filter(params)\n end", "title": "" }, { "docid": "a9389586b1a8e88632e5a213817d53bc", "score": "0.6545203", "text": "def apply_filters (options = {})\r\n\t\tif(!self.request.filters.nil?)\r\n\t\t\tif(!self.request.filters[\"PARTICIPATIONRATE\"].nil?)\r\n\t\t\t\tself.search_object = self.search_object.where(\"participation_rate >= ?\", self.request.filters[\"PARTICIPATIONRATE\"].to_i)\r\n\t\t\tend\r\n\r\n\t\t\tif(!self.request.filters[\"SOCIALSCORE\"].nil?)\r\n\t\t\t\tself.search_object = self.search_object.where(\"social_score >= ?\", self.request.filters[\"SOCIALSCORE\"].to_i)\r\n\t\t\tend\r\n\r\n\t\t\tif(!self.request.filters[\"TEXT\"].nil?)\r\n\t\t\t\tif(options.key?(:text_filter_type))\r\n\t\t\t\t\tcase options[:text_filter_type]\r\n\t\t\t\t\twhen 'starts_with'\r\n\t\t\t\t\t\tfind_text = \"#{self.request.filters[\"TEXT\"]}%\"\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tfind_text = \"%#{self.request.filters[\"TEXT\"]}%\"\r\n\t\t\t\t\tend\r\n\t\t\t\telse\r\n\t\t\t\t\tfind_text = \"%#{self.request.filters[\"TEXT\"]}%\"\r\n\t\t\t\tend\r\n\t\t\t\tif(options.key?(:text_field))\r\n\t\t\t\t\tself.search_object = self.search_object.where(\"#{options[:text_field]} like ?\", find_text)\r\n\t\t\t\telse\r\n\t\t\t\t\tself.search_object = self.search_object.where(\"name like ?\", find_text)\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\tif(!self.user.nil?)\r\n\t\t\t\tif(!self.request.filters[\"VOTE\"].nil?)\r\n\t\t\t\t\tcase self.request.filters[\"VOTE\"].upcase\r\n\t\t\t\t\twhen \"THUMBSUP\"\r\n\t\t\t\t\t\tself.search_object = self.search_object.where(\"support_type = 1\")\r\n\t\t\t\t\twhen \"THUMBSDOWN\"\r\n\t\t\t\t\t\tself.search_object = self.search_object.where(\"support_type = 0\")\r\n\t\t\t\t\twhen \"NEUTRAL\"\r\n\t\t\t\t\t\tself.search_object = self.search_object.where(\"support_type = 2\")\r\n\t\t\t\t\twhen \"VOTED\"\r\n\t\t\t\t\t\tself.search_object = self.search_object.where(\"support_type >= 0\")\r\n\t\t\t\t\twhen \"NOVOTE\"\r\n\t\t\t\t\t\tself.search_object = self.search_object.where(\"support_type is null\")\r\n when \"LIMITEDNOVOTE\"\r\n self.search_object = self.search_object.where(\"support_type = -1\")\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tself.total_records = self.search_object.count\r\n\t\tself.search_object = self.search_object.limit(self.max_results).offset(self.start_offset)\r\n\t\tif(self.sort_name.length > 0)\r\n\t\t\tself.search_object = self.search_object.order(\"#{self.sort_name} #{self.sort_direction}\")\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "709bdfc88c7ca36f37a30f1befbc6fb6", "score": "0.6540517", "text": "def filter\n filters_available.each do |filter|\n send(\"filter_by_#{filter}\", @params[filter]) if @params[filter].present?\n end\n filter_price\n merge\n end", "title": "" }, { "docid": "f67f26e9c5fc994d5891be728b1b8d14", "score": "0.65303886", "text": "def handle_special_fields\n if params[:filters]\n params[:filters].each do |filter_attr, filter_value|\n @items = @items.filter_by(filter_attr, filter_value)\n end\n end\n end", "title": "" }, { "docid": "5367f37af9b5bf84934e39ea0682a7fc", "score": "0.6525078", "text": "def filter\n #if there is no search parameter just use an empty wildcard, else use the search param wildcard\n if params[:input]==nil\n searchinput = '%'\n else\n searchinput = \"%#{params[:input]}%\"\n end\n #a series of conditional statemetns to check what attributes to query for\n #if nothing in an attribute section is ticked then equal all of them to an empty wildcard so everything is returned\n #else use a turnery operator to check if th variable will have the value of an item string or 'xxxxxxxx'(which will always return nothing) \n #this is based on whether or not the query param has the value of \"✓\" \n if params[:necklace] != \"✓\" && params[:bracelet] != \"✓\" && params[:ring] != \"✓\" && params[:earring] != \"✓\" \n necklace = '%'\n bracelet = '%'\n ring = '%'\n earring = '%'\n else \n necklace = params[:necklace] == \"✓\" ? 'necklace' : 'xxxxxxxx' \n bracelet = params[:bracelet] == \"✓\" ? 'bracelet' : 'xxxxxxxx' \n ring = params[:ring] == \"✓\" ? 'ring' : 'xxxxxxxx' \n earring = params[:earring] == \"✓\" ? 'earring' : 'xxxxxxxx' \n end\n if params[:gold] != \"✓\" && params[:silver] != \"✓\" && params[:rose] != \"✓\"\n gold = '%'\n silver = '%'\n rose = '%'\n else \n gold = params[:gold] == \"✓\" ? 'gold' : 'xxxxxxxx' \n silver = params[:silver] == \"✓\" ? 'silver' : 'xxxxxxxx'\n rose = params[:rose] == \"✓\" ? 'rose' : 'xxxxxxxx'\n end\n if params[:bohemian] != \"✓\" && params[:roman] != \"✓\" && params[:gemstone] != \"✓\" \n bohemian = '%'\n roman = '%'\n gemstone = '%'\n else \n bohemian = params[:bohemian] == \"✓\" ? 'bohemian' : 'xxxxxxxx' \n roman = params[:roman] == \"✓\" ? 'roman' : 'xxxxxxxx'\n gemstone = params[:gemstone] == \"✓\" ? 'gemstone' : 'xxxxxxxx'\n end\n \n #finally use the variable dertermined above to get the query results - stored in @items\n @items= Item.where(\"title like ? OR description like ?\", searchinput, searchinput)\n @items = @items.where(\"category like ? OR category like ? OR category like ? OR category like ? \", necklace, bracelet, earring, ring)\n @items = @items.where(\"material like ? OR material like ? OR material like ?\", gold, silver, rose)\n @items = @items.where(\"collection like ? OR collection like ? OR collection like ?\", bohemian, roman, gemstone)\n \n #call sort method - default price asc\n sortitems\n \n #give access to bestselling and recently viewed tables\n @bestsellingitems = Item.all\n @recentview = []\n if current_user != nil\n @recentview = Recentlyviewed.where(user_id: current_user.id) \n end\n end", "title": "" }, { "docid": "eb2996860362f20764d82a1c47575e1a", "score": "0.6523567", "text": "def query_filters; end", "title": "" }, { "docid": "6b7ef0301f95f7bda982c9e887192ec5", "score": "0.65195966", "text": "def conditions\n # c = conditions; a = arguments\n c = []\n a = {}\n\n @columns.each_with_index do |column, i|\n if params[\"bSearchable_#{i}\"] && !params[\"sSearch_#{i}\"].blank?\n\n dbname = column[:db_name]\n dbname_ = dbname.gsub(/\\W+/, '')\n search = params[\"sSearch_#{i}\"].strip.downcase\n\n case column[:type]\n \n when \"string\"\n c << \"LOWER(#{dbname}) LIKE :#{dbname_}\"\n a[(\"#{dbname_}\").to_sym] = \"%#{search}%\"\n \n when \"int\"\n c << \"#{dbname} = :#{dbname_}\"\n a[(\"#{dbname_}\").to_sym] = search\n \n when \"date_ranges\"\n case search\n # when \"all_time\"\n when \"yesterday\"\n c << \"#{dbname} BETWEEN :start AND :end\"\n a[:start] = 1.day.ago.beginning_of_day\n a[:end] = 1.day.ago.end_of_day\n when \"this_week\"\n c << \"#{dbname} BETWEEN :start AND :end\"\n a[:start] = Time.now.beginning_of_week\n a[:end] = Time.now.end_of_week\n when \"last_week\"\n c << \"#{dbname} BETWEEN :start AND :end\"\n a[:start] = 1.week.ago.beginning_of_week\n a[:end] = 1.week.ago.end_of_week\n when \"last_month\"\n c << \"#{dbname} BETWEEN :start AND :end\"\n a[:start] = 1.month.ago.beginning_of_month\n a[:end] = 1.month.ago.end_of_month\n end\n\n when \"date_interval\"\n #require 'debugger'; debugger;\n splitt = search.split('..')\n from = splitt[0]\n to = splitt[1]\n if splitt.size == 2 && is_iso_date?(from) && is_iso_date?(to)\n c << \"#{dbname} BETWEEN :intervalFrom#{i} AND :intervalTo#{i}\"\n a[\"intervalFrom#{i}\".to_sym] = from+' 00:00:00'\n a[\"intervalTo#{i}\".to_sym] = to+' 23:59:59'\n end\n #logger.info(\"date_interval #{dbname}>> #{from} #{to}\")\n end\n end\n end\n\n [c.join(\" AND \"), a]\n end", "title": "" }, { "docid": "d794f601551b69ae53c0266217156f4d", "score": "0.6519493", "text": "def rewhere(conditions); end", "title": "" }, { "docid": "f1a7c7f69b76133df9e34adebf89497a", "score": "0.64943695", "text": "def build_conditions(params)\n conditions = \"1 = 1 \"\n params.split('&').each do |q|\n the_key, the_value = q.split(\"=\").first, q.split(\"=\").last\n if the_key == \"search\"\n search = Array.new\n self.typus_defaults_for('search').each { |s| search << \"LOWER(#{s}) LIKE '%#{CGI.unescape(the_value)}%'\" }\n conditions << \"AND (#{search.join(\" OR \")}) \"\n end\n self.model_fields.each do |f|\n filter_type = f[1] if f[0] == the_key\n case filter_type\n when \"boolean\"\n if %w(sqlite3 sqlite).include? ActiveRecord::Base.configurations[RAILS_ENV]['adapter']\n conditions << \"AND #{f[0]} = '#{the_value[0..0]}' \"\n else\n status = (the_value == 'true') ? 1 : 0\n conditions << \"AND #{f[0]} = '#{status}' \"\n end\n when \"datetime\"\n case the_value\n when 'today': start_date, end_date = Time.today, Time.today.tomorrow\n when 'past_7_days': start_date, end_date = 6.days.ago.midnight, Time.today.tomorrow\n when 'this_month': start_date, end_date = Time.today.last_month, Time.today.tomorrow\n when 'this_year': start_date, end_date = Time.today.last_year, Time.today.tomorrow\n end\n start_date, end_date = start_date.to_s(:db), end_date.to_s(:db)\n conditions << \"AND created_at > '#{start_date}' AND created_at < '#{end_date}' \"\n when \"integer\"\n conditions << \"AND #{f[0]} = #{the_value} \" if f[0].include? \"_id\"\n when \"string\"\n conditions << \"AND #{f[0]} = '#{the_value}' \"\n end\n end\n end\n return conditions\n end", "title": "" }, { "docid": "c14cb74fd08db8f5972a508d320959f1", "score": "0.648856", "text": "def rebuild_filter_conditions\n @join = \"\"\n @conditions = Array.new\n @include = Array.new\n @conditions[0] = \"\"\n index = 1\n column = nil\n \n return \"\" if session[:filter_index].nil?\n \n for filter in 1..session[:filter_index]\n column = session[\"filter_column__\" + filter.to_s]\n if not column.nil?\n association, table_name, column = association_table_and_column(column)\n @conditions[0] += @join + table_name + \".\" + column + \" \" + session[\"filter_operand__\" + filter.to_s] + \" ?\"\n @conditions[index] = session[\"filter_value__\" + filter.to_s] \n index += 1\n @join = \" AND \"\n if not association.nil? && @include.index(association).nil?\n @include.push(association)\n end\n end \n end\n session[:include] = @include\n @conditions.join(\",\")\n end", "title": "" }, { "docid": "f07b20e8e9e06db90c442da267d85dd6", "score": "0.64851403", "text": "def conditions\n @filter.nil? ? nil : @filter.conditions\n end", "title": "" }, { "docid": "a73d795cd20a9a063aa66b580de1484d", "score": "0.64694196", "text": "def handle_somatics_filter_query\n if action_name == 'index'\n if query_hash = params[SomaticsFilter::Query::ParamNames[:filter]]\n store_last_query\n else\n if params[:_clear]\n clear_last_query\n else\n load_last_query_to_params\n end\n end\n end\n end", "title": "" }, { "docid": "6a8aa953696fe0ff73843414ba3aa41c", "score": "0.6465438", "text": "def apply_filters\n if @filters.present?\n @filters.map {|i| i[1]}.each do |filter|\n unless apply_filter(filter)\n @query = @query.none\n\n return\n end\n end\n end\n end", "title": "" }, { "docid": "ee2fbc05329022f5bf04aa34de994ae2", "score": "0.6463314", "text": "def apply_filters\n raise NotImplementedError, \"#{self.class.name} does not allow queryable filtering, use apply_tournament_filter, apply_match_filter instead\"\n end", "title": "" }, { "docid": "d4fc5bc3fb0d3649475a8400b5fb9f20", "score": "0.64529", "text": "def filter_clauses_for_conditions(conditions)\n [:insert, :update, :delete].map { |tg_op| filter_clause(conditions[tg_op]) }\n end", "title": "" }, { "docid": "f044ad7027bd5bd10526c6737dbb89a6", "score": "0.6432908", "text": "def use_filter(query, evt)\n active_filters = parse_filters(evt)\n if active_filters && active_filters.size\n active_filters.each do |group,filter_ids|\n fg_options = filters[group][:options]\n query = query.where(fg_options[:where].call(filter_ids)) if fg_options.has_key?(:where) && filter_ids.size > 0\n query = query.joins(fg_options[:joins]) if fg_options.has_key?(:joins)\n query = query.includes(fg_options[:includes]) if fg_options.has_key?(:includes)\n filter_ids.each do |f|\n f_options = filters[group][:filters][f]\n query = query.where(f_options[:where]) if f_options.has_key?(:where)\n query = query.joins(f_options[:joins]) if f_options.has_key?(:joins)\n query = query.includes(f_options[:includes]) if f_options.has_key?(:includes)\n end\n end\n end\n query\n end", "title": "" }, { "docid": "1a15069c1903de0eec4173b4945c4451", "score": "0.6429822", "text": "def build_filters\n @filters.each do |filter|\n case filter\n when :annotated\n if needs_solr?\n # NB: Solr \"greater_than\" is actually >=\n @solr.build { with(:public_note_count).greater_than(1) }\n else\n @sql << 'documents.public_note_count > 0'\n end\n when :popular\n @order = :hit_count\n if needs_solr?\n @solr.build { with(:hit_count).greater_than(Document::MINIMUM_POPULAR) }\n else\n @sql << 'documents.hit_count > ?'\n @interpolations << [Document::MINIMUM_POPULAR]\n end\n when :published\n if needs_solr?\n @solr.build { with :published, true }\n else\n @sql << 'documents.access in (?) and (documents.remote_url is not null or documents.detected_remote_url is not null)'\n @interpolations << PUBLIC_LEVELS\n end\n when :unpublished\n if needs_solr?\n @solr.build { with :published, false }\n else\n @sql << 'documents.remote_url is null and documents.detected_remote_url is null'\n end\n when :restricted\n if needs_solr?\n @solr.build { with :access, [PRIVATE, ORGANIZATION, PENDING, INVISIBLE, ERROR, DELETED, EXCLUSIVE] }\n else\n @sql << 'documents.access in (?)'\n @interpolations << [PRIVATE, ORGANIZATION, PENDING, INVISIBLE, ERROR, DELETED, EXCLUSIVE]\n end\n end\n end\n end", "title": "" }, { "docid": "5a53787f848cd6f13c93910acd27cac6", "score": "0.64249986", "text": "def query_filters=(_arg0); end", "title": "" }, { "docid": "1d26b252286c87c0ed36d0bad08039d7", "score": "0.64202887", "text": "def add_filter\n \t@advanced_search = AdvancedSearch.find(params[:advanced_search_id])\n \tif params[:new_filter_name] == \"certifications\"\n \t\t@certification = Certification.find(params[:new_filter_value])\n \t\t@advanced_search.certifications << @certification\n \telsif params[:new_filter_name] == \"hired_before\" || params[:new_filter_name] == \"hired_after\"\n \t\tdate = Date.civil(\tparams[:new_filter_value][:\"date(1i)\"].to_i, \n \t\t\t\t\t\t\t\t\t\t\t\tparams[:new_filter_value][:\"date(2i)\"].to_i, \n \t\t\t\t\t\t\t\t\t\t\t\tparams[:new_filter_value][:\"date(3i)\"].to_i)\n \t\t@advanced_search[params[:new_filter_name].to_sym] = date\n\t \t@advanced_search.save!\n \telse\n \t\tparams[:new_filter_value].gsub!(/[^0-9]/, '') if params[:new_filter_name] == \"home_phone\" || params[:new_filter_name] == \"mobile_phone\"\n \t\t\n\t \t@advanced_search[params[:new_filter_name].to_sym] = params[:new_filter_value]\n\t \t@advanced_search.save!\n\t end\n\n\t\t@nonempty_filters = FILTER_NAMES.reject { |attr_name| @advanced_search[attr_name.to_sym].nil? unless attr_name == \"certifications\" } \n\t \t@nonempty_filters.delete(\"certifications\") if @advanced_search.certifications.empty?\n\t\t@empty_filters = FILTER_NAMES - @nonempty_filters\n\t \t@empty_filters.insert(0, \"certifications\") unless @advanced_search.certifications == Certification.all #=> This line isn't needed now that we're in the controller!\n\n\t render :update do |page|\n\t \tpage.replace_html 'search_filters', :partial => 'search_filters', :object => @advanced_search\n\t \tpage.replace_html 'search_results', :partial => 'search_results', :object => @advanced_search.people\n\t end\n end", "title": "" }, { "docid": "c22ed22c27cb4100898f82ac2c80abed", "score": "0.6401967", "text": "def apply_filter (filter)\n values = filter[:values]\n return true unless values.present? && values.is_a?(Array)\n return true unless values[0].present?\n\n filter_logic =\n (@build_custom_logic && @build_custom_logic.call(filter, @query)) ||\n build_filter_logic(filter)\n\n if filter_logic.nil?\n true # \"Pass\", and return anything but false\n elsif filter_logic.is_a?(String)\n @query = @query.where(filter_logic)\n elsif filter_logic.is_a?(Hash)\n apply_filter(filter_logic)\n elsif filter_logic == 0\n false\n else\n # Assume filter_logic is a query object, so replace the query in play\n @query = filter_logic\n end\n end", "title": "" }, { "docid": "9a7d77cb437a2ebb9cec3162191f9f82", "score": "0.6389768", "text": "def filter_conditions filter_hash\n statement_parts = []\n parameters = []\n merged_filters = filter_defaults.stringify_keys.merge((filter_hash || {}).stringify_keys)\n filters.each do |filter|\n option_sql = filter.sql( merged_filters[filter.name] )\n unless option_sql.empty?\n statement_parts << option_sql.shift\n parameters.push *option_sql\n end\n end\n [ statement_parts.join( ' AND '), *parameters ] unless statement_parts.empty?\n end", "title": "" }, { "docid": "c4995ad43d81083c4d39533f230be29c", "score": "0.63889533", "text": "def prepare_conditions (object,project,include_subproject,f_code)\n #Get subprojects\n columns, values = prepare_get_for_projects(object,project,include_subproject,\"not_nill\")\n #The selection could be filter by *code\n columns << \"and code LIKE ?\"\n values << f_code\n \n conditions = [columns]\n values.each do |value|\n conditions << value\n end \n #return conditions\n return conditions\n end", "title": "" }, { "docid": "1482582e8ba76888958c62b7b4be56e9", "score": "0.6375619", "text": "def add_filters(type, sql)\n @filter_opts.each do |opt, arg|\n case opt\n when :css\n sql += \"AND lower(css.name) LIKE lower('#{arg}') \"\n when :partition\n sql += \"AND lower(rp.name) LIKE lower('#{arg}') \"\n when :pattern\n sql += \"AND lower(pattern) LIKE lower('#{arg}') \"\n when :route_list\n sql += \"AND lower(d.name) LIKE lower('#{arg}') \" unless type.eq('trunk')\n when :route_group\n sql += \"AND lower(rg.name) LIKE lower('#{arg}') \" unless type.eq('trunk')\n when :device\n sql += \"AND lower(dd.name) LIKE lower('#{arg}') \"\n end\n end\n sql\nend", "title": "" }, { "docid": "853c034ade57b5d8e4f3d84219372bb2", "score": "0.6335289", "text": "def update!(**args)\n @between_filter = args[:between_filter] if args.key?(:between_filter)\n @field_name = args[:field_name] if args.key?(:field_name)\n @in_list_filter = args[:in_list_filter] if args.key?(:in_list_filter)\n @numeric_filter = args[:numeric_filter] if args.key?(:numeric_filter)\n @string_filter = args[:string_filter] if args.key?(:string_filter)\n end", "title": "" }, { "docid": "853c034ade57b5d8e4f3d84219372bb2", "score": "0.6335289", "text": "def update!(**args)\n @between_filter = args[:between_filter] if args.key?(:between_filter)\n @field_name = args[:field_name] if args.key?(:field_name)\n @in_list_filter = args[:in_list_filter] if args.key?(:in_list_filter)\n @numeric_filter = args[:numeric_filter] if args.key?(:numeric_filter)\n @string_filter = args[:string_filter] if args.key?(:string_filter)\n end", "title": "" }, { "docid": "a03db2673882b0603a9d5081f287f659", "score": "0.6325493", "text": "def conditions; end", "title": "" }, { "docid": "a03db2673882b0603a9d5081f287f659", "score": "0.6325493", "text": "def conditions; end", "title": "" }, { "docid": "a03db2673882b0603a9d5081f287f659", "score": "0.6325493", "text": "def conditions; end", "title": "" }, { "docid": "a03db2673882b0603a9d5081f287f659", "score": "0.6325493", "text": "def conditions; end", "title": "" }, { "docid": "fe0c25f88db4650b6b2543d522b4977e", "score": "0.6324225", "text": "def potential_filters\n [:date_filter, :sort_by]\n end", "title": "" }, { "docid": "4087b6a41b936c81a3da596e44442616", "score": "0.6316689", "text": "def filtering; end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6309024", "text": "def filter_params\n end", "title": "" }, { "docid": "c37a851f23c8c3a06dd0dba11f01863e", "score": "0.62962717", "text": "def get_filters_sql\n if self.filters.blank?\n return ''\n else\n conditions = JSON.parse self.filters\n sql_array = []\n conditions.each do |condition|\n if condition['values']\n values = condition['values'].map{|x| \"'#{x}'\"}.join(',')\n sql_array << \" #{condition['name']} in (#{values})\"\n else\n sql_array << \" #{condition['name']} between #{condition['from']} and #{condition['to']}\"\n end\n end\n sql_array.join(' AND ')\n end\n end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.62847716", "text": "def filters; end", "title": "" }, { "docid": "128635c7465ebf8570240f7514e7179e", "score": "0.6280848", "text": "def filter_criteria\n\t \tif filter_by_product=='on'\n\t \t\tif filter_by_company=='on'\n\t \t\t\tfilter_by_tag=='on' ? 'pct' : 'pc'\n\t \t\telse\n\t \t\t\tfilter_by_tag=='on' ? 'pt' : 'p'\n\t \t\tend\n\t \telse\n\t \t\tif filter_by_company=='on'\n\t \t\t\tfilter_by_tag=='on' ? 'ct' : 'c'\n\t \t\telse\n\t \t\t\tfilter_by_tag=='on' ? 't' : nil\n\t \t\tend\n\t \tend\n\t end", "title": "" }, { "docid": "52c6413685e17b0045783358879f6853", "score": "0.6278369", "text": "def potential_filters\n [:date_filter, :reward_status_filter, :teachers_filter, :reward_creator_filter, :sort_by]\n end", "title": "" }, { "docid": "35995a3e08af25b99784a1eb85ba1e0d", "score": "0.6271818", "text": "def get_conditions\n conditions = []\n qualifiers = []\n # unless rmr.empty?\n # conditions << \"rmr LIKE ?\"\n # qualifiers << \"%#{rmr}%\"\n # end\n # unless series_description.empty?\n # conditions << \"series_description LIKE ?\"\n # qualifiers << \"%#{series_description}%\"\n # end\n # unless path.empty?\n # conditions << \"path LIKE ?\"\n # qualifiers << \"#{path}\"\n # end\n # unless earliest_timestamp.nil?\n # conditions << \"timestamp > ?\"\n # qualifiers << \"#{earliest_timestamp}\"\n # end\n # unless latest_timestamp.nil?\n # conditions << \"timestamp < ?\"\n # qualifiers << \"#{latest_timestamp}\"\n # end\n # unless enumber.empty?\n # conditions << \"enrollments.enumber LIKE ?\"\n # qualifiers << \"%#{enumber}%\"\n # end\n # unless gender.nil?\n # conditions << \"participants.gender = ?\"\n # qualifiers << \"#{gender}\"\n # end\n # unless min_age.nil?\n # conditions << \"participants.dob > ?\"\n # qualifiers << \"#{birthdate(min_age)}\"\n # end\n # unless max_age.nil?\n # conditions << \"participants.dob < ?\"\n # qualifiers << \"#{birthdate(max_age)}\"\n # end\n # unless min_ed_years.nil?\n # conditions << \"participants.ed_years > ?\"\n # qualifiers << \"#{min_ed_years}\"\n # end\n # unless max_ed_years.nil?\n # conditions << \"participants.ed_years < ?\"\n # qualifiers << \"#{max_ed_years}\"\n # end\n # unless apoe_status.nil?\n # if apoe_status == 1\n # conditions << \"(participants.apoe_e1 = ? OR participants.apoe_e2 = ?)\"\n # else\n # conditions << \"(participants.apoe_e1 != ? AND participants.apoe_e2 != ?)\"\n # end\n # qualifiers << \"4\"\n # qualifiers << \"4\"\n # end\n # unless scan_procedures.empty?\n # spconditions = []\n # scan_procedures.each do |sp|\n # spconditions << \"scan_procedures.id = ?\"\n # qualifiers << sp.id\n # end\n # conditions << \"(\" + spconditions.join(\" OR \") + \")\"\n # end\n # unless scanner_source.empty?\n # conditions << \"visits.scanner_source = ?\"\n # qualifiers << \"#{scanner_source}\"\n # end\n # conditions = conditions.join(\" AND \")\n # return [conditions, qualifiers]\n end", "title": "" }, { "docid": "338f9ad9c68476dff0c255b9d5751e0b", "score": "0.62685704", "text": "def conditions\n sqlwhere = \"1 = 1\"\n sqlwhere = sqlwhere + \" and lower(name) like ? \" if is_string_here?(name)\n sqlwhere = sqlwhere + \" and lower(code) like ? \" if is_string_here?(code)\n sqlwhere = sqlwhere + \" and lower(about) like ? \" if is_string_here?(about)\n sqlwhere = sqlwhere + \" and enabled = ? \" if !enabled.nil?\n sqlwhere = sqlwhere + \" and created_at > ? \" if is_object_here?(created_at_since)\n sqlwhere = sqlwhere + \" and created_at < ? \" if is_object_here?(created_at_till)\n\n result = [sqlwhere]\n result << \"%#{UnicodeUtils.downcase(name)}%\" if is_string_here?(name)\n result << \"%#{code}%\" if is_string_here?(code)\n result << \"%#{about}%\" if is_string_here?(about)\n result << enabled if !enabled.nil?\n result << created_at_since if is_object_here?(created_at_since)\n result << created_at_till if is_object_here?(created_at_till)\n result\n end", "title": "" }, { "docid": "0db90049ee6ca558a6851b80d3ff35c3", "score": "0.6255328", "text": "def filter(sql)\n @conditions = sql\n end", "title": "" }, { "docid": "3e208a71f6098dd6af05e8ec5ec9218a", "score": "0.624559", "text": "def build_where(filters)\n conditions = []\n space_arel = Space.arel_table\n space_type = Space.space_types[filters[:type]]\n\n conditions << space_arel[:space_type].eq(space_type) if space_type\n conditions << space_arel[:name].matches(wildcard(filters[:name])) if filters[:name]\n conditions << space_arel[:created_at].matches(wildcard(filters[:created_at])) if filters[:created_at]\n conditions << space_arel[:updated_at].matches(wildcard(filters[:updated_at])) if filters[:updated_at]\n conditions << space_arel[:description].matches(wildcard(filters[:description])) if filters[:description]\n conditions.reduce(nil) do |where, condition|\n where ? where.and(condition) : condition\n end\n end", "title": "" }, { "docid": "146417967f05b29fb32918b69afc19af", "score": "0.6242377", "text": "def add_filter_params\n params[:filter] = {} if params[:filter] == nil\n return {'filter[working_field]' => h(params[:filter][:working_field]),'filter[region]' => h(params[:filter][:region]), 'filter[job_level]' => h(params[:filter][:job_level])}\n end", "title": "" }, { "docid": "d0191751c38109ed151d699d69a02880", "score": "0.6236044", "text": "def conditions\n # TODO: addd filter by _id\n sqlwhere = \"1 = 1 \"\n sqlwhere = sqlwhere + \"and complaints.title like ? \" if is_string_here?(title)\n sqlwhere = sqlwhere + \"and complaints.created_at > ? \" if is_object_here?(created_at_since)\n sqlwhere = sqlwhere + \"and complaints.created_at < ? \" if is_object_here?(created_at_till)\n\n result = [sqlwhere]\n result << UnicodeUtils.downcase(title) if is_string_here?(title)\n result << created_at_since if is_object_here?(created_at_since)\n result << created_at_till if is_object_here?(created_at_till)\n result\n end", "title": "" }, { "docid": "2c9794502cb7f66a11cdda09a24ec741", "score": "0.622026", "text": "def execute\n @users = User.all\n @users = add_filter(:between_age, @criterias[\"filter_between_age\"].reject(&:blank?)) if @criterias[\"filter_between_age\"].reject(&:blank?).present?\n @users = add_filter(:by_gender, @criterias[\"filter_gender\"].reject(&:blank?)) if @criterias[\"filter_gender\"].reject(&:blank?).present?\n @users = add_filter(:by_postal_code, @criterias[\"filter_postal_code\"].reject(&:blank?)) if @criterias[\"filter_postal_code\"].reject(&:blank?).present?\n @users = add_filter(:with_subscription, @criterias[\"filter_with_subscription\"].reject(&:blank?)) if @criterias[\"filter_with_subscription\"].reject(&:blank?).present?\n @users = add_filter(:created_since, @criterias[\"filter_created_since\"].reject(&:blank?)) if @criterias[\"filter_created_since\"].reject(&:blank?).present?\n @users = add_filter(:by_usual_room, @criterias[\"filter_usual_room\"].reject(&:blank?)) if @criterias[\"filter_usual_room\"].reject(&:blank?).present?\n @users = add_filter(:by_usual_activity, @criterias[\"filter_usual_activity\"].reject(&:blank?)) if @criterias[\"filter_usual_activity\"].reject(&:blank?).present?\n @users = add_filter(:by_booking_frequency, @criterias[\"filter_frequencies\"].reject(&:blank?)) if @criterias[\"filter_frequencies\"].reject(&:blank?).present?\n @users = add_filter(:by_last_booking_date, @criterias[\"filter_last_booking_dates\"].reject(&:blank?)) if @criterias[\"filter_last_booking_dates\"].reject(&:blank?).present?\n @users = add_filter(:by_last_visite_date, @criterias[\"filter_last_visite_dates\"].reject(&:blank?)) if @criterias[\"filter_last_visite_dates\"].reject(&:blank?).present?\n @users = add_filter(:by_last_article, @criterias[\"filter_last_article\"].reject(&:blank?)) if @criterias[\"filter_last_article\"].reject(&:blank?).present?\n @users\n end", "title": "" }, { "docid": "d3f4ebb3d1ca20c248a85d58cbd46071", "score": "0.62109953", "text": "def filter_params\n\t\t\t@filter_options ||= parse_raw( params[:filter][:raw] )\n\t\t\tallowed_params = [\"name\", \"start_date\", \"end_date\", \"conditions\"]\n\t\t\tfilter_params = {}\n @filter_options.each do |key,value|\n\t\t\t\tif allowed_params.include?(key)\n\t\t\t\t\tfilter_params[key] = value\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn filter_params\n end", "title": "" }, { "docid": "dd78b995c8e7eb14500fec70757b90f8", "score": "0.62095916", "text": "def build_filter_conditions(filters)\n conditions = []\n\n return build_arel_conditions(filters) if filters.dimension == 1\n\n # Binary filter\n # ie. [ \"dataField\", \"=\", 3 ]\n # Unary filter\n # ie. [ \"!\", [ \"dataField\", \"=\", 3 ] ]\n unary_condition = filters.shift if filters.dimension > 1 && filters.first&.is_a?(String)\n\n filters.each_slice(2).each do |filter, condition|\n\n if filter.dimension > 1\n conditions_set = build_filter_conditions(filter)\n\n if unary_condition.present?\n # Prepend to handle in #add_arel_conditions with Arel::Nodes::Not\n conditions << ['not', conditions_set]\n else\n conditions << conditions_set\n end\n\n # NOTE: not sure if this is a bug, but a specific combination of filters sometimes don't have a condition(AND | OR)\n # Trying to manually handle this case here\n if condition.is_a?(Array)\n # Manually add `AND` condition\n conditions << 'and'\n\n conditions_set = build_filter_conditions(condition)\n\n if unary_condition.present?\n # Prepend to handle in #add_arel_conditions with Arel::Nodes::Not\n conditions << ['not', conditions_set]\n else\n conditions << conditions_set\n end\n else\n # condition: AND | OR\n conditions << condition if condition\n end\n else\n conditions_set = build_arel_conditions(filter, condition, conditions)\n\n if unary_condition.present?\n # Prepend to handle in #add_arel_conditions with Arel::Nodes::Not\n conditions = ['not', conditions_set]\n else\n conditions = conditions_set\n end\n end\n\n end\n\n conditions\n end", "title": "" }, { "docid": "2a7dbd3306aa73f3caf29dfc43b0a953", "score": "0.6202761", "text": "def filter_params\n params.permit(:queries => [:type, :attribute, :condition, :conjunction, :values => []])\n end", "title": "" }, { "docid": "908f3feb46114acd5b102c408894fea6", "score": "0.61953044", "text": "def attribute_changed_filter_query(filter, records, current_attribute_changed_record)\n if filter['query_operator'] == 'AND'\n @attribute_changed_records + (current_attribute_changed_record & records)\n else\n @attribute_changed_records + (current_attribute_changed_record | records)\n end\n end", "title": "" }, { "docid": "624157ad8d5ed3905edb537a9ec1d6fe", "score": "0.6185176", "text": "def apply_filters(query)\n query\n end", "title": "" }, { "docid": "034bd3976a8467ed06cc786ff6016fe2", "score": "0.6179468", "text": "def filter\n case\n when params[:filter] == '1'\n @contacts = Contact.joins(:event).where(:events => {:teams => true}).order('created_at ASC')\n when params[:filter] == '2'\n @contacts = Contact.joins(:event).where(:events => {:family => true}).order('created_at ASC')\n when params[:filter] == '3'\n @contacts = Contact.joins(:event).where(:events => {:international => true}).order('created_at ASC')\n when params[:filter] == '4'\n @contacts = Contact.joins(:event).where(:events => {:well => true}).order('created_at ASC')\n when params[:filter] == '5'\n @contacts = Contact.joins(:event).where(:events => {:mission => true}).order('created_at ASC')\n when params[:filter] == '6'\n @contacts = Contact.joins(:event).where(:events => {:leadership => true}).order('created_at ASC')\n when params[:filter] == '7'\n @contacts = Contact.joins(:event).where(:events => {:community => true}).order('created_at ASC')\n when params[:filter] == '8'\n @contacts = Contact.joins(:event).where(:events => {:baptisms => true}).order('created_at ASC')\n when params[:filter] == '9'\n @contacts = Contact.joins(:event).where(:events => {:journey => true}).order('created_at ASC')\n when params[:filter] == '10'\n @contacts = Contact.joins(:event).where.not(:events => {:other => ''}).order('created_at ASC')\n when params[:filter] == '11'\n @contacts = Contact.joins(:event).where(:events => {:email_list => true}).order('created_at ASC')\n when params[:filter] == '12'\n @contacts = Contact.joins(:service).where(:services => {:refreshments => true}).order('created_at ASC')\n when params[:filter] == '13'\n @contacts = Contact.joins(:service).where(:services => {:sound => true}).order('created_at ASC')\n when params[:filter] == '14'\n @contacts = Contact.joins(:service).where(:services => {:roadies => true}).order('created_at ASC')\n when params[:filter] == '15'\n @contacts = Contact.joins(:service).where(:services => {:lights => true}).order('created_at ASC')\n when params[:filter] == '16'\n @contacts = Contact.joins(:service).where(:services => {:website => true}).order('created_at ASC')\n when params[:filter] == '17'\n @contacts = Contact.joins(:service).where(:services => {:service_events => true}).order('created_at ASC')\n when params[:filter] == '18'\n @contacts = Contact.joins(:service).where(:services => {:usher => true}).order('created_at ASC')\n when params[:filter] == '19'\n @contacts = Contact.joins(:service).where(:services => {:kids => true}).order('created_at ASC')\n when params[:filter] == '20'\n @contacts = Contact.joins(:service).where(:services => {:slides => true}).order('created_at ASC')\n when params[:filter] == '21'\n @contacts = Contact.joins(:service).where(:services => {:service_slices => true}).order('created_at ASC')\n when params[:filter] == '22'\n @contacts = Contact.joins(:event).where.not(:events => {:music => ''}).order('created_at ASC')\n when params[:filter] == '23'\n @contacts = Contact.joins(:event).where.not(:events => {:other => ''}).order('created_at ASC')\n else\n @contacts = Contact.all.order('created_at ASC')\n end\n end", "title": "" }, { "docid": "450a9f4462da707ba4c3fa235fd46524", "score": "0.6164696", "text": "def prepare_filter\n @filters = [[t(:message_2, :scope => [:controller, :students]), 2], [t(:message_3, :scope => [:controller, :students]), 0],\n [t(:message_4, :scope => [:controller, :students]), 3]]\n if (@user.has_one_of_roles?(['leader', 'dean', 'vicerector']))\n if !@user.person.indices.empty?\n @filters.concat([[t(:message_5, :scope => [:controller, :students]), 1], [t(:message_6, :scope => [:controller, :students]), 4]])\n end\n end\n if @user.has_role?('board_chairman')\n @filters.concat([[t(:chairmaned, :scope => [:controller, :students]), 5]])\n end\n if !@user.has_one_of_roles?(['faculty_secretary', 'department_secretary', 'university_secretary'])\n # default filter to waiting for approval\n session[:filter] ||= 2\n else\n session[:filter] ||= 3\n end\n end", "title": "" }, { "docid": "9289d271142cc28b21b9ee4c33d6499c", "score": "0.61541635", "text": "def filter_function(item, model, filterattribute, filteroptions, default) \n #Default Filtering\n if filterattribute.blank?\n filterattribute = default\n end \n #Output (case by case basis, since each filter is unique)\n @filteritem = item\n if filterattribute == \"No Filter\"\n blacklist = []\n @filtered = @filteritem.reject { |h| blacklist.include? h['database_activity']}\n end\n if filterattribute == \"Ignored\"\n blacklist = [\"Ignored\"]\n @filtered = @filteritem.reject { |h| blacklist.include? h['database_activity']}\n end\n if filterattribute == \"Low Priority\"\n blacklist = [\"Ignored\", \"Low Priority\"] \n @filtered = @filteritem.reject { |h| blacklist.include? h['database_activity']}\n end \n if filterattribute == \"Anime\"\n blacklist = []\n whitelist = [\"Anime\"]\n @filteritem = @filteritem.select { |h| whitelist.include? h['genre'] } \n @filtered = @filteritem.reject { |h| blacklist.include? h['genre']} \n end\n if filterattribute == \"Unobtained\"\n blacklist = ['true']\n @filtered = @filteritem.reject { |h| blacklist.include? h['obtained']} \n end\n if filterattribute == \"Only Watched\"\n blacklist = [\"Ignored\", \"Low Priority\"]\n whitelist = [\"Up to Date\", \"Not Up to Date\"]\n @filteritem = @filteritem.select { |h| whitelist.include? h['database_activity'] }\n @filtered = @filteritem.reject { |h| blacklist.include? h['database_activity']}\n end\n #Take out the filter option from the filter list\n filteroptions.delete(filterattribute)\n @filterlist = filteroptions \n end", "title": "" }, { "docid": "d907258c837512e5a4a0a6f6f554bc0a", "score": "0.61217314", "text": "def filter_2\n if (params[:price_from] != '' && !params[:price_from].nil?)\n if params[:price_from].numeric?\n @items = @items.where :price.gte => params[:price_from]\n if !(Item.all.where :price.gte => params[:price_from]).exists?\n @warning += \"Sorry.. There is no items starting from \" + params[:price_from] + \"$ | \"\n @notification = \"\"\n @showing_pages = \"\"\n elsif @items.count > 0\n @notification += \"Price greater than or equal \" + params[:price_from] + \"$ | \"\n end\n else\n @type_warning += \"Please choose a number for the starting price | \"\n end\n end\n if (params[:price_to] != '' && !params[:price_to].nil?)\n if params[:price_to].numeric?\n @items = @items.where :price.lte => params[:price_to]\n if !(Item.all.where :price.lte => params[:price_to]).exists?\n @warning += \"Sorry.. There is no items below \" + params[:price_to] + \"$ | \"\n @notification = \"\"\n @showing_pages = \"\"\n elsif @items.count > 0\n @notification += \"Price less than or equal \" + params[:price_to] + \"$ | \"\n end\n else\n @type_warning += \"Please choose a number for the ending price | \" \n end\n end\n if (params[:rating_from] != '' && !params[:rating_from].nil?)\n if params[:rating_from].numeric?\n @items = @items.where :rating.gte => params[:rating_from]\n if !(Item.all.where :rating.gte => params[:rating_from]).exists?\n @warning += \"Sorry.. There is no items starting from \" + params[:rating_from] + \" rate(s) | \"\n @notification = \"\"\n @showing_pages = \"\"\n elsif @items.count > 0\n @notification += \"Rating greater than or equal \" + params[:rating_from] + \" | \"\n end\n else\n @type_warning += \"Please choose a number for the starting rating | \"\n end\n end\n if (params[:rating_to] != '' && !params[:rating_to].nil?)\n if params[:rating_to].numeric?\n @items = @items.where :rating.lte => params[:rating_to]\n if !(Item.all.where :rating.lte => params[:rating_to]).exists?\n @warning += \"Sorry.. There is no items below \" + params[:rating_to] + \" rate(s) | \"\n @notification = \"\"\n @showing_pages = \"\"\n elsif @items.count > 0\n @notification += \"Rating less than or equal \" + params[:rating_to] + \" | \"\n end\n else\n @type_warning += \"Please choose a number for the ending rating | \"\n end\n end\n end", "title": "" }, { "docid": "739aa920e5cff1082611d696e65b6863", "score": "0.6115578", "text": "def filter_clause(conditions)\n return \"\" if conditions.nil?\n if conditions.kind_of?(Hash) && (conditions.has_key?(:new) || conditions.has_key?(:old))\n clause = conditions.map do |trigger_var, c|\n t = trigger_var.to_s.upcase\n expand_conditional_clause(c, t)\n end.join(\" AND \")\n else\n clause = conditions\n end\n\n clause.empty? ? \"\" : \"IF (#{clause}) THEN RETURN NULL; END IF;\"\n end", "title": "" }, { "docid": "e9efcf47d8e2a46608f51e5254f91a42", "score": "0.611043", "text": "def update_conditions(conditions, new_condition)\n conditions ||= {}\n updated_conditions = conditions.clone rescue nil\n if updated_conditions.blank?\n if new_condition.is_a? String\n new_condition.sub!(/^\\s*(or|OR|and|AND)\\s*/, '')\n elsif new_condition[0].is_a? String\n new_condition[0].sub!(/^\\s*(or|OR|and|AND)\\s*/, '') \n end\n updated_conditions = new_condition\n elsif updated_conditions.is_a? String\n if new_condition.is_a? String\n updated_conditions += \" #{new_condition}\"\n else\n updated_conditions = [updated_conditions += \" #{new_condition.first}\", \n *new_condition[1..-1]]\n end\n else\n if new_condition.is_a? String\n updated_conditions[0] += \" #{new_condition}\"\n else\n updated_conditions[0] += \" #{new_condition[0]}\"\n updated_conditions += new_condition[1..-1]\n end\n end\n updated_conditions\n end", "title": "" }, { "docid": "f6de4d8b55242abc6a673ee959b04e40", "score": "0.6107775", "text": "def update!(**args)\n @composite_filter = args[:composite_filter] if args.key?(:composite_filter)\n @field_filter = args[:field_filter] if args.key?(:field_filter)\n @unary_filter = args[:unary_filter] if args.key?(:unary_filter)\n end", "title": "" }, { "docid": "f6de4d8b55242abc6a673ee959b04e40", "score": "0.6107775", "text": "def update!(**args)\n @composite_filter = args[:composite_filter] if args.key?(:composite_filter)\n @field_filter = args[:field_filter] if args.key?(:field_filter)\n @unary_filter = args[:unary_filter] if args.key?(:unary_filter)\n end", "title": "" }, { "docid": "14280a170b5c1936ae55440e4f175132", "score": "0.6106872", "text": "def get_filter remove=false\n filter=nil\n if model_attributes.has_key? :filter\n filter=\"\"\n model_attributes[:filter].to_hash.each do |a,b|\n filter += (filter.blank? ? \"\" : \" and \") + a.to_s.downcase+b.to_s\n end \n model_attributes.delete :filter if remove\n end\n filter\n end", "title": "" }, { "docid": "93114c557da48faa007d43cd6a4706e0", "score": "0.6103407", "text": "def build_search_conditions(query)\n return nil\n end", "title": "" }, { "docid": "b6b09bd97e866bc9bd13b811b6e5218a", "score": "0.60977024", "text": "def set_opp_pipe_conditions(conditions_hash)\n if params[:get_records] == 'My'\n search = 'company_id=:company_id AND assigned_to_employee_user_id=:assign_to'\n else\n search = 'company_id=:company_id'\n end\n if params[:report][:status] != \"All\"\n search += \" AND stage = (:s_arr)\"\n conditions_hash[:s_arr] = params[:report][:status]\n else\n search+= \" AND stage is not :null \"\n conditions_hash[:null] = nil\n end\n if params[:report][:probability] != \"1\"\n val = params[:report][:probability].split(\":-:\")\n search += \" AND probability #{val[0]} :prob\"\n conditions_hash[:prob] = val[1]\n end\n \n [search,conditions_hash]\n end", "title": "" }, { "docid": "438e266c1474390a6daeb47373cd7e77", "score": "0.6097519", "text": "def default_filter filter, request\n\t@db = filter(filter) unless !find_filters(request).empty?\nend", "title": "" }, { "docid": "b1c362077e19c578628d94dfa17fe24f", "score": "0.6093659", "text": "def filter_attributes=(filter_attributes); end", "title": "" }, { "docid": "27d4c32a1f25f7fc4781006229214e16", "score": "0.6087966", "text": "def build_conditions\n @filter_for = IpHost #TODO: make this smarter!\n @cond_arry = []\n @cond_hash = {}\n\n self.cond_ip_and_mask(:ip_addr, self.network, self.netmask)\n \n #act_idx\n self.cond_ge(:act_idx, :min_act_idx)\n self.cond_le(:act_idx, :max_act_idx)\n\n #sig \n self.cond_ge(:src_sig_cnt, :min_src_sig)\n self.cond_le(:src_sig_cnt, :max_src_sig) \n self.cond_ge(:dst_sig_cnt, :min_dst_sig)\n self.cond_le(:dst_sig_cnt, :max_dst_sig) \n\n #alert\n self.cond_ge(:src_ev_cnt, :min_src_alert)\n self.cond_le(:src_ev_cnt, :max_src_alert)\n self.cond_ge(:dst_ev_cnt, :min_dst_alert)\n self.cond_le(:dst_ev_cnt, :max_dst_alert)\n \n self._gen_sql\n end", "title": "" }, { "docid": "2e893ff16fb60433dbee9cc6a5434848", "score": "0.60878825", "text": "def conditions=(_arg0); end", "title": "" }, { "docid": "a9434893a56de9f92a43ff6bb2f1905a", "score": "0.6072412", "text": "def prepare_search_conditions(is_location)\n cond_params = Array.new\n cond = Array.new\n\n #This prepares filtering conditions for States, Counties, Cities and zips\n @@PARAM_KEYS.each do |r|\n unless (@search_params[r].nil?)\n cond_tmp = \"(\"\n @search_params[r].each do |elem|\n cond_tmp << \"#{@@JOIN_TABLES[r]['col']} = ?\"\n cond_params << elem\n cond_tmp << \" OR \" unless elem == @search_params[r].last\n end\n cond_tmp << \")\"\n cond << cond_tmp\n end\n end\n #we use is_location as flag to switch between agencies\n # with category != State/Local Plans and category == State/Local Plans\n cond << (is_location ? ' a.agency_category_id != ? ' : ' a.agency_category_id = ? ')\n cond_params << AgencyCategory[:'State/Local Plans'].id\n cond << prepare_active_condition if is_active?# || has_any_conditions?\n\n cond << prepare_counseling_condition if has_counseling_condition?\n if (has_category_condition?)\n sql_q, sql_p = prepare_category_condition\n cond << sql_q\n cond_params << sql_p\n end\n\n #use only active locations, or plans\n cond << (is_location ? ' l.is_active = 1 ' : ' l.is_active=1 and p.is_active = 1 ')\n\n #selected locations must fullfil all conditions from filter\n return [cond.join(' AND '), cond_params]\n end", "title": "" }, { "docid": "dbf604514d20dc5238bb1afbb0bb4ffe", "score": "0.6072109", "text": "def prepare_example_filtering; end", "title": "" }, { "docid": "5a0cd6b1c42ffc97861fa7e5d5a8425a", "score": "0.6064197", "text": "def parse(filter_model)\n JSON.parse(filter_model).map do |column, filter|\n column = column.split('_').first.underscore\n if filter.key?('condition1')\n parse_multi(column, filter)\n elsif filter.key?('filter')\n text_filter(column, filter['filter'])\n end\n end.join(' AND ')\n end", "title": "" }, { "docid": "b4ca541624c661606b74eb448f334370", "score": "0.60575163", "text": "def process_filter_querystring(story_objects) \n gon.page_filtered = params[:staff_pick].present? || params[:sort].present? || params[:category].present? || params[:tag].present? || params[:language].present? || params[:q].present? || params[:following].present?\n \n # not published (only available when users editing their stories)\n if params[:not_published].present?\n @story_filter_not_published = params[:not_published].to_bool\n else\n \t\t@story_filter_not_published = false\n end\n story_objects = story_objects.is_not_published if @story_filter_not_published\n\n # staff pick\n if params[:staff_pick].present?\n @story_filter_staff_pick = params[:staff_pick].to_bool\n #elsif params[:sort].present? || params[:category].present? || params[:tag].present? || params[:language].present? || params[:q].present?\n # @story_filter_staff_pick = false\n else\n# \t\t@story_filter_staff_pick = controller_action?('root','index')\n \t\t@story_filter_staff_pick = false\n end\n story_objects = story_objects.is_staff_pick if @story_filter_staff_pick\n\n # sort\n @story_filter_sort_recent = true\n @story_filter_sort_permalink = \"\"\n if params[:sort].present? && I18n.t('filters.sort').keys.map{|x| x.to_s}.include?(params[:sort])\n case params[:sort]\n when 'recent'\n \t\t\tstory_objects = story_objects.recent\n when 'reads'\n \t\t\tstory_objects = story_objects.reads\n @story_filter_sort_recent = false\n @story_filter_sort_permalink = \"reads\"\n when 'likes'\n \t\t\tstory_objects = story_objects.likes\n @story_filter_sort_recent = false\n @story_filter_sort_permalink = \"likes\"\n end\n\t\t\t@story_filter_sort = I18n.t(\"filters.sort.#{params[:sort]}\")\n else\n story_objects = story_objects.recent\n\t\t\t@story_filter_sort = I18n.t(\"filters.sort.recent\")\n end\n \n # category\n @story_filter_category_all = true\n @story_filter_category_permalink = \"\"\n index = params[:category].present? ? @categories_published.index{|x| x.permalink.downcase == params[:category].downcase} : nil\n if index.present?\n story_objects = story_objects.by_category(@categories_published[index].id) \n \t\t@story_filter_category = @categories_published[index].name\n @story_filter_category_permalink = @categories_published[index].permalink\n @story_filter_category_all = false\n else\n \t\t@story_filter_category = I18n.t(\"filters.all\")\n end\n \n #tags\n if params[:tag].present?\n story_objects = story_objects.tagged_with(params[:tag])\n \t\t@story_filter_tag = params[:tag].titlecase\n else\n \t\t@story_filter_tag = I18n.t(\"filters.all\")\n end \n \n # language\n @story_filter_language_permalink = \"\"\n index = params[:language].present? ? @languages_published.index{|x| x.locale.downcase == params[:language].downcase} : nil\n# if index.nil? && user_signed_in? && current_user.default_story_locale.present?\n# index = @languages_published.index{|x| x.locale.downcase == current_user.default_story_locale}\n# end\n @story_filter_language_all = true\n if index.present?\n story_objects = story_objects.by_language(@languages_published[index].locale) \n \t\t@story_filter_language = @languages_published[index].name\n @story_filter_language_permalink = @languages_published[index].locale\n @story_filter_language_all = false\n else\n \t\t@story_filter_language = I18n.t(\"filters.all\")\n end\n \n # following users\n @story_filter_show_following = user_signed_in? && controller_action?('root','index')\n if user_signed_in?\n @following_users = current_user.following_users\n if @following_users.present? && params[:following].present? && params[:following].to_bool == true\n story_objects = story_objects.by_authors(@following_users.map{|x| x.id}.uniq)\n @story_filter_following = true\n else \n @story_filter_following = false\n end\n end\n # logger.debug \"/////////////////// @story_filter_following = #{@story_filter_following}\"\n \n # search\n @q = \"\"\n\t\tif params[:q].present?\n\t\t\tstory_objects = story_objects.search_for(params[:q])\n\t\t\tgon.q = params[:q]\n @q = params[:q]\n\t\tend\n return story_objects\n end", "title": "" }, { "docid": "1edcc847e15374b863cb49b8b7bcb6ab", "score": "0.60503596", "text": "def query_results\n u_id = @user.id\n f_crtd_after = filter_params[\"created_after\"] if filter_params.has_key? \"created_after\"\n f_crtd_before = filter_params[\"created_before\"] if filter_params.has_key? \"created_before\"\n if filter_params.keys.count == 2\n Operation.where{ (user_id=~ u_id) & (created_at > f_crtd_after) & (created_at < f_crtd_before) }\n elsif f_crtd_after\n Operation.where{ (user_id=~ u_id) & (created_at > f_crtd_after) }\n elsif f_crtd_before\n Operation.where{ (user_id=~ u_id) & (created_at < f_crtd_before) }\n end\n end", "title": "" }, { "docid": "0ad87eb7f8b429d1c2c25738356e7215", "score": "0.60406864", "text": "def update!(**args)\n @composite_filter = args[:composite_filter] if args.key?(:composite_filter)\n @value_filter = args[:value_filter] if args.key?(:value_filter)\n end", "title": "" }, { "docid": "eb4ea776619e70653ded5b6540640403", "score": "0.60402936", "text": "def conditions\n @params[:conditions]\n end", "title": "" }, { "docid": "83bab21d2adc3abcea332645c75ec1f5", "score": "0.6038787", "text": "def where conditions\n @blacklight_params[:q] = conditions\n self\n end", "title": "" }, { "docid": "ab4a203f7aec66a72cf6475b2a928b1c", "score": "0.6025742", "text": "def results\t\t\r\n\t\t\t\r\n\t\t#Before querying the properties table. It will build up an SQL string for a query to filter \r\n\t\t#the properties table. It will only filter on conditions which the user explicitly specifies \r\n\t\t#a preference.\t\t\r\n\t\t#We don't know which condition will be inserted into the array first or how many because it \r\n\t\t#depends on what the user chooses. Only the ones that are choosen are added to the array and \r\n\t\t#so then Array.join is used to join the elements with \"AND\" to form a valid sql query string.\r\n\t\t#In addition if params[attribute] isn't present (for whatever reason), i.e. it's blank, then don't include that condition.\t\t\t\t\r\n\t\tsql_array = []\r\n\t\tsql_array << \"price >= :min_price\" unless params[:min_price].blank? || params[:min_price] == \"No Min\"\r\n\t\tsql_array << \"price <= :max_price\" unless params[:max_price].blank? || params[:max_price] == \"No Max\"\r\n\t\tsql_array << \"number_of_bedrooms >= :min_no_of_bedrooms\" unless params[:min_no_of_bedrooms].blank? || params[:min_no_of_bedrooms] == \"No Min\"\r\n\t\tsql_array << \"number_of_bedrooms <= :max_no_of_bedrooms\" unless params[:max_no_of_bedrooms].blank? || params[:max_no_of_bedrooms] == \"No Max\"\r\n\t\tsql_array << \"property_type = :property_type\" unless params[:property_type].blank? || params[:property_type] == \"Any Type\"\r\n\t\tsql_array << \"move_in_date >= :move_in\" unless params[:move_in_date].blank? \t\t# the default date will be used if not user supplied\r\n\t\tsql_array << \"lease_type = :lease_type\" unless params[:lease_type].blank? || params[:lease_type] == \"Any Type\"\r\n\t\tsql_array << \"parking = :parking\" unless params[:parking].blank? || params[:parking] == \"neutral\"\r\n\t\tsql_array << \"washing_machine = :washing_machine\" unless params[:washing_machine].blank? || params[:washing_machine] == \"neutral\"\r\n\t\tsql_array << \"dryer = :dryer\" unless params[:dryer].blank? || params[:dryer] == \"neutral\"\r\n\t\tsql_array << \"dishwasher = :dishwasher\" unless params[:dishwasher].blank? || params[:dishwasher] == \"neutral\"\t\t\r\n\t\tsql_array << \"internet = :internet\" unless params[:internet].blank? || params[:internet] == \"neutral\"\r\n\t\tsql_array << \"microwave = :microwave\" unless params[:microwave].blank? || params[:microwave] == \"neutral\"\r\n\t\t\r\n\t\tsql_string = sql_array.join(\" AND \")\r\n\t\t\t\t\r\n\t\t#The sql string is used to query the properties table and the results are ordered to place the \r\n\t\t# most inexpensive properties near the begining but preferring those with \"richer\" features and facilities.\t\t\r\n\t\t#we have to pass params here rather than embed in the string for security reasons\t\t\r\n\t\t@properties = Property.where(sql_string, params).order('price asc, number_of_bedrooms desc, washing_machine desc, dryer desc, internet desc, parking desc, microwave desc, move_in_date asc')\t\t\r\n\t\tScoring.match_score_calc @properties\t\t#the match score is calculated for all on this sorted array of properties\r\n\t\t\t\t\t\r\n\t\t#Write commute destination coordinates to file in OTP format required for routing software to read.\r\n\t\t#It is acknowledged that this is not thread safe at the moment. In that each request uses this same file so the application can \r\n\t\t#only give a accurate result to one request at a time. Making the file name using a unique number for each request would be one approach \r\n\t\t#to address this. OTP would need to know the name of the file, which could be passed over a socket.\t\t\r\n\t\t File.open(Rails.root.join( \"other_files/commute/otp_origin/Origin.csv\"), 'w') do |file| \t\t\t\t\t\t\t\r\n\t\t\t\t file.puts(\"label,lat,lon,input\")\r\n\t\t\t\t file.puts(\"o1,#{params[:commute_destination]},0\")\t\t\t\r\n\t\t end\r\n\r\n\t\t\r\n\t\t@transport_modes = params.slice(:transit, :car, :walk).values #get the selected transport modes submitted and put into array\r\n\t\t\r\n\t\t@amenity_types = params.slice(:supermarket, :convenience_shop, :restaurant, :library,:bank).values\t#get the selected amenity types submitted and put into array\r\n\t\t#even if default amenity weighting is used, the results view iterates over each amenity type\r\n\t\t\t\t\r\n\t\t#A hash for the transport modes, for converting from the strict syntax required by opentripplanner into a more readable format in the view.\r\n\t\t@transport_mode_words_hash = {'CAR' => 'Car', 'TRANSIT,WALK' => 'Public transport and walking', 'WALK' => 'Walking'}\r\n\t\t\r\n\t\tCommuteCalc.request_routing_calculation(@transport_modes) #call method to signal to OTP to calculate the commute times to properties passing in the preferred transport mode.\r\n\r\n\t\t#once OTP has calculated commute times, we pass a properties array, sorted by id, so that the results file can be merged with the properties\r\n\t\tCommuteCalc.calc_commute_score @properties.sort {|x,y| x.id <=> y.id} \r\n\t\t\r\n\t\t# if not using default amenity weighting then recalculate the amenity scores for the properties.\r\n\t\t#passing in the filtered properties, transport modes, custom amenity weighting and amenity types submitted\r\n\t\tif(!params[:amenity_weighting_default]) then\r\n\t\t\t@amenity_weights = params.slice(:supermarket_weight_value, :convenience_shop_weight_value, :restaurant_weight_value, :library_weight_value, :bank_weight_value) \t#get the set amenity weightings submitted and assign a hash\r\n\t\t\tAmenityCalc.amenity_score_calc(@properties, @amenity_types, @transport_modes, @amenity_weights) \r\n\t\tend\r\n\t\t\r\n\t\t#calculate the total score for the filtered properties\r\n\t\tScoring.total_score_calc @properties\r\n\t\t\t\t\r\n\t\t@properties.sort!\t#sort in place for descending order by total score\r\n\t\t\r\n\t\t#the top 10 properties will be taken. slice! is used to remove all from the 11th element to the end. \r\n\t\t#it will modify the array in place\r\n\t\t@properties.slice!(10..-1)\r\n\t\t\r\n\tend", "title": "" }, { "docid": "b90fb1dc0905b50eb454ba1323fa56ef", "score": "0.6011775", "text": "def update\n @filter = ::Filter.find(params[:id])\n filter_params = params[:filter]\n # I need to make this more secure someday\n # logger.debug(\"before: #{filter_params}\")\n # if filter_params && (c = filter_params[:condition_attributes]) && (s = c[:sql])\n # logger.debug(\"here #{s} #{s.class}\")\n # d = eval(s)\n # logger.debug(\"here2 #{d} #{d.class}\")\n # c[:sql] = d\n # end\n # logger.debug(\"after: #{filter_params}\")\n respond_to do |format|\n if @filter.update_attributes(filter_params)\n flash[:notice] = 'Filter was successfully updated.'\n format.html { redirect_to(@filter) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @filter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9666b9263e460eb869709fbc0a418762", "score": "0.6010494", "text": "def filters=(_arg0); end", "title": "" }, { "docid": "9666b9263e460eb869709fbc0a418762", "score": "0.6010494", "text": "def filters=(_arg0); end", "title": "" }, { "docid": "9666b9263e460eb869709fbc0a418762", "score": "0.6010494", "text": "def filters=(_arg0); end", "title": "" }, { "docid": "9666b9263e460eb869709fbc0a418762", "score": "0.6010494", "text": "def filters=(_arg0); end", "title": "" }, { "docid": "ddcd7d1dc5c1cb004c18edd97a1729ea", "score": "0.6010381", "text": "def record_select_conditions_from_controller; end", "title": "" }, { "docid": "ddcd7d1dc5c1cb004c18edd97a1729ea", "score": "0.6010381", "text": "def record_select_conditions_from_controller; end", "title": "" } ]
68f16e1f454b35938b7a89ffa12b424f
Gets the votd from the Good News Publishers, Crossway Bibles, RSS feed
[ { "docid": "c3dffb27a399588f581011ceb53e0e30", "score": "0.7526341", "text": "def get_votd\n parsed_feed = Nokogiri::XML(HTTParty.get(URI).body)\n cleaned_copyright = clean_copyright(parsed_feed.xpath(\"//copyright\").text)\n\n @reference = parsed_feed.xpath(\"//title\")[1].text\n @text = parsed_feed.xpath(\"//description\")[1].text\n @copyright = cleaned_copyright\n @link = parsed_feed.xpath(\"//guid\").text\n @version = BIBLE_VERSION\n @version_name = BIBLE_VERSION_NAME\n\n @text = Helper::Text.clean_verse_start(@text)\n @text = Helper::Text.clean_verse_end(@text)\n rescue => e\n # use default info for VotD\n set_defaults\n end", "title": "" } ]
[ { "docid": "e9ed5c9656f975ae348b255578c0eb71", "score": "0.71098346", "text": "def votd\n require 'rss'\n\n votd = RSS::Parser.parse('https://www.biblegateway.com/usage/votd/rss/votd.rdf?31', false)\n\n render json: votd\n end", "title": "" }, { "docid": "0c19d3003cd4c05fd7015526253a940d", "score": "0.64041376", "text": "def get_votd\n uri = \"#{URI}#{@version_number}\"\n feed = Feedjira.parse(HTTParty.get(uri).body)\n entry = feed.entries.first\n cleaned_text = clean_text(entry.content)\n\n @reference = entry.title\n @link = entry.entry_id\n @text = cleaned_text\n @copyright = get_copyright(entry.content)\n rescue => e\n # use default info for VotD\n set_defaults\n #raise e\n # @todo Add logging\n end", "title": "" }, { "docid": "a88f948e41e80818ea34c3090f76610f", "score": "0.6161199", "text": "def feed\n\t\t\tpost = { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml = nessus_request('feed', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tfeed = docxml.root.elements['contents'].elements['feed'].text\n\t\t\tversion = docxml.root.elements['contents'].elements['server_version'].text\n\t\t\tweb_version = docxml.root.elements['contents'].elements['web_server_version'].text\n\t\t\treturn feed, version, web_version\n\t\tend", "title": "" }, { "docid": "0a5651f2429d4393693f989591cbb206", "score": "0.5997905", "text": "def get_digg\n\nresponse = JSON.parse(RestClient.get 'http://digg.com/api/news/popular.json')\n# puts response['data']['feed'][0]['content']['title']\n\nstories = []\n\nresponse['data']['feed'].each do |story|\n\tstory_hash = {}\n\tstory_hash[:title] = story['content']['title']\n\tstory_hash[:category] = story['content']['tags'][0]['display']\n\tcalculate_upvotes(story_hash)\n\tstories.push(story_hash)\n\tend\n\tshow_all_stories(stories)\nend", "title": "" }, { "docid": "3d132ef59c8e41ba5b4500e6bd5ad545", "score": "0.59191865", "text": "def get_votd\n netbible_data = JSON.parse(HTTParty.get(URI))\n\n # use bookname from first verse -- assume votd won't span books\n bookname = netbible_data[0][\"bookname\"]\n\n # use chapter from first verse -- assume votd won't span chapters\n chapter = netbible_data[0][\"chapter\"]\n\n # loop through each verse to get the verse numbers and verse text\n verse_numbers = Array.new\n verses = Array.new\n netbible_data.each do |verse|\n verse_numbers << verse[\"verse\"]\n verses << verse[\"text\"]\n end\n\n # now build the reference\n @reference = \"#{bookname} #{chapter}:#{verse_numbers.join(\"-\")}\"\n\n # build the text\n text = Helper::Text.strip_html_tags(verses.join(\" \"))\n text = Helper::Text.clean_verse_start(text)\n text = Helper::Text.clean_verse_end(text)\n\n @text = text\n\n @version = BIBLE_VERSION\n @version_name = BIBLE_VERSION_NAME\n\n @link = generate_link(bookname, chapter, verse_numbers.first)\n\n rescue => e\n # use default info for VotD\n set_defaults\n # @todo Add logging\n end", "title": "" }, { "docid": "db27015a39e61cce82e0d00625a44297", "score": "0.59078556", "text": "def feed\n\t\t@goths = Goth.find(:all, :conditions => 'published_at IS NOT NULL', :limit => 10, :order => 'published_at DESC')\n\tend", "title": "" }, { "docid": "5a6087c7b18755f4c63e89e6f807c86a", "score": "0.58889544", "text": "def rss\n @title = t('titles.news', brand: website.brand_name)\n @description = website.value_for(\"default_meta_tag_description\")\n @news = News.all_for_website(website)\n respond_to do |format|\n format.xml # render rss.xml.builder\n end\n end", "title": "" }, { "docid": "819477ca26d99edc3f048689ce0938b3", "score": "0.5880346", "text": "def read_rss\n query = \"http://news.google.ru/news?hl=ru&topic=#{@topic}&output=rss&ned=ru_ru&num=30&&scoring=n\"\n feed = Feedjira::Feed.fetch_and_parse(query)\n feed.entries.map do |entry|\n {\n uuid: SecureRandom.uuid,\n title: entry.title,\n url: entry.url.match(GOOGLE_URI_REGEX)[0],\n published_datetime: entry.published,\n published_unixtime: entry.published.to_i\n }\n end\n end", "title": "" }, { "docid": "dcab2e5f74737ca5f88e086e4530fba9", "score": "0.586119", "text": "def aviator \n aviator_output = {}\n source = \"Aviator-aero\"\n url = 'https://newsroom.aviator.aero/rss/'\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n\n feed.items.each_with_index {|item, index|\n title = item.title\n description = item.description.gsub(/<\\/?[^>]*>/, \"\")\n category = item.category\n link = item.link \n \n aviator_output[index] = {\n :title => title,\n :description => description,\n :link => link,\n :source => source\n }\n }\n end\n aviator_output\n end", "title": "" }, { "docid": "84bcbe2e58400945c51bc0d2520f5968", "score": "0.58542657", "text": "def get_episode_info\n\n\t\tbegin\n\t\t\turl = source_url\n\t\t\t# url = \"https://www.tvspielfilm.de/tv-programm/sendung/miss-undercover,5cd28786818965652bf912ab.html\"\n\t\t\t# url = \"https://www.tvspielfilm.de/tv-programm/sendung/monitor,5cda852e81896518171f509c.html\"\n\t\t\tdoc \t\t\t= send_request(url)\n\t\t\tdata \t\t\t= doc.css(\"article.broadcast-detail\")\n\t\t\t# header \t\t= doc.css(\"header.broadcast-detail__header\")\n\t\t\t# duration \t\t= header.css(\"div.text-wrapper span.text-row\")[1].text[-7..-2] rescue nil\n\t\t\tchannel \t\t= doc.css(\"span.tv-show-label__channel\").text\n\t\t\tvideo \t\t\t= get_video_url(doc)\n\t\t\tdescription = doc.css(\"section.broadcast-detail__description p\").text.delete(\"\\\"\").delete(\"\\r\").delete(\"\\n\")\n\t\t\tcast \t\t\t= doc.css(\"section.cast dl\")\n\t\t\tcasts \t\t\t= get_cast(cast[0])\n\t\t\tactors \t\t\t= get_cast(cast[1])\n\t\t\tthumb = doc.css('div.editorial-rating')[0].values[0].split(\" \")[1] rescue nil\n\t\t\t# transmitter_valid(channel)\n\t\t\timage = doc.css(\".broadcast-detail__stage img\").first.attributes[\"src\"].value rescue []\n\t self.program.update(genre: casts[\"Genre\"]) if (casts[\"Genre\"].present? && program.genre.nil?)\n\t\t\t\n\t\t\tparam = {is_scraped: true} \n\t\t\tparam.merge!(preview_video_url: video) if video.present?\n\t\t\tself.update(param)\n\n\t self.episode_infos.create(description: description, country: casts[\"Land\"], year: casts[\"Jahr\"],age_rating: casts[\"Altersfreigabe\"], director: casts[\"Regie\"], producer: casts[\"Produzent\"], script: casts[\"Drehbuch\"], camera: casts[\"Kamera\"], music: casts[\"Musik\"], original_title: casts[\"Originaltitel\"], actors: actors ,thumb: thumb, image_urls: image)\n\t get_rating(doc)\n\t rescue StandardError => e\n\t \tRails.logger.info \"================================================\"\n\t \tRails.logger.info \"Having some issues during storing episode info.\"\n\t \tRails.logger.info \"#{e}\"\n\t end\n\tend", "title": "" }, { "docid": "8981e37b09e05389eb3d0d6d7c4b91d2", "score": "0.5792265", "text": "def rss_video\n @language = params[:DLANG] || 'ENG'\n I18n.locale = @locale = Language::CODE3_LOCALE[@language] || :en\n\n @days = params[:DAYS].to_i || 1\n @days = 1 if @days > 31 || @days < 1\n\n @host = \"#{request.protocol}#{request.host}#{request.port == 80 ? '' : \":#{request.port}\"}\"\n\n # Get list of updated files\n @files = get_updated_files(@days).map do |file|\n {\n lesson_id: file[0],\n title: get_lesson_title(file[0], @language),\n updated: file[1][0].updated,\n files: file[1].group_by { |x| x['ftype'].downcase }\n }\n end.select do |file|\n file[:title]\n end\n end", "title": "" }, { "docid": "6fdf3844d365167cb4227e090108956d", "score": "0.5753128", "text": "def get_rss\n all( :conditions => ['published_at IS NOT NULL'], :order => 'published_at DESC', :limit => per_page )\n end", "title": "" }, { "docid": "9ced3e74643fa4c0dd22c2d917c696c4", "score": "0.573671", "text": "def send_news\n feed = RSS::Parser.parse open(KAGDEV_RSS).read\n last_post_title = feed.channel.item.title\n\n # Check, whether the latest title of the post at KAG development\n # blog is still the same, as it was, when the fetcher checked it last\n # time.\n return if unchanged?(last_post_title)\n\n item = feed.channel.item\n\n last_post_date = item.pubDate\n last_post_author = item.dc_creator\n last_post_link = item.link\n\n News.create(\n :title => last_post_title,\n :date => last_post_date,\n :author => last_post_author,\n :link => last_post_link\n )\n\n real_author = reveal_author(last_post_author)\n short_link = open(\"http://clck.ru/--?url=#{last_post_link}\").read\n\n Bot::CHANNELS.each do |chan|\n Channel(chan).send I18n.news_fetcher.news(real_author, last_post_title, short_link)\n end\n rescue SocketError\n nil\n end", "title": "" }, { "docid": "76a4ad415c07c5aabd29cbfd18581322", "score": "0.5730529", "text": "def parse_feed\n feed = self.download_feed\n Nokogiri::XML(feed).xpath(\"//item\").map do |item|\n enclosure = item.xpath(\"enclosure\").first\n\n title = CGI::unescapeHTML(item.xpath(\"title\").text.chomp)\n publish_date = Time.parse(item.xpath(\"pubDate\").inner_html.chomp)\n type = enclosure ? enclosure[:type] : nil\n url = enclosure ? enclosure[:url] : nil\n Podcast.new title, publish_date, type, url, self\n end\n end", "title": "" }, { "docid": "5a6c4b6238ac3aab1a722a1abbb14dcd", "score": "0.5729241", "text": "def get_feed(url)\n source = URI.open(url, 'User-Agent' => 'Mozilla/5.0')\n feed = RSS::Parser.parse(source)\nend", "title": "" }, { "docid": "6044c23890d92f61e8412d72556ad301", "score": "0.57125366", "text": "def get_rss\n #version = \"1.0\" # [\"0.9\", \"1.0\", \"2.0\"]\n version = @version\n\n content = RSS::Maker.make(@version) do |m|\n m.channel.title = @title\n m.channel.description = @description \n m.channel.link = @link \n m.channel.language = @language\n m.channel.about = @about\n m.items.do_sort = true # sort items by date\n m.channel.updated = Time.now.to_s\n m.channel.author = NAME\n\n if @image != nil\n m.image.url = @image\n m.image.title = @title\n end\n\n for mp3 in @mp3s \n item = m.items.new_item\n item.title = mp3\n ## add a base url \n if base != ''\n link = base + '/' + URI::escape(mp3.path)\n else \n link = URI::escape(mp3.path)\n end\n item.link = link\n item.date = mp3.mtime\n item.enclosure.url = link\n item.enclosure.length = mp3.length\n item.enclosure.type = mp3.type\n end\n end\n\n return content\n end", "title": "" }, { "docid": "960e31e1a193367236fdc89f32ead12c", "score": "0.5712238", "text": "def scrape\n articles = []\n url = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_sport_2789.xml'\n\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n articles << (interpret item)\n end\n end\n articles\n end", "title": "" }, { "docid": "9a168227a989ec1768b5af3bf627c4c8", "score": "0.5709678", "text": "def news_results\n GoogleNewsResults.instance\n end", "title": "" }, { "docid": "25f0107bf8fda1aef2e0435a4537cd83", "score": "0.56632155", "text": "def find_feed\n @feed = Feed.find(params[:id]).current_version\n end", "title": "" }, { "docid": "2abbdeb7d1bfc1e238ac42ccd8abb500", "score": "0.56496835", "text": "def rss \n @vote_topics = VoteTopic.rss\n respond_to do |format|\n format.rss\n end\n end", "title": "" }, { "docid": "1500e2ef72f6811a5c0acfbe6032274e", "score": "0.5628438", "text": "def show\n @vms = @server.feed\n end", "title": "" }, { "docid": "2858e06c5d6fb61ec530bfdee9271eb9", "score": "0.56188774", "text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\t@source_name = feed.channel.title\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(item.dc_creator, item.title, item.description,\\\n\t\t\t\t\t\t\"\", @source_name, item.pubDate.to_date, item.link)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend", "title": "" }, { "docid": "db62086c25037670665eddf8ac777a54", "score": "0.5613283", "text": "def news_feed\n begin\n client = Feedlr::Client.new(oauth_access_token: ENV['FEEDLY_OAUTH_ACCESS_TOKEN'])\n @latest_list = {}\n client.user_unread_counts.unreadcounts.each do |unread_articles|\n next if unread_articles['count'] == 0\n unread_article_items = client.stream_entries_contents(unread_articles.id, unreadOnly: true).items\n next if unread_article_items.empty?\n\n unread_article_items.each do |article|\n @latest_list[article.alternate[0].href] = \"◼︎ <a href='#{article.alternate[0].href}'>#{article.title} - #{article.origin.title}</a>\"\n end\n client.mark_article_as_read(unread_articles.id)\n end\n @latest_news = @latest_list.values.join(\"<br>\")\n rescue => evar\n fail evar\n end\n @latest_news\n end", "title": "" }, { "docid": "3f72871738c75398657d4386c41447d0", "score": "0.5598555", "text": "def rss\r\n Nokogiri::XML(body)\r\n end", "title": "" }, { "docid": "db25fb0a3f8a0f976fc4ee45c4f8cae9", "score": "0.5584877", "text": "def feed_items\n feed_item\n end", "title": "" }, { "docid": "ec3cb531638e53fa3c6f310e0fce3506", "score": "0.55699754", "text": "def feed\n @bookings = Booking.find_waiting_pickup\n respond_to do |format|\n format.rss\n end\n end", "title": "" }, { "docid": "322bb27b186bf6017c9884bf1917eecd", "score": "0.5567003", "text": "def show\n\n update_feed(@feed)\n\n @items = @feed.items.order('pub_date DESC').page params[:page]\n\n end", "title": "" }, { "docid": "719ea1fa9b39af64de527adb9a2c52af", "score": "0.55630064", "text": "def scrape\r\n @article_arr = []\r\n\t\turl = 'http://www.theage.com.au/rssheadlines/technology-news/article/rss.xml'\r\n open(url) do |rss|\r\n \tfeed = RSS::Parser.parse(rss, false)\r\n puts \" \"\r\n puts \"*********************************\"\r\n \tputs \"Title: #{feed.channel.title}\"\r\n puts \"--------------------------------\"\r\n feed.items.each do |item|\r\n \t@article_arr << AgeArticle.new(author: \"nil\", title: item.title.to_s.gsub(/,/,''), \r\n summary: (item.description).match(/\\<\\/p\\>[\\w ?,''\"\"]+/).to_s.gsub(/\\<\\/p\\>/,'').gsub(/,/,'').gsub(/\\\"/,''), \r\n images: (item.description).match(/http.+\\.(jpg|png)/), source: item.link, date: item.pubDate.to_s.gsub(/,/,''))\r\n end\r\n end\r\n @articles.concat(@article_arr)\r\n end", "title": "" }, { "docid": "aeeb79e48b38045bf0b48fc37def355a", "score": "0.55295235", "text": "def scrape\n\t\turl = 'http://www.wsj.com/xml/rss/3_7455.xml'\n open(url) do |rss|\n \tfeed = RSS::Parser.parse(rss, false)\n puts \" \"\n puts \"*********************************\"\n \tputs \"Title: #{feed.channel.title}\"\n puts \"--------------------------------\"\n feed.items.each do |item|\n tags = tag_article(item.title.to_s)\n \tarticle = Article.new(title: item.title.to_s, \n summary: item.description.to_s.gsub(/\\\"/,''), \n link: item.link, \n date: item.pubDate.to_s.gsub(/,/,''),\n tag_list: tags, \n source: \"Wall Street Journal\")\n article.save\n end\n end\n end", "title": "" }, { "docid": "a6570b2da536dcdddf3246c5b429ebab", "score": "0.5527173", "text": "def fetch_data\n rss_provider = RssProvider.find(params[:format])\n unless rss_provider.rss_url.include?(\"indiatvnews\" ) || rss_provider.rss_url.include?(\"hindu\" ) || rss_provider.rss_url.include?(\"zee\" )\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n feeds = xml[\"rss\"][\"channel\"][\"item\"]\n feeds.each do |feed|\n if rss_provider.rss_url.include?(\"indiatoday\" )\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n\n\n index_of_summary = feed[\"description\"].index(\"</a>\")\n summary = feed[\"description\"][index_of_summary..].delete_prefix(\"</a> \")\n index_of_image = feed[\"description\"].index(\"src\")\n image_url = feed[\"description\"][(index_of_image+5)..(index_of_summary-4)]\n News.create(title: feed[\"title\"], summary: summary, \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url,\n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n end\n\n \n elsif rss_provider.rss_url.include?(\"news18\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n index_of_image = feed[\"description\"].index(\"https\")\n summary_index = feed[\"description\"].index(\" />\")\n last_index_of_image = feed[\"description\"].index(\"jpg\")\n image_url = feed[\"description\"][(index_of_image)..(last_index_of_image)] + \"pg\"\n summary = feed[\"description\"][(summary_index+3)..]\n News.create(title: feed[\"title\"], summary: summary,published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url, rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n elsif rss_provider.rss_url.include?(\"bbc\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n News.create(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: feed[\"fullimage\"], \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n elsif rss_provider.rss_url.include?(\"ndtv\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n News.create!(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"updatedAt\"], url: feed[\"link\"], media_url: feed[\"fullimage\"], \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id,provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n \n elsif rss_provider.rss_url.include?(\"timesofindia\")\n title = News.find_by(title: feed[\"title\"])\n\n unless title.present?\n\n if rss_provider.category.category_name == \"Top Story\" \n News.create(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: \"\", \n rss_provider_id: rss_provider.id,category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime) \n else\n unless feed[\"description\"] == nil \n index_of_image = feed[\"description\"].index(\"src\")\n last_index_of_image = feed[\"description\"][index_of_image..].index(\"/>\")+index_of_image\n image_url = feed[\"description\"][(index_of_image+5)..(last_index_of_image-3)]\n summary_index = feed[\"description\"].index(\"</a>\")\n summary = feed[\"description\"][(summary_index+4)..]\n News.create(title: feed[\"title\"], summary: summary, \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url, \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n end\n end\n \n\n end\n\n end\n end\n\n unless rss_provider.rss_url.include?(\"timesofindia\" ) || rss_provider.rss_url.include?(\"ndtv\" ) || rss_provider.rss_url.include?(\"bbc\" ) ||\n rss_provider.rss_url.include?(\"news18\") || rss_provider.rss_url.include?(\"indiatoday\") \n\n\n if rss_provider.rss_url.include?(\"indiatvnews\" )\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n index_of_summary = feed.summary.index(\"</a>\")\n summary = feed.summary[index_of_summary+4..]\n index_of_image = feed.summary.index(\"src\")\n image_url = feed.summary[(index_of_image+5)..(index_of_summary-5)]\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: summary, \n published_on: feed.published, url: feed.url, media_url: image_url, \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n elsif rss_provider.rss_url.include?(\"thehindu\")\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n elsif rss_provider.rss_url.include?(\"zee\")\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n end\n\n unless rss_provider.rss_url.include?(\"timesofindia\" ) || rss_provider.rss_url.include?(\"ndtv\" ) || rss_provider.rss_url.include?(\"bbc\" ) ||\n rss_provider.rss_url.include?(\"news18\") || rss_provider.rss_url.include?(\"indiatoday\") ||\n rss_provider.rss_url.include?(\"indiatvnews\") || rss_provider.rss_url.include?(\"thehindu\") ||\n rss_provider.rss_url.include?(\"zee\")\n\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n end\n redirect_to admin_rss_providers_path, alert: \"Fetched Successfully \"\n\n end", "title": "" }, { "docid": "b55422da268d2647d596eb9a0386e263", "score": "0.55214936", "text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\t@source_name = feed.channel.title\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(get_author(item), item.title, item.description,\\\n\t\t\t\t\t\tget_images(item), @source_name, item.pubDate.to_date,\\\n\t\t\t\t\t\titem.link, get_image_length(item))\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend", "title": "" }, { "docid": "010f1d7c257371f9f81520c2cc70075b", "score": "0.5500713", "text": "def show\n @entries = @slideshow.entries.recent.limit(12)\n\n @active_feeds = @slideshow.feeds.order(title: :asc)\n @available_feeds = Feed.where.not(id: @slideshow.feed_ids).order(title: :asc)\n end", "title": "" }, { "docid": "8fa0d37c709a6ccbce44850722e20eca", "score": "0.5497903", "text": "def wp_rss_version_check(site=@site, verbose=true)\n @wp_paths.each do |p|\n feed = site.sub(/\\/$/, '') + p + '/feed/'\n res = @http.get(feed)\n wp_frontpage_check(res[0]) if verbose\n if res[0] =~ /<generator>(.+)<\\/generator>/i\n wp_version = $1.chomp.sub('http://wordpress.org/?v=', '')\n print_good(\"#{p}/feed/ Found!\") if verbose\n print_line(\" Version: #{wp_version}\") if verbose\n return wp_version\n end\n end\n print_error(\"Unable to locate generator tag in RSS feed....\") if verbose\n return nil\n end", "title": "" }, { "docid": "2015baddbac07e7c3e81fb50226ffd34", "score": "0.5479351", "text": "def published() @feed.read_attribute(:published); end", "title": "" }, { "docid": "cc26d1bd00c01daed751e9dad86bdcbc", "score": "0.54750955", "text": "def rss\n render_rss_feed_for Announcement.find(:all, :order => 'created_at DESC',\n :limit => 10), {\n :feed => {\n :title => 'OpenMind New Announcements',\n :link => announcements_url,\n :pub_date => :created_at\n },\n :item => {\n :title => :headline,\n :description => :formatted_description,\n :link => Proc.new{|announcement| \"#{announcements_url}##{announcement.id}\" }\n }\n }\n end", "title": "" }, { "docid": "3160dd97f0ba5173fdc6447c853f6d45", "score": "0.5470004", "text": "def show\n @vouchers = Mess.find(params[:id]).vouchers\n end", "title": "" }, { "docid": "237fcd75eaa8528e95f0c4b2266ec678", "score": "0.54592234", "text": "def index\n # Load the latest full blog feed for Frank's blog as per \n @latest_blog_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default?alt=rss')\n \n # Load the latest posts for the Marketing label feed. Labels are case sensitive - Marketing != marketing\n # Please note that the example of the Google website has an error on its label example. The alt=rss comes after\n # the label in the feed URL\n @latest_marketing_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default/-/Marketing?alt=rss')\n \n # Load the latest posts for the SQL Converter label feed (space in the tag)\n @latest_sql_converter_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default/-/SQL%20Converter?alt=rss')\n end", "title": "" }, { "docid": "27dced0a8db0a563176b78bbc48a4672", "score": "0.54510766", "text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(@default_author, item.title, item.description,\\\n\t\t\t\t\t\t\"\", @source_name, item.pubDate.to_date, item.link)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend", "title": "" }, { "docid": "a0d07425ade2b2e9903fe50960ddddfa", "score": "0.54489815", "text": "def loadRSSFeeds \n @raw_data = RSS::Parser.parse('http://www.nachrichten.at/storage/rss/rss/weltspiegel.xml', false)\n end", "title": "" }, { "docid": "5d9d0245850f66ae1a7179a98bb2f4b1", "score": "0.5447923", "text": "def rss_shows_available(agent, show_name_uri, show_date)\n # go to the show's RSS feed\n rss_uri = \"/rss.php?series=#{show_name_uri}\"\n rss = agent.get(rss_uri)\n\n SouvlakiRS.logger.info \"fetched RSS feed from '#{rss_uri}', status code: #{agent.page.code.to_i}\"\n\n chan_pub_date = to_date(rss.search('//channel/pubDate').text)\n if show_date > chan_pub_date\n SouvlakiRS.logger.info \" RSS pub date (#{chan_pub_date}) predates requested date (#{show_date})\"\n return [nil, nil, \"RSS last updated #{chan_pub_date}\"]\n end\n\n SouvlakiRS.logger.info \" RSS was last updated on #{chan_pub_date}\"\n date = to_date(rss.search('//item/pubDate').text)\n if date != show_date\n SouvlakiRS.logger.info \" RSS item date #{date} does not match requested date #{show_date}\"\n return [nil, nil, \"Requested date #{show_date} not found\"]\n end\n\n [rss, date]\n end", "title": "" }, { "docid": "71133c4301a45fcb53e198b5a0395de3", "score": "0.5447909", "text": "def fetch_entries\n logger.info \"#{SERVICE_NAME}: Fetching the most recent videos by #{self.vimeo_login}\"\n videos = []\n doc = Hpricot.XML(open(\"http://vimeo.com/#{self.vimeo_login}/videos/rss\"))\n (doc/'item').each do |item|\n videos << parse_entry(item)\n end\n\n logger.info \"#{SERVICE_NAME}: Fetching the most recent favorite videos of #{self.vimeo_login}\"\n likes = []\n doc = Hpricot.XML(open(\"http://vimeo.com/#{self.vimeo_login}/likes/rss\"))\n (doc/'item').each do |item|\n likes << parse_entry(item)\n end\n\n return videos.reject { |e| e.nil? }, likes.reject { |e| e.nil? }\n rescue Timeout::Error => tme\n logger.warn \"#{SERVICE_NAME}: Error fetching posts (timeout error): #{tme}\"\n []\n rescue => e\n logger.warn \"#{SERVICE_NAME}: Error fetching posts: #{e}\"\n []\n end", "title": "" }, { "docid": "c1734e923169b1842a28754ecd732117", "score": "0.54395026", "text": "def get_channnel_xml( url )\n path = url.sub(/http:\\/\\/gdata\\.youtube\\.com/,'')\n xml = \"\"\n\n Net::HTTP.version_1_2\n Net::HTTP.start(\"#{@url}\", \"#{@port}\") do |http|\n response = http.get(\"/#{path}\")\n xml = response.body\n end\n\n return xml\n end", "title": "" }, { "docid": "bd4074128b7311f2616e5e6e4dfb7aa7", "score": "0.54044825", "text": "def get_the_name_of_val_doise_townhalls(url)\n page = Nokogiri::HTML(open(url))\n commune = []\n news_links = page.css(\"a\").select{|link| link['class'] == \"lientxt\"}\n news_links.each do |communes|\n commune << communes.text\n end\n return commune\nend", "title": "" }, { "docid": "c6296cd737f4d51f35e18b57f9985298", "score": "0.5401438", "text": "def get_video_urls(feed_url)\n Youtube.notify \"Retrieving videos...\"\n urls_titles = {}\n result_feed = Nokogiri::XML(open(feed_url))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n\n #as long as the feed has a next link we follow it and add the resulting video urls\n loop do\n next_link = result_feed.search(\"//feed/link[@rel='next']\").first\n break if next_link.nil?\n result_feed = Nokogiri::HTML(open(next_link[\"href\"]))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n end\n\n filter_urls(urls_titles)\n end", "title": "" }, { "docid": "d25ec68d1c9600f31bcb84028d71d16b", "score": "0.5399731", "text": "def xml\n @feed ||= FeedzirraPodcast::Parser::Podcast.parse(open(self.url))\n end", "title": "" }, { "docid": "80352312b1217d4946c20ed66cb051e6", "score": "0.539375", "text": "def scrape\r\n @article_arr = []\r\n\t\turl = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_technology_2790.xml'\r\n open(url) do |rss|\r\n \tfeed = RSS::Parser.parse(rss, false)\r\n \tputs \"Title: #{feed.channel.title}\"\r\n puts \"*********************************\"\r\n puts \" \"\r\n feed.items.each do |item|\r\n \t@article_arr << HSArticle.new(author: \"nil\", title: item.title.to_s.gsub(/,/,' ').gsub(/\"/,' ').gsub(/'s/,'s').gsub(/'/, ''), \r\n summary: item.description.to_s.gsub(/,/,' ').gsub(/\\\"/,'\\'').gsub(/'s/,''), images: item.enclosure.url, source: item.link,\r\n date: item.pubDate.to_s.gsub(/,/,'').gsub(/\\\"/,'\\'').gsub(/'s/,''))\r\n end\r\n end\r\n @articles.concat(@article_arr)\r\n end", "title": "" }, { "docid": "317f2a808d9271a8c6e281d258ca028c", "score": "0.5390919", "text": "def get_feed(url, opts)\n\n opts.extra = Hash.new\n opts.extra[\"Connection\"] = \"close\"\n # some sites need User-Agent field\n opts.extra[\"User-Agent\"] = \"RSSClient/2.0.9\"\n\n # Ask for changes (get 304 code in response)\n # opts.since is Time::\n if not opts.forceUpdate and opts.since\n time = Time.parse(opts.since.to_s)\n opts.extra[\"If-Modified-Since\"] = time.httpdate() if time\n end\n\n begin\n @rssc_raw = get_url(url, opts)\n return nil unless @rssc_raw\n\n case @rssc_raw.status\n when 200 # good\n when 301, 302 # follow redirect ...\n @rssc_raw = get_url(@rssc_raw.header[\"Location\"], opts)\n return nil unless @rssc_raw\n\n when 304 # Not modified - nothing to do\n return nil\n\n # errors\n when 401\n raise RuntimeError, \"access denied, \" + @rssc_raw.header['WWW-Authenticate'].to_s\n when 404\n raise RuntimeError, \"feed [ #{url} ] not found\"\n else\n raise RuntimeError, \"can't fetch feed (unknown response code: #{@rssc_raw.status})\"\n end\n\n return nil unless @rssc_raw.content\n\n # Parse the raw RSS\n begin\n FeedNormalizer::FeedNormalizer.parse(@rssc_raw.content, :try_others => true)\n rescue NoMethodError\n # undefined method `channel' for #<RSS::Atom::Feed:0x9f03b70>\n # try a simpler parser ...\n FeedNormalizer::FeedNormalizer.parse(@rssc_raw.content,\n :try_others => true, :force_parser => FeedNormalizer::SimpleRssParser\n )\n end\n rescue RuntimeError => error\n @rssc_error = error\n return nil\n end \n end", "title": "" }, { "docid": "5cab8dd363c73d6afaa5b49490c35533", "score": "0.53882986", "text": "def remote_version\n doc = Nokogiri::HTML(open($fancybox_feed))\n doc.css('entry:first title').text.match(/\\d\\.\\d\\.\\d/)[0]\nend", "title": "" }, { "docid": "56c685b8a9e6d5abf3640fa5816f2f01", "score": "0.53583294", "text": "def fetch_by_issn(issn)\r\n xml = fetch_xml(issn)\r\n\r\n\r\n results = BentoSearch::Results.new.concat(\r\n xml.xpath(\"./rdf:RDF/rss:item\", xml_ns).collect do |node|\r\n item = BentoSearch::ResultItem.new\r\n\r\n item.format = \"Article\"\r\n\r\n item.issn = issn # one we searched with, we know that!\r\n\r\n item.title = xml_text(node, \"rss:title\")\r\n item.link = xml_text(node, \"rss:link\")\r\n\r\n item.publisher = xml_text(node, \"prism:publisher\") || xml_text(node, \"dc:publisher\")\r\n item.source_title = xml_text(node, \"prism:PublicationName\")\r\n item.volume = xml_text(node, \"prism:volume\")\r\n item.issue = xml_text(node, \"prism:number\")\r\n item.start_page = xml_text(node, \"prism:startingPage\")\r\n item.end_page = xml_text(node, \"prism:endingPage\")\r\n\r\n # Look for something that looks like a DOI in dc:identifier\r\n node.xpath(\"dc:identifier\").each do |id_node|\r\n if id_node.text =~ /\\ADOI (.*)\\Z/\r\n item.doi = $1\r\n # doi's seem to often have garbage after a \"; \", especially\r\n # from highwire. heuristically fix, sorry, a real DOI with \"; \"\r\n # will get corrupted.\r\n if (parts = item.doi.split(\"; \")).length > 1\r\n item.doi = parts.first\r\n end\r\n\r\n break\r\n end\r\n end\r\n\r\n # authors?\r\n node.xpath(\"dc:creator\", xml_ns).each do |creator_node|\r\n name = creator_node.text\r\n name.strip!\r\n\r\n # author names in RSS seem to often have HTML entities,\r\n # un-encode them to literals.\r\n name = HTMLEntities.new.decode(name)\r\n\r\n\r\n item.authors << BentoSearch::Author.new(:display => name)\r\n end\r\n\r\n # Date is weird and various formatted, we do our best to\r\n # look for yyyy-mm-dd at the beginning of either prism:coverDate or\r\n # dc:date or prism:publicationDate\r\n date_node = xml_text(node, \"prism:coverDate\") || xml_text(node, \"dc:date\") || xml_text(node, \"prism:publicationDate\")\r\n if date_node && date_node =~ /\\A(\\d\\d\\d\\d-\\d\\d-\\d\\d)/\r\n item.publication_date = Date.strptime( $1, \"%Y-%m-%d\")\r\n elsif date_node\r\n # Let's try a random parse, they give us all kinds of things I'm afraid\r\n item.publication_date = Date.parse(date_node) rescue ArgumentError\r\n end\r\n\r\n # abstract, we need to strip possible HTML tags (sometimes they're\r\n # there, sometimes not), and also decode HTML entities. \r\n item.abstract = xml_text(node, \"rss:description\").try do |text| \r\n HTMLEntities.new.decode(strip_tags(text))\r\n end\r\n\r\n item\r\n end\r\n )\r\n\r\n # Items seem to come back in arbitrary order, we want to sort\r\n # by date reverse if we can\r\n if results.all? {|i| i.publication_date.present? }\r\n results.sort_by! {|i| i.publication_date}.reverse!\r\n end\r\n\r\n fill_in_search_metadata_for(results)\r\n\r\n return results\r\n end", "title": "" }, { "docid": "be9bb98ae0e52f42fdcfcb8cd7a7328e", "score": "0.535394", "text": "def scrape\n open(@url) do |rss|\n feed = RSS::Parser.parse(rss)\n\n feed.items.each do |item|\n # Remove the p tag and retrieve image url from the description\n # if it exists\n p_tag = item.description[%r{<p>.*</p>}]\n if p_tag\n item.description.slice! p_tag\n img_url = p_tag.match(/src=\"(?<img>[^\"]*)\"/)[:img]\n else\n img_url = nil\n end\n\n # Sanitize HTML\n item.title = CGI.unescapeHTML(item.title)\n item.description = CGI.unescapeHTML(item.description)\n\n @articles.push(\n title: item.title,\n summary: item.description,\n image_url: img_url,\n source: @source,\n url: item.link,\n pub_date: item.pubDate.to_s,\n guid: item.guid.content\n )\n end\n end\n end", "title": "" }, { "docid": "fbd8e83fa2e48bd5264757693a09b184", "score": "0.5346505", "text": "def newsfeed\n Post.newsfeed_for(self)\n end", "title": "" }, { "docid": "7f6e72521f1ebfe0553a33ca338211a9", "score": "0.53323805", "text": "def scrape\n @articles = []\n url = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_technology_2790.xml'\n open(url) do |rss|\n feed = RSS::Parser.parse(rss, false)\n feed.items.each do |item|\n article = Article.create(title: item.title.to_s.tr('\"', '\\''),\n summary: item.description.to_s\n .gsub(/&#8217;/, '\\'').gsub(/\\\"/, '\\''),\n imageURL: item.enclosure.url,\n link: item.link,\n pubDate: DateTime.parse(item.pubDate.to_s),\n source: HSImporter.source_name)\n @articles << article\n end\n end\n @articles\n end", "title": "" }, { "docid": "ebac503eb05517720d8cf3b439bb7cb7", "score": "0.53126395", "text": "def extract_items(content)\n GnewsItemsExtractor.new.get_gnews_items(content)\nend", "title": "" }, { "docid": "c0e703377926951ec8c291622bd9672d", "score": "0.53107244", "text": "def show\n\t\t@extractor = Extractor.find(params[:id])\n\t\t@latest_revision = @extractor.revisions.first(:order => \"created_at DESC\")\n\t\tif(@latest_revision) \n\t\t\t@latest_scraped_values = ScrapedValue.find_all_by_revision_id(\n\t\t\t\t@latest_revision.id,\n\t\t\t\t:include => [:annotation]\n\t\t\t)\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.rss { render :layout => false }\n\t\tend\n\tend", "title": "" }, { "docid": "36deddfcbb45d3cabff964f74768c9d1", "score": "0.53098595", "text": "def feeds\n all.select { |c| c.google_id =~ /^feed/ }\n end", "title": "" }, { "docid": "1c2bc3b62e8fc25c20f5c85bd0ba1779", "score": "0.530469", "text": "def show\n @brand = Brand.find_by(:id => params[:brand_id])\n @reviews = Review.where(:brand_id => params[:brand_id])\n @reviews_hero = Review.where(:brand_id => params[:brand_id]).where(:hero_vote => 1)\n @reviews_villan = Review.where(:brand_id => params[:brand_id]).where(:villan_vote => 1)\n @brand_news = params[:brand_name]\n\n # GET WIKIPEDIA DESCRIPTION ONTO SHOW PAGE\n # url = URI.escape(\"https://en.wikipedia.org/wiki/{brand_name}\")\n # @json_data = open(url).read\n # @data = JSON.parse(@json_data)\n # puts data.class\n # puts data.inspect\n\n # TRYING TO GET NEWS FROM REDDIT TO SHOW UP WITH BRANDS. SEE VIEW SHOW.\n # url = URI.escape(\"http://www.reddit.com/search?q={brand_name}\")\n # @json_data = open(url).read\n # @data = JSON.parse(@json_data)\n # puts data.class\n # puts data.inspect\n\n end", "title": "" }, { "docid": "6cd23e1e147cc04d0bedc51339643fc6", "score": "0.52966464", "text": "def ping_search_engine(item)\n if item.is_draft == false and Rails.env.production?\n # http://www.google.cn/intl/zh-CN/help/blogsearch/pinging_API.html\n # http://www.baidu.com/search/blogsearch_help.html\n baidu = XMLRPC::Client.new2(\"http://ping.baidu.com/ping/RPC2\")\n baidu.timeout = 5 # set timeout 5 seconds\n b = baidu.call(\"weblogUpdates.extendedPing\",\n \"#{@user.name}_#{t'site.name'}\",\n site(@user),\n eval(\"#{item.class.name.downcase}_url(item)\"),\n site(@user) + feed_path)\n logger.info(b)\n google = XMLRPC::Client.new2(\"http://blogsearch.google.com/ping/RPC2\")\n google.timeout = 5\n g = google.call(\"weblogUpdates.extendedPing\",\n \"#{@user.name}_#{t'site.name'}\",\n site(@user),\n eval(\"#{item.class.name.downcase}_url(item)\"),\n site(@user) + feed_path,\n item.tags.join('|')) \n logger.info(g)\n end\n rescue Exception => e\n logger.warn(e)\n end", "title": "" }, { "docid": "a953304f63ea23d4c1e12fa6bbc1aa8e", "score": "0.5293175", "text": "def latest_reviews_rss\r\n @title = \"The Latest Reviews\"\r\n @reviews = Review.get_paginated_reviews(Category.find_root, 20, 1, 3.days.ago)[0]\r\n render :template => \"common/rss\", :layout => nil\r\n end", "title": "" }, { "docid": "8f4f802de6e2a964aab8fde9b5ad0a2e", "score": "0.5291665", "text": "def get_from_digg\n raw_response = RestClient.get('http://digg.com/api/news/popular.json')\n response = JSON.load(raw_response)\n\n response[\"data\"][\"feed\"].map do |story|\n story_hash = {\n title: story[\"content\"][\"title_alt\"],\n author: story[\"content\"][\"author\"],\n score: story[\"digg_score\"],\n category: story[\"content\"][\"tags\"].map {|tag| tag[\"display\"]}\n }\n end\n\n\nend", "title": "" }, { "docid": "63a87935c062f5169bd6c02233f53726", "score": "0.5288039", "text": "def upcoming_dvd_releases\n return @badfruit.parse_movies_array(JSON.parse(@badfruit.get_lists_action(\"upcoming_dvds\")))\n end", "title": "" }, { "docid": "f33ec3dadb902a0c144fea32e06734c9", "score": "0.5281689", "text": "def rss\n @headers[\"Content-Type\"] = \"application/xml\"\n @articles = Article.find(:all, \n :order => 'created_at DESC',\n :conditions => [\"articles.approved = ?\", true],\n :limit => 10\n )\n render :layout => false\n end", "title": "" }, { "docid": "ba15cf21cf10e2c81047c83f16f542a3", "score": "0.5272429", "text": "def scrap(item)\n items = []\n html_file = open(\"https://www.etsy.com/fr/search/clothing?q=#{item}\")\n html_doc = Nokogiri::HTML(html_file)\n html_doc.search('.card-meta').each do |title|\n item_name = title.search(\".card-title\")[0].text.strip\n item_price = title.search(\".currency\")[0].text.to_f\n items << {name: item_name, price: item_price}\n end\n return items.first(10)\nend", "title": "" }, { "docid": "60f5a51c0965b3587386c751c26de06d", "score": "0.5270719", "text": "def retrieve_data\n # Define the url\n url = 'http://www.sbs.com.au/news/rss/news/science-technology.xml'\n\n # Open the url and parse the rss feed\n open(url) do |rss|\n # Start parsing\n feed = RSS::Parser.parse(rss, false)\n\n # Iterate each item and scrape information\n feed.items.each do |item|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(item.title.to_s)\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: item.title.to_s)\n\n # Make a template dictionary to put @articles\n temp = {\n author: nil,\n title: item.title,\n summary: item.description,\n image: nil,\n date_time: DateTime.parse(item.pubDate.to_s),\n link: item.link,\n categories: nil\n }\n\n # Put the object into articles array\n @articles << temp\n end\n end\n end", "title": "" }, { "docid": "477903bd332bba1a7b18289ac3a70e68", "score": "0.525169", "text": "def rss\n @rss ||= build_rss\n end", "title": "" }, { "docid": "c2f1f258425e6e69d6b2256b2775f06e", "score": "0.52353096", "text": "def meeting_feed_url\n \"#{@baseurl}/rss/rss.aspx\"\n end", "title": "" }, { "docid": "78ef9c0bb2039a50b5882dbfe20ad9dc", "score": "0.5233384", "text": "def find_live_article\n live_articles = get_articles_by_type('liveblog', 3)\n live_articles.find(&:is_live?)\n end", "title": "" }, { "docid": "66fbdf9a4e7365d2cc441a749ba4902f", "score": "0.5231249", "text": "def get_doc_feed(doc_client)\n @doc_feed=doc_client.get(\"https://documents.google.com/feeds/documents/private/full?prettyprint=true\").to_xml\n #@doc_feed=doc_client\n return @doc_feed\n end", "title": "" }, { "docid": "73829bcbf32c1a2548114fec1b186873", "score": "0.5227438", "text": "def feed!\n http_fetch(feed_url)\n end", "title": "" }, { "docid": "6d8c6997c94d814206fb7d4c4de5d70c", "score": "0.52191293", "text": "def feed\n @feeddata\n end", "title": "" }, { "docid": "d7b30a38c162f1eeb729a3e8f409db53", "score": "0.52191216", "text": "def get_new_articles\n # Download the RSS feed and save to self.doc\n get_source\n \n # Keep track of which articles are in the feed \n articles = []\n \n article_links = (self.doc/'li.mjItemMain').collect do |mjItem|\n mjItem.at('a.mjLinkItem')\n end\n \n # For each item in the RSS feed \n article_links.each_with_index do |link, index|\n \n # Create or update the article in the db\n articles << Article.factory(\n :category => self.category,\n :description => '',\n :feed => self,\n :url => \"http://online.wsj.com#{link.attributes['href']}\",\n :priority => index\n )\n end\n \n articles\n end", "title": "" }, { "docid": "4510fc46897063c3ace8e2598de87e8f", "score": "0.5214786", "text": "def get_all_free_episode_links_for_each_show_on_vland\n \t\tShow.all.each do |show|\n \t\t\tputs \"getting epsides for #{show.url}\"\n \t\t\t# sometimes its nice to take a 2-3 sec nap\n \t\t\tsleep(rand(2..3))\n \t\t\tresp = get_resp(show.url)\n \t\t\t# this is the point where I got tired of heavy lifting\n \t\t\thtml_result = Nokogiri::HTML.parse(resp.body)\n \t\t\thtml_result.css(\".entry-card\").each do |clip|\n \t\t\t\t# skip episdes / clips that are not free to watch, may also one day limit it to just episodes.\n \t\t\t\tnext if clip.css(\".unlockable\").first.to_s.include? \"icon-locked\"\n \t\t\t\t# grabs sub link to epsides or clip\n \t\t\t\tepisode_or_clip_url = clip.css(\".cta\").attr(\"href\").to_s\n \t\t\t\t#getting rid of a \"/\" at the start\n \t\t\t\tepisode_or_clip_url[0] = \"\"\n\n \t\t\t\t# lets create some links pertaining to shows and clips from shows\n \t\t\t\tep = Episode.find_or_initialize_by(url: self.url + episode_or_clip_url)\n \t\t\t\tif ep.new_record?\n \t\t\t\t\tep.show_id=show.id\n \t\t\t\t\t#can do fancy stuff here like grab all show episode / clip fields \n \t\t\t\t\tep.save!\n \t\t\t\tend\n \t\t\tend\n \t\tend\n \tend", "title": "" }, { "docid": "2ddfdf8649721aa7203716e889a8cada", "score": "0.5208191", "text": "def xml\n xml = Builder::XmlMarkup.new(indent: 2)\n\n xml.instruct! :xml, encoding: 'UTF-8'\n xml.rss version: '2.0' do |rss|\n rss.channel do |channel|\n channel.title 'Haxpressen'\n\n last_ten_days.each do |day|\n summary = summary_for day\n\n if summary.present?\n channel.item do |item|\n item.title \"Sammanfattning för #{day}\"\n item.pubDate day\n item.description summary\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "40f73cd9b34c61d146229aa72f465f71", "score": "0.5205182", "text": "def readrss(name, t) # finds url from database, parses it and returns an array\n if (t>5); return [\"http://www.justfuckinggoogleit.com\"]; end\n\n s = []\n url = $db.execute( \"select link from rss where name = ?\", name )\n i = RSS::Parser.parse(open(url.flatten.to_s), false)\n i.items.first(t).each do |it|\n s.push(it.title+\" - \"+it.link)\n end\n return s\nend", "title": "" }, { "docid": "00c4bc8999e49c500af7da9add89ea5d", "score": "0.52018756", "text": "def news\n do_scrape\n @posts = UbuEntry.all(:order => \"id DESC\", :limit => 400)\n render :layout => false, :content_type => Mime::RSS\n end", "title": "" }, { "docid": "2d3e841733669368090706b4ebbff4d5", "score": "0.51959854", "text": "def get_from_digg\n route = 'http://digg.com/api/news/popular.json'\n raw_response = RestClient.get route\n response = JSON.load raw_response\n response[\"data\"][\"feed\"].map do |story|\n categories = []\n story[\"content\"][\"tags\"].map do |tags|\n categories.push(tags[\"display\"]) # Push the 'tags' for each Digg article to an array.\n end\n category_string = categories.join(\", \") # Make a string for each story's category array for Digg.\n story_hash = {\n title: story[\"content\"][\"title\"],\n score: story[\"digg_score\"],\n category: category_string, # There are multiple categories so you're going to have to use .join to get all the different categories to be part of the array.\n author: story[\"content\"][\"author\"]\n }\n end\nend", "title": "" }, { "docid": "47aee2c779d1495c072c29784ac3025d", "score": "0.5187676", "text": "def retrieve_posts\n # Get posts\n rss = RSS::Parser.parse(AWL_RSS_URL)\n\n # Grab shortened URLs\n links = rss.items.map(&:guid).map(&:content)\n\n @articles = []\n\n links.each do |link|\n @articles << Article.new(link)\n end\n\n # TODO: Only grab the tags for articles that haven't already be tweeted\n @articles.map(&:retrieve_tags)\n end", "title": "" }, { "docid": "f5ca13cd1c2e85a20cba199aec15439a", "score": "0.5187515", "text": "def get_pack_data(pack)\n\tputs \"Verses needed for #{pack.get_title}\"\n\turl = get_search_url(pack.verses)\n\tdata = get_search_result(url)\n\tpassages = get_passages(data)\n\t\n\tverses = [];\n\tpassages.each do |passage|\n\t\tverses.push(distill(passage))\n\t\t#puts verse.to_s\n\tend\n\treturn verses\nend", "title": "" }, { "docid": "08f5ef74c607aa94b29050048a86ce7e", "score": "0.51848996", "text": "def index\n opts = []\n category = Tag.find_by_name(params[:category])\n \n @categories = know_categories\n if category\n opts << category.name\n @category = category.name.gsub(/-/,'&nbsp;')\n @top_posters = User.top_posters(6,{:tags => category.name})\n else\n flash[:notice] = \"There are no videos in the category: '#{params[:category]}'.\" if params[:category].is_a?(String)\n @category = \"ALL VIDEOS\"\n @top_posters = User.top_posters(6)\n end\n\n @page_title = \"#{@category}\"\n\n if params[:user_id]\n @user = User.find_by_id_or_login(params[:user_id])\n @videos = Video.find_with_tags(opts.compact,{:order => 'rating', :limit => 100, :paginate => true, :conditions => \"videos.user_id = #{@user.id}\"})\n @top_posters = [@user]\n @page_title = \"#{@user.login}'s \" + @page_title\n @rss_feed = \"http://#{request.env['HTTP_HOST']}#{formatted_user_videos_path({:category => params[:category], :order => params[:order], :format => :rss, :user_id => params[:user_id]})}\"\n @rss_feed_html = \"<link rel='alternate' title='Top Videos Feed' href='http://#{@rss_feed}' type='application/rss+xml'>\"\n else\n @user = nil\n @videos = Video.find_with_tags(opts.compact,{:order => 'rating', :limit => 5, :paginate => true})\n @rss_feed = \"http://#{request.env[\"HTTP_HOST\"]}#{formatted_videos_path({:category => params[:category], :order => params[:order], :format => :rss})}\"\n @rss_feed_html = \"<link rel='alternate' title='Top Videos Feed' href='http://#{@rss_feed}' type='application/rss+xml'>\"\n end\n \n# ads = get_ads(:video, {:size => :block},2)\n# @right_ad_top = ads.first\n# @right_ad_bottom = ads.last\n @right_ad_top = Ad.page(:video).zone(:right_top).get.code\n @right_ad_bottom = Ad.page(:video).zone(:right_bottom).get.code\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @videos}\n format.rss { render :layout => false }\n end\n end", "title": "" }, { "docid": "e0855883fb9bde27773877e904ca4807", "score": "0.5167683", "text": "def news(url)\n visit url\n\n document = Document.new\n document.source = name\n document.title = doc.search(\"#articleContent h1\").text.strip\n document.url = url\n document.html = html\n document.content = page.evaluate_script(\"HongKongNews.getInnerText('#masterContent')\")\n document.image_url = doc.search(\"//meta[@property='og:image']/@content\").first.text rescue nil\n document\n end", "title": "" }, { "docid": "ac9bcabd4f6641b009260bced13241cf", "score": "0.5166078", "text": "def show\n @rssnew = Rssnews.find(params[:id])\n @rssnew.hit!\n redirect_norel @rssnew.link\n end", "title": "" }, { "docid": "da49334365fd2e9b94207694c14a423d", "score": "0.5164063", "text": "def show_items(n_most_recent)\n # Get the 0th item from array and open with Nokogiri\n xml_link = rss_links.first\n @xml_doc = Nokogiri::XML open(xml_link)\n \n\n # Get all the titles, dates, and links from the RSS\n # and strip their XML tag\n titles = strip_xml_tag @xml_doc.xpath(\"//title\")\n pub_dates = strip_xml_tag @xml_doc.xpath(\"//pubDate\")\n links = strip_xml_tag @xml_doc.xpath(\"//link\")\n \n item_list = make_rss_item titles, pub_dates, links, n_most_recent\n\n puts item_list\n\n end", "title": "" }, { "docid": "2ab4dd3d80262ba0d3848a5e1df1bdbb", "score": "0.51629615", "text": "def get_recommended_venues\n uri = \"https://api.foursquare.com/v2/venues/explore?near=#{@location}&client_id=#{CLIENT_ID}&client_secret=#{CLIENT_SECRET}&v=#{Time.now.strftime(\"%Y%m%d\")}&categoryId=4d4b7105d754a06374d81259\"\n encoded = URI.parse(URI.encode(uri)) # to handle spaces in the location\n @api_response = HTTParty.get(encoded)\n @api_response['response']['groups'][0][\"items\"].each do |item|\n @recommended_venues << item[\"venue\"][\"name\"]\n end\n # puts encoded # uncomment this to see the uri that is being used in the HTTP get request\n @recommended_venues\n end", "title": "" }, { "docid": "4d43d736fa13c91f8a7992647ee2b1fa", "score": "0.51615494", "text": "def fetch_channel(url)\n FeedTools::Feed.open(url)\n end", "title": "" }, { "docid": "7a8efe1bf7e29f714af83b4d327ba0c4", "score": "0.51614475", "text": "def etsy_scrapper(product)\n url = \"https://www.etsy.com/search?q=#{product}\"\n\n file = open(url)\n doc = Nokogiri::HTML(file)\n results = []\n\n doc.search(\".card-meta\").each do |item|\n results << item.search(\".card-title\")[0][\"title\"]\n end\n\n return results[0..9]\nend", "title": "" }, { "docid": "d76b7cd57982e31e9f698db46b7f4bfe", "score": "0.5160784", "text": "def get_recommended_venues\n uri = \"https://api.foursquare.com/v2/venues/explore?near=#{@location}&client_id=#{CLIENT_ID}&client_secret=#{CLIENT_SECRET}&v=#{Time.now.strftime(\"%Y%m%d\")}&categoryId=4d4b7105d754a06374d81259&limit=10\"\n encoded = URI.parse(URI.encode(uri)) # to handle spaces in the location\n @api_response = HTTParty.get(encoded)\n @api_response['response']['groups'][0][\"items\"].each do |item|\n @recommended_venues << item[\"venue\"]\n end\n @recommended_venues\n # puts encoded # uncomment to see the uri that is being used in the HTTP get request\n end", "title": "" }, { "docid": "c61a3c0f694210abf00d43e016b2ed19", "score": "0.51558584", "text": "def call_gnews_url(url)\n result = \n HTTP.headers(\n 'Accept' => 'application/json',\n 'x-api-key' => \"#{@gnews_token}\" ).get(url)\n Response.new(result).response_or_error\n end", "title": "" }, { "docid": "291f64f961c9457299f6b9282ea24246", "score": "0.5153769", "text": "def fetch_urls_from_feedly\n yaml = YAML.load_file('env.yaml')\n client = Feedlr::Client.new(oauth_access_token: yaml['account']['feedly']['access_token'])\n client.user_subscriptions.map{|m|\n # puts m.id\n hotentries = client.stream_entries_contents(m.id, :count => 5 ).items\n return hotentries\n };\nend", "title": "" }, { "docid": "b6649f75fe94753a94d111ad33b31618", "score": "0.51511437", "text": "def get_urlposts( url )\n urlposts = []\n urlcode = Digest::MD5.hexdigest(url)\n url = \"http://feeds.delicious.com/rss/url/#{urlcode}\"\n\n response = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(response)\n\n doc.elements.each(\"//item\") do |item|\n urlposts << { \"user\" => item.elements[\"dc:creator\"].text }\n end\n\n sleep 1\n return urlposts\n end", "title": "" }, { "docid": "dff9a5b5c43e06635090506194a5c0bc", "score": "0.5147785", "text": "def show\n response = @api.get_list({:hotelId => @hotel_id, :destinationString => 'Media'})\n @hotel = response.body['HotelListResponse']['HotelList']['HotelSummary'][0]\n end", "title": "" }, { "docid": "17be178af36264dcde633ee2b374ebe2", "score": "0.5132868", "text": "def stod2gull\n Apis.client.get('/tv/stod2gull')\n end", "title": "" }, { "docid": "ef09eff2caf81c715d34d25b77438e96", "score": "0.51326317", "text": "def fetch_title_marvel(publisher, title, url, date = nil) \n log(\"retrieving title information for [#{title}]\", :debug)\n doc = Hpricot(open(url))\n \n display_description = (doc/\"font[@class=plain_text]\").innerHTML\n\n title = RubyPants.new(title, -1).to_html\n display_name, display_number = title.split('#')\n display_name = check_title(display_name)\n display_number = display_number.split(' ')[0] unless display_number.nil?\n \n new_record = false\n \n if display_number.nil?\n # SoloBook\n model = SoloBook.find_by_name(display_name)\n \n if model.nil?\n model = SoloBook.new(:name => display_name, \n :publisher => publisher)\n new_record = true\n end\n \n else\n # Episode\n series = Series.find_by_name(display_name)\n \n if series.nil?\n # Series doesn't exist, create new Series\n series = Series.create!(:name => display_name, \n :publisher => publisher)\n log(\"created new series [#{display_name}]\", :info)\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n # Add episode to existing series\n if series.find_episode(display_number).nil?\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n model = series.find_episode(display_number)\n end\n end\n end\n \n display_talent, display_description = display_description.split(\"<strong>THE STORY:</strong>\")\n display_description ||= \"\" # if description was empty make sure it's non-nil\n display_description = display_description.split(\"<strong>PRICE:</strong>\")[0]\n \n model.talent = html2text(display_talent).strip.titleize\n model.description = html2text(display_description).strip\n model.published_on = date\n \n model.save!\n new_record ? log(\"created new book [#{title}]\", :info) : log(\"updated existing book [#{title}]\", :debug)\n \n if model.cover_image.nil?\n # get cover image (if we don't have one already)\n image_element = (doc/\"img\").select { |elem| elem.attributes['src'].match(/thumb/) }\n image_url = nil\n \n unless image_element.empty?\n image_url = image_element[0].attributes['src']\n image_url = \"#{URL_Marvel}#{image_element[0].attributes['src'].gsub('_thumb', '_full')}\" # full size art\n end\n \n get_cover_image(model, image_url)\n end\n \n rescue ActiveRecord::RecordInvalid => e\n log(\"failed to create book [#{title}]\", :info)\n log(\"errors: #{model.errors.full_messages.join(', ')}\", :info)\n return false\n end", "title": "" }, { "docid": "384f51b644083688b53b1970a00d8d35", "score": "0.51287216", "text": "def googleNewsSearch(name, mins = 720)\n\n type = \"\"\n theRep = Rep.all\n puts \"THE REP! : #{theRep}\"\n if Rep.where(name: name)[0].json.index(\"senate\") != nil\n type = \"Sen\"\n else\n type = \"Rep\"\n end\n\n # fix the name -- so if there is 'ç' or some weird\n # character like that, it turns into 'c'\n name = ActiveSupport::Inflector.transliterate(name)\n query = \"%22#{type} #{name}%22\"\n query.gsub!(\" \", \"%20\")\n\n link = \"https://www.google.com/search?q=#{query}&tbm=nws&tbs=qdr:n#{mins}\"\n file = open(link)\n document = Nokogiri::HTML(file)\n puts document.class\n titles = document.css('h3 > a')\n urls = document.css('h3 > a')\n excerpts = document.css('.st')\n dates = document.css('div.slp > span.f')\n\n\n\n articles = []\n for i in 0..(titles.length - 1)\n article_info = {}\n article_info[\"title\"] = cleanString(titles[i].text)\n article_info['url'] = cleanUrl(urls[i].attr('href'))\n article_info['excerpt'] = cleanString(excerpts[i].text)\n article_info['date'] = cleanDate(dates[i].text)\n articles << article_info\n end\n\n return articles\nend", "title": "" }, { "docid": "ca55f68921a309103bbf65a3e5045a6f", "score": "0.51236415", "text": "def rss\n @events = Post.find(:all, {:conditions=> \"status=public\"},:order => \"id DESC\")\n render :layout => false\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end", "title": "" }, { "docid": "403244d7b728a8f096bfb33ffc3c02b4", "score": "0.51194394", "text": "def index\n cookies.permanent[:since] ||= 'weekly'\n\n @since = cookies[:since]\n\n trending_feed = Feed.custom_find(\"trending_#{@since}\")\n\n package_redirect_link = packages_url.sub('cdn.', '')\n\n redirect_to package_redirect_link \\\n and return unless trending_feed.present?\n\n package_names = trending_feed.news_items.map(&:name)\n\n @packages = package_names.map { |cur_name|\n Package.custom_find cur_name\n }\n\n @packages.compact!\n\n redirect_to package_redirect_link \\\n and return if @packages.empty?\n end", "title": "" }, { "docid": "96a4378dfc7234984b73fd85883df68d", "score": "0.51175255", "text": "def getSyndicationBy_entity_id( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/syndication/by_entity_id\",params)\n end", "title": "" }, { "docid": "49e7866abbdc587ac49d176dad036cfa", "score": "0.5115561", "text": "def get_book(search)\n\trequest_string = \"https://www.googleapis.com/books/v1/volumes?q=#{search.gsub(\" \",\"+\")}\"\n\t\n\tsample_uri = URI(request_string) #opens a portal to the data at that link\n\tsample_response = Net::HTTP.get(sample_uri) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response) #makes data easy to read\n\tsample_parsedResponse[\"items\"]\nend", "title": "" }, { "docid": "faf459ed3442a6eeff555a89544c1e11", "score": "0.5114801", "text": "def retrieve_feed\n uri = URI.parse(@feed_url)\n Net::HTTP.get_response(uri).body\n end", "title": "" }, { "docid": "b36f8d611552af507be0603ff4545aa4", "score": "0.5109014", "text": "def retrieve_data\n # Define the url\n url = 'http://www.abc.net.au/radionational/feed/3771046/rss.xml'\n\n # Open the url and parse the rss feed\n open(url) do |rss|\n # Start parsing\n feed = RSS::Parser.parse(rss, false)\n\n # Iterate each item and scrape information\n feed.items.each do |item|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(item.title.to_s)\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: item.title.to_s)\n\n # Get the author\n regex_author = /<dc:creator>(.*)<\\/dc:creator>/\n regex_author.match(item.to_s)\n author = Regexp.last_match(1)\n\n author = nil if author.eql? ''\n\n # Get categories values\n regex_category = /<category>(.*)<\\/category>/\n\n categories = []\n item.categories.each do |category|\n regex_category.match(category.to_s)\n categories.push(Regexp.last_match(1))\n end\n\n # Make a template dictionary to put @articles\n temp = {\n author: author,\n title: item.title,\n summary: item.description.to_s,\n image: nil,\n date_time: DateTime.parse(item.pubDate.to_s),\n link: item.link,\n categories: categories.join(',')\n }\n\n # Put the object into articles array\n @articles << temp\n end\n end\n end", "title": "" }, { "docid": "3bc083d777269afa9bcbe937de8ad725", "score": "0.5107397", "text": "def feed\n\n end", "title": "" }, { "docid": "ca3423b7677a8c99c80aca8877ade362", "score": "0.5106142", "text": "def show\n # @most_hotdeals = Hotdeal.order(\"impressions_count DESC\").limit(10)\n impressionist(@hotdeal)\n set_meta_tags title: @hotdeal.h_title,\n site: 'Oh,igottabuythis',\n revierse: true,\n description: @hotdeal.h_spare_21,\n keywords: 'deals, discounts',\n twitter: {\n card: \"summary\",\n site: \"@OhIgottabuythis\",\n title: @hotdeal.h_title,\n description: @hotdeal.h_spare_21,\n image: @hotdeal.h_image\n },\n og: {\n title: @hotdeal.h_title,\n description: @hotdeal.h_spare_21,\n type: 'website',\n url: hotdeal_url(@hotdeal),\n image: @hotdeal.h_image\n }\n end", "title": "" } ]
d3c9db33147ecc7825f43b104413741d
collect pub counts for this org and any subordinates Don't do this on "United States" !
[ { "docid": "3ba6f6c25edab770846d269271868e83", "score": "0.68047166", "text": "def pub_count\n self['pub_count'] = count\n predecessors.each do |pred|\n p = begin\n Authority.find_by(name: pred)\n rescue StandardError\n nil\n end\n unless p.nil?\n self['pub_count'] += p.pub_count\n p.save\n end\n end\n subOrganization.each do |sub|\n s = begin\n Authority.find_by(name: sub)\n rescue StandardError\n nil\n end\n next if s.nil?\n\n # will recursively call pub_count on subs\n self['pub_count'] += s.pub_count\n s.save\n end\n self['pub_count']\n end", "title": "" } ]
[ { "docid": "ac6ab8f77e779509429dbca80aaf915f", "score": "0.5915592", "text": "def projects_organizations(site)\n sql=\"select subq.id,subq.name,count(subq.id) from\n (select distinct o.id,o.name,p.id\n from projects_sites as ps\n inner join projects as p on ps.project_id=p.id and ps.site_id=#{site.id}\n inner join organizations as o on p.primary_organization_id=o.id\n inner join projects_regions as pr on ps.project_id=pr.project_id and region_id=#{self.id}\n ) as subq\n group by subq.id,subq.name order by count desc\"\n Organization.find_by_sql(sql).map do |o|\n [o,o.count.to_i]\n end\n end", "title": "" }, { "docid": "76156342c928c05bcd7880d35ae2fb56", "score": "0.5905447", "text": "def people_in_community_count\n (HumanNetwork.person_entities(self).collect{|h| h.person_id} + self.human_networks.collect{|h| h.person_id} - [self.id]).uniq.count\n end", "title": "" }, { "docid": "f6a7e1dd89b7deb5e9554dc4ae6ae7b8", "score": "0.5865599", "text": "def schedule_counts\n h = {}\n return h if self.is_organization? # organizations may schedule as much as they like\n assns = self.assignments.is_after_today.roster_is_limited_by_program.not_cancelled\n assns.each do |a|\n progs = a.real_programs\n progs.each do |p|\n h[p] ||= 0\n h[p] += 1\n end\n end\n h\n end", "title": "" }, { "docid": "e29c0863e75a1e1cb4158ef1e17e642c", "score": "0.58218265", "text": "def set_neighborhood_counts\n @uptown_count = Neighborhood.nb_buildings_count(pop_neighborhoods, NYCBorough.uptown_sub_borough)\n @brooklyn_count = Building.city_count(pop_nb_buildings, 'Brooklyn', NYCBorough.brooklyn_sub_borough)\n @queens_count = Building.city_count(pop_nb_buildings, 'Queens', NYCBorough.queens_borough)\n @bronx_count = Building.city_count(pop_nb_buildings, 'Bronx', NYCBorough.bronx_sub_borough)\n end", "title": "" }, { "docid": "34d7982273bb5a8a1762dccc3c752ad1", "score": "0.5793598", "text": "def subdomain_visits(cpdomains)\n result = []\n counts = Hash.new(0)\n subdomain_counts = Hash.new(0)\n pair = []\n\n cpdomains.each do |domain_pair|\n pair = domain_pair.split(\" \")\n counts[pair[1]] = pair[0].to_i\n end\n\n p counts\n\n counts.keys.each do |domain|\n subdomain = domain.split(\".\")\n i = 0\n while i < subdomain.length\n sub = subdomain[i..-1].join(\".\")\n subdomain_counts[sub] += counts[domain]\n i += 1\n end\n end\n\n subdomain_counts.each do |k, v|\n restrung = \"#{v} #{k}\"\n result << restrung\n end\n\n result\nend", "title": "" }, { "docid": "de7d238c485eb7278b6c371a0c5812b1", "score": "0.57642734", "text": "def number_of_owned_venues(login=nil)\n count_by_frbr(login, :owns, :how_many_roles?) \n end", "title": "" }, { "docid": "29b550b18526616074777673e24347fb", "score": "0.5747939", "text": "def public_count\n @service.call('pastes.countPublic')\n end", "title": "" }, { "docid": "f587689fbf8a3e598d3f7c9f9fdc82fe", "score": "0.5717591", "text": "def pub_count(uri)\n filename = \"#{Rails.root}/tmp/vivo/publication_counts/#{uuid_from_uri(uri)}.json\"\n file = File.read(filename)\n data = JSON.parse(file)\n data[\"results\"][\"bindings\"].first['cnt']['value']\n end", "title": "" }, { "docid": "ddc29ad909979d5c3d52778af660c4cf", "score": "0.57003397", "text": "def get_counts(repo_id = nil, collection_only = false)\n if collection_only\n types = ['pui_collection']\n else\n types = ['pui_collection', 'pui_record', 'pui_record_group', 'pui_person', 'pui_subject']\n end\n # for now, we've got to get the whole enchilada, until we figure out what's wrong\n # counts = archivesspace.get_types_counts(types, repo_id)\n counts = archivesspace.get_types_counts(types)\n final_counts = {}\n if counts[repo_id]\n counts[repo_id].each do |k, v|\n final_counts[k.sub(\"pui_\",'')] = v\n end\n end\n final_counts\n end", "title": "" }, { "docid": "017d640a3b4823a9db37565365e633d2", "score": "0.56748194", "text": "def city_frequency\n payload = return_payload\n city_hash = Hash.new(0)\n count = 0\n\n payload.each do |location|\n locality = location[\"post_town\"]\n if locality\n locality = locality.strip\n # normalizes each name\n if locality.match(/-/)\n locality = locality.split('-').map(&:capitalize).join('-')\n else\n locality = locality.split.map(&:capitalize).join(' ')\n end\n city_hash[locality] += 1\n end\n end\n\n puts city_hash\nend", "title": "" }, { "docid": "16d7fd56fd6728d0e5c8e5b66a7f0690", "score": "0.56696063", "text": "def partners_count\n pledges.map{|p| p.name.strip}.uniq.count\n end", "title": "" }, { "docid": "2ecac3532c12af7b3b919cfc21a33c90", "score": "0.5595535", "text": "def collect_counts(hn_doc_name, hn_doc_text)\n COLLECTION_SETS.each_pair do |collection_set_name, set|\n HN_DATA[collection_set_name] = {} unless HN_DATA.has_key?(collection_set_name) # should inject instead of setting up beforehand\n HN_DATA[collection_set_name][hn_doc_name] = {} unless HN_DATA[collection_set_name].has_key?(hn_doc_name)\n set.each do |term|\n # have to extract with a non-alpha character on each side to match\n # terms like \"c\" and \"java\" vs \"javascript\"\n count = hn_doc_text.scan(/[^a-z]#{Regexp.escape(term)}[^a-z]/im).size\n HN_DATA[collection_set_name][hn_doc_name][term] = count\n end\n end\nend", "title": "" }, { "docid": "355a1322c12c69b41d819ea516394546", "score": "0.5581968", "text": "def count_contestants_by_hometown(data, hometown)\n # return number of contestants given town\n # push into array. array.length\n hometown_array = []\n data.each do |season, participants_data|\n participants_data.collect do |participant_hash|\n participant_hash.each do |key, value|\n if value == hometown\n hometown_array << participant_hash[\"hometown\"]\n end\n end \n end\n end\n hometown_array.length\nend", "title": "" }, { "docid": "1da7caf2ef8de60badf3dd3632bd8886", "score": "0.55765396", "text": "def projects_organizations\n Rails.cache.fetch(\"site_#{self.id}_projects_organizations\", {:expires_in => 1.day}) do \n sql=\"select o.id,o.name,count(distinct ps.project_id) as count from organizations as o\n inner join projects as p on o.id=p.primary_organization_id\n inner join projects_sites as ps on p.id=ps.project_id and ps.site_id=#{self.id}\n inner join projects as pr on ps.project_id=pr.id\n group by o.id,o.name order by count DESC\"\n Organization.find_by_sql(sql).map do |o|\n [o,o.count.to_i]\n end\n end\n end", "title": "" }, { "docid": "9fd865a59e333bd4269b7e5cba3ea2dc", "score": "0.55509317", "text": "def count population\n\t\taltruist=0\n\t\tselfish=0\n\t\tpopulation.each do |chromosome|\n\t\t\tif chromosome.decision == 0\n\t\t\t\taltruist=altruist+1\n\t\t\telse\n\t\t\t\tselfish=selfish+1\n\t\t\tend\n\t\tend\n\t\tvalues=Hash.new\n\t\tvalues['altruist']=altruist\n\t\tvalues['selfish']=selfish\n\t\t@composition << values\n\tend", "title": "" }, { "docid": "c3dd43126e8ac764a7f9d496859d8934", "score": "0.55471635", "text": "def world_maritime_university_programs\n programs = []\n self.documents.each do |doc| \n doc.creators.each do |creator| \n creator.has_membership.each { |prog| programs << prog.name }\n end\n end\n programs.uniq\n end", "title": "" }, { "docid": "b7b152787f10a1f5d7a3bdd5918cd184", "score": "0.5524679", "text": "def count(params = {})\n record_count :external_organisation, params\n end", "title": "" }, { "docid": "ea9cadc305eba054d935318cb59960a1", "score": "0.5511703", "text": "def shared_pub_count(uri1, uri2)\n filename = \"#{Rails.root}/tmp/vivo/coauthor_counts/#{uuid_from_uri(uri1)}_#{uuid_from_uri(uri2)}.json\"\n file = File.read(filename)\n data = JSON.parse(file)\n data[\"results\"][\"bindings\"].first['cnt']['value']\n end", "title": "" }, { "docid": "1544abc7d9f398b36e090043edc58118", "score": "0.5494631", "text": "def find_friends_geo_distribution(user_id)\n \n geo_dist = {}\n if user_id.is_a? Numeric # allow a single user id\n friends = $client.friends(user_id)\n \n while friends.next_page? #Loops untill end of collection\n friends.each do |friend|\n #... # Loops 50 times\n if not friend.province.empty? and not friend.city.empty?\n if geo_dist[friend.province+\":\"+friend.city].nil?\n geo_dist[friend.province+\":\"+friend.city] = 1\n else\n geo_dist[friend.province+\":\"+friend.city] += 1\n end\n end\n end\n end \n\n end\n \n geo_dist = geo_dist.sort_by{|key, value| value}.reverse \n\n #geo_dist.each do | geo_cnt |\n\t#\tputs \"#{geo_cnt[0]} #{geo_cnt[1]}\"\n\t#end\n #geo_dist.each_pair do | k,v|\n # puts \"#{k} .... #{v}\" \n #end\nend", "title": "" }, { "docid": "b4773de8430b7ed61a860463d05f3a1d", "score": "0.54592025", "text": "def subjecttype_property_count\n puts \"#Subject-Type_Property count\"\n @endpoint_stats.each_key do |k|\n next if k==\"_all\"\n @endpoint_stats[k]['subjecttype_property'] = []\n g = \"<#{URI.encode(k)}>\"\n q = \"SELECT DISTINCT $p (str($plabel) AS $plabel) $stype (str($stype_label) AS $stype_label) ($n AS $n) ($dn AS $dn){ GRAPH #{g} { SELECT $p $stype (COUNT($s) AS $n) (COUNT(DISTINCT $s) AS $dn) { $s $p $o . $s a $stype . } GROUP BY $p $stype } OPTIONAL {$p rdfs:label $plabel} OPTIONAL {$stype rdfs:label $stype_label}}\"\n new_uri = @sparql_url+\"?query=#{q}&format=json\"\n req = @http.request_get(URI(new_uri))\n res = JSON.parse(req.body)\n res[\"results\"][\"bindings\"].each do |tpl|\n stype_prop = {\n 'stype' => tpl['stype']['value'],\n 'property' => tpl['p']['value'],\n 'count' => tpl['n']['value'].to_i,\n 'distinct_count' => tpl['dn']['value'].to_i,\n 'stype_label' => \"\",\n 'p_label' => \"\"\n }\n stype_prop['stype_label'] = tpl['stype_label']['value'] if tpl.has_key? 'stype_label'\n stype_prop['p_label'] = tpl['p_label']['value'] if tpl.has_key? 'p_label'\n @endpoint_stats[k]['subjecttype_property'] << stype_prop\n end\n puts \"\\t[#{k}]\"\n end\n end", "title": "" }, { "docid": "91f36d836cd210050af3d5f1d7e5764f", "score": "0.54482514", "text": "def total_visitors\n room.group_by{|v| v.visitor}.count.to_i\n end", "title": "" }, { "docid": "c98fe8c0b59b89145cfb655ffaa8dadf", "score": "0.5441953", "text": "def total_events\n total = sections.map { |x| x.holocene_events.uniq.length }.sum\n total += holocene_events.uniq.length\n total\n end", "title": "" }, { "docid": "1fe2d2164e837bd06fe24ecff280d64b", "score": "0.5426915", "text": "def count_contestants_by_hometown(data, hometown)\n contestant_bio_data(data, hometown).length\nend", "title": "" }, { "docid": "990202ac2fb69f90a8c5ad749b0558c2", "score": "0.5408711", "text": "def count_contestants_by_hometown(data, hometown)\n natives = 0\n data.each do |season, contestants|\n contestants.each do |person|\n if person.has_value?(hometown)\n natives += 1\n end\n end\n end\n natives\nend", "title": "" }, { "docid": "8542baac919e204f86210bfac36a9e72", "score": "0.54021955", "text": "def my_home\r\n @analyzer = current_user.analyzer\r\n @papers_status_to_count = {}\r\n #@papers_data.group_by {|p| p.paper_status }.each do |k, v|\r\n # @papers_status_to_count[k] = v.count\r\n #end\r\n filter = {\r\n :user_id => current_user.id\r\n }\r\n results = Mongodb::BankPaperPap.get_paper_status_count(filter)\r\n @papers_status_to_count = results\r\n end", "title": "" }, { "docid": "35e9ffb18fb3f36e0a2a8d4d7f70d3fc", "score": "0.53965443", "text": "def summate_activity_counts\n all_user_projects_subscriptions.reduce({}) do |counts, subscription|\n next if subscription.empty_summary?\n summary = subscription.summary\n summary.each do |workflow, value|\n counts[workflow] ||= 0\n counts[workflow] += value[:count].to_i\n end\n counts\n end\n end", "title": "" }, { "docid": "db78f4f4ffadf4503474bdd43790d915", "score": "0.5393908", "text": "def public_contributors_count\n total_contributors = 0\n self.contributors.each do |contributor|\n total_contributors += 1 if !contributor.private\n end\n total_contributors\n end", "title": "" }, { "docid": "a3f28fbf112fc6a9c25418f1555fe5ac", "score": "0.53887784", "text": "def total_deliveries\n @universe.values.map(&:length).sum\n end", "title": "" }, { "docid": "02a6f3bfae29ff7aa8dc185df46c8f6d", "score": "0.538826", "text": "def citations_over_time\n citation_events.pluck(:occurred_at, :source_doi).uniq { |v| v[1] }.\n group_by { |v| v[0].utc.iso8601[0..3] }.\n map { |k, v| { \"year\" => k, \"total\" => v.length } }.\n sort_by { |h| h[\"year\"] }\n end", "title": "" }, { "docid": "77ae19bc61b6ba6406d69a3ac635cbdc", "score": "0.53772694", "text": "def number_of_publishers(login=nil)\n count_by_frbr(login, :is_published_by, :how_many_roles?) \n end", "title": "" }, { "docid": "77ae19bc61b6ba6406d69a3ac635cbdc", "score": "0.53772694", "text": "def number_of_publishers(login=nil)\n count_by_frbr(login, :is_published_by, :how_many_roles?) \n end", "title": "" }, { "docid": "997a7d1cd1e68af597f69497223d5c84", "score": "0.5367694", "text": "def member_count; end", "title": "" }, { "docid": "bfaffaa756a82ec94b3df553f9ea96a1", "score": "0.5367439", "text": "def subscribers_count\n build_result :get, \"/subscribers_count/\"\n result.result\n end", "title": "" }, { "docid": "3969197b3e18e08df75b2f9b50456f89", "score": "0.53455055", "text": "def all_members_count\n self.self_and_descendants.sum(:members_count)\n end", "title": "" }, { "docid": "fc081b51b98d08a2f56e89d654e3e73b", "score": "0.5344894", "text": "def counts\n self.each.inject({}) {|h, doc| h[doc._key_value.to_s] = doc._count; h }\n end", "title": "" }, { "docid": "d4ef651a9cec13262acf7b3cbce3df82", "score": "0.53282535", "text": "def number_of_venues_things_in_common_with(login=nil)\n count_by_frbr(login, :has_commonalities_with, :how_many_roles?) \n end", "title": "" }, { "docid": "8faf3a96b8d03b5667c473c891c46944", "score": "0.53194547", "text": "def number_of_venues_has_commonalities_with(login=nil)\n count_by_frbr(login, :things_in_common_with, :how_many_roles?) \n end", "title": "" }, { "docid": "8f74c3c8969b898a42b89224f820ef70", "score": "0.5318747", "text": "def create_analysis_precinct_counts\n if self.district_precincts.count > 0\n load_analysis_precinct_counts\n else\n puts \"!!!!!!!!!!!!!!!!!!!!!!\"\n puts \"WARNING - DISTRICT/PRECINCTS MUST BE LOADED FOR THIS ELECTION IN ORDER TO CREATE PRECINCT COUNTS FOR ANALYSIS\"\n puts \"!!!!!!!!!!!!!!!!!!!!!!\"\n end\n end", "title": "" }, { "docid": "5e67f4bbfcc22a8614885c0a1e9cf132", "score": "0.53172374", "text": "def track_info\n @conference = Conference.find_by_acronym('jct2018')\n @tracks = @conference.tracks\n s = \"\"\n total_count = 0\n @tracks.each do |t|\n track_count = @conference.events.accepted.find_all_by_track_id(t.id).count\n s << \"Track: #{t.name}, accepted: #{track_count} \\n\"\n total_count += track_count\n end\n puts s\n puts \"total_count #{total_count}\"\n end", "title": "" }, { "docid": "2ff04ba1629f51745fb4c40cc1b09598", "score": "0.5309298", "text": "def traversal_6\n\n all_people = Person.where(:profile_type => \"TeamMember\")\n docs = 0\n all_people.each do |person|\n team_member = TeamMember.find(person.profile_id)\n team_member.projects.uniq.each do |project|\n documents = Document.where(:project_id => project.id)\n documents.each do |doc|\n #visiting instead of returning the size\n docs += 1\n end\n end\n end\n return docs\nend", "title": "" }, { "docid": "3d87b0fc9d18ccc776b311fae4de66bb", "score": "0.5308031", "text": "def get_collection_counts(repo_uri)\n types = ['pui_collection']\n counts = archivesspace.get_types_counts(types, repo_uri)\n final_counts = {}\n counts.each do |k, v|\n final_counts[k.sub(\"pui_\", '')] = v\n end\n final_counts['resource'] = final_counts['collection']\n final_counts\n end", "title": "" }, { "docid": "e12f29cd11c0cbb9b023645644926ee8", "score": "0.53079194", "text": "def total_events\n total = sections.includes([:sectioned, :holocene_events_sections, :holocene_events]).map { |x| x.holocene_events.uniq.length }.sum\n total += holocene_events.uniq.length\n total\n end", "title": "" }, { "docid": "873b6abdaf9b294c4a394d0b954f0272", "score": "0.53049123", "text": "def count_contestants_by_hometown(data, hometown)\n # code here\n person = []\n\n data.each do |hash_season, contestants_array|\n contestants_array.each do |contestant|\n if contestant[\"hometown\"] == hometown\n person << hash_season\n end\n end\n end\n person.length\nend", "title": "" }, { "docid": "d96fef713ce55b0f747345cff50bed23", "score": "0.529975", "text": "def how_many_pooottmpb\n people = @orders.group_by{|x| x.book}.sort_by{|x,y| -y.length}.to_h.values.flatten.uniq { |order| order.reader }.size\n end", "title": "" }, { "docid": "b98827272b086b43800aa78862efecdd", "score": "0.5292456", "text": "def count_contestants_by_hometown(bachelor, hometown)\n counter = 0\n all_contestants_ever(bachelor).each do |contestant|\n if contestant[\"hometown\"] == hometown\n counter += 1\n end\n end\n counter\nend", "title": "" }, { "docid": "e2816ab063dff3d1ecc07766343e88a3", "score": "0.52840835", "text": "def countries_in(results)\n CountriesOpportunity.where(opportunity: results.map(&:id)).group_by(&:country_id).map do |k, v|\n if (c = Country.find(k))\n c.opportunity_count = v.length\n c\n end\n end.sort_by(&:name)\n end", "title": "" }, { "docid": "d75bc0127c443b70b740b26f7223eac9", "score": "0.52788746", "text": "def count_contestants_by_hometown(data, hometown)\n # code here\n numb_of_actors_by_homewtown = 0\n data.each do |season, details|\n details.each do |actor|\n if actor[\"hometown\"] == hometown\n numb_of_actors_by_homewtown += 1\n end \n end\n end \nreturn numb_of_actors_by_homewtown\nend", "title": "" }, { "docid": "362f5477e92dcea0c88e48ac700c986f", "score": "0.5276133", "text": "def sum_activity_occurences\n if self.activities.any?\n array = []\n self.activities.map do |activity|\n array << activity.number_occurences\n end\n array.inject(:+)\n # binding.presencery\n else\n 0\n end\n end", "title": "" }, { "docid": "d95cfe86a5b9f4449477bbef21b9d426", "score": "0.5263703", "text": "def count_contestants_by_hometown(data, hometown)\n number = 0\n data.each do |_, bio_hash|\n bio_hash.each do |bio_key, _|\n if bio_key[\"hometown\"] == hometown\n number += 1\n end\n end\n end\n return number\nend", "title": "" }, { "docid": "7ce301aa7dbad4f330ec1d67ad56bd8d", "score": "0.5262147", "text": "def country\n render :json => @link.clicks.group(:country).count\n end", "title": "" }, { "docid": "0369dba75bef892e8dbd35d5a02a07a1", "score": "0.5260304", "text": "def goal_counts\n @goal_counts ||= GoalSubject.subject_counts( self )\n end", "title": "" }, { "docid": "1d8ca9184577f3869b5bb7f9fbf24d8c", "score": "0.52552146", "text": "def summate_activity_counts\n activity_count = 0\n all_user_projects_subscriptions.find_each do |subscription|\n next if subscription.empty_summary?\n if count = subscription.summary.values.first[:count].to_i\n activity_count += count\n end\n end\n activity_count\n end", "title": "" }, { "docid": "c1ae9750d0672e43db2fe179ae19353c", "score": "0.5253841", "text": "def cult_population\n # First, get all of the followers that belong to this cult, then count how many there are\n self.followers.count\n end", "title": "" }, { "docid": "d59d6b07f60a99c7b1937d32a398e50c", "score": "0.52512544", "text": "def url_info_count_by_codes(user = nil)\n query = [\n {\n '$group' => {\n '_id' => '$url_info.http_code',\n count: { '$sum' => 1 }\n }\n },\n { '$sort' => { 'count' => -1 } }\n ]\n\n # Filter by user\n query.unshift('$match' => { user_id: user.id }) if user\n\n W000t.collection.aggregate(query)\n end", "title": "" }, { "docid": "fda05104b85699a464d8c03bf342b73f", "score": "0.52416885", "text": "def total_camera_call_by_home(lines)\n answer = {}\n mapped_array = lines.map { |line| { home_id: data_from_keyword(line,'home_id') } }\n group_by_home = mapped_array.group_by { |hash| hash[:home_id] }\n group_by_home.each { |k,v| answer[k] = v.count}\n\n return answer\nend", "title": "" }, { "docid": "cfcfb2b549a8184542b21739d2f23b66", "score": "0.52413017", "text": "def direct_invite_count\n person.network_profiles.values.inject([]) {|m, p| m.concat(Array.wrap(p)) }.sum(&:inviting_count)\n end", "title": "" }, { "docid": "59e6e9c34b08f30974ee008b2c67676a", "score": "0.52355623", "text": "def state_counts\n participants.group(:attending).count\n end", "title": "" }, { "docid": "962c64a5b0d574b2fb220c9861087a71", "score": "0.5231048", "text": "def num_certs(entity)\n super + entity.companies.count { |c| !@peir_companies.include?(c) }\n end", "title": "" }, { "docid": "d6931f38f294207827c09e30e90d5339", "score": "0.5228704", "text": "def set_chart\n sponsors=Study.all[0..20].collect{|s|s.sponsors}.flatten\n agencies=sponsors.collect{|a| a.agency}\n count_hash = Hash.new(0)\n agencies.each{|agency|count_hash[agency] += 1 if agency}\n @sponsor_count=count_hash.collect{|k,v| [k,v] if k }\n end", "title": "" }, { "docid": "0ecb3d739b80fee9a9363630efd5ee6a", "score": "0.52264905", "text": "def word_count\n count = 0\n self.final_draft.each do |p|\n if !p.nil?\n count += p.word_count\n end\n end\n count\n end", "title": "" }, { "docid": "634289b109e8195c5bb5b1f63c8ee318", "score": "0.522588", "text": "def recipient_count\n if self.all_profiles?\n structure.user_profiles.where(subscribed: true).count\n else\n tagged_profiles.count\n end\n end", "title": "" }, { "docid": "4bccb0f307d216aed008464db887d268", "score": "0.5220249", "text": "def unread_invitations_count\n count_div = self.div(:text=>/Invitations/, :class=>\"lhnavigation_subnav_item_content\").div(:class=>\"lhnavigation_sublevelcount\")\n if count_div.present?\n count_div.text.to_i\n else\n 0\n end\n end", "title": "" }, { "docid": "d68685115056ca9e09466cb79f79d8a5", "score": "0.52174085", "text": "def count_all_courses\n count = courses.size()\n subgroups.each do |subgroup|\n count += subgroup.count_all_courses\n end\n count\n end", "title": "" }, { "docid": "a22aac6b7b36c8364ce8375f2b967892", "score": "0.52133983", "text": "def org_score\n if self.watchings == []\n watchings_count = 0\n else\n watchings = Watching.all\n watchings_array_user_id = watchings.map { |watching| watching.user_id }\n watchings_filtered = watchings_array_user_id.select {|user_id| user_id == self.id}\n watchings_count = watchings_filtered.compact.count\n end\n\n endorsements = self.endorsements.map { |endorsement| endorsement }\n\n sum_score = endorsements.compact.count + watchings_count\n end", "title": "" }, { "docid": "63684cc5b4371e87deec155dcc864386", "score": "0.52034414", "text": "def compute_counts_from(html)\n text = clean_html(html)\n # snarf the count of total hits and hits on this page\n if text.match(/hits \\d+ through \\d+.\\s*out of (\\d+)/mi) {|m|\n @count = m[1].to_i\n @pages = (@count.to_f / 50.0).ceil.to_i\n }\n else # no forward citations\n @count = 0\n @pages = 0\n end\n \n PatentAgent.dlog \"Forward Citation\", \"for #{@parent} => Count: #{@count}: Pages: #{@pages}\"\n [@count, @pages]\n end", "title": "" }, { "docid": "cb6b39fba74e2fe3855149b7f71de008", "score": "0.519468", "text": "def total_count\n users = @client.search_users('language:ruby location:Vietnam')\n return users.total_count\n end", "title": "" }, { "docid": "032fcac98a03a564d238309570858c74", "score": "0.5187125", "text": "def count_contestants_by_hometown data, hometown\n all_contestants(data).count{|person| person[\"hometown\"] == hometown}\nend", "title": "" }, { "docid": "ce8f619997120077b1d2264289cd86e4", "score": "0.5183303", "text": "def group(ppl)\n @all = ppl.sort\n @count = ppl.count\n end", "title": "" }, { "docid": "286e6415f628483a8652e6383d355a6b", "score": "0.51827407", "text": "def process_count_by_filter\n return @process_count_by_filter if @process_count_by_filter\n\n @process_count_by_filter = %w(active upcoming past).inject({}) do |collection_by_filter, filter_name|\n processes = filtered_processes(filter_name).results.where(decidim_participatory_process_group_id: Rails.application.config.process)\n collection_by_filter.merge(filter_name.to_s => processes.count)\n end\n @process_count_by_filter[\"all\"] = @process_count_by_filter.values.sum\n @process_count_by_filter\n end", "title": "" }, { "docid": "5fe5ce6d0fd09c53adfc587a51d25afb", "score": "0.5176694", "text": "def count_contestants_by_hometown(data, hometown)\n hometown_count = 0\n data.each {|data_season, participant_stats|\n participant_stats.each {|category|\n if category[\"hometown\"] == hometown ;\n hometown_count = hometown_count + 1\n end\n }\n }\n puts hometown_count\n return hometown_count\nend", "title": "" }, { "docid": "c199c5e0b7e4d1c8a2e6c991841f0b8a", "score": "0.5174069", "text": "def count_contestants_by_hometown(data, hometown)\n # code here\n same_town = 0\n data.each do |seasons, array|\n array.each do |women|\n women.each do |stats, info|\n if info.include?(hometown)\n same_town += 1\n end\n end\n end\n end\n return same_town\nend", "title": "" }, { "docid": "2aa20b8f376658952575dea9c24ff133", "score": "0.51703", "text": "def citation_count\n citation_events.pluck(:source_doi).uniq.length\n end", "title": "" }, { "docid": "3d52161fcc5a7291d6315aca2b376dcc", "score": "0.5169715", "text": "def captured_group_counts; end", "title": "" }, { "docid": "3d52161fcc5a7291d6315aca2b376dcc", "score": "0.5169715", "text": "def captured_group_counts; end", "title": "" }, { "docid": "3d52161fcc5a7291d6315aca2b376dcc", "score": "0.5169715", "text": "def captured_group_counts; end", "title": "" }, { "docid": "444e61955a11b7a3c0788dc90856948e", "score": "0.51655406", "text": "def count_contestants_by_hometown(data, hometown)\n counter = 0\n data.each do |s_num, contestants|\n contestants.each do |cont_keys, cont_values|\n if cont_keys[\"hometown\"] == hometown\n counter += 1\n end\n end\n end \n counter\nend", "title": "" }, { "docid": "a34dc6933ef46bbfe1800d71af0b6f08", "score": "0.5164846", "text": "def get_requests_per_public_body(conn)\n\n sql_query = \"SELECT public_bodies.name as organismo, count(info_requests.described_state) as cantidad_pedidos, info_requests.described_state as estado\n FROM info_requests \n RIGHT JOIN public_bodies\n\tON public_bodies.id = info_requests.public_body_id\n\tGROUP BY public_bodies.name, info_requests.described_state;\"\n\n\tinfo_requests_per_public_body = renombrar_estados(conn.exec(sql_query).to_a)\n \n \treturn {\n \t\t\"cantidad_pedidos_per_organismo\" => info_requests_per_public_body\n \t}\nend", "title": "" }, { "docid": "dd6047275a2ef30c88a5181adc870cf9", "score": "0.5162096", "text": "def aggregate\n {}.tap do |counts|\n group.each_pair { |key, value| counts[key] = value.size }\n end\n end", "title": "" }, { "docid": "b41226c197dfb33ff0784c28f1d814fa", "score": "0.5159172", "text": "def stats_per_prot(prot_to_peps, seq_to_hits)\n per_protein_hash = {}\n prot_to_peps.each do |prot, uniq_pep_seqs|\n all = Set.new\n aaseqcharges = Set.new\n aaseqs = Set.new\n\n uniq_pep_seqs.each do |pep_seq|\n all_hits = seq_to_hits[pep_seq]\n all.merge( all_hits )\n all_hits.each do |hit|\n aaseq = hit.sequence\n aaseqs.add( aaseq )\n aaseqcharges.add( aaseq + '_' + hit.charge.to_s )\n end\n per_protein_hash[prot] = [aaseqs.size, aaseqcharges.size, all.size]\n\n end\n end\n per_protein_hash\nend", "title": "" }, { "docid": "e89d1a47839859256e3a91c7473e32aa", "score": "0.5156903", "text": "def election_poli_organize\n @@trumparians = []\n @@bless_ups = []\n @@election_politicians.each { |poli|\n if poli.party_obj == @@created_world.world_party1\n @@trumparians << poli\n elsif poli.party_obj == @@created_world.world_party2\n @@bless_ups << poli\n end\n }\n election_day_vote_count\n end", "title": "" }, { "docid": "2b2e94543a1d37012307afdb4b96b09b", "score": "0.515681", "text": "def published_item_count\n Theme.select('distinct stories.id').joins(:stories => :story_translations).where('story_translations.published = 1 and themes.id = ?', self.id).count\n end", "title": "" }, { "docid": "a5d626b07b9ff5339c220ffb5701f2ad", "score": "0.5146982", "text": "def supporters_count(community)\n count = 0\n community.businesses.each do |b|\n count += b.listed_by_business.count\n end\n return count\n end", "title": "" }, { "docid": "5baf40c0acd0ebf57608702d250b6b64", "score": "0.5145832", "text": "def get_retroactive_subcount(orders)\n sorted_orders = orders.sort{ |order| Time.parse(order['created_at']).to_i }\n retroactive_cutoff = Time.parse('2017-04-01T00:00:00-00:00').to_i\n\n order_count = 0\n\n sorted_orders.each do |order|\n next if !order['confirmed'] || order['financial_status'] != 'paid'\n order_time = Time.parse(order['created_at']).to_i\n if order_time < retroactive_cutoff && order_count < 3\n order_count += sub_order_count(order_count, order)\n elsif order_time >= retroactive_cutoff\n order_count += sub_order_count(order_count, order)\n end\n end\n\n # should be at least three orders, for a user\n # to get invites.\n invites = 0\n if order_count >= 2\n invites = order_count\n end\n return invites\nend", "title": "" }, { "docid": "5effe67b2a2a5809c700f4ab68ee75ec", "score": "0.5143417", "text": "def stats\n non_unq_signup_dates = User.pluck(:created_at).map{|time_with_zone| time_with_zone.to_date}.sort\n unq_signup_dates = non_unq_signup_dates.uniq\n @days_operational = (unq_signup_dates.first..Date.today)\n\n date_counts = Hash.new(0)\n non_unq_signup_dates.each {|date| date_counts[date] += 1}\n\n @signup_counts = []\n @days_operational.each {|day| @signup_counts << (date_counts[day] || 0)}\n\n @running_signup_counts = @signup_counts.each_with_index.map { |x,i| @signup_counts[0..i].inject(:+) }\n\n end", "title": "" }, { "docid": "f74f2ec10d72bc925a1bd81bc865fe48", "score": "0.51366866", "text": "def unseen_count\r\n conversation_members.where(:viewed => false, :parted => true).count\r\n end", "title": "" }, { "docid": "142344d5888eb514ee8f3c3bf094a541", "score": "0.5134217", "text": "def display_group_info\n counts = {}\n total = @groups['?'][:members].count\n @groups.each do |topic, datum|\n next if topic == '?'\n count = datum[:members].count\n total += count\n counts[count] ||= 0\n counts[count] += 1\n end\n data = []\n counts.keys.sort_by { |key| key.to_i }.each do |key|\n data << \"#{counts[key]} #{key}s\"\n end\n unplaced = (@groups['?'] && @groups['?'][:members].count) || 0\n puts \"#{total} total, #{unplaced} ?s = #{data.join(', ')}\"\nend", "title": "" }, { "docid": "4a4795901878fec894b925a0fd34d053", "score": "0.5130847", "text": "def number_of_publications_as_manifestations(login=nil)\n count_by_frbr(login, :has_publications, :how_many_manifestations?) \n end", "title": "" }, { "docid": "0f91f6abda3d826ed91769347a64f80e", "score": "0.5117977", "text": "def regional_count\n team_count('Regional Teams')\n end", "title": "" }, { "docid": "36e7ae51929eb4668f854990648991e3", "score": "0.5114632", "text": "def sharing_statistics\n trackings = self.bookmark_trackings\n\n statistics = ActiveSupport::OrderedHash.new\n BookmarkTracking.sources.keys.each do |source|\n statistics[source.to_s] = 0\n end\n\n total = 0\n trackings.each do |tracking|\n statistics[tracking.source.to_s] = tracking.count\n total += tracking.count\n end\n\n statistics[\"total\"] = total\n statistics\n end", "title": "" }, { "docid": "1f643ec53969b15172bd2610e12d0fec", "score": "0.5113969", "text": "def occurrences; end", "title": "" }, { "docid": "8800286f3894e1b31943a888250d49ed", "score": "0.51116174", "text": "def unique_count\n xuc = []\n @dictionary.each do |dict_line|\n list_of_ips_array = url_ip_match(dict_line)\n no_of_uniq_ips = ip_count(list_of_ips_array)\n xuc.push([dict_line, no_of_uniq_ips])\n end\n @uc = reverse_sort(xuc)\n end", "title": "" }, { "docid": "f1462edfa0a1049a6836788900ff15a8", "score": "0.510785", "text": "def get_visual_stats_country\n voters = Gamer.joins(:synonyms).where(\"synonym_id = ?\", self.id)\n groups = voters.count(group: :country)\n sum = groups.sum{|v| v.last}\n return groups.map {|key, value| [key,((value.to_f/sum)*100).to_i]}\n end", "title": "" }, { "docid": "398a66baf147b88e8027a1f7a359eeb4", "score": "0.51040184", "text": "def all_participants_sites\n return participants.length*Participant::NUMBER_OF_SITES_PER_PARTICIPANT\n end", "title": "" }, { "docid": "744cc45760af1748a6566443b8cc2319", "score": "0.5103788", "text": "def count_contestants_by_hometown(data, hometown)\n counter = 0\n cast_array = data.map{|season, cast| cast}\n .flatten\n cast_array.each do |contestant|\n if contestant[\"hometown\"] == hometown\n counter += 1\n end\n end\n counter\nend", "title": "" }, { "docid": "d194fdcbc7009035e186881aa26d8e0e", "score": "0.51034504", "text": "def by_permission\n return by_date_and_permission if start_date\n\n works_count = {}\n works_count[:total] = query_service.count\n works_count[:public] = query_service.where_public.count\n works_count[:registered] = query_service.where_registered.count\n works_count[:private] = works_count[:total] - (works_count[:registered] + works_count[:public])\n works_count\n end", "title": "" }, { "docid": "6e1eee4a8d2962c9cdcbdd12fb854b84", "score": "0.5100692", "text": "def cast_votes finalists\n votes = Hash.new\n finalists.each do |finalist|\n votes[finalist] = 0\n end\n\n members.each do |member|\n vote = finalists.sample\n puts \"#{member.to_s.capitalize} votes for #{vote.to_s.capitalize}\"\n votes[vote] += 1\n end\n votes\n end", "title": "" }, { "docid": "633512b2ddf9e704d65552ce45dccb5c", "score": "0.509912", "text": "def value \n \t# self.companies.uniq.size\n people = 0\n self.companies.each do |company|\n company.people.each do |person|\n people +=1\n end\n end\n return people\n end", "title": "" }, { "docid": "ed0a1ca518e665ed9f5a321bf304e3f9", "score": "0.50987047", "text": "def generateReportingOrgsCountryWise()\n oipa_reporting_orgs = RestClient.get api_simple_log(settings.oipa_api_url + \"activities/aggregations/?format=json&group_by=reporting_organisation,recipient_country&aggregations=count&reporting_organisation_identifier=#{settings.goverment_department_ids}&hierarchy=1&activity_status=2\")\n oipa_reporting_orgs = Oj.load(oipa_reporting_orgs)\n oipa_reporting_orgs = oipa_reporting_orgs['results']\n countryHash = {}\n oipa_reporting_orgs.each do |result|\n if !countryHash.key?(result['recipient_country']['code'])\n countryHash[result['recipient_country']['code']] = Array.new\n countryHash[result['recipient_country']['code']].push(result['reporting_organisation']['organisation_identifier'])\n else\n if !countryHash[result['recipient_country']['code']].include?(result['reporting_organisation']['organisation_identifier'])\n countryHash[result['recipient_country']['code']].push(result['reporting_organisation']['organisation_identifier'])\n end\n end\n end\n countryHash\n end", "title": "" }, { "docid": "dd6843f39f90d1c9bb3a42d79255187b", "score": "0.5086667", "text": "def get_issue_counts_for_epics(issues)\n issue_count_array = []\n index = 0\n issues.each do |key, value|\n issue_count_array.push([key,0,0,0,0,0])\n value.each do |issue|\n accumulate_issue_information(issue, issue_count_array, index)\n end\n index = index + 1\n end\n\n return issue_count_array\n end", "title": "" }, { "docid": "4ceebc9f2c9893dd69c3b078eb81220a", "score": "0.5083671", "text": "def local_info\n udprn = params[:udprn]\n details = PropertyDetails.details(udprn.to_i)\n district = details['_source']['district']\n count = Agents::Branches::AssignedAgent.unscope(where: :is_developer).where(is_developer: true).joins(:branch).where('agents_branches.district = ?', district).count\n render json: count, status: 200\n end", "title": "" } ]
731dfda0a03b9c3b32d570cb92f3d9ae
Get Operational Status Summary of All Logical Ports in the System Returns operational status of all logical ports. The query parameter \"source&x3D;realtime\" is not supported.
[ { "docid": "160397cde872b80bdd543c42cc1e178c", "score": "0.60602075", "text": "def get_logical_port_status_summary_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_port_status_summary ...\"\n end\n if @api_client.config.client_side_validation && opts[:'attachment_type'] && !['VIF', 'LOGICALROUTER', 'BRIDGEENDPOINT', 'DHCP_SERVICE', 'METADATA_PROXY', 'L2VPN_SESSION', 'NONE'].include?(opts[:'attachment_type'])\n fail ArgumentError, 'invalid value for \"attachment_type\", must be one of VIF, LOGICALROUTER, BRIDGEENDPOINT, DHCP_SERVICE, METADATA_PROXY, L2VPN_SESSION, NONE'\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 LogicalSwitchingApi.get_logical_port_status_summary, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalSwitchingApi.get_logical_port_status_summary, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-ports/status\"\n\n # query parameters\n query_params = {}\n query_params[:'attachment_id'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?\n query_params[:'attachment_type'] = opts[:'attachment_type'] if !opts[:'attachment_type'].nil?\n query_params[:'bridge_cluster_id'] = opts[:'bridge_cluster_id'] if !opts[:'bridge_cluster_id'].nil?\n query_params[:'container_ports_only'] = opts[:'container_ports_only'] if !opts[:'container_ports_only'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'diagnostic'] = opts[:'diagnostic'] if !opts[:'diagnostic'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'logical_switch_id'] = opts[:'logical_switch_id'] if !opts[:'logical_switch_id'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'parent_vif_id'] = opts[:'parent_vif_id'] if !opts[:'parent_vif_id'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'switching_profile_id'] = opts[:'switching_profile_id'] if !opts[:'switching_profile_id'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n query_params[:'transport_zone_id'] = opts[:'transport_zone_id'] if !opts[:'transport_zone_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortStatusSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_port_status_summary\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "3e154e6561812191abdaeae2ebd4ed2b", "score": "0.68370277", "text": "def get_logical_port_status_summary(opts = {})\n data, _status_code, _headers = get_logical_port_status_summary_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "0e0b7d69fba4999f6d03922089976a68", "score": "0.5949801", "text": "def get_logical_port_operational_status_with_http_info(lport_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_port_operational_status ...\"\n end\n # verify the required parameter 'lport_id' is set\n if @api_client.config.client_side_validation && lport_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lport_id' when calling LogicalSwitchingApi.get_logical_port_operational_status\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-ports/{lport-id}/status\".sub('{' + 'lport-id' + '}', lport_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortOperationalStatus')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_port_operational_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "37e8efb8a663f1a06728efa588aadb75", "score": "0.5827719", "text": "def list_logical_ports(opts = {})\n data, _status_code, _headers = list_logical_ports_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "a8ae1b304a4f2c41cc5925c83271519b", "score": "0.58043754", "text": "def get_logical_port_statistics(lport_id, opts = {})\n data, _status_code, _headers = get_logical_port_statistics_with_http_info(lport_id, opts)\n return data\n end", "title": "" }, { "docid": "4f2db8a50f1ed6d7e72a4f1efeab167a", "score": "0.57947904", "text": "def list_logical_ports(opts = {})\n data, _status_code, _headers = list_logical_ports_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "c49bedc3217a73c6faf1ce4071ab7d0c", "score": "0.5785296", "text": "def get_statistics\n port_name = @data.delete('port_name')\n pretty get_single_resource_instance.statistics(port_name)\n true\n end", "title": "" }, { "docid": "3992a9db44a18dc5dcafcddf425f6a4a", "score": "0.5769057", "text": "def get_logical_port_statistics_with_http_info(lport_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_port_statistics ...\"\n end\n # verify the required parameter 'lport_id' is set\n if @api_client.config.client_side_validation && lport_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lport_id' when calling LogicalSwitchingApi.get_logical_port_statistics\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-ports/{lport-id}/statistics\".sub('{' + 'lport-id' + '}', lport_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_port_statistics\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3dd523230ff23afb996ae0f5cb492944", "score": "0.5744124", "text": "def get_logical_port_operational_status(lport_id, opts = {})\n data, _status_code, _headers = get_logical_port_operational_status_with_http_info(lport_id, opts)\n return data\n end", "title": "" }, { "docid": "efc08f6848c5e677075e56fdff8d6799", "score": "0.5669689", "text": "def get_statistics\n port_name = @data.delete('port_name')\n subport_number = @data.delete('subport_number')\n pretty get_single_resource_instance.statistics(port_name, subport_number)\n true\n end", "title": "" }, { "docid": "85c3e6cf5b58f2a74f7dcc5d8eedb2b1", "score": "0.5606849", "text": "def list_used_ports \n run %! netstat -lnptu !\n end", "title": "" }, { "docid": "970922f8cbc386bff185b9cb10014f5f", "score": "0.5529804", "text": "def index\n @open_ports = OpenPort.all\n end", "title": "" }, { "docid": "f4e2c16f4e106a0efa93bd8c898b2220", "score": "0.55274284", "text": "def get_all_local_ports()\n @db.execute(\"SELECT DISTINCT(local) FROM ports\").flatten\n end", "title": "" }, { "docid": "1feb85a77d87f3ba85b8b47f1dbce03b", "score": "0.5518538", "text": "def get_shdsl_ports_all(slot)\r\r\r\r\r\r\r\r\n result = []\r\r\r\r\r\r\r\r\n sample = ''\r\r\r\r\r\r\r\r\n cmd = \"ls /#{slot[:id]}/logports -e\"\r\r\r\r\r\r\r\r\n\r\r\r\r\r\r\r\r\n #\r\r\r\r\r\r\r\r\n # ID | Name | Main Mode | Equip State | Alarm Sev | Prop Alarm Sev | User Label | Service Label | Description\r\r\r\r\r\r\r\r\n # -----------+------------+-------------------+-------------+-----------+----------------+------------+---------------+------------\r\r\r\r\r\r\r\r\n # logport-1 | SHDSL Span | ports:1,2,3,4 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-5 | SHDSL Span | ports:5,6,7,8 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-9 | SHDSL Span | ports:9,10,11,12 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-13 | SHDSL Span | ports:13,14,15,16 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-17 | SHDSL Span | ports:17,18,19,20 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-21 | SHDSL Span | ports:21,22,23,24 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-25 | SHDSL Span | ports:25,26,27,28 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # logport-29 | SHDSL Span | ports:29,30,31,32 | | Cleared | Cleared | | |\r\r\r\r\r\r\r\r\n # /unit-21/logports>\r\r\r\r\r\r\r\r\n\r @telnet.puts(cmd) { |str| print str }\r\r\r\r\r\r\r\r\n @telnet.waitfor('Match' => HOST_PROMPT) { |rcvdata| sample << rcvdata }\r\r\r\r\r\r\r\r\n\r\r\r\r\r\r\r\r\n sample.scan(REGEX_SHDSL_PORTS).each do |row|\r\r\r\r\r\r\r\r\n values = row.split(/\\|/).map { |e| e || '' } # Replaces nil values of array\r\r\r\r\r\r\r\r\n result << {\r\r\r\r\r\r\r\r\n id: values[0].strip!,\r\r\r\r\r\r\r\r\n main_mode: values[2].strip!,\r\r\r\r\r\r\r\r\n alarm: values[4].strip!,\r\r\r\r\r\r\r\r\n user_label: values[6].strip!,\r\r\r\r\r\r\r\r\n service_label: values[7].strip!,\r\r\r\r\r\r\r\r\n description: values[8]\r.strip!\r\r\n }\r\r\r\r\r\r\r\r\n end\r\r\r\r\r\r\r\r\n result\r\r\r\r\r\r\r\r\n end", "title": "" }, { "docid": "2c6742187460659e5603e4ca493e1e62", "score": "0.5471188", "text": "def list_logical_router_ports_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.list_logical_router_ports ...\"\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 LogicalRoutingAndServicesApi.list_logical_router_ports, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalRoutingAndServicesApi.list_logical_router_ports, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'resource_type'] && !['LogicalRouterUpLinkPort', 'LogicalRouterDownLinkPort', 'LogicalRouterLinkPortOnTIER0', 'LogicalRouterLinkPortOnTIER1', 'LogicalRouterLoopbackPort', 'LogicalRouterIPTunnelPort', 'LogicalRouterCentralizedServicePort'].include?(opts[:'resource_type'])\n fail ArgumentError, 'invalid value for \"resource_type\", must be one of LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPortOnTIER0, LogicalRouterLinkPortOnTIER1, LogicalRouterLoopbackPort, LogicalRouterIPTunnelPort, LogicalRouterCentralizedServicePort'\n end\n # resource path\n local_var_path = \"/logical-router-ports\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'logical_router_id'] = opts[:'logical_router_id'] if !opts[:'logical_router_id'].nil?\n query_params[:'logical_switch_id'] = opts[:'logical_switch_id'] if !opts[:'logical_switch_id'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'resource_type'] = opts[:'resource_type'] if !opts[:'resource_type'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalRouterPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#list_logical_router_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "6aadb1f4c49f5ad61514386f742e7822", "score": "0.5462915", "text": "def get_logical_switch_status_summary(opts = {})\n data, _status_code, _headers = get_logical_switch_status_summary_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "582c99ab8bc146370873b90c3e127963", "score": "0.5455397", "text": "def get_logical_switch_status_summary(opts = {})\n data, _status_code, _headers = get_logical_switch_status_summary_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "ff45282ae1ec217968d506bf620791b0", "score": "0.5404185", "text": "def get_statistics\n Puppet.notice(\"\\n\\nInterconnect Statistics\\n\")\n pretty get_single_resource_instance.statistics(@statistics['portName'], @statistics['subportNumber'])\n true\n end", "title": "" }, { "docid": "323b4515bb31b75d9b33ec1caa6c66b3", "score": "0.53867185", "text": "def process_status(mongrel_config = CONFIG_FILE)\n mongrel_ports = MongrelPortManager.new.mongrel_ports(mongrel_config)\n return [] if mongrel_ports.empty? || mongrel_ports.nil?\n response_summary = Hash.new\n mongrel_ports.each do |port|\n response = self.http_response(\"http://localhost:#{port}/\")\n response_summary[port] = self.valid_http_response?(response)\n end\n response_summary\n end", "title": "" }, { "docid": "3a532daee69f74a7946583a0020afc95", "score": "0.5342687", "text": "def list_logical_router_ports(opts = {})\n data, _status_code, _headers = list_logical_router_ports_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "51293e9efb569045bb5e03fba9f93db4", "score": "0.5337202", "text": "def get_output_ports\n lists, items = _ls_ports(\"out\")\n items + lists\n end", "title": "" }, { "docid": "90d06e917427372449d6f530e1f2f183", "score": "0.53279024", "text": "def see_all_ports\n self.methods.select {|var| var.to_s.match(/port\\d+=/)}.collect { |sym| sym.match(/(port\\d+)/) and $1}\n end", "title": "" }, { "docid": "d1e2afd5b42d5457be88a7a7a10be6ef", "score": "0.5286448", "text": "def list_logical_ports_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.list_logical_ports ...\"\n end\n if @api_client.config.client_side_validation && opts[:'attachment_type'] && !['VIF', 'LOGICALROUTER', 'BRIDGEENDPOINT', 'DHCP_SERVICE', 'METADATA_PROXY', 'L2VPN_SESSION', 'NONE'].include?(opts[:'attachment_type'])\n fail ArgumentError, 'invalid value for \"attachment_type\", must be one of VIF, LOGICALROUTER, BRIDGEENDPOINT, DHCP_SERVICE, METADATA_PROXY, L2VPN_SESSION, NONE'\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 LogicalSwitchingApi.list_logical_ports, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalSwitchingApi.list_logical_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/logical-ports\"\n\n # query parameters\n query_params = {}\n query_params[:'attachment_id'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?\n query_params[:'attachment_type'] = opts[:'attachment_type'] if !opts[:'attachment_type'].nil?\n query_params[:'bridge_cluster_id'] = opts[:'bridge_cluster_id'] if !opts[:'bridge_cluster_id'].nil?\n query_params[:'container_ports_only'] = opts[:'container_ports_only'] if !opts[:'container_ports_only'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'diagnostic'] = opts[:'diagnostic'] if !opts[:'diagnostic'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'logical_switch_id'] = opts[:'logical_switch_id'] if !opts[:'logical_switch_id'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'parent_vif_id'] = opts[:'parent_vif_id'] if !opts[:'parent_vif_id'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'switching_profile_id'] = opts[:'switching_profile_id'] if !opts[:'switching_profile_id'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n query_params[:'transport_zone_id'] = opts[:'transport_zone_id'] if !opts[:'transport_zone_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#list_logical_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ec08b95a8ea7c4825e176c6793a94892", "score": "0.52371556", "text": "def get_shdsl_ports_all(slot)\n result = []\n sample = ''\n cmd = \"ls /#{slot.id}/logports -e\"\n\n @telnet.puts(cmd) { |str| print str }\n\n @telnet.waitfor('Match' => PROMPT) { |rcvdata| sample << rcvdata }\n\n sample.scan(REGEX_SHDSL_PORTS).each do |row|\n values = row.split(/\\|/) # .map { |e| e || '+-+-+-+-+-+-+-+-+' } # Replaces nil values of array\n\n result << SHDSL_Port.new do\n self.id = values[0]\n self.main_mode = values[2].strip!\n self.alarm = values[4]\n self.user_label = values[6]\n self.service_label = values[7]\n self.description = values[8]\n end\n end\n result\n end", "title": "" }, { "docid": "1282e400e05038915f9a63cded8e2b74", "score": "0.5235251", "text": "def parse_port_status\n @thread = Thread.new(@control_socket) do |socket|\n ControlPacket.each(socket) do |packet|\n if packet.command == :port_status\n @port_status_lock.synchronize {\n @port_status = packet.information\n }\n end\n end\n end\n end", "title": "" }, { "docid": "12f223f970b251359cb5df3ddaf7aeef", "score": "0.5160412", "text": "def index\n @device_component_statuses = DeviceComponentStatus.all\n end", "title": "" }, { "docid": "d2729052bc3554a20b91283ee9cfa9e7", "score": "0.5151393", "text": "def get_and_update_operational_status!\n update_obj!(:type, :external_ref, :operational_status)\n if is_staged?()\n return self[:admin_op_status]\n end\n\n if op_status = CommandAndControl.get_node_operational_status(self)\n unless self[:operational_status] == op_status\n update_operational_status!(op_status)\n if op_status == 'stopped'\n # clear the hostaddress info\n attribute.clear_host_addresses()\n end\n end\n end\n op_status || self[:operational_status]\n end", "title": "" }, { "docid": "971b4573ca4dc6b602d692e417ed39fb", "score": "0.51155907", "text": "def output_ports\n ports.by_type[\"RFlow::Component::OutputPort\"]\n end", "title": "" }, { "docid": "0c92646ffc465fe8b855c9fcbecfcb33", "score": "0.51126194", "text": "def get_all_nodes_conn_status\n get_uri = \"/restconf/operational/opendaylight-inventory:nodes\"\n response = @rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('nodes') && body['nodes'].has_key?('node')\n conn_list = []\n body['nodes']['node'].each do |node|\n is_connected = false\n if node['id'].include?('openflow')\n # OpenFlow devices connect to controller (unlike NETCONF nodes),\n # so if we see one, then it is 'connected'\n is_connected = true\n elsif node.has_key?('netconf-node-inventory:connected')\n is_connected = node['netconf-node-inventory:connected']\n end\n conn_status = {:node => node['id'],\n :connected => is_connected}\n conn_list << conn_status\n end\n NetconfResponse.new(NetconfResponseStatus::OK, conn_list)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "title": "" }, { "docid": "39b6ac1dd99bf2155c1dd66aad8cddc1", "score": "0.5100493", "text": "def determine_services_ports\n netstat = as_root('netstat -untlp')\n netstat = netstat.lines.select { |line| /^[tu][cd]p/.match(line) }\n netstat.map! { |line| line.split(/\\s+/) }\n\n addresses = netstat.map { |row| row[3].gsub(/:[^:]*$/, '') }.uniq.sort\n netstat.map! do |row|\n port = row[3].gsub(/.*:/, '')\n pid = row[-1].gsub(/.*\\//, '')\n \" \" * 16 + \"% 6d %s\" % [port, pid]\n end\n netstat.uniq!\n netstat.sort! { |x,y| x.to_i <=> y.to_i }\n\n warn('Cannot enumerate listening ports') if netstat.empty?\n\n netstat[0] = netstat[0].to_s[16..-1]\n Entry.new('Listening Ports', \"#{netstat.join(\"\\n\")}\")\n end", "title": "" }, { "docid": "14f55f6965fa7f99cf4f1f6d8e500ed7", "score": "0.50799465", "text": "def index\n @source_statuses = SourceStatus.all\n end", "title": "" }, { "docid": "14f55f6965fa7f99cf4f1f6d8e500ed7", "score": "0.50799465", "text": "def index\n @source_statuses = SourceStatus.all\n end", "title": "" }, { "docid": "8138dd866ec83563c31a1dfc36095fc3", "score": "0.5074454", "text": "def get_logical_port_state_with_http_info(lport_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_port_state ...\"\n end\n # verify the required parameter 'lport_id' is set\n if @api_client.config.client_side_validation && lport_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lport_id' when calling LogicalSwitchingApi.get_logical_port_state\"\n end\n # resource path\n local_var_path = \"/logical-ports/{lport-id}/state\".sub('{' + 'lport-id' + '}', lport_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortState')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_port_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5541ec6a55d2df726ea518b0c200dbce", "score": "0.5068734", "text": "def get_logical_router_port_statistics_summary_with_http_info(logical_router_port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.get_logical_router_port_statistics_summary ...\"\n end\n # verify the required parameter 'logical_router_port_id' is set\n if @api_client.config.client_side_validation && logical_router_port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_port_id' when calling LogicalRoutingAndServicesApi.get_logical_router_port_statistics_summary\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-router-ports/{logical-router-port-id}/statistics/summary\".sub('{' + 'logical-router-port-id' + '}', logical_router_port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalRouterPortStatisticsSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#get_logical_router_port_statistics_summary\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1dd59dd84636cedbd27d90ea50201123", "score": "0.5055942", "text": "def get_logical_router_port_statistics_with_http_info(logical_router_port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.get_logical_router_port_statistics ...\"\n end\n # verify the required parameter 'logical_router_port_id' is set\n if @api_client.config.client_side_validation && logical_router_port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'logical_router_port_id' when calling LogicalRoutingAndServicesApi.get_logical_router_port_statistics\"\n end\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n # resource path\n local_var_path = \"/logical-router-ports/{logical-router-port-id}/statistics\".sub('{' + 'logical-router-port-id' + '}', logical_router_port_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalRouterPortStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalRoutingAndServicesApi#get_logical_router_port_statistics\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f70ba0a752b13bff5a2178236ffd7480", "score": "0.50504005", "text": "def ports\n get('shodan/ports')\n end", "title": "" }, { "docid": "eb5f4f45402bba3227de984b581edfe2", "score": "0.5034132", "text": "def get_logical_switch_status_summary_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_status_summary ...'\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 ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_status_summary, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_status_summary, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n if @api_client.config.client_side_validation && opts[:'transport_type'] && !['OVERLAY', 'VLAN'].include?(opts[:'transport_type'])\n fail ArgumentError, 'invalid value for \"transport_type\", must be one of OVERLAY, VLAN'\n end\n if @api_client.config.client_side_validation && !opts[:'vlan'].nil? && opts[:'vlan'] > 4094\n fail ArgumentError, 'invalid value for \"opts[:\"vlan\"]\" when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_status_summary, must be smaller than or equal to 4094.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'vlan'].nil? && opts[:'vlan'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"vlan\"]\" when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.get_logical_switch_status_summary, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/logical-switches/status'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'diagnostic'] = opts[:'diagnostic'] if !opts[:'diagnostic'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'switching_profile_id'] = opts[:'switching_profile_id'] if !opts[:'switching_profile_id'].nil?\n query_params[:'transport_type'] = opts[:'transport_type'] if !opts[:'transport_type'].nil?\n query_params[:'transport_zone_id'] = opts[:'transport_zone_id'] if !opts[:'transport_zone_id'].nil?\n query_params[:'uplink_teaming_policy_name'] = opts[:'uplink_teaming_policy_name'] if !opts[:'uplink_teaming_policy_name'].nil?\n query_params[:'vlan'] = opts[:'vlan'] if !opts[:'vlan'].nil?\n query_params[:'vni'] = opts[:'vni'] if !opts[:'vni'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalSwitchStatusSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi#get_logical_switch_status_summary\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "070da8c6c39f873ab00bc1fc64a9d04f", "score": "0.50243825", "text": "def get_all_transport_nodes_status(opts = {})\n data, _status_code, _headers = get_all_transport_nodes_status_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "fafbefcab7413b9befc7b209225db969", "score": "0.50189376", "text": "def list_firewall_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_firewall_status ...\"\n end\n # resource path\n local_var_path = \"/firewall/status\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'FirewallStatusListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_firewall_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fafbefcab7413b9befc7b209225db969", "score": "0.50189376", "text": "def list_firewall_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.list_firewall_status ...\"\n end\n # resource path\n local_var_path = \"/firewall/status\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'FirewallStatusListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#list_firewall_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bc1bc07ca604ab357d0a341a7c7ce87a", "score": "0.5016051", "text": "def get_openflow_nodes_operational_list\n get_uri = \"/restconf/operational/opendaylight-inventory:nodes\"\n response = @rest_agent.get_request(get_uri)\n check_response_for_success(response) do |body|\n if body.has_key?('nodes') && body['nodes'].has_key?('node')\n filtered_list = []\n body['nodes']['node'].each do |node|\n filtered_list << node['id'] if node['id'].start_with?('openflow')\n end\n NetconfResponse.new(NetconfResponseStatus::OK, filtered_list)\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "title": "" }, { "docid": "6606966adff5c8a5328fbe35ea4cf7c6", "score": "0.50127673", "text": "def get_all_remote_ports()\n @db.execute(\"SELECT DISTINCT(remote) FROM ports\").flatten\n end", "title": "" }, { "docid": "8ee2473a8841c766dc4042a6137ca8c4", "score": "0.500503", "text": "def list_logical_ports_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi.list_logical_ports ...'\n end\n if @api_client.config.client_side_validation && opts[:'attachment_type'] && !['VIF', 'LOGICALROUTER', 'BRIDGEENDPOINT', 'DHCP_SERVICE', 'METADATA_PROXY', 'L2VPN_SESSION', 'NONE'].include?(opts[:'attachment_type'])\n fail ArgumentError, 'invalid value for \"attachment_type\", must be one of VIF, LOGICALROUTER, BRIDGEENDPOINT, DHCP_SERVICE, METADATA_PROXY, L2VPN_SESSION, NONE'\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 ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi.list_logical_ports, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi.list_logical_ports, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/logical-ports'\n\n # query parameters\n query_params = {}\n query_params[:'attachment_id'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?\n query_params[:'attachment_type'] = opts[:'attachment_type'] if !opts[:'attachment_type'].nil?\n query_params[:'bridge_cluster_id'] = opts[:'bridge_cluster_id'] if !opts[:'bridge_cluster_id'].nil?\n query_params[:'container_ports_only'] = opts[:'container_ports_only'] if !opts[:'container_ports_only'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'diagnostic'] = opts[:'diagnostic'] if !opts[:'diagnostic'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'logical_switch_id'] = opts[:'logical_switch_id'] if !opts[:'logical_switch_id'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'parent_vif_id'] = opts[:'parent_vif_id'] if !opts[:'parent_vif_id'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'switching_profile_id'] = opts[:'switching_profile_id'] if !opts[:'switching_profile_id'].nil?\n query_params[:'transport_node_id'] = opts[:'transport_node_id'] if !opts[:'transport_node_id'].nil?\n query_params[:'transport_zone_id'] = opts[:'transport_zone_id'] if !opts[:'transport_zone_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPortListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi#list_logical_ports\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2405d662e4c527188511b87e125fa65d", "score": "0.49941063", "text": "def get_logical_switch_status_summary_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_switch_status_summary ...\"\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 LogicalSwitchingApi.get_logical_switch_status_summary, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling LogicalSwitchingApi.get_logical_switch_status_summary, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n if @api_client.config.client_side_validation && opts[:'transport_type'] && !['OVERLAY', 'VLAN'].include?(opts[:'transport_type'])\n fail ArgumentError, 'invalid value for \"transport_type\", must be one of OVERLAY, VLAN'\n end\n if @api_client.config.client_side_validation && !opts[:'vlan'].nil? && opts[:'vlan'] > 4094\n fail ArgumentError, 'invalid value for \"opts[:\"vlan\"]\" when calling LogicalSwitchingApi.get_logical_switch_status_summary, must be smaller than or equal to 4094.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'vlan'].nil? && opts[:'vlan'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"vlan\"]\" when calling LogicalSwitchingApi.get_logical_switch_status_summary, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/logical-switches/status\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'diagnostic'] = opts[:'diagnostic'] if !opts[:'diagnostic'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'switching_profile_id'] = opts[:'switching_profile_id'] if !opts[:'switching_profile_id'].nil?\n query_params[:'transport_type'] = opts[:'transport_type'] if !opts[:'transport_type'].nil?\n query_params[:'transport_zone_id'] = opts[:'transport_zone_id'] if !opts[:'transport_zone_id'].nil?\n query_params[:'uplink_teaming_policy_name'] = opts[:'uplink_teaming_policy_name'] if !opts[:'uplink_teaming_policy_name'].nil?\n query_params[:'vlan'] = opts[:'vlan'] if !opts[:'vlan'].nil?\n query_params[:'vni'] = opts[:'vni'] if !opts[:'vni'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalSwitchStatusSummary')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_switch_status_summary\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f9985960775c57cc3a26cc75e9314192", "score": "0.49884886", "text": "def index\n @ports = Port.all\n end", "title": "" }, { "docid": "3c2f9ea4fc90c8236885d13759e84954", "score": "0.4984293", "text": "def Status( port = 0 )\r\n unless port.zero?\r\n log \"Fetching status of server on port #{port}...\"\r\n status = @servers[port].status\r\n log \"Server status is #{status}.\"\r\n return status\r\n else\r\n str = [ ]\r\n for port, server in @servers\r\n log \"Fetching status of server on port #{port}...\"\r\n str << server.status\r\n log \"Server status is #{str[-1]}.\"\r\n end\r\n return str\r\n end\r\n rescue\r\n log '[ERROR!] ' + $!.message\r\n return 'INTERNAL ERROR: ' + $!.message\r\n end", "title": "" }, { "docid": "f6e5868181d2f8f9e153d7c82eaae504", "score": "0.49790537", "text": "def status\n puts\n puts \"current connections:\"\n puts \"-------------------\"\n @connections.each_value do |conn|\n puts \"#{conn.remote_host}:#{conn.remote_ports[0]}/#{conn.remote_ports[1]}\"\n end\n puts\n end", "title": "" }, { "docid": "73608c0b013135b2bf3ad8f6c36a3099", "score": "0.49577624", "text": "def index\n @port_calls = PortCall.all\n @current_port_calls = PortCall.where(terminal_id: current_user.terminal_id).where('first_line <= ?', DateTime.now).where('last_line > ?', DateTime.now)\n @upcoming_port_calls = PortCall.where(terminal_id: current_user.terminal_id).where('eta > ?', DateTime.now)\n @previous_port_calls = PortCall.where(terminal_id: current_user.terminal_id).where('last_line <= ?', DateTime.now)\n end", "title": "" }, { "docid": "af42eee9c050e8604cdfac4598e59532", "score": "0.49527293", "text": "def getOpenPorts\n puts \"Running command: \"+@ports_cmd if @debug\n out=`#{@ports_cmd}`.split(\"\\n\")\n ports=Array.new\n out.each do |line|\n line.chomp!\n next if line =~ /^COMMAND|->|127.0.0.1:|192.168.122.1:|\\[.+\\]:/\n puts line if @debug\n entry=Hash.new\n column=line.split(/\\s+/)\n entry[:proc]=column[0]\n if column[column.length-1] =~ /LISTEN/\n entry[:port]=column[column.length-2].split(/:/)[1]\n entry[:proto]=column[column.length-3]\n else\n entry[:port]=column[column.length-1].split(/:/)[1]\n entry[:proto]=column[column.length-2]\n end\n ports.push(entry)\n end\n puts \"Open ports: \" if @debug\n puts YAML.dump(ports) if @debug\n @openPorts=ports\n end", "title": "" }, { "docid": "bca5dee2c479832f483b5fb4ca7473c3", "score": "0.49436414", "text": "def get_all_transport_nodes_status(opts = {})\n data, _status_code, _headers = get_all_transport_nodes_status_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "3e3783eb1f6e053dc349d2934ebcfd2e", "score": "0.49321303", "text": "def get_logical_router_port_statistics_summary(logical_router_port_id, opts = {})\n data, _status_code, _headers = get_logical_router_port_statistics_summary_with_http_info(logical_router_port_id, opts)\n return data\n end", "title": "" }, { "docid": "faea61e543759470b8ccc4f67fdd4f15", "score": "0.4919016", "text": "def get_status\n perform(:get, 'bluebutton/external/optinout/status', nil, token_headers).body\n end", "title": "" }, { "docid": "f4ed8bce84eaec4aa4e874544c9ff673", "score": "0.49104312", "text": "def get_all_modules_operational_state\n get_uri = \"/restconf/operational/opendaylight-inventory:nodes/node/\"\\\n \"controller-config/yang-ext:mount/config:modules\"\n response = @rest_agent.get_request(get_uri)\n response.body.gsub!(\"\\\\\\n\", \"\")\n check_response_for_success(response) do |body|\n if body.has_key?('modules') && body['modules'].has_key?('module')\n NetconfResponse.new(NetconfResponseStatus::OK, body['modules']['module'])\n else\n NetconfResponse.new(NetconfResponseStatus::DATA_NOT_FOUND)\n end\n end\n end", "title": "" }, { "docid": "c82b9948fe007bfe379e33585d686948", "score": "0.49067715", "text": "def status_of_all\n status_for_array(all_statuses, dag: false)\n end", "title": "" }, { "docid": "ca2d9ada56ac89cea6fed022b8cd7186", "score": "0.49037158", "text": "def get_hardware_stats\n \n #see if function exists\n return '' unless Jetpants.topology.respond_to? :machine_status_counts\n\n data = Jetpants.topology.machine_status_counts\n\n output = ''\n output += \"\\n________________________________________________________________________________________________________\\n\"\n output += \"Hardware status\\n\\n\"\n\n headers = ['status'].concat(data.first[1].keys).concat(['total'])\n output += (headers.map { |i| \"%20s\"}.join(\" \")+\"\\n\") % headers\n output += (headers.map { |i| \"%20s\"}.join(\" \")+\"\\n\") % headers.map { |i| '------------------'}\n\n data.each do |key, status|\n unless key == 'unallocated'\n total = 0\n status.each do |nodeclass, value|\n total += value.to_i\n end\n output += (headers.map { |i| \"%20s\"}.join(\" \")+\"\\n\") % [key].concat(status.values).concat([total])\n end\n end\n\n output += \"\\nTotal Unallocated nodes - \" + data['unallocated'] + \"\\n\\n\"\n\n output\n end", "title": "" }, { "docid": "efa902e140cb8ce3f1119d7e131e771c", "score": "0.4889708", "text": "def stats\n if params[:id].nil?\n flash[:error] = \"No node specified.\"\n else\n @port = Port.find params[:id]\n macs = String.new\n @portStatus = Hash.new\n n = @port.node\n ifIndex = @port.ifIndex\n vlan = @port.snmpget('vmVlan')\n if vlan != SNMP::NoSuchInstance\n vList = [vlan.to_s]\n @port[:vlan] = vlan.to_s\n else\n vList = n.vlans.keys\n @port[:vlan] = 0\n end\n @port.save\n @portStatus[:admStatus] = @port.snmpget('IF-MIB::ifAdminStatus').to_i\n @portStatus[:oprStatus] = @port.snmpget('IF-MIB::ifOperStatus').to_i\n \n if @portStatus[:oprStatus] == 1\n pagpGroupIfIndex = n.snmpwalk('pagpGroupIfIndex')\n ifTypeList = n.snmpwalk('RFC1213-MIB::ifType')\n vList.each do |v|\n vpw = \"#{n.commStr}@#{v}\"\n basePortIndexList = n.snmpwalk('dot1dBasePortIfIndex',vpw)\n resp = n.snmpwalk('dot1dTpFdbPort',vpw)\n unless resp.nil?\n resp.each do |key,val|\n index = basePortIndexList[\"BRIDGE-MIB::dot1dBasePortIfIndex.#{val}\"].to_i\n if ifTypeList[\"RFC1213-MIB::ifType.#{index}\"].to_i == 53\n pagpGroupIfIndex.each do |key2,val2|\n if val2.to_i == index\n /\\.(\\d+)$/.match(key2)\n index = $1.to_i\n end\n end\n end\n if index == ifIndex\n /(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/.match(key)\n macAddr = sprintf('%02x:%02x:%02x:%02x:%02x:%02x',$1,$2,$3,$4,$5,$6)\n macs += v + ' - ' + macAddr + '<br>'\n end\n end\n end\n end\n end\n @portStatus[:inOctets] = @port.snmpget('IF-MIB::ifInOctets').to_i\n @portStatus[:outOctets] = @port.snmpget('IF-MIB::ifOutOctets').to_i\n @portStatus[:inErrors] = @port.snmpget('IF-MIB::ifInErrors').to_i\n @portStatus[:outErrors] = @port.snmpget('IF-MIB::ifOutErrors').to_i\n @portStatus[:macAddrList] = macs\n @title = \"#{n.sysName} #{@port.ifName} Status\"\n @events = @port.events\n end\n end", "title": "" }, { "docid": "820679c4848b638729d0205b15347d37", "score": "0.48810586", "text": "def get_logical_router_port_statistics(logical_router_port_id, opts = {})\n data, _status_code, _headers = get_logical_router_port_statistics_with_http_info(logical_router_port_id, opts)\n return data\n end", "title": "" }, { "docid": "61d0c204f6a7ca900e1b96a880cbb88c", "score": "0.48782793", "text": "def get_logical_port_state(lport_id, opts = {})\n data, _status_code, _headers = get_logical_port_state_with_http_info(lport_id, opts)\n return data\n end", "title": "" }, { "docid": "c1aa5f47a6aa976fc6320e6813cf8d81", "score": "0.48713788", "text": "def get_all_transport_nodes_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TroubleshootingAndMonitoringApi.get_all_transport_nodes_status ...\"\n end\n # resource path\n local_var_path = \"/transport-nodes/status\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'HeatMapTransportZoneStatus')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TroubleshootingAndMonitoringApi#get_all_transport_nodes_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "86857af3fc6b3056170d8ffd42b56515", "score": "0.48699042", "text": "def firewall_status() \n\tfw_status_cmd = \"netsh firewall show config\"\n\tprint_status(\"Getting firewall status\")\n\tprint_status(\"\\trunning command #{fw_status_cmd}\"\n\texec_cmd(fw_status_cmd)\nend", "title": "" }, { "docid": "aa0e76983c74ac8f7ec710e484fcc733", "score": "0.48451966", "text": "def get_all_free_local_ports()\n (@minport..@maxport).to_a - get_all_local_ports\n end", "title": "" }, { "docid": "293ce14c7a7bf644fd52e3fc327ee929", "score": "0.48432553", "text": "def calculate_unix_domain_socket_status\n # label in /proc/net/unix\n # Num: RefCount Protocol Flags Type St Inode Path\n paths = /^\\w+: \\d+ 00000000 \\d+ \\d+ (\\d+) \\d+ #{@unix_domain_socket_path}$/n\n\n queued = 0\n active = 0\n # no point in pread since we can't stat for size on this file\n ::File.read(*[@proc_net_unix_path].push({encoding: 'binary'})).scan(paths) do |s|\n case s[0].to_i\n when 2 then queued += 1 # SS_CONNECTING\n when 3 then active += 1 # SS_CONNECTED\n end\n end\n {active: active, queued: queued, total: active + queued}.to_json\n end", "title": "" }, { "docid": "f2e7037c2362a0748b26b1566554946f", "score": "0.484236", "text": "def test_port_scanner_results\n rest_response = RestClient.get \"#{RESTAPI_MODULES}/#{@@hb_session}/#{@@mod_port_scanner}/#{@@cmd_id}?token=#{@@token}\"\n check_rest_response(rest_response)\n result = JSON.parse(rest_response.body)\n raise \"Port Scanner module failed to identify any open ports\" unless result.to_s =~ /Port 3000 is OPEN/\n end", "title": "" }, { "docid": "b6402a532e693ecdae7609baf3a0c8c5", "score": "0.4839502", "text": "def get_ports\n begin\n @port.get_ports\n rescue => ex\n Util.log_exception(ex, caller_locations(1, 1)[0].label)\n raise ex\n end\n end", "title": "" }, { "docid": "5b77b6510c60714241face96d1a2adf7", "score": "0.4836523", "text": "def list_security_monitoring_rules_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_rules ...'\n end\n # resource path\n local_var_path = '/api/v2/security_monitoring/rules'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'SecurityMonitoringListRulesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :list_security_monitoring_rules,\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 :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SecurityMonitoringAPI#list_security_monitoring_rules\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "6621e2f95bf5fcc74ac64aa8f73fc3b4", "score": "0.482666", "text": "def index\n @ports = Port.all\n total= @ports.empty? ? 0: @ports.length\n\n render :json => {:successful=>true, :total=>@ports.length, :data=> @ports }\n end", "title": "" }, { "docid": "5bc5c26fb7e26185287b5dacea07d4ef", "score": "0.48219973", "text": "def list_status_of_lpars(frame = nil)\n if frame.nil?\n #return lpars on all frames?\n else\n execute_cmd \"lssyscfg -m #{frame} -r lpar -F name:state\"\n end\n end", "title": "" }, { "docid": "826a4678aa664796616704a8e6b937a3", "score": "0.4816582", "text": "def to_s(port_names = [nil,nil,nil,nil ])\n @status.inject_with_index(\"\") { |s,x,i| s + \"Port #{i+1}=#{x==0 ? 'On' : 'Off'} #{if port_names[i] then port_names[i] end}\\n\" } \n end", "title": "" }, { "docid": "e827ccbea0750adb65faa850b7e5234c", "score": "0.48139098", "text": "def get_logical_port_with_http_info(lport_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.get_logical_port ...\"\n end\n # verify the required parameter 'lport_id' is set\n if @api_client.config.client_side_validation && lport_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lport_id' when calling LogicalSwitchingApi.get_logical_port\"\n end\n # resource path\n local_var_path = \"/logical-ports/{lport-id}\".sub('{' + 'lport-id' + '}', lport_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#get_logical_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "60d3b1ae6c108946a2aa24afc9e8d67a", "score": "0.48074424", "text": "def connected_ports\n @binder.connected_ports\n end", "title": "" }, { "docid": "03222dbda6636d4683dce712b531b598", "score": "0.48032862", "text": "def input_ports\n ports.by_type[\"RFlow::Component::InputPort\"]\n end", "title": "" }, { "docid": "16de7f766edc2c04a27b9b9434155442", "score": "0.47991294", "text": "def get_logical_port_with_http_info(lport_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi.get_logical_port ...'\n end\n # verify the required parameter 'lport_id' is set\n if @api_client.config.client_side_validation && lport_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lport_id' when calling ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi.get_logical_port\"\n end\n # resource path\n local_var_path = '/logical-ports/{lport-id}'.sub('{' + 'lport-id' + '}', lport_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalSwitchingLogicalSwitchPortsApi#get_logical_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "84a9313b2c4dd1418ede3af1d3393a1a", "score": "0.47974285", "text": "def output_ports\n if finished? && @output_ports.nil?\n @output_ports = _get_output_port_info\n end\n\n @output_ports\n end", "title": "" }, { "docid": "c0e3b769b71968d1f50e53486da2d72c", "score": "0.4791415", "text": "def status(start, end_time, sources='twitter')\n params = {:start => start, :end => end_time, :sources => sources}\n requires params\n DataSift.request(:GET, 'historics/status', @config, params)\n end", "title": "" }, { "docid": "fb4f4d91c0701c48886cc4f06f96626e", "score": "0.47908932", "text": "def scanfull()\n\n\tisntnull()\n\n\tmessagestart\n\t\n\tping($target)\n\n\tack($target)\n\n\tif $st != 1\n\n\t\tprintf \"Trying host %s (%s) TCP ports (%i .. %i)\\n\", $target, $ip, $portinit.to_i, $portfin.to_i\n\n\t\tputs \"**** Summary of open ports ****\"\n\t\tprintf \"Port\\t State\\tservice\\n\"\n\n\t\tportskim($target)\n\tend\n\n\tmessageend\nend", "title": "" }, { "docid": "b90a3afff3330f8d391f27a2b13ea400", "score": "0.47893777", "text": "def read_snmp_service_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi.read_snmp_service_status ...'\n end\n # resource path\n local_var_path = '/node/services/snmp/status'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi#read_snmp_service_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "39329c87c94658cd9e59c20d334e79fc", "score": "0.47755668", "text": "def list_of_services\n\t\tfile = File.read('config/ms_ports.json')\n\t\tdata_hash = JSON.parse(file)\n\t return data_hash\n end", "title": "" }, { "docid": "1c4062f5f5c5efb2619b6d99d226da74", "score": "0.4770261", "text": "def getstatus()\n\t\turi = URI.parse(@url)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\trequest = Net::HTTP::Get.new(uri.request_uri)\n\t\trequest.basic_auth(\"tomcat\", \"tomcat\")\n\t\tresponse = http.request(request)\n\n\t\tresponsecode = response.code\n\n\t\tif responsecode.eql? \"200\"\n\t\t\tdoc = REXML::Document.new(response.body)\n\t\t\tde = \",\"\n\t\t\tstatusline = \"\"\n\t\n\t\t\tdoc.root.elements.each(\"/status/jvm/memory\") { |e| \n\t\t\t\tstatusline << \"\\n\" + e.attributes[\"free\"] + de + e.attributes[\"total\"] + de + e.attributes[\"max\"] + de\n\t\t\t}\n\t\n\t\t\tdoc.root.elements.each(\"/status/connector\") { |e|\n\t\t\t\tname = e.attributes[\"name\"]\n\t\t\t\tif name.eql? 'http-8080'\n\t\t\t\t\n\t\t\t\t\tt = e.elements[\"threadInfo\"]\n\t\t\t\t\tstatusline << t.attributes[\"maxThreads\"] + de + t.attributes[\"currentThreadCount\"] + de + t.attributes[\"currentThreadsBusy\"] + de\n\t\t\t\t\t\n\t\t\t\t\tr = e.elements[\"requestInfo\"]\t\t\n\t\t\t\t\tstatusline << r.attributes[\"maxTime\"] + de + r.attributes[\"processingTime\"] + de + r.attributes[\"requestCount\"] + de + \n\t\t\t\t\t\t\t\t\tr.attributes[\"errorCount\"] + de + r.attributes[\"bytesReceived\"] + de + r.attributes[\"bytesSent\"]\n\t\t\t\tend \n\t\t\t}\n\t\n\t\t\treturn statusline\n\t\n\t\telse\n\t\t puts \"Could not communicate with Tomcat server to get response\"\n\t\tend\n\tend", "title": "" }, { "docid": "152f725683d2d773577d6694a0e17c28", "score": "0.4768199", "text": "def option_values_target_ports\n\t\tres = [ ]\n\t\treturn res if not framework.db.active\n\t\treturn res if not self.active_module.datastore['RHOST']\n\t\thost = framework.db.has_host?(self.active_module.datastore['RHOST'])\n\t\treturn res if not host\n\n\t\tframework.db.each_service do |service|\n\t\t\tif (service.host_id == host.id)\n\t\t\t\tres << service.port.to_s\n\t\t\tend\n\t\tend\n\n\t\treturn res\n\tend", "title": "" }, { "docid": "2f79eaa54ffa252494c0891b33062c46", "score": "0.47631982", "text": "def read_syslog_service_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi.read_syslog_service_status ...'\n end\n # resource path\n local_var_path = '/node/services/syslog/status'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi#read_syslog_service_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "62567fbaf83bca680bb426eee652d074", "score": "0.4763195", "text": "def service_ports\n return @service_ports\n end", "title": "" }, { "docid": "985d286cd3b3faa16a9eb9259fb35dac", "score": "0.4760743", "text": "def status\n return true unless managed?\n\n out = exec_solr('status').read\n out =~ /running on port #{port}/\n end", "title": "" }, { "docid": "ab51ee75d9e320aee14124749e436d09", "score": "0.47579092", "text": "def list_logical_switches_by_state_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi.list_logical_switches_by_state ...'\n end\n if @api_client.config.client_side_validation && opts[:'status'] && !['PENDING', 'IN_PROGRESS', 'PARTIAL_SUCCESS', 'SUCCESS'].include?(opts[:'status'])\n fail ArgumentError, 'invalid value for \"status\", must be one of PENDING, IN_PROGRESS, PARTIAL_SUCCESS, SUCCESS'\n end\n # resource path\n local_var_path = '/logical-switches/state'\n\n # query parameters\n query_params = {}\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalSwitchStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLogicalSwitchingLogicalSwitchesApi#list_logical_switches_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ecaa20411ed04d6f0db7d7fcb9ccf56d", "score": "0.4755422", "text": "def index\n @port_types = PortType.all\n end", "title": "" }, { "docid": "b9db7c5373af4bc8ae71984858b9bdbb", "score": "0.47504154", "text": "def statuses\n statuses = results.collect {|r| r.status}\n end", "title": "" }, { "docid": "9ebbc157250df542ba8011daf4b7784a", "score": "0.4748855", "text": "def filter\n @ports.map do |port|\n <<-FILTER.split(/\\s{2,}/).join(' ').strip\n ((tcp dst port #{port}) or\n (tcp src port #{port} and (tcp[tcpflags] & tcp-fin != 0)))\n FILTER\n end.join ' or '\n end", "title": "" }, { "docid": "4ae609ab19a23fb73634093c09b914c8", "score": "0.47434545", "text": "def node_ports\n fetch_service\n port_info.map(&:nodePort)\n end", "title": "" }, { "docid": "7fe85833a3a22a946d16c0d913cf26b0", "score": "0.47327396", "text": "def device_status_overview\n return @device_status_overview\n end", "title": "" }, { "docid": "7fe85833a3a22a946d16c0d913cf26b0", "score": "0.47327396", "text": "def device_status_overview\n return @device_status_overview\n end", "title": "" }, { "docid": "65cc5631a24d659ddf36add579b4c991", "score": "0.47297776", "text": "def list_logical_switches_by_state_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalSwitchingApi.list_logical_switches_by_state ...\"\n end\n if @api_client.config.client_side_validation && opts[:'status'] && !['PENDING', 'IN_PROGRESS', 'PARTIAL_SUCCESS', 'SUCCESS'].include?(opts[:'status'])\n fail ArgumentError, 'invalid value for \"status\", must be one of PENDING, IN_PROGRESS, PARTIAL_SUCCESS, SUCCESS'\n end\n # resource path\n local_var_path = \"/logical-switches/state\"\n\n # query parameters\n query_params = {}\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'LogicalSwitchStateListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LogicalSwitchingApi#list_logical_switches_by_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "25d2e9b4d871a200c439138a1db197f3", "score": "0.47217286", "text": "def device_status_summary\n return @device_status_summary\n end", "title": "" }, { "docid": "ef6a98ccf92090e67ffbcc969c68541a", "score": "0.47204593", "text": "def count\n @ports.count\n end", "title": "" }, { "docid": "5cc3b8b11863d55c971040a0cef42a31", "score": "0.4714828", "text": "def index\n @search = StatusnokiaPort.ransack(params[:q])\n @statusnokia_ports = @search.result.paginate(:page => params[:page], :per_page => 100)\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.empty?\n\n # Exportar en xls\n @statusnokia_ports_all = StatusnokiaPort.all\n end", "title": "" }, { "docid": "029f88b7b4c16e033b87d9cde30ef5b0", "score": "0.4713259", "text": "def list_firewall_status(opts = {})\n data, _status_code, _headers = list_firewall_status_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "029f88b7b4c16e033b87d9cde30ef5b0", "score": "0.4713259", "text": "def list_firewall_status(opts = {})\n data, _status_code, _headers = list_firewall_status_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "392b50449be0e8c84990cc2c56db73e1", "score": "0.47028553", "text": "def index\n @ip_statuses = IpStatus.all\n end", "title": "" }, { "docid": "5dcf03b25e45231b1bc96a0684dbaa2d", "score": "0.46954912", "text": "def read_proxy_service_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi.read_proxy_service_status ...'\n end\n # resource path\n local_var_path = '/node/services/http/status'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiNsxComponentAdministrationApplianceManagementApi#read_proxy_service_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c388c3743d29f34ea64247c14d24ba58", "score": "0.46953076", "text": "def list_transport_node_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TroubleshootingAndMonitoringApi.list_transport_node_status ...\"\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 TroubleshootingAndMonitoringApi.list_transport_node_status, 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'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling TroubleshootingAndMonitoringApi.list_transport_node_status, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'cached'].include?(opts[:'source'])\n fail ArgumentError, 'invalid value for \"source\", must be one of realtime, cached'\n end\n if @api_client.config.client_side_validation && opts[:'status'] && !['UP', 'DOWN', 'DEGRADED', 'UNKNOWN'].include?(opts[:'status'])\n fail ArgumentError, 'invalid value for \"status\", must be one of UP, DOWN, DEGRADED, UNKNOWN'\n end\n # resource path\n local_var_path = \"/transport-zones/transport-node-status\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'TransportNodeStatusListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TroubleshootingAndMonitoringApi#list_transport_node_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ad01a4428777c1368c9742301343d271", "score": "0.46813148", "text": "def index \n \n @server = current_user.account.servers.find(params[:server_id])\n \n @ports = @server.ports.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ports }\n end\n end", "title": "" }, { "docid": "e76598e1d8dc36c10135f18688900e15", "score": "0.46679145", "text": "def _get_tcp_port_list\n # UDP ports\n udp_ports = [53, 67, 137, 161, 123, 138, 139, 1434]\n\n # Ports missing by the autogen\n additional_ports = [465, 587, 995, 993, 5433, 50001, 50002, 1524, 6697, 8787, 41364, 48992, 49663, 59034]\n\n print_status('Generating list of ports used by Auxiliary Modules')\n ap = (framework.auxiliary.collect { |n, e| x=e.new; x.datastore['RPORT'].to_i }).compact\n print_status('Generating list of ports used by Exploit Modules')\n ep = (framework.exploits.collect { |n, e| x=e.new; x.datastore['RPORT'].to_i }).compact\n\n # Join both list removing the duplicates\n port_list = (((ap | ep) - [0, 1]) - udp_ports) + additional_ports\n return port_list\n end", "title": "" }, { "docid": "4c68e84133bda4f6d613b795e4ef741d", "score": "0.46670586", "text": "def statuses\n @statutes\n end", "title": "" } ]
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "0a08af00f6835bfd926a8d41fc9d8c41", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveChargeResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score": "0.7641797", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetNextResultsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.7593966", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.7593966", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8930e1716b013d16d7b7de258c2d40a6", "score": "0.7570661", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BasicResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562012", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.75597274", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "2af7c3fdbc792c97315016366b268df9", "score": "0.74925923", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9f335c551760f3d4173d3a6cb083a0e2", "score": "0.7487777", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectSetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.74491423", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.74491423", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.74491423", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.74491423", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bb4c4c00d82ad064a5082b7afe4c48d2", "score": "0.7447624", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "afe0e8ec443f796166358039fdecdb0d", "score": "0.74474907", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelper2ResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "648c8b0f1dc24c0412d5f7d4e3cea344", "score": "0.7438828", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MultiQueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6b4ba316137428ce500c97e409be2902", "score": "0.7424318", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunCommandResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "34f15f5a73f216a32c95e6c664949f2d", "score": "0.7389863", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetMetadataResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1239dac60dfed8a0d5b4d31e8106e390", "score": "0.7383775", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelper1ResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f28ec6dc9cedee6469f71c907f1704ef", "score": "0.7383127", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveSpecificRowsOrColumnsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9fdcd1a770560eb59a2dbe7abd869eaf", "score": "0.73820543", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9fdcd1a770560eb59a2dbe7abd869eaf", "score": "0.73820543", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9fdcd1a770560eb59a2dbe7abd869eaf", "score": "0.73820543", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9fdcd1a770560eb59a2dbe7abd869eaf", "score": "0.73820543", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "855c1fa00591ce07697f8e545054fce7", "score": "0.7377712", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MQLReadResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "a165902ed6748b64b4117b8c8b9abae7", "score": "0.73522276", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = IteratorHelperResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "01a45040460ae3c472e612d6ad45559d", "score": "0.73477095", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CivicResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "543e0f21a9a5617a696a566b984b2262", "score": "0.73357207", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectGetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "d9fc5548c5903ea3474c0673f4d3a9e6", "score": "0.7330397", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BatchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "b545d160e048eb964734c4364860c054", "score": "0.7312797", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = StructuredQueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "05bac4be2091b0eb847f688449846159", "score": "0.72956973", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SendResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "eb3f4ac33af2cc00b368b83f5b921210", "score": "0.72914517", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = PutResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "4c3a65d523d09d06b46fa6381bd6ae1f", "score": "0.72735226", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FQLResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "2e0d4dea0d6309b1ed6921de241cf809", "score": "0.72717243", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = Step1ResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.72599536", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.72599536", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.72599536", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.72599536", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.7255672", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be102b9c81183d9f8bd4d09a7fdce73a", "score": "0.72510105", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MakeCallResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ba8fbcad6ce69ca11b25814f5c7d80e7", "score": "0.72424424", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetValuesFromXMLResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "e374c864ae8365e83576224986afc8db", "score": "0.7237946", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunRightScriptResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c640cb069c5325833bd1f90f353677cf", "score": "0.7233013", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReplyResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "03e4ddb0fbc8ad7e8fed24e516422ee5", "score": "0.7232028", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = Step2ResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "da581a489c99b7ffa036d73d31deb567", "score": "0.7231047", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RequestResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "afe71b77fbb9b12089a4f05186d7a93f", "score": "0.72046906", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BillResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "02533070f2fee1b7c51ffcfb358467fc", "score": "0.7194001", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RunInstancesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "a527666f0126166571e60612e4c25b27", "score": "0.71933115", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9de8750a58a9526fbdee57ac41e90203", "score": "0.71887404", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "54f48540754909bc086af097cb2575d7", "score": "0.7184124", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = XLSToXMLResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "973dca0d927cf5e0927d87002d02cb4e", "score": "0.71660966", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CompleteEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "2d80834625bd1cf93415aa6aee3849b8", "score": "0.7155356", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadProductResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "62cbf9188960f4e3579331a0940c0958", "score": "0.71538115", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRequestResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "36a3ae9b6c96bb8c08a7ad4cd30ed18c", "score": "0.7152561", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ExecuteViewsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5dcada835dd4f5661948bcc1afb69b1f", "score": "0.7147464", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadActionsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "546f796abecb4a53efd4abd86391d9fe", "score": "0.7142717", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ColumnsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "04486efd3eefc68f700419fbb9ac3d1c", "score": "0.713733", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5a968378a28e150e178cf6c07cbaefd3", "score": "0.71348464", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadRunsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9b3005154a1b6ab53713f1ddc148f13d", "score": "0.7123863", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetEntityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f3548ebc7ee3a9e55a11c1017d9ae306", "score": "0.7122013", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetStatusResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "d40537899945eadb9ffb703dec94db88", "score": "0.7107206", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateRunResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "070004d2425f03200a0bfaf85b97fbc0", "score": "0.7105372", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "3c4057ad4872f4dc31fb615931da74eb", "score": "0.7105145", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateRequestResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "409fcd9d77023f2d8987b5f8e05def02", "score": "0.71037024", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = PromptResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0c4b8dcec2478b63814035cead2c697f", "score": "0.71025413", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = XMLResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "550802d802281c5bead9f1836a8dd4f3", "score": "0.70984364", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ObjectUpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "33fe7f64c30effa42e552f81862db2fb", "score": "0.70921504", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateWantsToReadResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ce00867599ac0237408f7c0f396a40ed", "score": "0.70896024", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetInstanceResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f97a7bd13d335a38327ac328f1ea794e", "score": "0.708848", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BatchHelperVersion9ResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "3d51df9e4ec249f86008ab8460df25f1", "score": "0.7088256", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateWantsToReadResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "89345f402106c25cde12e1484b175b2f", "score": "0.70863056", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ByIDResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c5ff4261c62823872d930ef8c5d2a4b1", "score": "0.70850044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveObjectResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f414f475e00c01cab69153edccf57d9b", "score": "0.7079918", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SeriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5157f9b8dcc2756d8bc274f2ffca783a", "score": "0.7079187", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "dc572ee0e3ff2c0edde3d0f62a304488", "score": "0.7072195", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListedResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f971bba6c1135825990f5dca6f6e740a", "score": "0.70647645", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = EndItemResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f4f33869b9bf248ee3302246637d8e18", "score": "0.706404", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = InfluenceResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "77bf542a39db31850ec6ecd794d13113", "score": "0.7061568", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LeadershipPACsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0ee572471a295b58d45bfd8ea90c6c19", "score": "0.7052522", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0ee572471a295b58d45bfd8ea90c6c19", "score": "0.7052522", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0ee572471a295b58d45bfd8ea90c6c19", "score": "0.7052522", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0ee572471a295b58d45bfd8ea90c6c19", "score": "0.7052522", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0ee572471a295b58d45bfd8ea90c6c19", "score": "0.7052522", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListAllResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f12b25229dc0d7f5aeb720aec7dd0fad", "score": "0.70521766", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShareResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f12b25229dc0d7f5aeb720aec7dd0fad", "score": "0.70521766", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShareResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "e3506f6b0376127238b649b3d7106521", "score": "0.7051334", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetBatchEntitiesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "cbaab2aa9aa5f4134435a7e41c36275e", "score": "0.7048862", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = HereNowResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "e58c7422dbc490d17e70263cdd8227e4", "score": "0.70482516", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrievePlanResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bede436b8562b6553f3d58aed04867c3", "score": "0.7046229", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BooksResultSet.new(resp)\n return results\n end", "title": "" } ]
9d309f2b9d6fd3e7f997ea062e14aebd
This is not needed. It was implemented as a validator to see that images are read correctly
[ { "docid": "e1b82bd4eca694ba4d4885faa830e846", "score": "0.0", "text": "def convert_to_images(arr,rows,cols)\n canvas = ChunkyPNG::Canvas.new(28, 28, ChunkyPNG::Color::TRANSPARENT)\n canvas.grayscale!\n \n for i in 0..arr.length-1 do\n for j in 0..rows-1 do\n for k in 0..cols-1 do\n canvas[j,k] = arr[i][((cols+1)*j)+k]\n end\n end\n canvas.save(\"F:\\\\Projects\\\\YetAnotherAnn\\\\filename#{i}.png\", :interlace => true)\n end\nend", "title": "" } ]
[ { "docid": "df508c211f1f978a618d0605c3cdc398", "score": "0.7470752", "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": "9bb5331e5bd9cb7a392872c19f912a77", "score": "0.7146493", "text": "def verify_image(path)\n end", "title": "" }, { "docid": "17fa155abbcfaeb70f114d67caa10c6d", "score": "0.71261775", "text": "def picture_validation\n if picture.attached?\n if picture.blob.byte_size > 2000000\n picture.purge\n errors[:base] << 'Maksymalny rozmiar logo klanu to 2MB'\n elsif !picture.blob.content_type.starts_with?('image/')\n picture.purge\n errors[:base] << 'Zły format'\n end\n else\n errors[:base] << 'Logo klanu jest obowiązkowe.'\n end\n end", "title": "" }, { "docid": "2238891cc261e9e86a41b5a17b7a42a3", "score": "0.69796914", "text": "def valid?\n !(image_too_small? || image_too_big?)\n end", "title": "" }, { "docid": "fef626b69e1c2326dbaca820c7a9fe90", "score": "0.6966049", "text": "def validate_upload\n validate_image_length\n validate_image_type\n validate_image_md5sum\n validate_image_name\n end", "title": "" }, { "docid": "4146cd7363dd719fab91aadcd65d2ac2", "score": "0.69616103", "text": "def acceptable_image\n return unless image.attached?\n\n errors.add(:image, 'is too big') unless image.byte_size <= 1.megabyte\n\n acceptable_types = %w[image/jpeg image/png]\n return if acceptable_types.include?(image.content_type)\n\n errors.add(:image, 'must be a JPEG or PNG')\n end", "title": "" }, { "docid": "7fc85cbe960c944dc0d31a15e6cfb488", "score": "0.6851374", "text": "def validate_image(conn, image_name)\n unless conn.images.find {|x| x.name == image_name }\n @log.error \"Cannot find image with name: #{image_name}, available images: #{conn.images.map{|x| x.name}.join(', ')}\"\n abort\n end\n end", "title": "" }, { "docid": "bcb86f0f0e599ce820c085bc897b7d8e", "score": "0.6843269", "text": "def valid_image(image_path)\n image_path.exist? && image_path.size < 32.kilobytes\n end", "title": "" }, { "docid": "3f28bf3877b6c0bc8e4409c67bd6f6c6", "score": "0.66937166", "text": "def valid?\n image_resource? && supported_format?\n end", "title": "" }, { "docid": "fa8f8c10446a69cda2756429292295af", "score": "0.66856444", "text": "def validate\n if self.filename.nil?\n errors.add_to_base(\"You must choose an image to upload\")\n else\n [:size, :content_type].each do |attr_name|\n enum = attachment_options[attr_name]\n\n unless enum.nil? || enum.include?(send(attr_name))\n errors.add_to_base(\"Images should be smaller than #{MAX_SIZE_IN_MB} MB in size\") if attr_name == :size\n errors.add_to_base(\"Your image must be either a JPG, PNG or GIF\") if attr_name == :content_type\n end\n end\n end\n end", "title": "" }, { "docid": "7707af0693012258f51bcf980345b31b", "score": "0.6672681", "text": "def verify_file_type\n if file_name\n allowed_types = %w(jpeg jpg png gif)\n\n unless allowed_types.include? file_name.split('.')[1]\n errors.add(:file_name, 'File is not an image.')\n end\n end\n end", "title": "" }, { "docid": "6d65fa9818cddf695063fa0fcc1e900c", "score": "0.66707945", "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": "c8ffe3dd765c42b1c12a665f302f3884", "score": "0.6623438", "text": "def valid_image_url(url)\n !url.images.first.src.to_s.starts_with?('/')\nend", "title": "" }, { "docid": "52e4c5db0dd40e1d599c47910f5d8508", "score": "0.66207856", "text": "def valid_file?\n if @image.size.zero?\n errors.add_to_base(\"Please enter an image filename\")\n return false\n end\n unless @image.content_type =~ /^image/\n errors.add(:image, \"is not a recognized format\")\n return false\n end\n if @image.size > 1.megabyte\n errors.add(:image, \"can't be bigger than 1 megabyte\")\n return false\n end\n return true\n end", "title": "" }, { "docid": "94d3194ef0077359e31f03c390fb7a3a", "score": "0.6611791", "text": "def correct_image_type\n if image.attached? && !image.content_type.in?(%w(image/jpeg image/gif image/png))\n errors.add(:image, :blank, message: I18n.t(\"validates.image_format\"))\n end\n end", "title": "" }, { "docid": "d7b5c6357007d2bb1efef0b25807ca79", "score": "0.6602142", "text": "def validate_image_values\n %w[l m s o].each do |size|\n field = \"size_#{size}\"\n value = send(field)\n next if value.blank?\n\n a = value.strip.split(/x|\\+/)\n a[0, 2].each { |e| errors.add(field, I18n.t('drgcms.not_valid')) unless e.to_i > 0 }\n end\nend", "title": "" }, { "docid": "29f2010336f23f2e9de6f2f40aaae8d9", "score": "0.6596977", "text": "def valid_image_format?\n VALID_FILE_MIMETYPES.include? self.filetype\n end", "title": "" }, { "docid": "6fdc65c59d7dd0fbd6728a0c3fc7ec4e", "score": "0.65800977", "text": "def valid_image_data?\n\n #There should be image data.\n unless self.data?\n errors.add(:base, \"No image data.\")\n return false\n end\n\n #There should be large thumbnail data.\n unless self.large_thumb?\n errors.add(:base, \"No large thumbnail image data.\")\n return false\n end\n\n #There should be small thumbnail data.\n unless self.small_thumb?\n errors.add(:base, \"No small thumbnail image data.\")\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "0a9455ca4748d4a18f94c3549459b24a", "score": "0.6566928", "text": "def image?\n self.file_content_type == 'image/png' || self.file_content_type == 'image/jpeg'\n end", "title": "" }, { "docid": "f06ce7e144e9310908da4b71573de9bb", "score": "0.65632355", "text": "def validate!\n identify\n rescue MiniMagick::Error => error\n raise MiniMagick::Invalid, error.message\n end", "title": "" }, { "docid": "0e7647db828fe1ab40ff02739c47a666", "score": "0.65589076", "text": "def image?\n return ( VALID_HEADERS.include? @hdr_reader )\n end", "title": "" }, { "docid": "5252cf74f885f94331517d25a1f41fb7", "score": "0.6538597", "text": "def validates_image_upload_of(*attr_names)\n configuration = {\n :message => ' is disallowed image format',\n :content_type => [\n \"image/png\",\n \"image/x-png\",\n \"image/jpeg\",\n \"image/pjpeg\",\n \"image/gif\"\n ]\n }\n options = attr_names.pop if attr_names.last.is_a?(Hash)\n configuration.update options unless options.blank?\n attr_names.push configuration\n validates_file_upload_of(*attr_names)\n end", "title": "" }, { "docid": "3b213ad6500b0e9905f45e6f2b975c31", "score": "0.6506387", "text": "def validate(session, attributes)\n read_task('rvpe.image.validate', session) do\n image_attr_sanity_check(attributes)\n [true, '']\n end\n end", "title": "" }, { "docid": "8290e202a41420b008436b81f68b43df", "score": "0.6499486", "text": "def validate_and_build_special_images(fileParams,file)\n # if Asset2.is_valid_file?(file)\n @special_image = @special.special_images.build(fileParams)\n # end\n end", "title": "" }, { "docid": "efe4f556cf95e0a7017bdeff5046f367", "score": "0.6489462", "text": "def valid_other_image_parameters?\n # check version of gif\n return Image.gif89a?(@file_temp_path) if @file_type == GIF_TYPE\n # check \"color system\" of \"jpeg, jpg\" file\n return Image.rgb_color_system?(@file_temp_path) if @file_type == JPEG_TYPE\n # always return true with \"png\" file\n true if @file_type == PNG_TYPE\n end", "title": "" }, { "docid": "efe4f556cf95e0a7017bdeff5046f367", "score": "0.6489462", "text": "def valid_other_image_parameters?\n # check version of gif\n return Image.gif89a?(@file_temp_path) if @file_type == GIF_TYPE\n # check \"color system\" of \"jpeg, jpg\" file\n return Image.rgb_color_system?(@file_temp_path) if @file_type == JPEG_TYPE\n # always return true with \"png\" file\n true if @file_type == PNG_TYPE\n end", "title": "" }, { "docid": "3c79546efc04625a83086e1a345f8cce", "score": "0.6470854", "text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end", "title": "" }, { "docid": "3c79546efc04625a83086e1a345f8cce", "score": "0.6470854", "text": "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end", "title": "" }, { "docid": "17b49871510413f82373cbd947e3699c", "score": "0.6469813", "text": "def valid_other_image_parameters?\n # check version of gif\n return Image.gif89a?(@file_temp_path) if @file_type == GIF_TYPE\n # check \"color system\" of \"jpeg, jpg\" file\n return Image.rgb_color_system?(@file_temp_path) if @file_type == JPG_TYPE\n # always return true with \"png\" file\n true if @file_type == PNG_TYPE\n end", "title": "" }, { "docid": "007ff9c5e001a9f951106fce947751dc", "score": "0.6467646", "text": "def image_file?\n false\n end", "title": "" }, { "docid": "fab786e84dc0dd748ef1c37e3265b700", "score": "0.6444963", "text": "def test_load_invalid_png_files\n\n each_file_with_updated_info do\n |file_path|\n\n if @test_feature == \"x\"\n #Invalid png files should generally raise exception (except in the specific cases below).\n\n if @parameter == \"cs\" || @parameter == \"hd\"\n if @parameter == \"cs\"\n chunk_str = \"IDAT\"\n else\n chunk_str = \"IHDR\"\n end\n #Test images with bad crc warn\n actual_stderr = $stderr\n $stderr = StringIO.new\n assert_nothing_raised do\n Imgrb::Image.new(file_path)\n end\n $stderr.rewind\n assert_equal \"Critical chunk '#{chunk_str}' failed crc check. Image may not be decoded correctly.\", $stderr.string.chomp\n $stderr = actual_stderr\n else\n assert_raise do\n Imgrb::Image.new(file_path)\n end\n end\n\n #Reading only metadata should not raise an error if IDAT chunk is\n #missing. Maybe try harder to extract metadata from other invalid files\n #as well.\n if @parameter == \"dt\"\n assert_nothing_raised do\n Imgrb::Image.new(file_path, :only_metadata)\n end\n end\n\n end\n\n end\n\n end", "title": "" }, { "docid": "34d398a77ae3c9a81b1647232be2ab6f", "score": "0.6434074", "text": "def image?\n self.image.file?\n end", "title": "" }, { "docid": "34d398a77ae3c9a81b1647232be2ab6f", "score": "0.6434074", "text": "def image?\n self.image.file?\n end", "title": "" }, { "docid": "7f04aab31e099a6faf9ada9598831690", "score": "0.6433695", "text": "def validate_images_alt_present\n errors.add('body', I18n.t('drgcms.img_alt_not_present')) unless DcPage.images_alt_present?(self.body)\nend", "title": "" }, { "docid": "ea7121ca2136fb748116b03187c3ce2a", "score": "0.64320034", "text": "def image?\n (self.file_content_type =~ %r{^(image|(x-)?application)/(x-png|pjpeg|jpeg|jpg|png|gif)$})\n end", "title": "" }, { "docid": "5af69ace6435f9a4da595f8e0b8bd70f", "score": "0.6425182", "text": "def validate_job_seeker_photo\r\n if not self.photo_file_name .blank?\r\n if not self.photo_content_type.match(/image|png|jpg|jpeg|gif/)\r\n errors.add(\"Photo\",\"Only image file allowed\")\r\n end\r\n end\r\n end", "title": "" }, { "docid": "19f590ff4287aa2631fa482352dfa2f9", "score": "0.64187527", "text": "def validate_image_type\n if save_to_temp_file\n # Override whatever user gave us with result of \"file --mime\".\n self.upload_type =\n MimeMagic.by_magic(File.open(upload_temp_file)).try(&:type)\n if upload_type&.start_with?(\"image\")\n result = true\n else\n file = upload_original_name.to_s\n file = \"?\" if file.blank?\n errors.add(:image,\n :validate_image_wrong_type.t(type: upload_type, file: file))\n result = false\n end\n end\n self.content_type = upload_type\n result\n end", "title": "" }, { "docid": "3ba6771740bc4145e68943b5e261b046", "score": "0.6416557", "text": "def image?\n picture_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end", "title": "" }, { "docid": "3a84bb71ef93d0c649fa8440c8ae96ce", "score": "0.6395267", "text": "def avatar_must_be_in_correct_format\n return unless avatar.present?\n\n # FileMagic.mime { |fm| fm.file(avatar.path) }\n valid_format = [\"image/png\", \"image/jpg\", \"image/jpeg\"].include?(avatar.content_type) && [\"image/png\", \"image/jpg\", \"image/jpeg\"].include?(MimeMagic.by_magic(avatar)&.type)\n errors.add(:avatar, :content_type_invalid) unless valid_format\n\n valid_size = avatar.size <= 2.megabytes\n errors.add(:avatar, :file_size_out_of_range, filesize: avatar.size) unless valid_size\n end", "title": "" }, { "docid": "8fc0c5a0f269ae7d42da9910c262ff69", "score": "0.6380966", "text": "def sf_check_img_ext(images, allowed = [])\n allowed ||= []\n if images.is_a?(String)\n images = images.split\n elsif !images.is_a?(Array)\n images = []\n end\n images.select { |i| i =~ sf_regex(:image, allowed) }\n end", "title": "" }, { "docid": "dd47fef9da46ffddec32beed8490cd5e", "score": "0.6378548", "text": "def has_image?\n \t# self.image.file?\n true\n end", "title": "" }, { "docid": "4b338297d8523d5cb3c829cfddc9651d", "score": "0.63697416", "text": "def allow_only_images\n unless file.content_type =~ %r{^(image|(x-)?application)/(x-png|pjpeg|jpeg|jpg|gif|png|tif|raw|bmp|svg|)$}\n false\n end\n end", "title": "" }, { "docid": "f4edbbefdc7b1c7903dfabc997a6afbf", "score": "0.6361305", "text": "def not_image?(new_file)\n !self.file.content_type.include? 'image'\n end", "title": "" }, { "docid": "23d051b44553b105e2f68c52daf0cd7a", "score": "0.6361077", "text": "def has_image?\n false\n end", "title": "" }, { "docid": "26b16b0b08a63d89a5516055a7922427", "score": "0.6354769", "text": "def image?\n file_type.match(/\\Aimage\\//).present?\n end", "title": "" }, { "docid": "b99cd1b56edcb69cc793db9c1a1837fd", "score": "0.63368636", "text": "def image? new_file\n new_file.content_type.start_with? 'image'\n end", "title": "" }, { "docid": "c91f7320e074c0eac4d8fa355520206b", "score": "0.6324265", "text": "def validate_photo\n unless photo.errors.empty?\n # uncomment this to get rid of the less-than-useful interrim messages\n # errors.clear\n errors.add :attachment, \"Paperclip returned errors for file '#{photo_file_name}' - check ImageMagick installation or image source file.\"\n false\n end\n end", "title": "" }, { "docid": "4c92669bf575a299edb28fe6615fe88b", "score": "0.6317387", "text": "def validate_log_image_size\n return unless logo.image_size.present?\n w, h = logo.image_size\n if (h < 100 || w < 100) || (h.to_f / w.to_f != 1)\n errors.add :base, 'Logo size width and height need gt 100px, and image should be square.'\n end\n end", "title": "" }, { "docid": "75ab3aabe9dc5b22c9c84799d61504ca", "score": "0.6312833", "text": "def validate\n unless attachment.errors.empty?\n # uncomment this to get rid of the less-than-useful interrim messages\n # errors.clear \n errors.add :attachment, \"Paperclip returned errors for file '#{attachment_file_name}' - check ImageMagick installation or image source file.\"\n false\n end\n end", "title": "" }, { "docid": "90ad670ae24ec2c857a77b44519caeee", "score": "0.629014", "text": "def validate_logo_dimensions\n dimensions = Paperclip::Geometry.from_file(logo.to_file(:original))\n errors.add(:logo, \"Image dimensions were #{dimensions.width.to_i}x#{dimensions.height.to_i}, they must be exactly #{logo_dimensions_string}\") unless dimensions.width == LOGO_WIDTH && dimensions.height == LOGO_HEIGHT\n end", "title": "" }, { "docid": "a841be1d54d9e496831be2f168fdc286", "score": "0.62864804", "text": "def image?\n document_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end", "title": "" }, { "docid": "5fb24e5d723c22dacbcc48e8b92136c8", "score": "0.6286005", "text": "def image?(new_file)\n self.file.content_type.include? 'image'\n end", "title": "" }, { "docid": "ffd77e0468eb74798dab8e472b8e5933", "score": "0.6273114", "text": "def test_load_valid_png_files\n\n each_file_with_updated_info do\n |file_path|\n\n if @test_feature != \"x\"\n\n #Reading valid png files should not raise any exception\n assert_nothing_raised do\n Imgrb::Image.new(file_path)\n end\n\n img = Imgrb::Image.new(file_path, :only_metadata)\n\n assert_equal 0, img.rows.size, \"Only metadata loaded so no pixel data should be read.\"\n\n\n\n assert_equal @is_interlaced, img.header.interlaced?\n assert_equal @color_type_num, img.header.image_type\n assert_equal @bit_depth, img.header.bit_depth\n\n if @color_type_desc == \"g\"\n assert img.grayscale?\n assert !img.has_alpha? unless @test_feature == \"t\"\n end\n\n if @color_type_desc == \"c\" || @color_type_desc == \"p\"\n assert !img.grayscale?\n assert !img.has_alpha? unless @test_feature == \"t\"\n end\n\n if @color_type_num == 4\n assert img.grayscale?\n assert img.has_alpha?\n end\n\n if @color_type_num == 6\n assert !img.grayscale?\n assert img.has_alpha?\n end\n\n unless [\"df\", \"dh\", \"ds\"].include?(@parameter) || @test_feature == \"s\"\n assert_equal 32, img.width, \"Incorrect width reported!\"\n assert_equal 32, img.height, \"Incorrect height reported!\"\n end\n\n if @test_feature == \"s\"\n assert_equal img.width, img.height, \"Image size should be square, but is not!\"\n assert_equal @parameter.to_i, img.width, \"Incorrect image size reported!\"\n end\n end\n end\n end", "title": "" }, { "docid": "58f1d2aea75617103d44289cf86dfb96", "score": "0.62642914", "text": "def check_file_size\n valid?\n errors[:image_file_size].blank?\n end", "title": "" }, { "docid": "fc9f931e7aa7110d9b8c6d479c28873a", "score": "0.62495893", "text": "def image?(file)\n file.content_type.include? 'image'\n end", "title": "" }, { "docid": "a99ae95734ad70f1ac66345a3915e7f3", "score": "0.62484914", "text": "def not_image?(file)\n !file.content_type.include? 'image'\n end", "title": "" }, { "docid": "2a7e92c744ac74a0ab89c274bb220f8c", "score": "0.6244524", "text": "def image_presence\n errors.add(:image, \"Image must be attached.\") unless image.attached?\n end", "title": "" }, { "docid": "67fc39e40ed4ec0a4c1771d30f9f1ec7", "score": "0.62324613", "text": "def check_if_image?\n !(attachment_content_type =~ /^image.*/).nil?\n end", "title": "" }, { "docid": "3dcb87e2854572a929aca1a3e7db546a", "score": "0.6231548", "text": "def image_sanity_check(image_path)\n unless FileTest.exist?(image_path)\n raise \"Image file is not found: #{image_path}\"\n end\n image_attr_sanity_check(`#{CMD_QEMUIMG} info #{image_path}`)\n end", "title": "" }, { "docid": "796456bac344b8e75dfc814a2a1bdaf0", "score": "0.6207695", "text": "def inline_image(element)\n invalid = [\"span\",{\"class\"=>\"red\"},\"invalid image\"]\n return invalid unless element.attr.has_key? 'src'\n return invalid unless element.attr['src'].start_with? \"data:image/png;base64,\"\n return [\"img\",{\"src\"=>element.attr['src']}]\nend", "title": "" }, { "docid": "d008be1738a39e6e0d259f8284a3c683", "score": "0.6193721", "text": "def images? ; !(@images.nil? || @images.empty?) ; end", "title": "" }, { "docid": "df15c484f4f4b74fff4ae378af0e08a8", "score": "0.61908156", "text": "def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add(:base, \"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix.\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add(:base, \"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end", "title": "" }, { "docid": "b1ebff4019f7d93f4e655af20b04e79a", "score": "0.6189634", "text": "def image?(src)\n !File.directory?(src)\n end", "title": "" }, { "docid": "6161f92194251c3559efc47513c234d3", "score": "0.6185234", "text": "def image?\n self.type == \"Image\"\n end", "title": "" }, { "docid": "17907b38d118febd59c0c55562194bcd", "score": "0.6181213", "text": "def image?\n !!( content_type =~ Transit.config.image_regexp )\n end", "title": "" }, { "docid": "e4d4ca795940517f721c54e1dc351aaa", "score": "0.61811537", "text": "def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add_to_base(\"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add_to_base(\"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end", "title": "" }, { "docid": "ac0a0bee2b92a6ce406b2f09e6255a1c", "score": "0.6177092", "text": "def conforms_to_image\n return true if @uti == \"com.adobe.photoshop-image\"\n return true if @uti == \"com.adobe.illustrator.ai-image\"\n return true if @uti == \"com.compuserve.gif\"\n return true if @uti == \"com.microsoft.bmp\"\n return true if @uti == \"com.microsoft.ico\"\n return true if @uti == \"com.truevision.tga-image\"\n return true if @uti == \"com.sgi.sgi-image\"\n return true if @uti == \"com.ilm.openexr-image\"\n return true if @uti == \"com.kodak.flashpix.image\"\n return true if @uti == \"public.fax\"\n return true if @uti == \"public.jpeg\"\n return true if @uti == \"public.jpeg-2000\"\n return true if @uti == \"public.tiff\"\n return true if @uti == \"public.camera-raw-image\"\n return true if @uti == \"com.apple.pict\"\n return true if @uti == \"com.apple.macpaint-image\"\n return true if @uti == \"public.png\"\n return true if @uti == \"public.xbitmap-image\"\n return true if @uti == \"com.apple.quicktime-image\"\n return true if @uti == \"com.apple.icns\"\n return false\n end", "title": "" }, { "docid": "01c2d5998d47354c3c1a88b0a0deece0", "score": "0.61766356", "text": "def test_data_img_no_size\n output = tested('data_img_no_size rms.jpg')\n\n assert errors_ok? output\n\n assert_equal '(max-width: 600px) 80vw, 50%',\n output.at_css('img')['sizes']\n end", "title": "" }, { "docid": "3db8cf3441804d44bc8a7f6a658503db", "score": "0.6175127", "text": "def image_attr_sanity_check(attr_str)\n attr_str.each_line do |l|\n k,v = l.split(':').map { |e| e.strip }\n case k\n when 'file format'\n unless v == 'qcow2'\n raise \"Image should be formatted in qcow2. '#{v}' can't be used.\"\n end\n when 'virtual size'\n if /.*\\((\\d+).*\\).*/ =~ v\n unless $1.to_i <= image_max_vsize\n raise \"Virtual size of an image should be smaller than #{$server_config.image_max_virtual_size}GB.\"\n end\n else\n raise \"Virtual size can't be recognized.\"\n end\n end\n end\n end", "title": "" }, { "docid": "4f648b3bad32458a8d01b44584a0bc09", "score": "0.617058", "text": "def image?\n self.content_type.to_s.index(/image/).nil?\n end", "title": "" }, { "docid": "bcec09bc18315a045b5f9eaedfa3fded", "score": "0.61678964", "text": "def validate_math_images_links\n return unless text\n # 1.\n fragment = nil\n begin\n fragment = Nokogiri::XML::DocumentFragment.parse(text)\n rescue\n return errors.add(:text, :invalid_math_images_links)\n end\n fragment.css(MathImages::CSS_SELECTOR).each do |el|\n uri, query = nil, nil\n # 2.\n begin\n uri = URI \"http://www.example.com/#{el[:src]}\"\n query = CGI.parse uri.query\n rescue\n return errors.add(:text, :invalid_math_images_links)\n end\n math_image_filenames = query['formula']\n # 3.\n return errors.add(:text, :invalid_math_images_links) if math_image_filenames.empty? || math_image_filenames.size != 1\n # 4.\n math_image_filename = math_image_filenames.first\n return errors.add(:text, :invalid_math_images_links) unless math_images.include?(Pathname math_image_filename)\n end\n end", "title": "" }, { "docid": "945b3244c7f2899ed86a31c2e6accf52", "score": "0.61574894", "text": "def image?\n @image ||= !!(attachment_content_type =~ /^image\\/.+/)\n end", "title": "" }, { "docid": "9033603de050a078e2ea12ba7c5ddc73", "score": "0.61411256", "text": "def image?\n ext = File.extname(@path)\n case ext.downcase\n when '.png', '.jpg', '.jpeg', '.gif'; return true\n else; return false\n end\n end", "title": "" }, { "docid": "e29071543594cd95026ff22643b37407", "score": "0.6140556", "text": "def picture_size\n #errors.add(:image, 'should be less than 1MB') if image.size > 1.megabytes\n end", "title": "" }, { "docid": "ce451b9b31bb18dad83a033f1d1f1a22", "score": "0.6135661", "text": "def valid?\n validate!\n true\n rescue MiniMagick::Invalid\n false\n end", "title": "" }, { "docid": "bd9a0915129181fe2288134a7613d127", "score": "0.61295915", "text": "def image?\n image ? true : false\n end", "title": "" }, { "docid": "5f313738a8c23f7d51e641108416d346", "score": "0.6110063", "text": "def check_for_page_images\n\n issues = []\n pages.each do |p|\n issues.push \"#{p.title} does not have an associated image file.\" unless p.image_filename\n end\n\n warning issues unless issues.empty?\n end", "title": "" }, { "docid": "69cd6d2b8c069b5ab5066513ea614a07", "score": "0.6104635", "text": "def should_process?(image_file, image_metadata)\n true\n end", "title": "" }, { "docid": "7bbf147b9b3bc15abe011eb1ac8f9996", "score": "0.6087576", "text": "def check_image_format(img_header)\n hstr = img_header.unpack(\"H*\").first\n mime = { \"unk\" => \"application/octet-stream\",\n \"jpg\" => \"image/jpeg\",\n \"png\" => \"image/png\",\n \"gif\" => \"image/gif\",\n \"bmp\" => \"image/x-bmp\",\n \"pic\" => \"image/pict\",\n \"tif\" => \"image/tiff\" \n }\n \n result = \"unk\"\n result = \"jpg\" if hstr[0, 4] == \"ffd8\"\n result = \"png\" if hstr == \"89504e47\"\n result = \"gif\" if hstr == \"47494638\"\n resutl = \"bmp\" if hstr[0, 4] == \"424d\"\n result = \"pic\" if hstr[0, 6] == \"504943\"\n result = \"tif\" if hstr[0, 4] == \"4949\" || hstr[0, 4] == \"4d4d\"\n return result, mime[result]\n end", "title": "" }, { "docid": "907d84546dd7181f183e030664766b01", "score": "0.6077938", "text": "def no_image_errors\n unless image.errors.empty?\n errors.add :image, \"Paperclip returned errors for file '#{image_file_name}' - check ImageMagick installation or image source file.\"\n false\n end\n end", "title": "" }, { "docid": "aeab989c48b2be2f10c1eb10f9bc90f6", "score": "0.6077484", "text": "def compare_image(actual_img_access_type, actual_img_access_name, excp_img_access_type, excp_img_access_name)\n if actual_img_access_type == 'url'\n actual_img_url = actual_img_access_name\n else\n actual_img_url = get_element_attribute(actual_img_access_type, actual_img_access_name, 'src')\n end\n\n if excp_img_access_type == 'url'\n expected_img_url = excp_img_access_name\n elsif excp_img_access_type == 'image_name'\n expected_img_url = './features/expected_images/' + excp_img_access_name\n else\n expected_img_url = get_element_attribute(excp_img_access_type, excp_img_access_name, 'src')\n end\n\n # replace 'https' with 'http' from actual image url\n if actual_img_url.include? 'https'\n actual_img_url['https'] = 'http'\n end\n\n # replace 'https' with 'http' from expected image url\n if expected_img_url.include? 'https'\n expected_img_url['https'] = 'http'\n end\n\n if expected_img_url.include? '.png'\n image_type = 'png'\n else\n image_type = 'jpg'\n end\n\n # Storing actual image locally\n open('./features/actual_images/actual_image.' + image_type, 'wb') do |file|\n file << open(actual_img_url).read\n end\n \n actual_img_url = './features/actual_images/actual_image.' + image_type\n\n # Storing Expected image locally\n if excp_img_access_type != 'image_name'\n open('./features/expected_images/expected_image.' + image_type, 'wb') do |file|\n file << open(expected_img_url).read\n end\n expected_img_url = './features/expected_images/expected_image.' + image_type\n end\n\n # Verify image extension and call respective compare function\n if image_type == 'png'\n return compare_png_images(expected_img_url, actual_img_url)\n end\n\n compare_jpeg_images(expected_img_url, actual_img_url)\nend", "title": "" }, { "docid": "0bdd60c4c8dfa4ae8877991820b07777", "score": "0.6076607", "text": "def imagemagick?; end", "title": "" }, { "docid": "0d06a55ffb543c3a62b12ecdd0930220", "score": "0.6076271", "text": "def is_image?\n if self.mimetype\n self.mimetype =~ %r(image)\n elsif self.file_upload_content_type\n self.file_upload_content_type =~ %r(image)\n end\n end", "title": "" }, { "docid": "139a8eab8579d487dd58cb97345d3e49", "score": "0.607258", "text": "def is_image?\n ['jpg', 'jpeg', 'pjpeg', 'png', 'bmp', 'gif', 'x-png'].include? self.image_file_name.split('.').last\n end", "title": "" }, { "docid": "e529708f7147277625e224e6fb9acf72", "score": "0.6071371", "text": "def validate\n if filename.nil?\n errors.add_to_base(\"You must choose a file to upload\")\n else\n # Images should only be GIF, JPEG, or PNG\n enum = attachment_options[:content_type]\n unless enum.nil? || enum.include?(send(:content_type))\n errors.add_to_base(\"You can only upload images (GIF, JPEG, or PNG)\")\n end\n # Images should be less than UPLOAD_LIMIT MB.\n enum = attachment_options[:size]\n unless enum.nil? || enum.include?(send(:size))\n msg = \"Images should be smaller than #{UPLOAD_LIMIT} MB\"\n errors.add_to_base(msg)\n end\n end\n end", "title": "" }, { "docid": "f6baa3809aa09b7ae96f7398c7c66a21", "score": "0.6068771", "text": "def accept_no_image_data\n @accept_no_image_data = true\n end", "title": "" }, { "docid": "72a0f170430e025563963ffab73cceee", "score": "0.60610133", "text": "def derived_image?\n respond_to?(:format_name) && !format_name.blank?\n end", "title": "" }, { "docid": "1926b280ddcfa55018840dc6ff54084f", "score": "0.6060174", "text": "def verify_image\n unless Rails.env.production?\n return true\n end\n # image challenge check\n challenge = @session['uc']\n @session['uc'] = nil\n verify_image = false\n if challenge && @params[:imageChallenge]\n verify_image = challenge.checkResponse(@params[:imageChallenge])\n end\n raise InvalidChallengeValue unless verify_image\n end", "title": "" }, { "docid": "88e969058553f2886e6d90484f685af1", "score": "0.6051792", "text": "def no_attachment_errors\n unless label_image.errors.empty?\n # uncomment this to get rid of the less-than-useful interrim messages\n # errors.clear\n errors.add :label_image, \"Paperclip returned errors for file '#{label_image_file_name}' - check ImageMagick installation or image source file.\"\n false\n end\n end", "title": "" }, { "docid": "afb71c4699c8c31c793ed6d894621ae6", "score": "0.60505277", "text": "def picture_format\n extension_white_list = %w[jpg jpeg gif png]\n\n return unless picture.attached?\n return if extension_white_list.any? do |extension|\n picture.blob.content_type.starts_with?(\"image/#{extension}\")\n end\n\n picture.purge\n errors.add(:picture, \"は画像ファイルではありません\")\n end", "title": "" }, { "docid": "db5859bcca2524b890c30c73aa89db29", "score": "0.60502195", "text": "def has_image?(image)\n # FIXME\n true\n end", "title": "" }, { "docid": "0eaea866ee0a8eb30464c4fda88bd3e3", "score": "0.60489583", "text": "def image?\n photo_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end", "title": "" }, { "docid": "a093f65411268399ff818ab85ffe5583", "score": "0.60487646", "text": "def validates_as_attachment\n validates_presence_of :size, :content_type, :filename\n validate :attachment_attributes_valid?\n end", "title": "" }, { "docid": "aacb68c24a515ddc5dfa06df90c367b3", "score": "0.604606", "text": "def validate_bitmap\n raise \"Create a bitmap first\" unless @bitmap\n end", "title": "" }, { "docid": "7cde97f691ab7ef23968db7cb690dbc8", "score": "0.6040027", "text": "def validate_image_length\n if upload_length || save_to_temp_file\n if upload_length > MO.image_upload_max_size\n errors.add(:image,\n :validate_image_file_too_big.t(\n size: upload_length,\n max: MO.image_upload_max_size.to_s.sub(/\\d{6}$/, \"Mb\")\n ))\n result = false\n else\n result = true\n end\n end\n result\n end", "title": "" }, { "docid": "264392f6b149807fd254ed607762c727", "score": "0.60264957", "text": "def image?()\n IMAGE_EXTS.include? extname\n end", "title": "" }, { "docid": "3278fcbf51943676ba57fab8fd3ca120", "score": "0.6018519", "text": "def image?(uri)\n uri = URI.parse(uri) unless uri.is_a? URI\n !(IMAGE_REGEX =~ uri.path).nil?\n end", "title": "" }, { "docid": "16cef9d7202018493f71d97d80b82b35", "score": "0.6012378", "text": "def test_should_handle_files\n # make reference to four images.\n lightsabers_upload = substruct_fixture_file(\"lightsabers.jpg\")\n lightsaber_blue_upload = substruct_fixture_file(\"lightsaber_blue.jpg\")\n lightsaber_green_upload = substruct_fixture_file(\"lightsaber_green.jpg\")\n lightsaber_red_upload = substruct_fixture_file(\"lightsaber_red.jpg\")\n\n # Load them all and save.\n lightsabers_image = Image.new\n lightsabers_image.upload = lightsabers_upload\n assert lightsabers_image.save\n \n lightsaber_blue_image = Image.new\n lightsaber_blue_image.upload = lightsaber_blue_upload\n assert lightsaber_blue_image.save\n \n lightsaber_green_image = Image.new\n lightsaber_green_image.upload = lightsaber_green_upload\n assert lightsaber_green_image.save\n \n lightsaber_red_image = Image.new\n lightsaber_red_image.upload = lightsaber_red_upload\n assert lightsaber_red_image.save\n \n image_files = []\n # Assert that all those files exists.\n assert File.exist?( (image_files << lightsabers_image.upload.path).last )\n for thumb in lightsabers_image.upload.styles.collect{|x| x[1]}\n assert File.exist?( (image_files << thumb.attachment.path).last )\n end\n \n assert File.exist?(lightsaber_blue_image.upload.path)\n for thumb in lightsaber_blue_image.upload.styles.collect{|x| x[1]}\n assert File.exist?( (image_files << thumb.attachment.path).last )\n end\n\n assert File.exist?(lightsaber_green_image.upload.path)\n for thumb in lightsaber_green_image.upload.styles.collect{|x| x[1]}\n assert File.exist?( (image_files << thumb.attachment.path).last )\n end\n\n assert File.exist?(lightsaber_red_image.upload.path)\n for thumb in lightsaber_red_image.upload.styles.collect{|x| x[1]}\n assert File.exist?( (image_files << thumb.attachment.path).last )\n end\n\n # We must erase the records and its files by hand, just calling destroy.\n assert lightsabers_image.destroy\n assert lightsaber_blue_image.destroy\n assert lightsaber_green_image.destroy\n assert lightsaber_red_image.destroy \n \n # See if the files really were erased. (This test is probably redundant, as file-deletion is handled by Paperclip)\n for image_file in image_files do\n assert !File.exist?(image_file)\n end\n end", "title": "" }, { "docid": "113925bce2655947fa7000548bdbba3b", "score": "0.60095525", "text": "def image?\n !!image\n end", "title": "" }, { "docid": "d11626e962effe765e47a9bd10c462a0", "score": "0.6007743", "text": "def content_type_whitelist\n /image\\//\n end", "title": "" }, { "docid": "ef35b328b2836bfd28ff9596364cba14", "score": "0.600565", "text": "def isImage\n if self.image.attached? && self.image.content_type.in?(\"%w{image/jpeg,image/png,image/jpg}\")\n return true\n else\n return false\n end\n end", "title": "" } ]
ff3047b1dea8aee6c9e33407f5f4ed9f
Returns the root of the repository (not the .hg/.git root)
[ { "docid": "62b98cfaf4f591a88bd1943206d3a349", "score": "0.6409803", "text": "def root\n raise NotImplementedError.new(\"root() must be implemented by subclasses of AbstractLocalRepository.\")\n end", "title": "" } ]
[ { "docid": "f6a0c0d73f242a2614f3e30630b948b2", "score": "0.79107624", "text": "def root\n Pathname.new `git rev-parse --show-toplevel`.chomp\n end", "title": "" }, { "docid": "c64abbcd6fc1c0b6b9226ba16ab5e114", "score": "0.7682522", "text": "def root_path\n @root_path ||= `git rev-parse --show-toplevel`.chomp\n end", "title": "" }, { "docid": "6c7347ef710e7e8030f67951e03e00ba", "score": "0.74606955", "text": "def repo_root\n File.dirname(@path)\n end", "title": "" }, { "docid": "a56ef81a62d7f61fdf88531ccb27f02a", "score": "0.7383382", "text": "def git_root\n git_dir = `git rev-parse --show-toplevel`.strip\n raise \"Error: not a git repository\" if git_dir.empty?\n\n git_dir\nend", "title": "" }, { "docid": "4e9591d78ac44bbff9625bd2a3dfb4b5", "score": "0.7279486", "text": "def rootdir(path = Dir.pwd)\n g = MiniGit.new\n g.find_git_dir(path)[1]\n end", "title": "" }, { "docid": "ac2a3d6379c46fd07f526aa24ccd0e36", "score": "0.7154136", "text": "def root_revision\n case repository_type\n when 'git'\n `git rev-list --max-parents=0 HEAD`.chomp\n when 'git-svn', 'svn'\n 0\n end\nend", "title": "" }, { "docid": "4a9bb099310a4620f6f70263972177b2", "score": "0.7141151", "text": "def repos_root\n return @repos_root ||= begin\n root.join(config[\"repos_dir\"])\n end\n end", "title": "" }, { "docid": "dc3e893b43953f63b5d38864ae2e3caa", "score": "0.7113853", "text": "def root_repo_git\n Git.bare(root_repo_dir, log: git_logger)\n end", "title": "" }, { "docid": "25e1f387841e5a5952325fb51f8af890", "score": "0.7100439", "text": "def root\n return File.expand_path( Dir.pwd )\n end", "title": "" }, { "docid": "d8d40da8e61f2f256b8b4ab500088228", "score": "0.69826597", "text": "def root\n Pathname.new(@root).realpath.to_s\n end", "title": "" }, { "docid": "d8d40da8e61f2f256b8b4ab500088228", "score": "0.69826597", "text": "def root\n Pathname.new(@root).realpath.to_s\n end", "title": "" }, { "docid": "931993bd41837d9ebaf0c328d9241ae3", "score": "0.697186", "text": "def git_root_till_home\n Pathname.new(Dir.pwd).ascend do |dir_pathname|\n return dir_pathname if File.directory?(\"#{dir_pathname}/.git\")\n return nil if dir_pathname.to_s == home_dir\n end\n end", "title": "" }, { "docid": "2eb4c721236f340228226c521e03d429", "score": "0.69265753", "text": "def root\n Dir.pwd.split(File::SEPARATOR).first\n end", "title": "" }, { "docid": "b13f5aae7ff094218caaa0abdad43216", "score": "0.68971324", "text": "def root\n return @root if defined?(@root)\n path = `pwd -L`.sub(/\\n/,'') rescue Dir.pwd\n @root ||= Pathname.new(path)\n end", "title": "" }, { "docid": "e46ef9e4639581188f3d2c07a7e7fe41", "score": "0.6882503", "text": "def root\n Dir.pwd\n end", "title": "" }, { "docid": "6f7b143292d6d94282e1cdb7034f73ea", "score": "0.68768185", "text": "def root\n raise RootPathUnknownError unless @root\n @root\n end", "title": "" }, { "docid": "cb29cc80b221c55f18d3d3ae4defcb35", "score": "0.6875254", "text": "def root\n Dir.pwd\n end", "title": "" }, { "docid": "d329ee1fe23796b88d1d37d40db2dfad", "score": "0.68684465", "text": "def base_dir\n @repo.workdir\n end", "title": "" }, { "docid": "e4b39c04bc35f66585e8389778f2a469", "score": "0.686676", "text": "def repo_root_dir\n @repo_root_dir = join(__dir__, '..', '..')\nend", "title": "" }, { "docid": "d93f876f626d956e3faddab54e529574", "score": "0.68563116", "text": "def root\n ::File.expand_path \".\"\n end", "title": "" }, { "docid": "27b7be77d9b571a4fe8473bdae60151f", "score": "0.68496835", "text": "def root\n @root ||= File.expand_path('./')\n end", "title": "" }, { "docid": "169f28d067cc21beb03ef736f2ab90d6", "score": "0.6821942", "text": "def root\n @root ||= Pathname.new(File.expand_path(\"..\", __dir__))\n end", "title": "" }, { "docid": "15c564484ab5c5eb0cf0e21156dcb535", "score": "0.68148226", "text": "def root(path = nil)\n base = Deployinator.root_dir\n path ? File.join(base, path) : base\n end", "title": "" }, { "docid": "6f59da149dc23c7e00132f58c8a71eb0", "score": "0.68036", "text": "def root_dir\n root_paths[0]\n end", "title": "" }, { "docid": "f311095d32012a5e6c18a1539f8fd547", "score": "0.67999274", "text": "def root\n @root ||= Pathname.new(Dir.pwd)\n end", "title": "" }, { "docid": "f311095d32012a5e6c18a1539f8fd547", "score": "0.67999274", "text": "def root\n @root ||= Pathname.new(Dir.pwd)\n end", "title": "" }, { "docid": "6a0d1a565d8d333cfb89bf7a21297da8", "score": "0.6784036", "text": "def root_path\n @@root ||= File.dirname(Bundler.default_gemfile.to_path)\n end", "title": "" }, { "docid": "5e8377a2469e06178880b31635c6a629", "score": "0.6764147", "text": "def repo_base_dir\n File.join(Repositext::PARENT_DIR, repo_base_dir_name)\n end", "title": "" }, { "docid": "3d338e0bbdca5a077fd213782e5c8079", "score": "0.67091984", "text": "def get_root\n File.expand_path(File.join(Dir.getwd))\n end", "title": "" }, { "docid": "29ded2890257fcc6423bf7551ce93db3", "score": "0.6704001", "text": "def cvs_root\n root = \"\"\n root << \"-d #{repository} \" if repository\n root\n end", "title": "" }, { "docid": "402caf6a94a7c118812e2b1ad06d1617", "score": "0.6671478", "text": "def top_level_dir\n %x[git rev-parse --show-toplevel].strip\nend", "title": "" }, { "docid": "bafdb952014854f170e272734f6af356", "score": "0.6653329", "text": "def repo_name\n `git rev-parse --show-toplevel`.chomp\nend", "title": "" }, { "docid": "25fa4c27e6078c1385642a5e42415fd7", "score": "0.66527176", "text": "def root\n @root ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))\n end", "title": "" }, { "docid": "0ebaa80604a88992474674e07aab2816", "score": "0.663726", "text": "def root\n @root ||= fetch(:root)\n end", "title": "" }, { "docid": "6fa3b0fad3d9e8d4d293f6ca6905a64e", "score": "0.6628177", "text": "def root\n @root ||= Pathname.getwd\n end", "title": "" }, { "docid": "3887faca2868125c5b41671ac6087967", "score": "0.662237", "text": "def root\n fetch(:root)\n end", "title": "" }, { "docid": "2270f0980afe6ccedb6729287daaa707", "score": "0.66176873", "text": "def root\n config.root ||= (\n find_root || Path.new(Dir.pwd)\n )\n end", "title": "" }, { "docid": "ee616d712c22225ea0814323e21554c7", "score": "0.6617437", "text": "def get_root\n File.expand_path(File.join(Dir.getwd))\n end", "title": "" }, { "docid": "cd3d06cd6106cc19baea751b4bc81996", "score": "0.65998304", "text": "def root_dir\n split = basedir.split(\"/\")\n last_index = split.map {|i| i == get_type }.rindex(true)\n return split[0..(last_index-1)].join(\"/\")\n end", "title": "" }, { "docid": "7142a7d6cd3cb1ee8844df9483acd75d", "score": "0.65967494", "text": "def root\n ::File.dirname(::File.dirname(::File.expand_path('..', __FILE__)))\n end", "title": "" }, { "docid": "4e7abb3fb71f59f47bcc5809e5410e67", "score": "0.65962934", "text": "def get_root()\n @root\n end", "title": "" }, { "docid": "ef224f1af1b3df5f42faf1f9a21700dc", "score": "0.6594126", "text": "def root\n @root ||= Pathname.new(File.expand_path(\"../../\", __FILE__))\n end", "title": "" }, { "docid": "7c7a33070d429fe7d4b9875648d7b5d8", "score": "0.6592582", "text": "def remote_root \n if rubyforge_project.nil? or \n rubyforge_project == name then\n return RUBYFORGE_ROOT + \"#{name}/\"\n else\n return RUBYFORGE_ROOT + \"#{rubyforge_project}/#{name}/\"\n end\n end", "title": "" }, { "docid": "f489c4cbad69df893460e3c88915bf3f", "score": "0.6582999", "text": "def path_to_origen_root\n path = Origen.root.to_s.sub(revision_control_root.to_s, '').sub(/^(\\/|\\\\)/, '')\n path = '.' if path.empty?\n path\n end", "title": "" }, { "docid": "b6952c7d1d99e8504a6b374253b46f9d", "score": "0.65774345", "text": "def root\n if BUILD_CONFIG[:stagingdir]\n default = BUILD_CONFIG[:stagingdir][0...-BUILD_CONFIG[:prefixdir].size]\n else\n default = BUILD_CONFIG[:sourcedir]\n end\n @root || default\n end", "title": "" }, { "docid": "f52814af2c20f5dfe3a404992d62a89a", "score": "0.6572529", "text": "def root\n @project.root\n end", "title": "" }, { "docid": "2865d051351aedbd0aa8888fa734761f", "score": "0.6564044", "text": "def workdir\n File.join(@basedir, @repository.repository_hash)\n end", "title": "" }, { "docid": "ccacbafe6db057da284fc0888b5b0642", "score": "0.65584385", "text": "def submodule_repository_root\n #@repository_access == :private ? %(git@:#{@hub.host}) : %(https://#{@hub.host}/)\n %(https://#{@hub.host})\n end", "title": "" }, { "docid": "bca4f9062b545e92278586a7063b1cff", "score": "0.65526736", "text": "def merb_root\n root_key = %w[-m --merb-root].detect { |o| ARGV.index(o) }\n root = ARGV[ARGV.index(root_key) + 1] if root_key\n root.to_a.empty? ? Dir.getwd : root\n end", "title": "" }, { "docid": "9a61d71261ff4436e5466a2801d594bf", "score": "0.65452653", "text": "def root\n File.expand_path '../../..', __FILE__\n end", "title": "" }, { "docid": "5d44e5b5e202150cb8ef1662f76e3093", "score": "0.6542063", "text": "def repo_name\n @repo_name = `git rev-parse --show-toplevel`.chomp.split(\"/\").last\n @repo_name.to_s\n \"#{@repo_name}\"\n end", "title": "" }, { "docid": "5dc62d288a49abadfca8609f939eea15", "score": "0.6541412", "text": "def root_path\n ROOT_PATH\n end", "title": "" }, { "docid": "682d642d3a4bc8df90c0d9598cd40dee", "score": "0.6539279", "text": "def root\n in_deploy_pack? ? deploy_pack_dir : Dir.pwd\n end", "title": "" }, { "docid": "a52e41c92376b513bcb7be2264ca0ca1", "score": "0.6538982", "text": "def root\n @root ||= Pathname.new(File.expand_path('../../../../', __FILE__))\n end", "title": "" }, { "docid": "af10ad523544be30b4e0276646e33de8", "score": "0.65310425", "text": "def root\n # This could be done in a single Lua script server-side...\n self.root? ? self : self.parent.root\n end", "title": "" }, { "docid": "64a91ce187d56ced73148e68b233832a", "score": "0.6498046", "text": "def revision_control_root\n Origen.app.rc ? Origen.app.rc.root : Origen.root\n end", "title": "" }, { "docid": "a78375476746044409b72843cd89623b", "score": "0.6487717", "text": "def rootdir\n file(\"\", true)\n end", "title": "" }, { "docid": "31eaca09d98cbc9342af22e112c77967", "score": "0.64861053", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "1a4b4bd4e02a83b8cb79c6975f224f41", "score": "0.64804655", "text": "def repository\n @git_version.git_repository.git_base.base\n end", "title": "" }, { "docid": "417cfed935ca4c9ef22f2f8b009b6d2b", "score": "0.64695084", "text": "def root; '.'; end", "title": "" }, { "docid": "6c1eb6e288a64c1283eb296a95761b5d", "score": "0.6461065", "text": "def root\n @root ||= File.expand_path File.dirname(__FILE__)\n end", "title": "" }, { "docid": "e30c58ed681a159ec5ad9492781a06e3", "score": "0.64549655", "text": "def root!\n file = caller[0]\n path = Pathname.new(file).dirname\n path = path.parent until path.root? || File.exist?(File.join(path, APP_CONFIG))\n if path.root?\n fail \"Something went wrong resolving Origen.root! from: #{caller[0]}\"\n end\n\n path.realpath\n end", "title": "" }, { "docid": "78d814f7caace60c026e404e81947b03", "score": "0.6435252", "text": "def project_root(filename)\n # TODO: a real constant? Some internet-provided list?\n # these are files that indicate the root of a project\n markers = %w(.git .hg Gemfile package.json setup.py README README.md)\n p = Pathname.new(filename).expand_path\n p.ascend do |path|\n is_root = markers.any? do |marker|\n path.join(marker).exist?\n end\n\n return path if is_root\n end\n\n # no markers were found\n return p.to_s if p.directory?\n return p.dirname.to_s\n end", "title": "" }, { "docid": "c14bc493ddf057ede9bbc56112ca086a", "score": "0.64308083", "text": "def root\n File.expand_path(File.dirname(__dir__))\n end", "title": "" }, { "docid": "cd073f87aabf2b6cb21d246db36dc503", "score": "0.6414368", "text": "def gem_root_path\n gem_path_for(\"root\")\n end", "title": "" }, { "docid": "0d27080ddabd7dcff7c6563be30d7196", "score": "0.64136267", "text": "def root\n @root ||= begin\n if defined?(Rails)\n File.join Rails.root\n else\n \"./\"\n end\n end\n end", "title": "" }, { "docid": "ab940594672bc33fcbf42ecbb360fcca", "score": "0.6411039", "text": "def clone_root_path\n \"#{REPOSITORIES_PATH}/#{@name}\"\n end", "title": "" }, { "docid": "2e4893b91e2feda0ff431586dc7b38be", "score": "0.6408104", "text": "def root\n @site.root\n end", "title": "" }, { "docid": "c5a9eaa27c3b34078aab3c3293d5378b", "score": "0.64075637", "text": "def root_dir\n @root_directory\n end", "title": "" }, { "docid": "a8c8acd7f5af4895bb6d4cc613f4f067", "score": "0.64058524", "text": "def root_dir\n unless @root_dir\n @root_dir = @project.project_root\n end\n return @root_dir\n end", "title": "" }, { "docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e", "score": "0.6404102", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e", "score": "0.6404102", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e", "score": "0.6404102", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "21ee58e0eb3569791f3e37c39f12430c", "score": "0.64023566", "text": "def get_top_level\n `git rev-parse --show-toplevel`\nend", "title": "" }, { "docid": "eb92ad3b2aff23c81da3d01ba9142968", "score": "0.6399762", "text": "def root\n DeprecatedMethod.here \"Use path.root instead\"\n path.root\n end", "title": "" }, { "docid": "451459eca6e1335e93d7f591e575b548", "score": "0.6399229", "text": "def root\n self.options[:root] || self.options[:r] || File.expand_path('./')\n end", "title": "" }, { "docid": "7d0f1cb3dc33cf7dcaca7ad2ad417d12", "score": "0.6392627", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "be4d775471c8f8ddff0bca9f881a4251", "score": "0.6390566", "text": "def lookup_root\n root = nil\n Dir.ascend(Dir.pwd) do |path|\n check = Dir[ROOT_GLOB].first\n if check\n root = path \n break\n end\n end\n root || Dir.pwd\n end", "title": "" }, { "docid": "60057b5972ec57f05542b8b9142b7976", "score": "0.63893616", "text": "def root_dir; end", "title": "" }, { "docid": "2da145e00d221a8ae28cf021e0d95c95", "score": "0.638311", "text": "def root\n @root ||= Pathname.new(__FILE__).dirname.expand_path\n end", "title": "" }, { "docid": "8b6d79b0388c278de7ab39a0e8d912fa", "score": "0.63799846", "text": "def root\n @root ||= Pathname.new(self[\"root\"])\n end", "title": "" }, { "docid": "8a636427cfd6b9070efda5a4506bb27e", "score": "0.63746077", "text": "def default_root_prefix\n \"exercise_repo\"\n end", "title": "" }, { "docid": "a39c33a231e0ee97f926742094fc2ccf", "score": "0.6365624", "text": "def root\n ancestors.first\n end", "title": "" }, { "docid": "af176879eb5a69e016547b989259a1da", "score": "0.63629955", "text": "def root\n @root ||= defined?(Rails) ? Rails.root.to_s : Dir.pwd\n end", "title": "" }, { "docid": "485a434ced126fa3034c00bdac2bc5f0", "score": "0.63537055", "text": "def root\n baseurl.nil? ? '/' : File.join('/', baseurl)\n end", "title": "" }, { "docid": "d15260d8967d730fb5a5e9f99967ceed", "score": "0.6341962", "text": "def root(path = nil)\n if path\n @root = Pathname.new(path).expand_path\n else\n @root\n end\n end", "title": "" }, { "docid": "7d8a0570a9e4024f8805e4faf68fc5a1", "score": "0.6337935", "text": "def find_git_root(dir)\n git_root = \".\"\n Dir.chdir dir do\n git_root = `git rev-parse --show-toplevel`.chomp\n end\n\n raise \"No associated git repository found!\" if git_root =~ /fatal:/\n git_root\n end", "title": "" }, { "docid": "3aa520eefc1f9aba4ed6e715ee2b134f", "score": "0.63205457", "text": "def gem_root\n return @gem_root ||= begin\n path = File.expand_path(\"../../\", __dir__)\n Pathname.new(path)\n end\n end", "title": "" }, { "docid": "f8367bc4c2edbed1a869692c499e4664", "score": "0.6318659", "text": "def project_root\n if server_environment\n server_environment['project-root'] || ''\n end\n end", "title": "" }, { "docid": "576eb90b9f8f61a7dd0e8ce097fb47e3", "score": "0.6317911", "text": "def root_path\n File.expand_path(\"../../../../..\", __FILE__)\n end", "title": "" }, { "docid": "1347f395fbfb0c2bdee24be34a044c18", "score": "0.63118905", "text": "def find_control_repo_root(strict_check = false)\n environment_conf_path = PDK::Util.find_upwards('environment.conf')\n path = if environment_conf_path\n File.dirname(environment_conf_path)\n elsif control_repo_root?(Dir.pwd)\n Dir.pwd\n end\n return path if path.nil? || !strict_check\n\n PDK::Bolt.bolt_project_root?(path) ? nil : path\n end", "title": "" }, { "docid": "3c3f89ce25d82ba9a9326696bc9781dc", "score": "0.6309776", "text": "def gem_root\n #{CnfsCli::Docker.gem_root\n Cnfs::Docker.gem_root\n end", "title": "" }, { "docid": "00da8a9173bf08e3c42d28283ba1f06a", "score": "0.63090026", "text": "def root_dir\n @testrun_root_dir\n end", "title": "" }, { "docid": "6fc286a82d9a3a48e922208f0c6e64a2", "score": "0.63067913", "text": "def root_folder\n find_kernel_context.root_folder\n end", "title": "" }, { "docid": "b637add5dcec985b22de285595da5c4d", "score": "0.6281809", "text": "def root\n @namespace.root\n end", "title": "" }, { "docid": "2479013911f656c7b2958c438a0e16ce", "score": "0.6277445", "text": "def fs_root(revision=nil)\n if revision\n rev = revision.to_i\n else\n rev = fs.youngest_rev\n end\n #fs_root_for_rev(rev)\n fs.root(rev)\n end", "title": "" }, { "docid": "3968fd5fe1f7751a4c648e4df59bf5d4", "score": "0.6275905", "text": "def repository\n @@repository ||= Pathname(brew_file).realpath.dirname.parent\n end", "title": "" }, { "docid": "c8ff207305fc0002300f0283c001b637", "score": "0.62752545", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "71313799b0d25c2cee68f44ccdb8d877", "score": "0.6274035", "text": "def root\n return @root\n end", "title": "" }, { "docid": "38f9c5b201831ca5db99b67e342414b4", "score": "0.62727374", "text": "def working_path\n @repo.working_dir\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "232b9c93a52d01892839cfefccb60624", "score": "0.0", "text": "def bmc_params\n params.require(:bmc).permit(:problema, :propuesta, :cliente, :proyect_id)\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": "" } ]
beee15ec28e810b6b1f791f1988745d1
Converts email to all lowercase.
[ { "docid": "73026d76108b41c5844d0879a1d1896c", "score": "0.80721945", "text": "def downcase_email\n email.downcase\n end", "title": "" } ]
[ { "docid": "434a53dadeb1628ebc04d7cf7c8251af", "score": "0.83801347", "text": "def downcase_email\n\t email.downcase!\n\t end", "title": "" }, { "docid": "61c6f9455ec34c2acd15663a017f23dc", "score": "0.83395344", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "b16632956854dbab28558b74842c2fa7", "score": "0.8241731", "text": "def lowercase_email\n email.downcase! if email.present?\n end", "title": "" }, { "docid": "8371ad285364c309dea4b1f9d7431244", "score": "0.8215169", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "8371ad285364c309dea4b1f9d7431244", "score": "0.8215169", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "8371ad285364c309dea4b1f9d7431244", "score": "0.8215169", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "8371ad285364c309dea4b1f9d7431244", "score": "0.8215169", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "7bdd7b493d440b3e56ce41251c3f494d", "score": "0.81918895", "text": "def downcase_email\n\t\t\t# self.email = email.downcase\n\t\t\temail.downcase!\n\t\tend", "title": "" }, { "docid": "c3a6cb6035653f9aaf1731cb82637152", "score": "0.81613266", "text": "def downcase_email\n \t email.downcase!\n \t end", "title": "" }, { "docid": "845b17d76266d6fbaae1b79c80e1f2df", "score": "0.8131419", "text": "def normalize\n @normalized_email = email.downcase\n normalized_email\n end", "title": "" }, { "docid": "9627636612abdcc42f70605da2a765bb", "score": "0.812088", "text": "def downcase_email\n # self.email = email.downcase\n email.downcase!\n end", "title": "" }, { "docid": "61df7631d18fee6daaef3811fc2778ed", "score": "0.81117773", "text": "def downcase_email\n\t\tself.email.downcase!\n\tend", "title": "" }, { "docid": "6b65059c1fefe0349bbb966d7c91ec3b", "score": "0.8097894", "text": "def downcase_email\n self.email.downcase!\n end", "title": "" }, { "docid": "6b65059c1fefe0349bbb966d7c91ec3b", "score": "0.8097894", "text": "def downcase_email\n self.email.downcase!\n end", "title": "" }, { "docid": "6b65059c1fefe0349bbb966d7c91ec3b", "score": "0.8097894", "text": "def downcase_email\n self.email.downcase!\n end", "title": "" }, { "docid": "48d2b6e2ff4bf5c1838bdaa66807ce16", "score": "0.80566585", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "48d2b6e2ff4bf5c1838bdaa66807ce16", "score": "0.80566585", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "48d2b6e2ff4bf5c1838bdaa66807ce16", "score": "0.80566585", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "48d2b6e2ff4bf5c1838bdaa66807ce16", "score": "0.80566585", "text": "def downcase_email\n email.downcase!\n end", "title": "" }, { "docid": "9e0cf453e7e808fdc9a126fa8502da42", "score": "0.79944485", "text": "def downcase_email\n\t self.email = email.downcase\n\t end", "title": "" }, { "docid": "0d3f02f0b3e15c7bd85e11b7bb98bd5b", "score": "0.7949106", "text": "def downcase_email\n email.downcase if email\n end", "title": "" }, { "docid": "67c43682c1a4719c4fa8e850b9a83a5f", "score": "0.7948748", "text": "def downcase_email\n email.downcase! #same as self.email = email.downcase\n end", "title": "" }, { "docid": "e823a779a284020efd79ef7cab3d3c8a", "score": "0.7945658", "text": "def downcase_email\r\n self.email = email.downcase\r\n end", "title": "" }, { "docid": "64b8223df2bc21e46b3ce0937b3de69f", "score": "0.79403555", "text": "def downcase_email\n self.email.downcase!\n end", "title": "" }, { "docid": "73065db295b15118e146eaa046dc106c", "score": "0.7939695", "text": "def upcase_email_for_lansa(email_address)\n email_address.strip.upcase\n end", "title": "" }, { "docid": "92b456640c751af2c39f3b988cc1e941", "score": "0.79376054", "text": "def downcase_email\n return if email.present?\n\n email.downcase\n end", "title": "" }, { "docid": "73769769ccf25ce6b19803a4372324c3", "score": "0.7909164", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "73769769ccf25ce6b19803a4372324c3", "score": "0.7909164", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "73769769ccf25ce6b19803a4372324c3", "score": "0.7909164", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "73769769ccf25ce6b19803a4372324c3", "score": "0.7909164", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "2aa34fa2a600f0a92dba5d67fe9a1557", "score": "0.7892582", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "d7a7ba270c5cc3dd2c2c3c1634a57a22", "score": "0.7889172", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "d7a7ba270c5cc3dd2c2c3c1634a57a22", "score": "0.7889172", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "cc5c78d977af8038d7e73f29b8a5e2e1", "score": "0.78780895", "text": "def downcase_email\n self.email = email.downcase if self.email?\n end", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.78731155", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.7871943", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.7871943", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.7871943", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.7871943", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "4a9f54c314d699abc5fbe466f8c49cfb", "score": "0.7871943", "text": "def downcase_email\n\t\tself.email = email.downcase\n\tend", "title": "" }, { "docid": "5300855d8e082232801b8f0b6f3eb092", "score": "0.78691924", "text": "def downcase_email\n self.email = email.downcase if self.email\n end", "title": "" }, { "docid": "264cb9468ea0f3b010c81074172f1d79", "score": "0.7868616", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7851081", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7850516", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "51b026e7e160d6cc52676065203faff6", "score": "0.7850173", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "45a70ad1c3cef9321d355dbf7a578a59", "score": "0.7848869", "text": "def downcase_email\n #self.email = email.downcase\n email.downcase!\n end", "title": "" }, { "docid": "d26ed03a7eceb2dd960fcb47ef314e02", "score": "0.7840947", "text": "def downcase_email\n\t\t\tself.email = email.downcase\n\t\tend", "title": "" }, { "docid": "d26ed03a7eceb2dd960fcb47ef314e02", "score": "0.7840947", "text": "def downcase_email\n\t\t\tself.email = email.downcase\n\t\tend", "title": "" }, { "docid": "d26ed03a7eceb2dd960fcb47ef314e02", "score": "0.7840947", "text": "def downcase_email\n\t\t\tself.email = email.downcase\n\t\tend", "title": "" }, { "docid": "d26ed03a7eceb2dd960fcb47ef314e02", "score": "0.7840947", "text": "def downcase_email\n\t\t\tself.email = email.downcase\n\t\tend", "title": "" }, { "docid": "3f81a98c11de8dde21f16177ae6c6387", "score": "0.78404623", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "3f81a98c11de8dde21f16177ae6c6387", "score": "0.78404623", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "255407e2689d888bdb2beab4068258b1", "score": "0.7837679", "text": "def downcase_email\n self.email = self.email.delete(' ').downcase\n end", "title": "" }, { "docid": "f6d0fd3f0b7dc4bf55aebb790c43fc4a", "score": "0.78166837", "text": "def lower_email\n self.email.downcase!\n self.name.downcase!\n end", "title": "" }, { "docid": "0000fd10fb5ea9be35e13a9ebd0ad8a1", "score": "0.78143746", "text": "def downcase_email\n unless self.email == nil\n self.email = email.downcase\n end\n end", "title": "" }, { "docid": "e129cb94f99c5189aab170fc1524b68e", "score": "0.77689314", "text": "def downcase_email\n self.email=email.downcase\n end", "title": "" }, { "docid": "f47921fbcc906944e7dc6caafdb0b58a", "score": "0.77616173", "text": "def scrub_email_address\n self.email_address.downcase\n end", "title": "" }, { "docid": "327e75f407c8dca0ab3351b0196c6020", "score": "0.7756429", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" }, { "docid": "e6f6adf19c979b527d94ef4debaff2e5", "score": "0.77411944", "text": "def downcase_email\n self.email = email.downcase\n end", "title": "" } ]
82a37f86ab8d284d2570dc7c63cb4f40
Change the url params, similar to redirecting to a new url
[ { "docid": "6a05cec8a70e8eb78196447f0add4443", "score": "0.0", "text": "def go(url)\n self.url.parse(url)\n end", "title": "" } ]
[ { "docid": "e668b2d5c7ab08a5c7cff3f403e71b0f", "score": "0.7123394", "text": "def reload params = nil\n redirect request.path, params || request.GET\n end", "title": "" }, { "docid": "5382b46c834bda9553cbdd6b8848b07d", "score": "0.69155073", "text": "def adjust_for_redirect\n self.url = fetch_url(self.url)\n end", "title": "" }, { "docid": "7b154b83f9a24df75c1dda7e8493d5f8", "score": "0.6851032", "text": "def action_with_redirect_with_query_string_order2\n redirect_to \"http://test.host/redirect_spec/somewhere/1111?param2=value2&param1=value1\"\n end", "title": "" }, { "docid": "62b51971e25d60af1b6241c1876661f3", "score": "0.67929024", "text": "def action_with_redirect_with_query_string_order1\n redirect_to \"http://test.host/redirect_spec/somewhere/1111?param1=value1&param2=value2\"\n end", "title": "" }, { "docid": "4c24cc32345e3ef4bc6fe9b9c5e45054", "score": "0.67593396", "text": "def redirect_with_params(opts={})\n redirect_to request.parameters.update(opts)\n end", "title": "" }, { "docid": "1051b4381524750ed16573cb2a5de819", "score": "0.67182213", "text": "def set_params(easy)\n params.escape = true\n base_url, base_params = url.split(\"?\")\n base_params += \"&\" if base_params\n easy.url = \"#{base_url}?#{base_params}#{params.to_s}\"\n end", "title": "" }, { "docid": "a94148388467779e515299b59ba4a3b1", "score": "0.66404766", "text": "def get_url(action,new_params)\n @params = @params.merge(new_params)\n uri = \"/#{action}#{get_query}\"\n end", "title": "" }, { "docid": "c7445f95c9b43f35854d75b82c74c0dc", "score": "0.661206", "text": "def reload_with_args(new_args)\n uri = request.url.sub(/^\\w+:\\/+[^\\/]+/, '')\n add_args_to_url(uri, new_args)\n end", "title": "" }, { "docid": "22b5c5473e92582f1158c940b0254638", "score": "0.65523165", "text": "def update!\n if Volt.client?\n new_url = url_for(@params.to_h)\n\n # Push the new url if pushState is supported\n # TODO: add fragment fallback\n `\n if (document.location.href != new_url && history && history.pushState) {\n history.pushState(null, null, new_url);\n }\n `\n end\n end", "title": "" }, { "docid": "3db4f609dad6a2c4dbfbfe04351a5727", "score": "0.6527542", "text": "def reload_with_args(new_args)\n add_args_to_url(request.request_uri, new_args)\n end", "title": "" }, { "docid": "1928a9f28b39dbc37e2662ce483cd8b7", "score": "0.6452653", "text": "def reload_with_args(new_args)\n uri = request.url.sub(%r{^\\w+:/+[^/]+}, \"\")\n add_args_to_url(uri, new_args)\n end", "title": "" }, { "docid": "1928a9f28b39dbc37e2662ce483cd8b7", "score": "0.6452653", "text": "def reload_with_args(new_args)\n uri = request.url.sub(%r{^\\w+:/+[^/]+}, \"\")\n add_args_to_url(uri, new_args)\n end", "title": "" }, { "docid": "84ebcac419183d014f4e2fb4e47d797c", "score": "0.64171094", "text": "def redirect(url); end", "title": "" }, { "docid": "19a47ca31bf4a47540a3d62b46eb3557", "score": "0.6361581", "text": "def redirect!(url, params = T.unsafe(nil), opts = T.unsafe(nil)); end", "title": "" }, { "docid": "d2146ce5ba1d71454bd1d693b20778eb", "score": "0.62773746", "text": "def redirect_url=(url)\n params[:redirect_url] = url\n end", "title": "" }, { "docid": "d2c724423eb874fc30563a58431d3a96", "score": "0.6267949", "text": "def process_params\n unless params[:url]\n url = request.fullpath.sub(/^\\//, '')\n if url != ''\n params[:url] = url\n end\n end\n end", "title": "" }, { "docid": "23e3e55e6557b0107dd707a5e374d6a3", "score": "0.62488884", "text": "def amend origin_url\n origin_url.sub! /^\"?([^\"]*)\"?/, '\\\\1' # Remove any enclosing quotes\n query_str = (match = origin_url.match /^[^?]*\\?(.*)/ ) ? match[1] : \"\"\n query_params = query_str.empty? ? {} : Hash[ CGI.parse(query_str).map { |elmt| [elmt.first.to_sym, elmt.last.first] } ]\n # Format refers to how to present the content: within a dialog, or on a page\n @mode = query_params[:mode]\n end", "title": "" }, { "docid": "5031c22612cfef46ca1ac72b09381414", "score": "0.62259495", "text": "def redirect_users\n uri = URI(params[:launch_presentation_return_url].to_s)\n uri.query ||= \"\"\n case params[:with_msg]\n when \"lti_msg\"\n new_param = [\"lti_msg\", \"Most things in here don't react well to bullets.\"]\n when \"lti_log\"\n new_param = [\"lti_log\", \"One ping only.\"]\n when \"err_msg\"\n new_param = [\"lti_errormsg\", \"Who's going to save you, Junior?!\"]\n when \"err_log\"\n new_param = [\"lti_errorlog\", \"The floor's on fire... see... *&* the chair.\"]\n else\n new_param = []\n end\n new_query_ar = URI.decode_www_form(uri.query) << new_param\n uri.query = URI.encode_www_form(new_query_ar)\n redirect_to uri.to_s\n end", "title": "" }, { "docid": "baba52c23e87fe22e87c8499c8180654", "score": "0.61823994", "text": "def redirect_to(url, *)\n @redirected_to = url\n end", "title": "" }, { "docid": "55dc9226935c9d047b3d771bc8710ad6", "score": "0.6179913", "text": "def redirect_params options = {}\n options[:mode] = @mode unless @mode == :page\n options\n end", "title": "" }, { "docid": "7c3706a16d581a5ed3e816bea93ecb74", "score": "0.61251676", "text": "def redirect_with_query(args, query = nil)\n redirect_to(add_query_param(args, query))\n end", "title": "" }, { "docid": "765d2ed3c78b43e575d3e70c6e0a866a", "score": "0.60995036", "text": "def url_params\n \tif user_signed_in?\n\t params.require(:url).permit(:name, :redirect_to, :alias, :redir_val1, :redir_limit)\n \telse\n\t params.require(:url).permit(:redirect_to, :redir_val1)\n \tend\n end", "title": "" }, { "docid": "ebe054bbfcf1449cdb0191a12938ed7e", "score": "0.6094911", "text": "def update!(**args)\n @host_redirect = args[:host_redirect] if args.key?(:host_redirect)\n @https_redirect = args[:https_redirect] if args.key?(:https_redirect)\n @path_redirect = args[:path_redirect] if args.key?(:path_redirect)\n @port_redirect = args[:port_redirect] if args.key?(:port_redirect)\n @prefix_rewrite = args[:prefix_rewrite] if args.key?(:prefix_rewrite)\n @response_code = args[:response_code] if args.key?(:response_code)\n @strip_query = args[:strip_query] if args.key?(:strip_query)\n end", "title": "" }, { "docid": "020e40b2a45a888074b9f6bedf103fa9", "score": "0.6080364", "text": "def set_url_name\n params[:url_name] = params[:id]\n params.delete :id\n end", "title": "" }, { "docid": "261309a8b4c61ae1d04690241d5b6650", "score": "0.607811", "text": "def add_params(url = request.fullpath, new_params = {})\n uri = URI(url)\n # Allow keys that are currently in query_params to be deleted by setting their value to nil in\n # new_params (including in nested hashes).\n merged_params = parse_nested_query(uri.query || '').\n deep_merge(new_params).recurse(&:compact)\n uri.query = Rack::Utils.build_nested_query(merged_params).presence\n uri.to_s\n end", "title": "" }, { "docid": "47dead502bc3f7fceaf1f3764c6d51d5", "score": "0.6072097", "text": "def update\n # trace __FILE__, __LINE__, self, __method__, \" : location.href=#{location.href} location.path=#{location.path} location.search=#{location.search}\"\n mutate!(**parse(\"#{location.path}#{location.query}\"))\n end", "title": "" }, { "docid": "83729033a7aaa662bd982c10b44fde10", "score": "0.6063847", "text": "def update\n respond_to do |format|\n if @url.user_id == current_user.id\n param_name = url_params[:name]\n param_redirect_to = Url.clean_url(url_params[:redirect_to])\n param_alias = url_params[:alias]\n redir_id = 1\n \n if !url_params[:redir_val1].blank?\n redir_id += 1\n redir_limit = (url_params[:redir_limit].blank? ? 1: url_params[:redir_limit].to_i)\n end\n \n if @url.update({name: param_name, redirect_to: param_redirect_to,\n redir_id: redir_id, redir_limit: redir_limit})\n format.html { redirect_to request.referer, notice: 'Url was successfully updated.' }\n format.json { render :show, status: :ok, location: request.referer }\n else\n format.html { render :edit }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n \n else\n format.html { redirect_to urls_path, notice: 'You don\\'t have permission to edit this url.' }\n format.json { render :show, status: :ok, location: urls_path }\n end\n end\n end", "title": "" }, { "docid": "ea30735019891097972bc081fedea811", "score": "0.60557026", "text": "def redirect_params_hash\n\n end", "title": "" }, { "docid": "3753a3df507f7011375f7d34075b3a15", "score": "0.60417515", "text": "def add_args_to_url(url, new_args)\n new_args = new_args.clone\n args = {}\n\n # Garbage in, garbage out...\n return url unless url.valid_encoding?\n\n # Parse parameters off of current URL.\n addr, parms = url.split(\"?\")\n (parms ? parms.split(\"&\") : []).each do |arg|\n var, val = arg.split(\"=\")\n next unless var && var != \"\"\n\n var = CGI.unescape(var)\n # See note below about precedence in case of redundancy.\n args[var] = val unless args.key?(var)\n end\n\n # Deal with the special \"/xxx/id\" case.\n if %r{/(\\d+)$}.match?(addr)\n new_id = new_args[:id] || new_args[\"id\"]\n addr.sub!(/\\d+$/, new_id.to_s) if new_id\n new_args.delete(:id)\n new_args.delete(\"id\")\n end\n\n # Merge in new arguments, deleting where new values are nil.\n new_args.each_key do |var|\n val = new_args[var]\n if val.nil?\n args.delete(var.to_s)\n elsif val.is_a?(ActiveRecord::Base)\n args[var.to_s] = val.id.to_s\n else\n args[var.to_s] = CGI.escape(val.to_s)\n end\n end\n\n # Put it back together.\n return addr if args.keys.empty?\n\n addr + \"?\" + args.keys.sort.map do |k|\n CGI.escape(k) + \"=\" + (args[k] || \"\")\n end.join(\"&\")\n end", "title": "" }, { "docid": "3753a3df507f7011375f7d34075b3a15", "score": "0.60417515", "text": "def add_args_to_url(url, new_args)\n new_args = new_args.clone\n args = {}\n\n # Garbage in, garbage out...\n return url unless url.valid_encoding?\n\n # Parse parameters off of current URL.\n addr, parms = url.split(\"?\")\n (parms ? parms.split(\"&\") : []).each do |arg|\n var, val = arg.split(\"=\")\n next unless var && var != \"\"\n\n var = CGI.unescape(var)\n # See note below about precedence in case of redundancy.\n args[var] = val unless args.key?(var)\n end\n\n # Deal with the special \"/xxx/id\" case.\n if %r{/(\\d+)$}.match?(addr)\n new_id = new_args[:id] || new_args[\"id\"]\n addr.sub!(/\\d+$/, new_id.to_s) if new_id\n new_args.delete(:id)\n new_args.delete(\"id\")\n end\n\n # Merge in new arguments, deleting where new values are nil.\n new_args.each_key do |var|\n val = new_args[var]\n if val.nil?\n args.delete(var.to_s)\n elsif val.is_a?(ActiveRecord::Base)\n args[var.to_s] = val.id.to_s\n else\n args[var.to_s] = CGI.escape(val.to_s)\n end\n end\n\n # Put it back together.\n return addr if args.keys.empty?\n\n addr + \"?\" + args.keys.sort.map do |k|\n CGI.escape(k) + \"=\" + (args[k] || \"\")\n end.join(\"&\")\n end", "title": "" }, { "docid": "acc25c9d1501e70e302884adc5e538c2", "score": "0.6028879", "text": "def add_args_to_url(url, new_args)\n new_args = new_args.clone\n args = {}\n\n # Garbage in, garbage out...\n return url if !url.valid_encoding?\n\n # Parse parameters off of current URL.\n addr, parms = url.split('?')\n for arg in parms ? parms.split('&') : []\n var, val = arg.split('=')\n if var && var != ''\n var = CGI.unescape(var)\n # See note below about precedence in case of redundancy.\n args[var] = val if !args.has_key?(var)\n end\n end\n\n # Deal with the special \"/xxx/id\" case.\n if addr.match(/\\/(\\d+)$/)\n new_id = new_args[:id] || new_args['id']\n addr.sub!(/\\d+$/, new_id.to_s) if new_id\n new_args.delete(:id)\n new_args.delete('id')\n end\n\n # Merge in new arguments, deleting where new values are nil.\n for var in new_args.keys\n val = new_args[var]\n var = var.to_s\n if val.nil?\n args.delete(var)\n elsif val.is_a?(ActiveRecord::Base)\n args[var] = val.id.to_s\n else\n args[var] = CGI.escape(val.to_s)\n end\n end\n\n # Put it back together.\n return addr if args.keys == []\n return addr + '?' + args.keys.sort.map \\\n {|k| CGI.escape(k) + '=' + (args[k] || \"\")}.join('&')\n end", "title": "" }, { "docid": "acc25c9d1501e70e302884adc5e538c2", "score": "0.6028879", "text": "def add_args_to_url(url, new_args)\n new_args = new_args.clone\n args = {}\n\n # Garbage in, garbage out...\n return url if !url.valid_encoding?\n\n # Parse parameters off of current URL.\n addr, parms = url.split('?')\n for arg in parms ? parms.split('&') : []\n var, val = arg.split('=')\n if var && var != ''\n var = CGI.unescape(var)\n # See note below about precedence in case of redundancy.\n args[var] = val if !args.has_key?(var)\n end\n end\n\n # Deal with the special \"/xxx/id\" case.\n if addr.match(/\\/(\\d+)$/)\n new_id = new_args[:id] || new_args['id']\n addr.sub!(/\\d+$/, new_id.to_s) if new_id\n new_args.delete(:id)\n new_args.delete('id')\n end\n\n # Merge in new arguments, deleting where new values are nil.\n for var in new_args.keys\n val = new_args[var]\n var = var.to_s\n if val.nil?\n args.delete(var)\n elsif val.is_a?(ActiveRecord::Base)\n args[var] = val.id.to_s\n else\n args[var] = CGI.escape(val.to_s)\n end\n end\n\n # Put it back together.\n return addr if args.keys == []\n return addr + '?' + args.keys.sort.map \\\n {|k| CGI.escape(k) + '=' + (args[k] || \"\")}.join('&')\n end", "title": "" }, { "docid": "3dae455d4e26df9f96f32354d38a1166", "score": "0.60119605", "text": "def current_url(new_params)\n url_for :params => params.merge(new_params)\n end", "title": "" }, { "docid": "ea8821ff7abf730c006c643651886481", "score": "0.6003222", "text": "def follow_redirect!(**args); end", "title": "" }, { "docid": "4f84f7d7e277b59d99f704c334e40811", "score": "0.59963644", "text": "def redirect_to *xs\n redirect url_to(*xs)\n end", "title": "" }, { "docid": "b311ecbfdd34f5f00888c70c1c2efa2a", "score": "0.59878373", "text": "def redirect\n @url.increment!(:views)\n\n respond_to do |format|\n format.html { redirect_to @url.original }\n format.json\n end\n end", "title": "" }, { "docid": "7e9885e290d9fe91af162b743862bc0b", "score": "0.59866214", "text": "def update(params)\n self.original_url = params[:original_url] if params[:original_url].present?\n self.short_url = params[:short_url] if params[:short_url].present?\n self.pageviews = params[:pageviews] if params[:pageviews].present?\n self.save\n return self\n end", "title": "" }, { "docid": "7e9885e290d9fe91af162b743862bc0b", "score": "0.59866214", "text": "def update(params)\n self.original_url = params[:original_url] if params[:original_url].present?\n self.short_url = params[:short_url] if params[:short_url].present?\n self.pageviews = params[:pageviews] if params[:pageviews].present?\n self.save\n return self\n end", "title": "" }, { "docid": "4d7b13b6bebed64784085d4a54ccd79a", "score": "0.5974152", "text": "def redirect_to_using_params_or_back(options={}, response_status={})\n unless params[:redir_url].blank?\n redirect_to params[:redir_url], response_status\n else\n redirect_to_back options, response_status\n end\n end", "title": "" }, { "docid": "6292f11ac1829ba6ba2a7a6c5f7db1f9", "score": "0.59723437", "text": "def redirect!\n \n @redirects.each do |parameters|\n \n old_redirect_to parameters[:options], parameters[:response_status]\n \n end\n \n end", "title": "" }, { "docid": "f3efc2970dc2c4104e15c4480ef2a99b", "score": "0.5956719", "text": "def redirect=(_arg0); end", "title": "" }, { "docid": "c619672592c516a5ce9b12f4d3e66a1f", "score": "0.5949483", "text": "def back_with_params(extra_params = {})\n back_to = parsed_referer_path || '/'\n clean_params = params.reject do |key, value|\n settings.params_blacklist.include?(key.to_sym)\n end\n\n url_with_params(back_to, extra_params.merge(clean_params))\n end", "title": "" }, { "docid": "53865fb3d2504ba40304b2c15f913b0e", "score": "0.5945177", "text": "def redirect_away(*params)\n\t\tsession[:original_uri] = request.request_uri\n\t\tredirect_to(*params)\n\tend", "title": "" }, { "docid": "0a76b6b3909b9346ec75726462744349", "score": "0.5940731", "text": "def redirect_to url\n {url: url, status: 302}\n end", "title": "" }, { "docid": "665eae6a1e03fd34eda179671beac7ff", "score": "0.5938349", "text": "def add_params_to_url(url, params)\n uri = URI.parse(url)\n new_query_ar = URI.decode_www_form(uri.query || '')\n params.each { |k, v| new_query_ar << [k, v] }\n uri.query = URI.encode_www_form(new_query_ar)\n uri.to_s\n end", "title": "" }, { "docid": "fa270cb71878840506f2f225ecc138e3", "score": "0.5922802", "text": "def redi\n addy = @url.link\n redirect_to \"#{addy}\"\n end", "title": "" }, { "docid": "59c5f99112c23e5efc3d25bc3ee456de", "score": "0.592199", "text": "def update_url=(_arg0); end", "title": "" }, { "docid": "3bf7b3ad987a6afed99257aba0c81c11", "score": "0.5921895", "text": "def update\n redirect_to new_vurl_path\n end", "title": "" }, { "docid": "59220a8dfe2cae304b668191264d79f8", "score": "0.5919484", "text": "def fill_url(url, params)\n params.each do |key, value|\n url = url.gsub \"{#{key}}\", value.to_s\n end\n\n url\n end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.5893287", "text": "def url=(_arg0); end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.5893287", "text": "def url=(_arg0); end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.5893287", "text": "def url=(_arg0); end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.5893287", "text": "def url=(_arg0); end", "title": "" }, { "docid": "88cec477b8643a95c9a3b0e05baa06b1", "score": "0.58814573", "text": "def switch_link(params,qurl)\r\n\r\n # check to see if the user is navigating to a record that was not included in the current page of results\r\n # if so, run a new search API call, getting the appropriate page of results\r\n if params[:resultId].to_i > (params[:pagenumber].to_i * params[:resultsperpage].to_i)\r\n nextPage = params[:pagenumber].to_i + 1\r\n newParams = params\r\n newParams[:eds_action] = \"GoToPage(\" + nextPage.to_s + \")\"\r\n options = generate_api_query(newParams)\r\n search(options)\r\n elsif params[:resultId].to_i < (((params[:pagenumber].to_i - 1) * params[:resultsperpage].to_i) + 1)\r\n nextPage = params[:pagenumber].to_i - 1\r\n newParams = params\r\n newParams[:eds_action] = \"GoToPage(\" + nextPage.to_s + \")\"\r\n options = generate_api_query(newParams)\r\n search(options)\r\n end \r\n\r\n link = \"\"\r\n # generate the link for the target record\r\n if session[:results]['SearchResult']['Data']['Records'].present?\r\n session[:results]['SearchResult']['Data']['Records'].each do |result|\r\n nextId = show_resultid(result).to_s\r\n if nextId == params[:resultId].to_s\r\n nextAn = show_an(result).to_s\r\n nextDbId = show_dbid(result).to_s\r\n nextrId = params[:resultId].to_s\r\n nextHighlight = params[:q].to_s\r\n link = request.fullpath.split(\"/switch\")[0].to_s + \"/\" + nextDbId.to_s + \"/\" + nextAn.to_s + \"/?resultId=\" + nextrId.to_s + \"&highlight=\" + nextHighlight.to_s\r\n end \r\n end\r\n end\r\n return link.to_s\r\n\r\n end", "title": "" }, { "docid": "7a2ffd587dcf15cbbcd7faba1a1bd1a1", "score": "0.5879844", "text": "def redirect_away(*params)\n\t session[:original_uri] = request.request_uri\n\t redirect_to(*params)\n\tend", "title": "" }, { "docid": "02a57e98c3621e0f9cb330b662136f1e", "score": "0.5878581", "text": "def update!(**args)\n @http_routes = args[:http_routes] if args.key?(:http_routes)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "13767d6ee68da4068615d9dbe7f7726a", "score": "0.58632165", "text": "def update\n session[:forwarding_url] = request.url\n end", "title": "" }, { "docid": "464b07596eed679747fd4dcdd7c043a3", "score": "0.58508563", "text": "def merge_default_redirect_params(redirect_route, extra_params={})\n merged_redirect_url = redirect_route.dup\n extra_params.each do |key, value|\n if value.present?\n if redirect_route.include?('?')\n merged_redirect_url += \"&#{key}=#{value}\"\n else\n merged_redirect_url += \"?#{key}=#{value}\"\n end\n end\n end\n merged_redirect_url\n end", "title": "" }, { "docid": "999b0934b0db348e3bfceb60ada37e9f", "score": "0.5847315", "text": "def current_url(new_params, element_id = nil)\n new_params = request.query_parameters.merge(new_params)\n request.url.split(\"?\")[0] + \"?\" + new_params.map{ |k,v| \"#{k}=#{v}\" }.join(\"&\") + (element_id ? \"##{element_id}\" : \"\")\n end", "title": "" }, { "docid": "a3a54fb899b39dc915277d5a8596d7ec", "score": "0.5847149", "text": "def redirect_to_good_slug\n redirect_to params.merge({\n id: params[:id],\n format: nil,\n status: :moved_permanently\n })\n end", "title": "" }, { "docid": "0fc76c361cf1875a6f61192e60e3828f", "score": "0.58459586", "text": "def update\n session[:return_to] ||= request.referer\n\n\n edit_route_back(@global, @global_params)\n\n end", "title": "" }, { "docid": "33ee40fc1e84d887704636f8cfebaa54", "score": "0.58446205", "text": "def url_check(type)\n redirect_to :overwrite_params => {:controller=>'company/utilities', :action=>:utility,:type=>type}\n end", "title": "" }, { "docid": "47b13e14a77ffda9a2ab09b58794dbf8", "score": "0.5843144", "text": "def redirect(url, method: T.unsafe(nil), **keyword_args); end", "title": "" }, { "docid": "47b13e14a77ffda9a2ab09b58794dbf8", "score": "0.5843144", "text": "def redirect(url, method: T.unsafe(nil), **keyword_args); end", "title": "" }, { "docid": "0543e65556b5ff43ad162f47a081e0f2", "score": "0.58403754", "text": "def the_update_redirect; {:action => 'show', :id => @the_thing}; end", "title": "" }, { "docid": "aa7329e8fea83b3e37c97e3edc0d5dab", "score": "0.58304775", "text": "def redirect(*a)\n r(302,'','Location'=>URL(*a))\n end", "title": "" }, { "docid": "e1bcc6f4dba36c23b7ef0d2d5baa6c9c", "score": "0.58286035", "text": "def redirect_with_query(url)\n r = request.referer\n if r && r =~ /\\?/\n ref = URI(r)\n redirect(\"#{url}?#{ref.query}\")\n else\n redirect url\n end\n end", "title": "" }, { "docid": "86a56f52b0b8a99f5fb2ea07cb95f91e", "score": "0.58223516", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "81a4d8db7c7897736f3ec49e9e929bc4", "score": "0.5821048", "text": "def redirect(*a)\n r(302,'','Location'=>URL(*a).to_s)\n end", "title": "" }, { "docid": "668ff3625fb55e1987b79a4f8c009a0d", "score": "0.58059645", "text": "def old_redirect\n redirect_to \"http://old.pittlandia.net/#{params[:year]}/#{params[:month]}/#{params[:day]}/#{params[:slug]}/\"\n end", "title": "" }, { "docid": "21c85dbc76ab363f98d4c238a1f1ce3d", "score": "0.5798819", "text": "def update\n utms = parse_utm_parameters\n check_protocol_on_url\n respond_to do |format|\n if @url.update(url_params.merge(utms))\n format.html { redirect_to @url, notice: 'Url was successfully updated.' }\n format.json { render :show, status: :ok, location: @url }\n else\n format.html { render :edit }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "465f687f1ceca403097c232b1322930f", "score": "0.5796363", "text": "def redirect_away(*params)\n session[:original_uri] = request.request_uri\n redirect_to(*params)\n end", "title": "" }, { "docid": "465f687f1ceca403097c232b1322930f", "score": "0.5796363", "text": "def redirect_away(*params)\n session[:original_uri] = request.request_uri\n redirect_to(*params)\n end", "title": "" }, { "docid": "465f687f1ceca403097c232b1322930f", "score": "0.5796363", "text": "def redirect_away(*params)\n session[:original_uri] = request.request_uri\n redirect_to(*params)\n end", "title": "" }, { "docid": "465f687f1ceca403097c232b1322930f", "score": "0.5796363", "text": "def redirect_away(*params)\n session[:original_uri] = request.request_uri\n redirect_to(*params)\n end", "title": "" }, { "docid": "57b3b90b6652b9665d321233ad9231eb", "score": "0.5793756", "text": "def update!(**args)\n @redirect_uri = args[:redirect_uri] if args.key?(:redirect_uri)\n end", "title": "" }, { "docid": "2fc45fcaf8f8571d9463bfd34f89f156", "score": "0.579268", "text": "def redirect_away(*params)\n session[:original_uri] = session[:original_request_before_auth]\n redirect_to(*params)\n end", "title": "" }, { "docid": "8a26f4160df734e64148355f276904c8", "score": "0.5791829", "text": "def add_tag_params_and_redirect(tag)\n new_params = add_tag_params(tag)\n\n # Delete page, if needed.\n new_params.delete(:page)\n\n Blacklight::Solr::FacetPaginator.request_keys.values.each do |paginator_key|\n new_params.delete(paginator_key)\n end\n new_params.delete(:id)\n\n # Force action to be index.\n new_params[:action] = \"index\"\n new_params\n end", "title": "" }, { "docid": "02e503c045e750ceeef93bd96425e003", "score": "0.5791521", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "02e503c045e750ceeef93bd96425e003", "score": "0.5791521", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "9da05f0e41bec419dda4fb48cca08f56", "score": "0.57910705", "text": "def back_path(new_params: {}, rescue_path: root_path) \n # rescue in case referrer_url is missing\n referrer_url = URI.parse(request.referrer) rescue URI.parse(rescue_path) \n\n if new_params.any?\n referrer_url.query = add_query_parameters(referrer_url: referrer_url, \n new_params: new_params)\n end\n referrer_url.to_s\n end", "title": "" }, { "docid": "75b035f046a9a014198d9769f05c465e", "score": "0.5788251", "text": "def refresh_or_redirect_to(url, **options)\n turbo_native_action_or_redirect url, :refresh, :to, options\n end", "title": "" }, { "docid": "8a1f286bd3fa72561631dac71fb60731", "score": "0.57791144", "text": "def redirect(options = {})\r\n end", "title": "" }, { "docid": "7080e4f47b9dfe0a056ab7368cc2377a", "score": "0.57781744", "text": "def redirect_away(*params)\n session[:original_uri] = request.request_uri\n redirect_to(*params)\n end", "title": "" }, { "docid": "ebe18cd60645713677d80a98f1d9fd0a", "score": "0.5771112", "text": "def redirect_params\n params.require(:redirect).permit(:rule, :new_url)\n end", "title": "" }, { "docid": "f8f67e0c58370243df3100baf5ee9f30", "score": "0.5770211", "text": "def add_param_to_url tmp_url, param\n if tmp_url.include?(\"?\")\n tmp_url += \"&\"\n else\n tmp_url += \"?\"\n end\n tmp_url += param\n tmp_url\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "e812f3c71850f753c3a1d42f7cf65169", "score": "0.5765085", "text": "def update!(**args)\n @url = args[:url] if args.key?(:url)\n end", "title": "" }, { "docid": "ff1160f8392a9a007f9ddeae85e15ebd", "score": "0.5761148", "text": "def update\n __log_activity\n __debug_route\n prm = url_parameters\n flags = prm.delete(:flags)\n prm.merge!(flags) if flags.present? && flags.is_a?(Hash)\n AppSettings.update(prm) if prm.present?\n # noinspection RubyResolve\n redirect_to settings_admin_path\n end", "title": "" }, { "docid": "e3614cc6e4766ee5e67b13cf55cdbac7", "score": "0.57557726", "text": "def set_url\n # @url = Url.find_by({shortened: params[:shortened]})\n @url = Url.find(params[:shortened])\n end", "title": "" }, { "docid": "0d85b11721eeb72b653c8148826ef099", "score": "0.5753524", "text": "def PO301=(arg)", "title": "" }, { "docid": "4e86be0f644569b5deffad3d9eb619ba", "score": "0.57523155", "text": "def url_add_parameters(url, parameters)\n url += '?'\n parameters.each do | k, v|\n url += \"#{k.to_s}=#{v.to_s}&\"\n end\n url.sub(/&$/, '') #remove trailing &\n end", "title": "" }, { "docid": "2bd7d8e43543dbf6a0e6ba6aeac05f23", "score": "0.57303697", "text": "def change_arm\n session[:current_arm_id]=params[:arm][:id]\n render :update do |page|\n page << \"location.href = '#{request.referrer.sub(/arm_id=\\d+/, \"arm_id=#{session[:current_arm_id]}\")}';\" #' - please leave this here to avoid a syntax highlighting bug in Aptana\n end\n end", "title": "" } ]
be607b46a1ea34ca8af06bff2ece5c6a
Returns the name of the column.
[ { "docid": "a8fc3b8f531fc4809c6ce786ed499fa7", "score": "0.0", "text": "def name\n return @args[:data][:Field]\n end", "title": "" } ]
[ { "docid": "8d08173b61cff9f3bc990b5305bbe4c3", "score": "0.9024783", "text": "def name\n column.name\n end", "title": "" }, { "docid": "6d42db251277227c38fce2cc3b738a20", "score": "0.900952", "text": "def name\n column.name\n end", "title": "" }, { "docid": "7fcb8fa24da79750e06d1ab712e91276", "score": "0.8983926", "text": "def column_name\n return @column_name\n end", "title": "" }, { "docid": "0e6aad38de3d749e71fc9d99c286c97a", "score": "0.8922377", "text": "def column_name\n name\n end", "title": "" }, { "docid": "0e6aad38de3d749e71fc9d99c286c97a", "score": "0.8922377", "text": "def column_name\n name\n end", "title": "" }, { "docid": "e8f96f3a34ab7a7719ac9be7d2f4bad1", "score": "0.8618668", "text": "def name\n @name ||= @column.name\n end", "title": "" }, { "docid": "5bae7cf9730a9d59c00d037bc6872c89", "score": "0.85576046", "text": "def column_name\n self.class.column_name\n end", "title": "" }, { "docid": "c589b9b68e2ff60e711739909d2aa287", "score": "0.85322464", "text": "def name\n column_name\n end", "title": "" }, { "docid": "513278778a2b9dd82f7144b315271190", "score": "0.83811307", "text": "def getColumnName\n\t\t\n\t\t\t\t\treturn @columnName\n\t\t\t\n\t\t\t\tend", "title": "" }, { "docid": "7d00d6026ae3b8d72c3a69b8962a1f05", "score": "0.8352458", "text": "def column_name(column)\r\n end", "title": "" }, { "docid": "cbc7ba5dac96a7305dc80ea92a43b129", "score": "0.7852235", "text": "def column_name=(value)\n @column_name = value\n end", "title": "" }, { "docid": "97c18627820f05202087b9e091011dd2", "score": "0.783659", "text": "def column_for(col_name)\n col_name if has_column?(col_name)\n end", "title": "" }, { "docid": "56d944e7834962baeace74481cf35338", "score": "0.7803837", "text": "def column_name(index)\r\n end", "title": "" }, { "docid": "3e17262a9d3087580ae426082edd6898", "score": "0.777666", "text": "def name\n column ? self.class.name_for_column(column) : self.class.name_for_klass(klass)\n end", "title": "" }, { "docid": "a74149a16683c6be67ce92de5b815855", "score": "0.7688937", "text": "def column\n @__column__\n end", "title": "" }, { "docid": "9aee0dfa0bade271c119a9fe71a684d4", "score": "0.7666165", "text": "def get_column_name_string\n @columns.keys.sort_sym.escape.join(', ')\n end", "title": "" }, { "docid": "add1e9e1d4e45d0b6f7668dda76c1a95", "score": "0.76643884", "text": "def getColumn()\n return @column\n end", "title": "" }, { "docid": "23fa1226d336a422841ddc2e623868b7", "score": "0.76056343", "text": "def column column = nil\n @column = column.to_sym if column\n @column\n end", "title": "" }, { "docid": "f74312b46b46331647f9a803ff1e2bd3", "score": "0.7574782", "text": "def column_name\n name.presence || label.to_s_default\n end", "title": "" }, { "docid": "3f4d02459a0ea171c70a22ae22095137", "score": "0.7573734", "text": "def column(name)\n @columns[name]\n end", "title": "" }, { "docid": "f9169198e8b4f48be0e7a443c7c9592b", "score": "0.7551056", "text": "def column(name)\n @columns[name]\n end", "title": "" }, { "docid": "c2c21c3e658f8e639279d4efb4a7776f", "score": "0.7539044", "text": "def col(name)\n query_table[name.to_s]\n end", "title": "" }, { "docid": "d60c7e31656b1a0005abc05a278da32a", "score": "0.7516412", "text": "def name_column(record)\n n = record.name\n return \"#{googlethis(n)} #{n}\"\n end", "title": "" }, { "docid": "88252d88bc90356f714c04fa0ddc07a7", "score": "0.75147784", "text": "def standard_column_name column_name\n column_name.to_s.gsub(/ /, '_').downcase.to_sym\n end", "title": "" }, { "docid": "d82a9ba57376614dacc7bc4bc365d26a", "score": "0.7489598", "text": "def column\n self.class.column\n end", "title": "" }, { "docid": "ab7f1b2d5c17de041ca08002ffaa5172", "score": "0.7463185", "text": "def migration_name_column\n @migration_name_column ||= quote_column_name('migration_name')\n end", "title": "" }, { "docid": "39478d2d8a84d9ef0bbe20d91487995f", "score": "0.74441856", "text": "def column\n klass.columns_hash[field.to_s]\n end", "title": "" }, { "docid": "39478d2d8a84d9ef0bbe20d91487995f", "score": "0.74441856", "text": "def column\n klass.columns_hash[field.to_s]\n end", "title": "" }, { "docid": "c8272780a57717241a52874a6810f154", "score": "0.74231774", "text": "def column_for_attribute(name)\n self.class.columns_hash[name.to_s]\n end", "title": "" }, { "docid": "e4d5615130bfa5e0eec1f82dca1c3018", "score": "0.7417678", "text": "def column_name stats_col,source\n return \"#{source.name}_#{stats_col}\".to_sym\n end", "title": "" }, { "docid": "18d9729b30220f5c7046b87677711420", "score": "0.7413756", "text": "def column\n \"\"\n end", "title": "" }, { "docid": "91a312eb14179474eb634ce13429e773", "score": "0.7396969", "text": "def column_names\n columns.map { |c| c.name }\n end", "title": "" }, { "docid": "49a9175f2c059fba41c18f06b33428d0", "score": "0.73938334", "text": "def column_for(name)\n self.class.columns.select { |column| column.name == name }.first\n end", "title": "" }, { "docid": "33775796b257923d39c1a22f32eb0cab", "score": "0.7378446", "text": "def column_for_attribute(name)\n self.class.columns_hash[name.to_s]\n end", "title": "" }, { "docid": "33775796b257923d39c1a22f32eb0cab", "score": "0.7378446", "text": "def column_for_attribute(name)\n self.class.columns_hash[name.to_s]\n end", "title": "" }, { "docid": "36f402dd397fcd5f741044fed51c1d66", "score": "0.7342206", "text": "def railsy_column_name(column)\n name = railsy_name(column.name)\n name = name.sub(%r{^is_}, '') if column.type == :boolean\n\n name\n end", "title": "" }, { "docid": "60a3e468f483abcec611209f10b2a499", "score": "0.7331759", "text": "def name_column(record)\n return \"#{googlethis(record.name)} #{record.name}\"\n end", "title": "" }, { "docid": "d23eda9c3ee2587fd44c072e68643914", "score": "0.7328645", "text": "def column_for_attribute(name)\n self.class.attributes[name.to_s]\n end", "title": "" }, { "docid": "246f1862087fd7a19a7cbbfada5da7d7", "score": "0.73235697", "text": "def get_column_name(col_or_sym)\n if col_or_sym.is_a?(Symbol)\n col_or_sym\n else\n col_or_sym.name\n end\n end", "title": "" }, { "docid": "41c93efa279eadd869a7245836ae8b96", "score": "0.73176056", "text": "def column name\n vector[name]\n end", "title": "" }, { "docid": "41c93efa279eadd869a7245836ae8b96", "score": "0.73176056", "text": "def column name\n vector[name]\n end", "title": "" }, { "docid": "41c93efa279eadd869a7245836ae8b96", "score": "0.73176056", "text": "def column name\n vector[name]\n end", "title": "" }, { "docid": "b8fe0a736494bb06783ef11197fe7bae", "score": "0.730901", "text": "def sql_column_name(column, options = {})\n return false unless is_sql_column?(column)\n sql = datasource_columns[column][:sql]\n return column.to_s if sql == true\n\n parts = []\n parts << sql[:table] if sql[:table] && !sql[:column].is_a?(String)\n parts << (sql[:column] || column).to_s\n sql_name = parts.join('.')\n\n sql_name << \" #{column}\" if options[:with_alias]\n sql_name\n end", "title": "" }, { "docid": "4b977b06c629a92f761ab8fd0fc851d6", "score": "0.7286657", "text": "def format_export_column_header_name(column)\n column.label\n end", "title": "" }, { "docid": "3c631c01f3a5b680e824c4ac47d0fcf2", "score": "0.7249619", "text": "def right_col_name\n self.class.right_col_name\n end", "title": "" }, { "docid": "4a88eb7b63996e237667de2917fde444", "score": "0.72428596", "text": "def quote_column_name(name)\n name.to_s\n end", "title": "" }, { "docid": "efdfeb39a67fb9131269b69d0c71213a", "score": "0.7240037", "text": "def column ix\n @table_column_model.column(ix)\n end", "title": "" }, { "docid": "48feff961be911cdf210d40235191d76", "score": "0.7230029", "text": "def column(column_name)\n self.columns.select{ |c| c.name == column_name }\n end", "title": "" }, { "docid": "1120ebd5aea589767e1f02c194758ffc", "score": "0.72136176", "text": "def name_for_column(column)\n \"#{column.name}_#{condition_name}\"\n end", "title": "" }, { "docid": "fd7d658027cf4d97b7353f8a9dc83a07", "score": "0.71824694", "text": "def quote_column_name(name)\n name\n end", "title": "" }, { "docid": "26dcc7847ab27505a0e7bc3ef6215f1a", "score": "0.7164058", "text": "def column(column_name)\n @columns.detect {|f| f.name == column_name.to_s}\n end", "title": "" }, { "docid": "0208a1793fbfbef6cc390cff0eb5ceee", "score": "0.7141115", "text": "def attribute_column\n connection = owner_class.connection\n \"#{connection.quote_table_name(owner_class.table_name)}.#{connection.quote_column_name(attribute)}\"\n end", "title": "" }, { "docid": "4d6911bbbdc8aaaf37d60690d392ba8e", "score": "0.713061", "text": "def column_names\n # NOTE: We don't use #columns\n # here to avoid the .dup. Premature optimization but eh.\n (@columns || {}).keys\n end", "title": "" }, { "docid": "2c3a43a35a819e396b82828daa22fbd2", "score": "0.70956606", "text": "def probable_column_name(c)\n case c\n when Symbol\n _, c, a = split_symbol(c)\n (a || c).to_sym\n when SQL::Identifier\n c.value.to_sym\n when SQL::QualifiedIdentifier\n col = c.column\n col.is_a?(SQL::Identifier) ? col.value.to_sym : col.to_sym\n when SQL::AliasedExpression\n a = c.alias\n a.is_a?(SQL::Identifier) ? a.value.to_sym : a.to_sym\n end\n end", "title": "" }, { "docid": "dcc54acb975ddf09d8722e764c2ba0f8", "score": "0.7093449", "text": "def get_column(column_name)\n column = self.record_datas.where(column_name:column_name).first\n if column\n column.value\n else\n \"\"\n end\n end", "title": "" }, { "docid": "327835e13bd4d13f8ab7387e11960a46", "score": "0.709155", "text": "def left_col_name\n self.class.left_col_name\n end", "title": "" }, { "docid": "bf2dc6ad5352827ff07faebe87385dd3", "score": "0.7085339", "text": "def name_column\n $tracer.trace(__method__)\n return ToolTag.new(th.className(\"user\").innerText(\"/Name/\"), __method__)\n end", "title": "" }, { "docid": "c006a9abc66d6fe85b677e0167f3b0c2", "score": "0.7066968", "text": "def quoted_column_name\n quote_column_name(column.name)\n end", "title": "" }, { "docid": "b5739011648ba84213e992a498c2e1fd", "score": "0.7046056", "text": "def format_print_list_column_header_name(column)\n column.name.to_s\n end", "title": "" }, { "docid": "4c718af86fa05d7a4f7ec18cd6ecdfef", "score": "0.7045523", "text": "def columnNameOfIndex(index)\n\tend", "title": "" }, { "docid": "cff08c4f9a917467bc7f103582fc4ac4", "score": "0.70453846", "text": "def column_for_attribute(name)\n model_for_property(name).column_for_attribute(name)\n end", "title": "" }, { "docid": "360cddbbfed45536f5af1700d27239be", "score": "0.7042941", "text": "def column_names\n _columns.keys\n end", "title": "" }, { "docid": "25a41718649fff9793e8885cea67cf12", "score": "0.70428646", "text": "def probable_column_name(c)\n case c\n when Symbol\n _, c, a = split_symbol(c)\n (a || c).to_sym\n when SQL::Identifier\n c.value.to_sym\n when SQL::QualifiedIdentifier\n col = c.column\n col.is_a?(SQL::Identifier) ? col.value.to_sym : col.to_sym\n when SQL::AliasedExpression\n a = c.aliaz\n a.is_a?(SQL::Identifier) ? a.value.to_sym : a.to_sym\n end\n end", "title": "" }, { "docid": "94926db84302188525bbbb1c5121ba22", "score": "0.70422256", "text": "def columns_name source\n @monitor.stats.columns.map { |c| column_name(c,source) }\n end", "title": "" }, { "docid": "a8cf0a25399ff48c5fc4de79dbd828b2", "score": "0.70352757", "text": "def column_named(name)\n @_column_hashes[name.to_sym]\n end", "title": "" }, { "docid": "c9524e492dcdcd1314b49cce9baa93ba", "score": "0.701459", "text": "def column\n\t\t@column\n\tend", "title": "" }, { "docid": "9e0fdce96df04f80ac9f3d32a02ccee7", "score": "0.7009428", "text": "def column_names\n @column_names ||= columns.map { |column| column.name }\n end", "title": "" }, { "docid": "9e0fdce96df04f80ac9f3d32a02ccee7", "score": "0.7009428", "text": "def column_names\n @column_names ||= columns.map { |column| column.name }\n end", "title": "" }, { "docid": "aedb114589c084eb46e3506199cbbb90", "score": "0.69898367", "text": "def getName(col)\n\t\tname_columns = []\n\t\tcol.each_with_index do |item, index|\n\t\t\tif item.has_key?(\"sTitle\".to_sym)\n\t\t\t\tname_columns[index] = item.slice(:sTitle).values[0]\n\t\t\tend\n\t\tend\n\t\tname_columns\n\tend", "title": "" }, { "docid": "db3f0b145842a3a5eb63d5c7b9f6cd5d", "score": "0.6985996", "text": "def get_col_names\n @names ||= @column_metadata.collect { |md| md.name }\n end", "title": "" }, { "docid": "d3a6c5222dfdae99d49cd9b5f4370c63", "score": "0.696816", "text": "def current_col\n @table.current_col\n end", "title": "" }, { "docid": "7134ef38f031da417c4a3478302aab3d", "score": "0.6934175", "text": "def full_column_name(column)\n column = column.to_s\n column.include?(\".\") ? column : [table_name, column].join(\".\")\n end", "title": "" }, { "docid": "e05cb73ede6950381c7b996706e5bf90", "score": "0.69299704", "text": "def to_column_name(has_parent=false)\n if @attr_name == nil or @attr_name.empty?\n raise QueryException.new(\"The stats cannot be converted into string column name because the name of the attribute is not set.\")\n end\n \n if (@attr_comp == nil or @attr_comp.empty?) and @attr_mod == nil\n raise QueryException.new(\"The stats cannot be converted into string column name because the comparator of the attribute and the deviation are not set.\")\n end\n \n if @attr_mod != nil\n return @attr_mod+\" \"+@attr_name\n end\n \n if @attr_value == nil or @attr_value.empty?\n return @attr_name+\" \"+@attr_comp \n end\n \n return @attr_name+\" \"+@attr_comp+\" \"+@attr_value;\n end", "title": "" }, { "docid": "363dbd4365c059e558541bb6f9b67bb7", "score": "0.6908459", "text": "def column_names\n @column_names ||= columns.map(&:name)\n end", "title": "" }, { "docid": "a6b11e368e0b5e8ddae833f5e4bc1c31", "score": "0.69077617", "text": "def column()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6a6a6e711317e13b6d88b9eacd839e22", "score": "0.6897117", "text": "def column_name(name_or_alias)\n _column_aliases[name_or_alias] || name_or_alias\n end", "title": "" }, { "docid": "481fa1d145443a9e08b5e293fb263cf8", "score": "0.6896199", "text": "def column_names\n columns.keys\n end", "title": "" }, { "docid": "655c6cf88b6d4212af87abf14c6aefed", "score": "0.6895434", "text": "def column\n @expression.column\n end", "title": "" }, { "docid": "4797a82eaab365a77af3321639cf2130", "score": "0.6879097", "text": "def name_fields()\n return @header['columns_name']\n end", "title": "" }, { "docid": "84f993876d5f9542f13820385990c97a", "score": "0.6876224", "text": "def column\n @column ||= begin\n if klass.columns_hash.has_key?(field.to_s)\n klass.columns_hash[field.to_s]\n else\n raise ActiveRecord::UnknownAttributeError.new(klass, field)\n end\n end\n end", "title": "" }, { "docid": "b79b985c1fffc055fbe4936fe3a08024", "score": "0.6860963", "text": "def column_full_names\n attributes.keys.collect{ |key| \"#{@column_family_name}:#{key}\"}\n end", "title": "" }, { "docid": "739c8f999f2e26cbc79d39c0491a8639", "score": "0.68591255", "text": "def col_names\n table_builder.names\n end", "title": "" }, { "docid": "bb4e477e5249647f344a9e3be65af6f7", "score": "0.6842893", "text": "def column(identifier)\n # @todo replace with Selection\n # Module and aliases?\n columns << identifier.to_s\n end", "title": "" }, { "docid": "1bb8c57fa6c999aa31072f2ce51f0a8c", "score": "0.68397063", "text": "def col col\n\t\treturn @cols[col]\n\tend", "title": "" }, { "docid": "5589d8796ce2ed531328ff4ce06a6c33", "score": "0.68361676", "text": "def column(name)\n defined?(@table_exists) or @table_exists = table_exists?\n if @table_exists\n columns_hash[name.to_s]\n end\n end", "title": "" }, { "docid": "3d8da7a179f2c876a93787363180860c", "score": "0.68349606", "text": "def character\n @column\n end", "title": "" }, { "docid": "2a62e44f89b2e7db8cec4a136f1f372d", "score": "0.6828282", "text": "def formatted_column_name(name)\n name.downcase.gsub(/[^a-z0-9-]/, \"_\").squeeze(\"_\").chomp(\"_\").sub(/^_/, \"\")\n end", "title": "" }, { "docid": "50e4ef9132f00e6bd82baa306f1a264a", "score": "0.68016624", "text": "def column(name)\n Column.new(table: self, name: name)\n end", "title": "" }, { "docid": "87f44718df57d4f87fa644508d54d7f4", "score": "0.6795279", "text": "def name\n return nil if column.blank? || row.blank? || (column.to_i <= 0) || (row.to_i <= 0)\n row_name = (?A..?Z).to_a[(row.to_i)-1].chr\n col_name = (column.to_i < 10) ? '0'+column.to_s : column.to_s\n return row_name+col_name \n end", "title": "" }, { "docid": "b0244e21e9bba932bb9add87b4903c9b", "score": "0.67939", "text": "def getColumn(indexOrName)\n\tend", "title": "" }, { "docid": "ae3cbe8d539aa932fa7ef639c4b1a0d4", "score": "0.67884934", "text": "def column_names\n @column_names || owner.column_names\n end", "title": "" }, { "docid": "2d7a476ae544a8110f99c7c0abb53eb7", "score": "0.6788437", "text": "def column_names\n sanity_check\n return @cols unless @cols.nil?\n @cols = @handle.column_info.collect {|col| col['name'] }\n end", "title": "" }, { "docid": "14729a8124d8623c11b94eed4cbfb773", "score": "0.67847455", "text": "def source_column\n return @source_column\n end", "title": "" }, { "docid": "7b53d1d1c11b9851f5dcdc8a20c2f4d5", "score": "0.6779832", "text": "def column\n \"#{table_name}.#{friendly_id_config.cache_column}\"\n end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" }, { "docid": "30d9ee12dd0fe393a2b7b5e51e1cad89", "score": "0.6778851", "text": "def column; end", "title": "" } ]
b602edf2da8c0a15c60f32675377c187
Pulpotomy antipolyneuritic glossolysis ignominiousness fingerhook tuition Charterist torculus noncirculation kasher preacuteness uniformless Boxfish lithographic contrivement thole taxpaid cognoscible Superestablish officialism underneath vesturer overvaliant pettifogulize
[ { "docid": "d3f33dca8d4f31260981b09013ec6f5d", "score": "0.0", "text": "def embryonary(batterfang, gyrovagues_nassellarian, pronounal_outlier)\n end", "title": "" } ]
[ { "docid": "4b4c31d84039944c5df3f5b1cc980d79", "score": "0.67786133", "text": "def prodigus(faussebrayed_ratoon, laughably_enhydris)\n end", "title": "" }, { "docid": "bd77180c68877091f38f06c7eb1e564d", "score": "0.6624687", "text": "def earnestness_cephaloclasia_preposterous()\n end", "title": "" }, { "docid": "06f16e021189dc9bb376efc9a716c8fc", "score": "0.6575939", "text": "def negro_unsepulcher_theopaschitally()\n cragged_overcultivate(orthodoxally_wigwag, chlorophylligenous, spissated_oes)\n ers_noncrinoid()\n apoplectic_aswail_supersolicitation(heliostatic, trigonometry, lambly_apolousis)\n end", "title": "" }, { "docid": "c0c979315c91738277c43007d1e711d6", "score": "0.6481395", "text": "def stratonical_protomagnate()\n feministic_pantostomatous(progresser, dishmonger)\n quadragesimal_manipulable_phrasemaker(flagrantly_mythologist, autotuberculin)\n end", "title": "" }, { "docid": "bbddeab408012e95c5886a702bd08c54", "score": "0.64082885", "text": "def precipitate_in_isopropanol\n show do\n title \"Precipitate DNA in Isopropanol\"\n\n check \"Add 1 #{MICROLITERS} of glycogen to each tube.\"\n check \"Add 600 #{MICROLITERS} isopropanol to each tube.\"\n note \"Mix by inverting each tube several times.\"\n note \"Centrifuge at 13,000 g for 10 minutes at room temperature.\"\n end\n end", "title": "" }, { "docid": "d0566886d2b02b3fadc403ea790d12e3", "score": "0.64014846", "text": "def pestful(perchromate, unstrategic, hackbuteer)\n magnesial_serpentoid_bobadilian(pupigerous_ooblast, bitten_clockmaker)\n end", "title": "" }, { "docid": "2d24099e25eaa04c2cc9f3acbbcd7059", "score": "0.6384702", "text": "def ppuy; end", "title": "" }, { "docid": "4df8663b26d206fc3686672fbbf29a9c", "score": "0.63703054", "text": "def consist_prereption_tarsitis()\n hexode(reprobatory, ungiven)\n penteteric_strathspey(semipopular, spurmoney_anadenia)\n end", "title": "" }, { "docid": "28e6c567b9b6b4338024f41f34c2140f", "score": "0.6366226", "text": "def traditious_grammatical_unblemishedness()\n paediatry_subarmor(echeneidoid_blazonry, precirculate_luminometer)\n end", "title": "" }, { "docid": "6fe0d95b33dd665f2d020d0194f1b8b7", "score": "0.6338961", "text": "def photesthesis_wouch()\n callitrichidae_subvertible_prerecital(molle, halcyonian_jean-christophe)\n enclitic_unchivalrous()\n end", "title": "" }, { "docid": "381959f7bee024febc4375da1dfe7bf0", "score": "0.62585723", "text": "def tussore_hallucinative_effluvial()\n wheyish_aerotactic()\n preobviously_ziphian_decidedly()\n end", "title": "" }, { "docid": "c1fb0e9632fe148cd94c7c97b4febd91", "score": "0.6257032", "text": "def gospelly_preambulation(ruination_scandicus, chorion_triskele, partisan)\n melanoid_ishpingo_pranked(impolished)\n homopterous(parelectronomy_langsat, glucose)\n end", "title": "" }, { "docid": "affe4000a22435d8cbe72ad52b581488", "score": "0.6174822", "text": "def sicel_workmanlike_pyridinize(thinking_preoral)\n end", "title": "" }, { "docid": "ac961bf36fcab85fc8e14171c1137c1e", "score": "0.6170079", "text": "def pharmacopedic(muddleproof_cucullately, liturgiologist_panspermia)\n end", "title": "" }, { "docid": "195cf42db01f5be50aba54f08a7adaf0", "score": "0.615047", "text": "def knifeman()\n euryalida_pedantocrat_reply(scrappingly, thucydidean_compressible, coeffluent)\n scolopax_bluffable_taistril(mongolian, discounter, udic_jobber)\n saponacity(compresence_shapely)\n end", "title": "" }, { "docid": "1233b594eb87ad97e19152d337e6de86", "score": "0.6107609", "text": "def brachyuranic_incorrespondent()\n hypersensuous(turkis, supersystem)\n ambilevous(witchen, percentably)\n colyum_cacodaemonial_spitzkop(opinatively, honorsman_overstalled, inessentiality)\n end", "title": "" }, { "docid": "6207af68823cbcacdc8ad2249e896b7a", "score": "0.6078908", "text": "def aqueomercurial_bobadil_tautosyllabic()\n hypsochromic_ultonian(nete_regicidal, phototelegraphic, sixtyfold)\n end", "title": "" }, { "docid": "a6778fc2cfea5a03f986845a2e505482", "score": "0.60574424", "text": "def phonetic; end", "title": "" }, { "docid": "0c24d4735f5d4421a641ac324cf2f442", "score": "0.60498995", "text": "def frogfish_beachman(propugnaculum, unguinous_greenheart, unexcepted_dorsum)\n buy_hyalospongia_hectogram()\n end", "title": "" }, { "docid": "9ded9cedf1fcb7f0a81234f02d1638a9", "score": "0.6042869", "text": "def goanna_uncreatedness_blepharitic(thighed, cystogram_contrapolarization, galp_orchitis)\n pinheaded(cheilodipteridae, firecoat, rationale_spiritleaf)\n cellulation?(unremote, antevert_relationary)\n end", "title": "" }, { "docid": "3dee00913bcd7d7dd8046fbfaa1b6d45", "score": "0.60365355", "text": "def sidesplittingly_unobligatory_pauperdom(proteosoma, unquestioningness_tentaculitidae)\n admonishingly_atony()\n spading_frowst_polymastigina(bullwhack, unsingability_internunciary, sourcrout_prodelay)\n end", "title": "" }, { "docid": "a26a7c7eee426283684b478cf6e252ca", "score": "0.6030103", "text": "def petrifier(probational_opulus, subspinous)\n genethliacon_pistle(usherless_sjouke)\n end", "title": "" }, { "docid": "b37290a50751816117e54322a6548bdd", "score": "0.6018457", "text": "def dishonorableness()\n ragwort_yellowrump_spearmanship(masurium_vulsinite, poco, renunciable)\n tchetnitsi()\n cognitive_dowser(underwave)\n end", "title": "" }, { "docid": "190ab8374b0270b1a0799ae2aeff08ab", "score": "0.60125685", "text": "def creosote_bountyless(vowelish_rosminian)\n inheaven_untreadable(spigot)\n end", "title": "" }, { "docid": "d3c7478086c73fd46cc3985607868af1", "score": "0.60102296", "text": "def uselessness_chirpling_distinction(corymbiferous_epicardial)\n end", "title": "" }, { "docid": "73bde02566affbf3daa77cd752553fff", "score": "0.6000446", "text": "def nonofficial_tonetics_arsenhemol()\n concyclically_snipefish_unifocal()\n end", "title": "" }, { "docid": "8672de13a1a44a1af10d30ff911a50ca", "score": "0.5980983", "text": "def perp; end", "title": "" }, { "docid": "8672de13a1a44a1af10d30ff911a50ca", "score": "0.5980983", "text": "def perp; end", "title": "" }, { "docid": "5b4428bc664aed9c732ff49b9e7ed312", "score": "0.59676486", "text": "def sphincteric_chondroxiphoid(slickenside_took)\n end", "title": "" }, { "docid": "e59b8fe4f183e7e48032239f6a3d3eee", "score": "0.5963593", "text": "def potagery(highhandedness)\n trappist(implodent, sprigtail)\n frowstily_outhector_sinisterness()\n intermix_ocydrome(metastrophe)\n end", "title": "" }, { "docid": "ff22a4e2c8306a77abe26b0e6f4dc18e", "score": "0.5961636", "text": "def carpopodite_unformalized()\n sparganiaceae(hippophagy_pamphletwise)\n end", "title": "" }, { "docid": "faeaa84ffcc02b353515febf7780f1ea", "score": "0.59510005", "text": "def enthralldom()\n casefy_pseudonucleolus_oxanilate(overzealously, mononucleosis)\n ascupart()\n end", "title": "" }, { "docid": "661f6578762251e0ba1b7b088786dc55", "score": "0.59477675", "text": "def unparried_parliamentary(galleriidae, bott, egol)\n popgun(subindicative)\n horrorize_ensorcelize()\n end", "title": "" }, { "docid": "49a1ca8e1c5ee73ef7f34449d9f22b25", "score": "0.59396607", "text": "def contentless_adversity_maybloom(presuccessful, filibeg_haggaday, electrical)\n corporification(lanugo)\n kiki(interlucent)\n end", "title": "" }, { "docid": "f144fe2beff61261d3f5c0a81df434d2", "score": "0.5922521", "text": "def torchon_fellage_postappendicular()\n confirmatory(unmoisten, ulysses, keratocentesis_thongy)\n end", "title": "" }, { "docid": "9b1fb38eed86fea6397ee0a8f9992981", "score": "0.5917992", "text": "def blearness_mesophile()\n end", "title": "" }, { "docid": "fb40040d9b588c458841ec4a0a6d35c6", "score": "0.59162587", "text": "def cuttingness_prevolunteer(distinctive_suingly, postconvalescent_septuple, charshaf)\n tylotoxeate_beggarism()\n waratah()\n end", "title": "" }, { "docid": "2a73cecfccc2a9ea7f80fd47569d4b82", "score": "0.58945763", "text": "def phase_one\n\tvoted_out_array = Array.new\n\t8.times do\n\tvoted_out = @borneo.immunity_challenge.tribal_council(no_immune: nil) # Returns the voted out member\n\tvoted_out_array << voted_out \n\tend\n\tprint_losers(voted_out_array)\n\tvoted_out_array.length \nend", "title": "" }, { "docid": "604fc4609660d56a04cb6522ba7997e0", "score": "0.58942866", "text": "def phosis_pluralistically_tattva(unremorsefully_blitum, transmarine_chalazion, saprodil)\n bantu_unforceable_stratagemically?(hypnophobia)\n orthogamous_obesely_saphenal?(ohmic)\n tribesmanship_accountant_frontispiece(scansionist_unfertileness, chinampa_twalpenny, gregal_undomineering)\n end", "title": "" }, { "docid": "8b6694152d58b8878b6ab3786e3e53ff", "score": "0.589338", "text": "def polytomous_peristeronic_snuffliness(exstrophy, anura, campine)\n nemalionales(smudged, pimaric)\n oestrum_hydrogeological(farasula_unreplied, argilliferous_nucleohyaloplasma, hyperpepsinia_phenozygous)\n squamatotuberculate_feria(foolhardiness)\n end", "title": "" }, { "docid": "5b02f4566ca4e8609332347d1f176000", "score": "0.5885167", "text": "def wordsman()\n tensiometer_fahlerz(workmanliness_pirn)\n inchoately(trifolium_doubting)\n cyclopentanone_integer_bedouin(bombycilla_garnel)\n end", "title": "" }, { "docid": "54c549f2281af307b030ab40a9b00ebd", "score": "0.5880469", "text": "def scutigeridae_symphily(unplenished, sandworm_tattoo, essayer)\n brunet_unstrangled_ballistite?(euphemistical, mutistic, gastrophilist_bauchle)\n persephassa_cerumniparous(reutilization_rebrick, apophyge_servilism, perineoplastic_ferfathmur)\n wheedler_synovially(myxa)\n end", "title": "" }, { "docid": "eda4e49205fad7cbe91ab5845c5ef751", "score": "0.58683956", "text": "def reactualization_separableness()\n court(bepreach)\n shoreweed_wormhood_obligant(symphytize_diemaker)\n husbandman_bigwiggedness(altarage, gynandria_parboil, gulaman_cellulase)\n end", "title": "" }, { "docid": "6f82f866c41dd87c2985d3de9a4040e9", "score": "0.5861564", "text": "def papyrine_vasodilation_cataracted()\n magianism_unmentionables_flexuousness(bonedog_microcephalus, polystome_chakari, taikhana)\n unperpendicular_lollardism(atavic, jawfooted)\n cobaltinitrite_discontinuer_anemophilous(hesther_leptomeninx, harpyia_cinquain)\n end", "title": "" }, { "docid": "1f36c306e3ef0236f35acd84af943d61", "score": "0.5856134", "text": "def pigeongram?()\n microreaction_glaked(fringilla, totemism, omnimeter_prologuizer)\n end", "title": "" }, { "docid": "37dd51a636bd4f92c4c4bdb82296b191", "score": "0.5851046", "text": "def frizz_pharmacolite_triaconter()\n end", "title": "" }, { "docid": "1e91950511f986d777e595f33eed42ae", "score": "0.58507407", "text": "def ferulaceous_subastragalar_nosographically()\n clarenceux(vacillatingly, scarring_precolorable)\n sephen_irritableness?(acidiferous_passionlessly, laparosplenectomy)\n end", "title": "" }, { "docid": "c0a2145f8451ff4557de67da098533eb", "score": "0.58447796", "text": "def thigh_fingertip_wright(bisectionally, hemiamblyopia_gutturopalatal)\n elicitation_publicheartedness_dope()\n end", "title": "" }, { "docid": "8fe349d46dbdf2bebaff80086db6e232", "score": "0.5833214", "text": "def protometal_strengthlessly?(gunz_uncongenial, hyperreverential_fictionary)\n end", "title": "" }, { "docid": "c6f64b23939f23caec9c89727b71558c", "score": "0.5820844", "text": "def tyrolienne_predarkness(content_richmondena, swig_spiritualism, pulveraceous)\n centauromachia?(antibasilican_anthrone)\n demagnetize_vizardless_nacreous(mnemonicon_sebiferous, uninquisitorial_vitrinoid)\n kaleyard_riverward_garageman?(foeship_planetist)\n end", "title": "" }, { "docid": "1b63319127cdc3f8e6a090cd0ff2e92b", "score": "0.58181167", "text": "def judaeophile_tripinnated()\n oilily_handcart?(posterity_promachinery, twiningly, standardize)\n end", "title": "" }, { "docid": "44728344125df4b389d715948c53726d", "score": "0.5817592", "text": "def skirting_ananias_lithochromatic(telemeteorographic, pleuropterygii_sternutation)\n campion_vagarity_maudlin(hypereutectic_waxy)\n localist_kerrite_romishly(lolo_myrmecophyte)\n hyperanarchy_mononychous(debasement, micropodidae_personalistic)\n end", "title": "" }, { "docid": "c82a21f1f40940154acfc5930a8d70e9", "score": "0.58160305", "text": "def fresnel_angioclast()\n mellifluent(granary_presentationism, brigander, balanceable)\n unpremeditatedness_crystallometric_overusual?(idiomorphous)\n ideological_synanthetic()\n end", "title": "" }, { "docid": "43e385f6c22a1d866490543e41920359", "score": "0.5815801", "text": "def presentiveness_chrysididae()\n end", "title": "" }, { "docid": "866ad0adb02f78ec45dea2e3df087b96", "score": "0.5809678", "text": "def stylochus_hyperdolichocephaly()\n bedcap_lollipop()\n discontinuousness(nonsurface_overshadowment)\n tilikum_iliopectineal(dioxide_peripatetic)\n end", "title": "" }, { "docid": "5b9b4c430f0e689bb06800c08265e0bc", "score": "0.58067167", "text": "def semiordinate_exormia()\n vinylidene_harvardian()\n tripudiation_unsupervised(caudatolenticular_snuffboxer, trichina_untraced, snakeology)\n end", "title": "" }, { "docid": "427b36412466724e0dc84ad5592ed869", "score": "0.5803923", "text": "def quinquevalence_pliothermic(effervescency_photoelasticity)\n end", "title": "" }, { "docid": "74cfcba14f6245e67446275f0593c764", "score": "0.57991403", "text": "def gulpease\n 89 + (((300 * num_sentences) - (10 * num_chars)) / num_words)\n end", "title": "" }, { "docid": "d8af7704b6d098bd2c2f6621ddb42db7", "score": "0.57918453", "text": "def posession\n noun = mutate_consonants_if_necessary\n return {\n ben: \"benim #{noun}\" + ben_ending,\n sen: \"senin #{noun}\" + sen_ending,\n o: \"onun #{noun}\" + o_ending,\n siz: \"sizin #{noun}\" + siz_ending,\n biz: \"bizim #{noun}\" + biz_ending,\n onlar: \"onların #{noun}\" + onlar_ending\n }\n end", "title": "" }, { "docid": "fda67beadc9755dfc8cde58efdd2f05e", "score": "0.57897496", "text": "def provisor(featherlet, furbishable, bardess_nautiloid)\n interentangle_eductive(phymatidae, blithehearted_adenization, cephalaspis)\n end", "title": "" }, { "docid": "cbcca25feab64a78f21dd043dbcbd00e", "score": "0.5784328", "text": "def discernibleness_pluffer(gelatinotype, chrysoberyl_penguinery)\n sate(stickfast)\n end", "title": "" }, { "docid": "3ac0a998ab943ab9730cb5c834ea2734", "score": "0.5784092", "text": "def demonetize_beng_dispireme()\n paperweight_fretty(prelacy_afrikaans, tablemaking, impatiens_untriumphed)\n meganucleus_convex(unisolable, myriadth)\n end", "title": "" }, { "docid": "758974d8d80e0fdcbd3c4194ca9ee9c0", "score": "0.5783594", "text": "def dinder_dendrochirota(trypanosomatic, vealiness)\n hundredpenny()\n end", "title": "" }, { "docid": "deadef34ddc6ac69a7fa1d308b25e860", "score": "0.5775834", "text": "def montesco(outblacken_princehood, oxyphonia_firlot, tubbable_preinspector)\n end", "title": "" }, { "docid": "6a4563bbf76de05c2239fb7a3114351f", "score": "0.5773827", "text": "def foresinger_leucism(chalybeous)\n end", "title": "" }, { "docid": "8ffdfeabbab52c9f676a378164348d63", "score": "0.57729506", "text": "def unmatrimonial(wholesome, screel, pyrrhotism_preaccommodate)\n end", "title": "" }, { "docid": "9ccc995d14612c3e2960def53c9d4a2d", "score": "0.57526", "text": "def tubulously?(alexipharmacon_scribeship, cryptographical, prostatorrhea_photovisual)\n unpriest_bytownite(evangelistic_asiatican, noncultivation_papilliform, solenostomus)\n end", "title": "" }, { "docid": "8d63a490a7b76b9b269f05c130d670e8", "score": "0.57522947", "text": "def overmerry(practiced, adiaphorism, dermopathic_rebeccaites)\n end", "title": "" }, { "docid": "c554ccccc771d31c83208bf4bfc78d60", "score": "0.57402784", "text": "def preobtrusion_apically?(mastoidectomy, marvelry, diptych_parasympathetic)\n cunarder_bissextile_arc()\n ocular_dehisce_nengahiba()\n scourwort(rhaptopetalaceae_birkremite, tumpline, saliniferous_cystophotography)\n end", "title": "" }, { "docid": "7037e6c2a5b328b380f0de60002f0faa", "score": "0.57397044", "text": "def phase_one\n 8.times do\n loosing_tribe = @borneo.immunity_challenge\n loosing_tribe.tribal_council\n end\nend", "title": "" }, { "docid": "c05892c505250d988529c5fac1d56d35", "score": "0.57378405", "text": "def bounden_undersort_peppin(intercorrelate, flavicant_helly, multitoned_ventriloque)\n physicochemist_clericality(swarthness_astur)\n telacoustic(sowbread_cholesteroluria, placard)\n end", "title": "" }, { "docid": "a09b0f998f9490e6b289920811e45fc8", "score": "0.5734038", "text": "def phase_one\n 8.times do\n voted_off = @borneo.individual_immunity_challenge\n puts \"#{voted_off.name.red} was voted off the island\"\n end\nend", "title": "" }, { "docid": "34924ba1eac9b84c3f9513aa9432766e", "score": "0.57317746", "text": "def punishmentproof(nachani_prewelcome, ultradignified_reinvade, relevy)\n oxycalorimeter_putrefactiveness_hobbyhorsically(photoceramics, glochis, rhytisma_undetermining)\n end", "title": "" }, { "docid": "2d1ef4fd21759951a2194d87312e5311", "score": "0.5729554", "text": "def passive_voice_subjunctive_mood_pastperfect_tense\n count = -1\n TenseBlock.new(PASS_PLUPERF_PAST_ENDINGS.map do |ending|\n count += 1\n (count <= 2 ?\n \"[ #{triplicate_and_genderize @pass_perf_part} ]\" :\n \"[ #{pluralize_participial_listing(triplicate_and_genderize(@pass_perf_part))} ]\" )+ \" \" + ending\n end,\n { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_pastperfect_tense] }\n )\n end", "title": "" }, { "docid": "1b2c78c5974918096176ea7df5059e75", "score": "0.57289004", "text": "def aulophyte()\n presentially_isocarpous_feminist(chrotta, charadrine_ultraconservative)\n sidetrack_ectocondylar(involvedly_aliptic, colony_chromodermatosis, althionic_tumultuously)\n fernsick_bidental_tarlatan()\n end", "title": "" }, { "docid": "3387573cd19c3400cdc8ffc9e5cd809f", "score": "0.57217735", "text": "def rarities ; return {\n :semi_precious => %w(knees)\n } ; end", "title": "" }, { "docid": "4fee0f594744ab90c1223b9817071e6c", "score": "0.5720269", "text": "def sketchability_himwards(manius_scrobiculate, nonbilious, mispleading)\n end", "title": "" }, { "docid": "87be2c338f25c94d5eab71d094cc4619", "score": "0.5718302", "text": "def catch_phrase\n [\n [\"Adaptive\", \"Advanced\", \"Ameliorated\", \"Assimilated\", \"Automated\", \"Balanced\", \"Business-focused\", \"Centralized\", \"Cloned\", \"Compatible\", \"Configurable\", \"Cross-group\", \"Cross-platform\", \"Customer-focused\", \"Customizable\", \"Decentralized\", \"De-engineered\", \"Devolved\", \"Digitized\", \"Distributed\", \"Diverse\", \"Down-sized\", \"Enhanced\", \"Enterprise-wide\", \"Ergonomic\", \"Exclusive\", \"Expanded\", \"Extended\", \"Face to face\", \"Focused\", \"Front-line\", \"Fully-configurable\", \"Function-based\", \"Fundamental\", \"Future-proofed\", \"Grass-roots\", \"Horizontal\", \"Implemented\", \"Innovative\", \"Integrated\", \"Intuitive\", \"Inverse\", \"Managed\", \"Mandatory\", \"Monitored\", \"Multi-channelled\", \"Multi-lateral\", \"Multi-layered\", \"Multi-tiered\", \"Networked\", \"Object-based\", \"Open-architected\", \"Open-source\", \"Operative\", \"Optimized\", \"Optional\", \"Organic\", \"Organized\", \"Persevering\", \"Persistent\", \"Phased\", \"Polarised\", \"Pre-emptive\", \"Proactive\", \"Profit-focused\", \"Profound\", \"Programmable\", \"Progressive\", \"Public-key\", \"Quality-focused\", \"Reactive\", \"Realigned\", \"Re-contextualized\", \"Re-engineered\", \"Reduced\", \"Reverse-engineered\", \"Right-sized\", \"Robust\", \"Seamless\", \"Secured\", \"Self-enabling\", \"Sharable\", \"Stand-alone\", \"Streamlined\", \"Switchable\", \"Synchronised\", \"Synergistic\", \"Synergized\", \"Team-oriented\", \"Total\", \"Triple-buffered\", \"Universal\", \"Up-sized\", \"Upgradable\", \"User-centric\", \"User-friendly\", \"Versatile\", \"Virtual\", \"Visionary\", \"Vision-oriented\"].rand, \n [\"24 hour\", \"24/7\", \"3rd generation\", \"4th generation\", \"5th generation\", \"6th generation\", \"actuating\", \"analyzing\", \"assymetric\", \"asynchronous\", \"attitude-oriented\", \"background\", \"bandwidth-monitored\", \"bi-directional\", \"bifurcated\", \"bottom-line\", \"clear-thinking\", \"client-driven\", \"client-server\", \"coherent\", \"cohesive\", \"composite\", \"context-sensitive\", \"contextually-based\", \"content-based\", \"dedicated\", \"demand-driven\", \"didactic\", \"directional\", \"discrete\", \"disintermediate\", \"dynamic\", \"eco-centric\", \"empowering\", \"encompassing\", \"even-keeled\", \"executive\", \"explicit\", \"exuding\", \"fault-tolerant\", \"foreground\", \"fresh-thinking\", \"full-range\", \"global\", \"grid-enabled\", \"heuristic\", \"high-level\", \"holistic\", \"homogeneous\", \"human-resource\", \"hybrid\", \"impactful\", \"incremental\", \"intangible\", \"interactive\", \"intermediate\", \"leading edge\", \"local\", \"logistical\", \"maximized\", \"methodical\", \"mission-critical\", \"mobile\", \"modular\", \"motivating\", \"multimedia\", \"multi-state\", \"multi-tasking\", \"national\", \"needs-based\", \"neutral\", \"next generation\", \"non-volatile\", \"object-oriented\", \"optimal\", \"optimizing\", \"radical\", \"real-time\", \"reciprocal\", \"regional\", \"responsive\", \"scalable\", \"secondary\", \"solution-oriented\", \"stable\", \"static\", \"systematic\", \"systemic\", \"system-worthy\", \"tangible\", \"tertiary\", \"transitional\", \"uniform\", \"upward-trending\", \"user-facing\", \"value-added\", \"web-enabled\", \"well-modulated\", \"zero administration\", \"zero defect\", \"zero tolerance\"].rand,\n [\"ability\", \"access\", \"adapter\", \"algorithm\", \"alliance\", \"analyzer\", \"application\", \"approach\", \"architecture\", \"archive\", \"artificial intelligence\", \"array\", \"attitude\", \"benchmark\", \"budgetary management\", \"capability\", \"capacity\", \"challenge\", \"circuit\", \"collaboration\", \"complexity\", \"concept\", \"conglomeration\", \"contingency\", \"core\", \"customer loyalty\", \"database\", \"data-warehouse\", \"definition\", \"emulation\", \"encoding\", \"encryption\", \"extranet\", \"firmware\", \"flexibility\", \"focus group\", \"forecast\", \"frame\", \"framework\", \"function\", \"functionalities\", \"Graphic Interface\", \"groupware\", \"Graphical User Interface\", \"hardware\", \"help-desk\", \"hierarchy\", \"hub\", \"implementation\", \"info-mediaries\", \"infrastructure\", \"initiative\", \"installation\", \"instruction set\", \"interface\", \"internet solution\", \"intranet\", \"knowledge user\", \"knowledge base\", \"local area network\", \"leverage\", \"matrices\", \"matrix\", \"methodology\", \"middleware\", \"migration\", \"model\", \"moderator\", \"monitoring\", \"moratorium\", \"neural-net\", \"open architecture\", \"open system\", \"orchestration\", \"paradigm\", \"parallelism\", \"policy\", \"portal\", \"pricing structure\", \"process improvement\", \"product\", \"productivity\", \"project\", \"projection\", \"protocol\", \"secured line\", \"service-desk\", \"software\", \"solution\", \"standardization\", \"strategy\", \"structure\", \"success\", \"superstructure\", \"support\", \"synergy\", \"system engine\", \"task-force\", \"throughput\", \"time-frame\", \"toolset\", \"utilisation\", \"website\", \"workforce\"].rand\n ].join(' ')\n end", "title": "" }, { "docid": "35a10d9d93382be95a3059eeef3134c9", "score": "0.57082134", "text": "def slingshot?(ethological_pigment, tubulodermoid)\n rehollow_succinct_precounsellor()\n physalian(sabdariffa, triantaphyllos_electrothermic, hilus)\n mazopathia_stalinite_recircle(scolopax_discharger, menorrheic)\n end", "title": "" }, { "docid": "2910585fa11924593e767110851b12a9", "score": "0.5705855", "text": "def irate()\n turbith_pycnodontoid(scutated_demonian, sheetlike, premisrepresent_balneal)\n disculpate_metrometer_sublimer(refractility_lysigenously, crubeen)\n preciseness_alum(alkekengi_dumminess, unrelaxed_phototrophy, tersulphide)\n end", "title": "" }, { "docid": "467fd92ce3b93b9b9cebff4243a78b15", "score": "0.57050765", "text": "def indefinite_possessive_pronoun\r\n return \"their\"\r\n end", "title": "" }, { "docid": "021b25dc3ce661ba803063a030d9b804", "score": "0.5703173", "text": "def take_bath \n self.hygiene += 4\n \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "title": "" }, { "docid": "6bc2ebaba9a2aae07a6f6388e6af097c", "score": "0.5701707", "text": "def collyrium_phylacobiosis(paralogism)\n end", "title": "" }, { "docid": "e9aa5cd78000cdbef6a7d00d18148768", "score": "0.57001674", "text": "def learn_proper_etiquette\n @db.train_from_file\n\n p \"Arthur::PrinceOfWales is now ready to converse.\"\n end", "title": "" }, { "docid": "527cd6eeb497ea9e238e3c90b5a61b6f", "score": "0.56963384", "text": "def somatognostic_impolite()\n inquiline(unstuffed_erogeny, thromboangiitis)\n end", "title": "" }, { "docid": "752eca34d2f67a25cb967cff7ef416f6", "score": "0.569135", "text": "def ttr_within_verbs(language) # see 3.3\n delete_empty_strings = true\n markers_verb1 = []\n markers_verb2 = []\n markers_verb3 = []\n verbstems_noun1 = []\n verbstems_noun2 = []\n \nlanguage.each_index do |phraseind| #\"phrase\" is used here and elsewhere as a synonym to \"sentence\"\n\tphrase = language[phraseind]\n if phrase #if not nil (doesn't happen in practice!)\n\t phrase = phrase.strip \n verb = phrase.split(\" \")[1].to_s\n if [2, 3, 4, 10, 11, 12].include?(phraseind) #first noun\n verbstems_noun1 << verb[0].to_s\n elsif [5, 6, 7, 13, 14, 15].include?(phraseind) #second noun\n verbstems_noun2 << verb[0].to_s\n end\n\n if [2, 5, 10, 13].include?(phraseind) #first verb\n markers_verb1 << verb[-1].to_s #taking the LAST symbol of the verb (empty string if there no verb)\n elsif [3, 6, 11, 14].include?(phraseind) #second verb\n markers_verb2 << verb[-1].to_s\n elsif [4, 7, 12, 15].include?(phraseind) #third verb\n markers_verb3 << verb[-1].to_s\n end\n \n else \n STDERR.puts \"Nil phrase!!!\"\n end\n end\n if delete_empty_strings\n [verbstems_noun1, verbstems_noun2, markers_verb1, markers_verb2, markers_verb3].each do |array|\n array.delete(\"\")\n end\n end\n\n ttr_marker_per_verb = (speakercomplexity1_norm(markers_verb1) + speakercomplexity1_norm(markers_verb2) + speakercomplexity1_norm(markers_verb3))/3.0\n ttr_stem_per_noun = (speakercomplexity1_norm(verbstems_noun1) + speakercomplexity1_norm(verbstems_noun2))/2.0\n \n return [ttr_marker_per_verb, ttr_stem_per_noun]\nend", "title": "" }, { "docid": "e05cc8ea5e79e372388e99984c1ccb70", "score": "0.5690556", "text": "def polypeptide_pygargus(punctator, unidentate_charier)\n bindwith_amoebous_villanously(tewsome, tantalic, bindlet_unshaped)\n hydroxylactone_adamantoblastoma_thanehood()\n fetalization_confidency_homoeomorphous(discourse_taffymaker, unimposedly_cobelief, xiphiiform_ignominiousness)\n end", "title": "" }, { "docid": "dbf06fa6344052901d2323e6aad3be69", "score": "0.56862205", "text": "def cotys_consummation()\n gladeye_tuberaceae(micro, glyptographic)\n diminutival()\n victualry()\n end", "title": "" }, { "docid": "5e8408dfcd45a4da3b93c034b38bd2ef", "score": "0.5676782", "text": "def amplify_loblolly()\n crambid_intertransverse()\n chromatographic_reconvalescent()\n underprize_contentedness()\n end", "title": "" }, { "docid": "e8cedb8cd05b16626be19000b44dbed8", "score": "0.5668774", "text": "def outgauge(profanism, inapparent, verbalizer)\n abscessed_jumboesque_pobby?(apocha_vertebrosacral, ferroalloy_hyponychium)\n sidecarist_helmless(unangelical, nettion_sassolite, loke_nondelineation)\n revictorious_heteradenia_norbertine(ehatisaht_chattelship, artinite_melanistic)\n end", "title": "" }, { "docid": "8d0ece11ecaf2a99ee24f9d0189a96e8", "score": "0.5666162", "text": "def possessive_noun\n random_noun :possessive\n end", "title": "" }, { "docid": "16441932d9b4e872caa01a66289293ae", "score": "0.5664381", "text": "def poecilonymy_epimeric_hypogastric(preblessing_lumine, diuturnal, pleacher_cystencyte)\n wanderingly_execution(viertel_nonracial)\n epicardium_pugmill(heder_thurible)\n end", "title": "" }, { "docid": "321443ea878247d6a2d6c723c512d7e1", "score": "0.566395", "text": "def perfect_passive_infinitive\n return perfect_passive_participle + \" esse\"\n end", "title": "" }, { "docid": "2c0faae05fb61bee3f76c56e3d973f5e", "score": "0.5661989", "text": "def puborectalis_supertoleration(archaicism_magnetometrical, merosomatous_kinetograph)\n relentlessly_heteromya_connubially(imitatee_myxospore)\n quinone_unintuitive(alveolonasal_oversize)\n aspidobranchiate_autoagglutinin_emboliform()\n end", "title": "" }, { "docid": "7b81e9d3c3e07722311610af2fccb893", "score": "0.5660174", "text": "def habu_caravanserial_hypopharynx(permoralize)\n unintermitted_undecipherable(hepatodysentery, ethide_repreparation, suppressedly_cuteness)\n recitable_iodinophilic_refrigerator(critical_bemail, shipwreck_fluor, gnomical)\n end", "title": "" }, { "docid": "b1076d0750ca5eb5d60aba958aa7b927", "score": "0.56576836", "text": "def hypostypsis_unsolidly(alkalemia, quinizarin)\n alexandrina_litster_microprojector(cowleech_ethnobiology)\n economite_fishingly(semiclause, polyoxide)\n gracilescent_appropriativeness(sporter_paraconscious, theoretician)\n end", "title": "" }, { "docid": "133af225f040e338ec865f39e487764a", "score": "0.5656005", "text": "def outjet_textualism(prickmedainty_trudgen)\n end", "title": "" }, { "docid": "675260b8f7353493837ff90cac14b2b0", "score": "0.56544006", "text": "def nonorganization_reintimation_measuredly()\n prediscontinue_arrowed_feal(prevailingly)\n vividialysis(epicede_vanillate, sceuophylacium_arabesquely)\n unpooled()\n end", "title": "" }, { "docid": "ca8db919d1c88cde6fe91012fb59af11", "score": "0.56516474", "text": "def preadvertent_importunance_undissoluble(troglodytish, musical, tutrice_cryptopapist)\n tritaph()\n end", "title": "" }, { "docid": "908a75d2715d45fa47a68ef923e9a084", "score": "0.564996", "text": "def sereward_laking_tuchunize()\n end", "title": "" }, { "docid": "72810e7f0cc2c896e2a30e441a3773ca", "score": "0.5647088", "text": "def antapocha_bunchflower_handfast()\n bousy_chappow()\n unsquelched_letchy_upsweep(oreotrochilus)\n isospondyli(promuscidate, scentlessness_chlamydospore, sailorproof_anthologist)\n end", "title": "" } ]
4e1ee086109f73a1218172bd85c3c691
Because FormBuilder::select only updates ids and not object references, we need this before_validation callback to sync these two in order to ensure that we pass validation.
[ { "docid": "47e5440643080166ced3b7b94e76d702", "score": "0.0", "text": "def fix_up_references\n if self.sub_task_type.nil? and !self.sub_task_type_id.nil?\n self.sub_task_type = SubTaskType.find(self.sub_task_type_id)\n end\n if self.task.nil? and !self.task_id.nil?\n self.task = Task.find(self.task_id)\n end\n end", "title": "" } ]
[ { "docid": "b4ac939221b9c2e5116401803b57ed1a", "score": "0.6233045", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:status_code => self.status_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_status\n\t end\nend", "title": "" }, { "docid": "6dddab25a6ba78bb739a65cb2dc07813", "score": "0.62327623", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:track_slms_indicator_code => self.track_slms_indicator_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_track_slms_indicator\n\t end\n\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:rmt_variety_code => self.rmt_variety_code}],self)\n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_forecast_variety\n\t end\nend", "title": "" }, { "docid": "df0fc9d3bec839bdcb7276edbe70d2e6", "score": "0.6209903", "text": "def validate\n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_id => self.location_id}],self)\n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_location\n\t end\nend", "title": "" }, { "docid": "12ca3ba6ebb563a6205fb9f28950694e", "score": "0.61917984", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_id => self.location_id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_precool_job\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:facility_type_code => self.facility_type_code},{:facility_code => self.facility_code},{:id => self.id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_facility\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_location\n\t end\nend", "title": "" }, { "docid": "68aaf8c8b65ed882d737ea5231c184ee", "score": "0.61871517", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t# is_valid = ModelHelper::Validations.validate_combos([{:id => self.id},{:farm_code => self.farm_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_farm\n\t end\n\t if is_valid\n\t\t #is_valid = ModelHelper::Validations.validate_combos([{:season_code => self.season_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_season\n#\t end\nend", "title": "" }, { "docid": "fb0e26afb08b92d4b776985004457245", "score": "0.6173351", "text": "def before_validation_on_update() end", "title": "" }, { "docid": "1712882d2b91b7432c24be08bb091595", "score": "0.6126117", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code},{:rmt_variety_code => self.rmt_variety_code},{:spray_result => self.spray_result},{:spray_program_code => self.spray_program_code}],self) \n\tend\n\t\n\t\n\t\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_rmt_variety\n\t end\n\t if is_valid\n\t#\t is_valid = ModelHelper::Validations.validate_combos([{:farm_id => self.farm_id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_spray_program_result\n\t end\nend", "title": "" }, { "docid": "d15627de360e6730ecd71fba3916ac49", "score": "0.60959655", "text": "def validate\n#\tfirst check whether combo fields have been selected\n is_valid = true\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:stack_type_code => self.stack_type_code}, {:id => self.id}], self)\n end\n #now check whether fk combos combine to form valid foreign keys\n if is_valid\n is_valid = set_stack_type\n end\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:load_number => self.load_number}], self)\n end\n #now check whether fk combos combine to form valid foreign keys\n if is_valid\n is_valid = set_load\n end\n end", "title": "" }, { "docid": "3196bf942d64aed26de845e31c61086b", "score": "0.6069275", "text": "def validate\n#\tfirst check whether combo fields have been selected\n is_valid = true\n\n #if is_valid\n # is_valid = ModelHelper::Validations.validate_combos([{:facility_code => self.facility_code}],self)\n #end\n #now check whether fk combos combine to form valid foreign keys\n if is_valid\n is_valid = set_facility\n end\n\n if is_valid\n is_valid = set_location_type_code\n end\n end", "title": "" }, { "docid": "b763f0f8193664640728bac14207ab22", "score": "0.6017762", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:drench_line_type_code => self.drench_line_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_drench_line_type\n\t end\nend", "title": "" }, { "docid": "796116a03e2b85f59e78e9c9ba7c5317", "score": "0.60087436", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:id => self.id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_bin_order\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:pack_material_product_code => self.pack_material_product_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_pack_material_product\n\t end\nend", "title": "" }, { "docid": "7a05f21d46d71547c9c64d79353e6f41", "score": "0.5991523", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:drench_line_code => self.drench_line_code}],self) \n#\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_drench_line\n\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:resource_code => self.resource_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_resource\n#\t end\nend", "title": "" }, { "docid": "2d365300175835744bbe0b06222e9c77", "score": "0.597314", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:inv_code => self.inv_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_inventory_code\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:short_description => self.short_description}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_organization\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "d528ec7b40280422ea392b030324578f", "score": "0.5971139", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:product_code => self.product_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_product\n\t end\nend", "title": "" }, { "docid": "a5ac259219f6bb930ac3c2d633d333f6", "score": "0.59554577", "text": "def validate\n #\tfirst check whether combo fields have been selected\n is_valid = true\n #validates uniqueness for this record\n end", "title": "" }, { "docid": "2de9f3d253455c90e5bce187a4c6c689", "score": "0.59428954", "text": "def validate\n super\n \tvalidates_unique [:choice_id, :career_id] \n end", "title": "" }, { "docid": "3f7643030e0b714dacabfabdca276435", "score": "0.59168357", "text": "def validate\n#\tfirst check whether combo fields have been selected\n#\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:order_number => self.order_number},{:customer_party_role_id => self.customer_party_role_id}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_order\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:id => self.id},{:vehicle_job_number => self.vehicle_job_number}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_vehicle_job\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:load_number => self.load_number}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_load\n#\t end\n end", "title": "" }, { "docid": "5a99719daed7d5fc9dd8a360c4f1c262", "score": "0.590795", "text": "def before_validation_on_update\n before_validation_on_create\n end", "title": "" }, { "docid": "5a99719daed7d5fc9dd8a360c4f1c262", "score": "0.590795", "text": "def before_validation_on_update\n before_validation_on_create\n end", "title": "" }, { "docid": "3ba2032151b0e2c7146519ea1eefe472", "score": "0.5900571", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:status_type_code => self.status_type_code}],self)\n#\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_status\n\t end\n\t#validates uniqueness for this record\n#\t if self.new_record? && is_valid\n#\t\t validate_uniqueness\n#\t end\nend", "title": "" }, { "docid": "3178f66c8f895c8ee1d01cdfe6e3f608", "score": "0.5881595", "text": "def after_validation_on_update() end", "title": "" }, { "docid": "7dc993913720e2b172b2092c1e3efe2a", "score": "0.5880133", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:country => self.country},{:club_name => self.club_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_golf_club\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "bc57b985dc7d483836bdb82a2e4f8c91", "score": "0.5879921", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:farm_code => self.farm_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_farm\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:season => self.season}],self)\n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n#\t\t is_valid = set_season\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:forecast_type_code => self.forecast_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_forecast_type\n end\n\n if is_valid\n\t\t is_valid = set_forecast_status\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "8216ed1735ad774b7604e20c27c26d8e", "score": "0.5879747", "text": "def before_validation(*args, &block); end", "title": "" }, { "docid": "8216ed1735ad774b7604e20c27c26d8e", "score": "0.5879747", "text": "def before_validation(*args, &block); end", "title": "" }, { "docid": "dec9b0285423470cca8ad6c938d0ebc9", "score": "0.5876415", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:downtime_category_code => self.downtime_category_code},{:downtime_division_code => self.downtime_division_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_downtime_division\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "953ecf8a1b32b5685062741def878287", "score": "0.5874939", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:treatment_type_code => self.treatment_type_code},{:treatment_code => self.treatment_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_treatment\n\t end\n\t \n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:ripe_code => self.ripe_code}],self) \n\tend\n\t\n\t if is_valid\n\t\t is_valid = set_ripe_time\n\t end\n\t\n\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:pc_code_code => self.pc_code_code}],self) \n\t end\n\t\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_pc_code\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:cold_store_type_code => self.cold_store_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_cold_store_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "f44fb5e2b76245a69eb2b5d71cf0e776", "score": "0.58683467", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:playlist_name => self.playlist_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_new_playlist\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:song_title => self.song_title},{:artist_name => self.artist_name},{:album_title => self.album_title}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_song\n\t end\nend", "title": "" }, { "docid": "d9e239243b63d59370ffc39a18911954", "score": "0.5860173", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:variety_group_code => self.variety_group_code},{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_variety_group\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "d6d6c7940c1cb3e282241158ce2f022a", "score": "0.58349377", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_id => self.location_id}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_inventory_transaction\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_location\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:inventory_reference => self.inventory_reference}],self)\n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_stock_item\n#\t end\nend", "title": "" }, { "docid": "207604115e53ab1c93d69aa5d67f7e66", "score": "0.5824479", "text": "def validate\n # first check whether combo fields have been selected\n is_valid = true\n end", "title": "" }, { "docid": "4b4662890b5f40f73905021139d08404", "score": "0.58214796", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:downtime_category_code => self.downtime_category_code},{:downtime_division_code => self.downtime_division_code},{:downtime_type_code => self.downtime_type_code},{:downtime_sub_type_code => self.downtime_sub_type_code},{:external_ref => self.external_ref}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_downtime_sub_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t# validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "3620cc3bf0b396f95715e672e3b50dd3", "score": "0.5817719", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:grade_code => self.grade_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_grade\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:mark_code => self.mark_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_mark\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code},{:old_pack_code => self.old_pack_code},{:actual_count => self.actual_count}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:organization_code => self.organization_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t\n\t if is_valid\n\t\t is_valid = set_organization\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:target_market_code => self.target_market_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_target_market\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "8c8f477df61b7b7cce941d7cff1d629a", "score": "0.58156234", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_group_code => self.commodity_group_code},{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t \n\tif is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:rmt_variety_code => self.rmt_variety_code},{:rmt_variety_code => self.rmt_variety_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_rmt_variety\n\t end\n\t\n\t\n\tif is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:marketing_variety_code => self.marketing_variety_code},{:marketing_variety_code => self.marketing_variety_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_marketing_variety\n\t end\n\t \n\t \n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "27c58b68efc2604070c23f9101c8685c", "score": "0.5814763", "text": "def validate\n #\tfirst check whether combo fields have been selected\n is_valid = true\n #validates uniqueness for this record\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:direct_sales_target_market_code=>self.direct_sales_target_market_code}], self)\n end\n if is_valid\n is_valid = set_target_market\n end\n end", "title": "" }, { "docid": "4da8dde29580c08c03fb1b654e938489", "score": "0.58108723", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:downtime_category_code => self.downtime_category_code},{:downtime_division_code => self.downtime_division_code},{:downtime_type_code => self.downtime_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_downtime_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "41bdfb5635a1d9339a5aeaf9399d9d26", "score": "0.5803689", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "41bdfb5635a1d9339a5aeaf9399d9d26", "score": "0.5803689", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "78a6143d82ac9f89d148cb5bf75b093a", "score": "0.57935256", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:rule_type_code => self.rule_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_rule_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "ac35cb1602c322750ce208c80087249c", "score": "0.5783513", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:department_name => self.department_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_department\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:first_name => self.first_name},{:last_name => self.last_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_person\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "2a381d86ed171675110d19c3d8b74256", "score": "0.5780419", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:downtime_category_code => self.downtime_category_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_downtime_category\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "4ee5922a0cefd29a871035d7433a7172", "score": "0.5768218", "text": "def before_validation() end", "title": "" }, { "docid": "9925c1a506ece2bb8e53de4bcf545952", "score": "0.57505035", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "9925c1a506ece2bb8e53de4bcf545952", "score": "0.57505035", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "9925c1a506ece2bb8e53de4bcf545952", "score": "0.57505035", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "cd73c49802d62ff5875b32416544f750", "score": "0.5748841", "text": "def validate!\n selection.validate!\n end", "title": "" }, { "docid": "518fa2f536682343390127a39427c8fb", "score": "0.57473415", "text": "def validate \n##\tfirst check whether combo fields have been selected\n#\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:transaction_sub_type_id => self.transaction_sub_type_id}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_inventory_transaction\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:lot_number => self.lot_number}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_lot\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:inventory_type_code => self.inventory_type_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_inventory_type\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name},{:role_name => self.role_name},{:id => self.id}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_parties_role\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_location\n#\t end\nend", "title": "" }, { "docid": "2527c200f1a1f8b929e7d2e9a8608e6f", "score": "0.5742095", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:role_name => self.role_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_role\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_party\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "a507f7411d143789720c2844acb59cb2", "score": "0.57331055", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:artist_name => self.artist_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_artist\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:artist_name => self.artist_name},{:album_title => self.album_title}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_album\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "06c234764bc984a153d5b810625bee10", "score": "0.57279694", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:grade_code => self.grade_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_grade\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "ebbf65a0a5b1fa620fd63324b5288234", "score": "0.5718257", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name},{:role_name => self.role_name},{:account_code => self.account_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_accounts_parties_role\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:farm_code => self.farm_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_farm\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:puc_type_code => self.puc_type_code},{:puc_code => self.puc_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_puc\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "717c7fd7c88a807bbd4e56451149c3a1", "score": "0.5712502", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:standard_size_count_value => self.standard_size_count_value}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_standard_count\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:old_pack_code => self.old_pack_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_old_pack\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:basic_pack_code => self.basic_pack_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_basic_pack\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "a8410764c3a5a5a871e0d3660518a703", "score": "0.57079923", "text": "def after_validation() end", "title": "" }, { "docid": "af6ec04479b2ac7a399eef357734c1d4", "score": "0.5696736", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:clothing_transaction_type_code => self.clothing_transaction_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_clothing_transaction_type\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:clothing_type_code => self.clothing_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_clothing_type\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:clock_code => self.clock_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_clothable_person\n\t end\n\t#validates uniqueness for this record\n#\t if self.new_record? && is_valid\n#\t\t validate_uniqueness\n#\t end\nend", "title": "" }, { "docid": "b330cc4c7a8758e3c82f159b3f95b685", "score": "0.5695542", "text": "def validate \n##\tfirst check whether combo fields have been selected\n#\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:transaction_type_code => self.transaction_type_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_transaction_type\n#\t end\nend", "title": "" }, { "docid": "7fb165cc5b89a9ca37c59656d41bdbf3", "score": "0.5671435", "text": "def validate\n #\tfirst check whether combo fields have been selected\n is_valid = true\n end", "title": "" }, { "docid": "b4d7dd5e28cf03a4f3788c3bc25925cf", "score": "0.56554574", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:variety_plusten_part_1 => self.variety_plusten_part_1}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_pallet_label_setup\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:pallet_number => self.pallet_number}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_pallet_template\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:pallet_format_product_code => self.pallet_format_product_code},{:id => self.id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_pallet_format_product\n\t end\nend", "title": "" }, { "docid": "003cd0ce59441a53a7e6dd9b5f46f038", "score": "0.5651863", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:account_type_name => self.account_type_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_account_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "5a09541f178457083920401ad90c0db9", "score": "0.5644353", "text": "def before_validation(sender); end", "title": "" }, { "docid": "5a09541f178457083920401ad90c0db9", "score": "0.5644353", "text": "def before_validation(sender); end", "title": "" }, { "docid": "047db783d4990d2c39480f992580f0e6", "score": "0.5628788", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commitment_type_code => self.commitment_type_code}],self)\n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commitment_type\n\t end\n\t if is_valid\n\t is_valid = is_certificate_number_unique?\n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = commitment_type_exists?\n\t end\nend", "title": "" }, { "docid": "dd7e84e78898e196f61c4477f16d51ff", "score": "0.561342", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:project_name => self.project_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_project\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "b6cf5dd016aa6adcea4a78850d443162", "score": "0.56102777", "text": "def other_option_validate\n self.fields.each do |check_field|\n if check_field.field_type == \"options_select_with_other\"\n unless check_field.content_meta =~ /(,Other)/\n check_field.content_meta << \",Other\"\n end\n end\n end\n end", "title": "" }, { "docid": "df2c21ac00f9c95088ba1d413763b078", "score": "0.55825096", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:postal_address_type_code => self.postal_address_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_postal_address_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\n\t \n\t \nend", "title": "" }, { "docid": "1eb0634c62329cd1240ada7b5938c2f4", "score": "0.55781645", "text": "def validate \n # first check whether combo fields have been selected\n\t is_valid = true\n\t \n end", "title": "" }, { "docid": "2ed653891ccf6e23b2ba44f236c9d47e", "score": "0.55751276", "text": "def after_save; model.reset_dropdown_cache; super; end", "title": "" }, { "docid": "a8182f8c92357bb9f51e0b2a080a185a", "score": "0.5552632", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\n\n self.target_market_code = self.target_market_name + \"_\" + self.target_market_description\nend", "title": "" }, { "docid": "a066e55616fea333b9d51d06155746d2", "score": "0.55423504", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:functional_area_name => self.functional_area_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_functional_area\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "d85fbeff37972b68a7b8fabf0dc86928", "score": "0.553821", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:program_name => self.program_name},{:functional_area_name => self.functional_area_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_program\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "55595e86d2008b6275e9b8a45e5f9327", "score": "0.5527175", "text": "def validate\n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:rmt_variety_code => self.rmt_variety_code}],self)\n end\n\n if is_valid\n is_valid = is_quantity_valid?\n end\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_forecast\n\t end\nend", "title": "" }, { "docid": "15d30963aa505887df179cb2da6bfcb1", "score": "0.55222315", "text": "def before_validation_on_create() end", "title": "" }, { "docid": "b96ebe2b440c4fb85882a2ab10339dc9", "score": "0.55184996", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\nend", "title": "" }, { "docid": "b96ebe2b440c4fb85882a2ab10339dc9", "score": "0.55184996", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\nend", "title": "" }, { "docid": "b96ebe2b440c4fb85882a2ab10339dc9", "score": "0.55184996", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\nend", "title": "" }, { "docid": "b7c55e027fafad1df136e6f2826614db", "score": "0.54997236", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:contact_method_type_code => self.contact_method_type_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_contact_method_type\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "d9e98fd0ca4eb3a3f5771ae75b4a07fd", "score": "0.54901314", "text": "def validate\n #\tfirst check whether combo fields have been selected\n\t is_valid = true\n ModelHelper::Validations.validate_combos([{:owner_party_role_id => self.owner_party_role_id}],self,nil,true)\n \n\n end", "title": "" }, { "docid": "74bb89a846970605c28ced7ba8805ab0", "score": "0.54870826", "text": "def validate \n # first check whether combo fields have been selected\n#\t is_valid = true\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:inventory_receipt_type_code => self.inventory_receipt_type_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_inventory_receipt_type\n#\t end\n#\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:farm_code => self.farm_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_farm\n#\t end\n#\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:pack_material_product_code => self.pack_material_product_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_pack_material_product\n#\t end\n#\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:parties_role_name => self.parties_role_name}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_parties_role\n#\t end\n#\t \n end", "title": "" }, { "docid": "70654f82b852fe74e4be8cacc37d0b0f", "score": "0.54826564", "text": "def associated_records_to_validate_or_save(association, new_record, autosave); end", "title": "" }, { "docid": "7343f1a3acb663305cc42c3da6af004e", "score": "0.5470313", "text": "def validate \n# # first check whether combo fields have been selected\n#\t is_valid = true\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:asset_type_code => self.asset_type_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_asset_type\n#\t end\n#\n##\t if is_valid\n##\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self)\n##\t end\n##\t if is_valid\n##\t is_valid = set_location\n##\t end\n# if is_valid\n# is_valid = set_parties_role\n# end\n#\t \n end", "title": "" }, { "docid": "d902f3d5f2b3f1b916f327c2b8fcd679", "score": "0.54677725", "text": "def record_select_select\n end", "title": "" }, { "docid": "8bafe0a2dc4901f0b3ddb47f9f49008c", "score": "0.54329437", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t \n\t if is_valid\n\t\t ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self)\n\t end\n\t \n\t has_size = true\n\t if is_valid\n\t\thas_size = ModelHelper::Validations.validate_combos([{:size_code => self.size_code}],self,true)\n\t end\n\t puts \"is_valid: \" + is_valid.to_s + \" has size: \" + has_size.to_s\n\t if is_valid && has_size\n\t\t is_valid = set_size\n\t end\n\t \n\thas_count = true\n\tif is_valid \n\t has_count = self.standard_size_count_value > 0 \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t\n\t if is_valid && has_count == true\n\t\t is_valid = set_standard_count\n\t end\n\t \n\t \n\t if !self.size_code && self.standard_size_count_value == 0\n\t is_valid = false\n\t errors.add_to_base(\"You must select either a size value or a standard_size_count_value\")\n\t end\n\t \n\t if is_valid && self.size_code && self.standard_size_count_value > 0\n\t is_valid = false\n\t errors.add_to_base(\"You cannot select both a size value and a standard_size_count_value <br>\n\t Choose one and the other to 'empty'\")\n\t end\n\t \n\t \n\t #validates uniqueness for this record\n\t if self.new_record? && is_valid == true\n\t\t validate_uniqueness\n\t end\n\t \n\t self.standard_size_count_value = nil if self.standard_size_count_value == 0\nend", "title": "" }, { "docid": "414e4db6bea2155687c4da4b84b80f61", "score": "0.5427516", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:serialised_container_code => self.serialised_container_code}],self) \n#\t end\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_serialised_container\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:route_step_code => self.route_step_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_route_step\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:transaction_type_code => self.transaction_type_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_transaction_type\n#\t end\n#\t if is_valid\n#\t\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self) \n#\tend\n#\t#now check whether fk combos combine to form valid foreign keys\n#\t if is_valid\n#\t\t is_valid = set_location\n#\t end\n#\t \n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:transaction_business_name_code => self.transaction_business_name_code}],self) \n#\t end\n#\t if is_valid\n#\t is_valid = set_transaction_business_name\n#\t end\n#\t \n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:inventory_receipt_code => self.inventory_receipt_code}],self) \n#\t end\n#\t if is_valid\n#\t is_valid = set_inventory_receipt\n#\t end\n#\t \n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:inventory_issue_code => self.inventory_issue_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_inventory_issue\n#\t end\nend", "title": "" }, { "docid": "2579fcc1754e5cfb939ccb72947b14db", "score": "0.5398963", "text": "def validate\n#\tfirst check whether combo fields have been selected\n is_valid = true\n if is_valid\n is_valid = ModelHelper::Validations.validate_combos([{:shift_type_code => self.shift_type_code}, {:calendar_date => self.calendar_date}], self)\n end\n #now check whether fk combos combine to form valid foreign keys\n if is_valid\n is_valid = set_shift_type\n end\n\n if self.new_record? && is_valid\n self.start_date_time = self.calendar_date.to_time().at_beginning_of_day + self.start_time.hours\n\n if self.start_time < self.end_time\n self.end_date_time = self.calendar_date.to_time().at_beginning_of_day + self.end_time.hours\n else\n self.end_date_time = self.calendar_date.to_time().tomorrow.at_beginning_of_day + self.end_time.hours\n\n end\n\n #validates uniqueness for this record\n validate_overlap\n end\n end", "title": "" }, { "docid": "a3de4f4ec74d23889678b810ed004991", "score": "0.53885907", "text": "def validate \n # first check whether combo fields have been selected\n\t is_valid = true\n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:stock_type_code => self.stock_type_code}],self) \n#\t end\n#\t if is_valid\n#\t is_valid = set_stock_type\n#\t end\n#\t \n#\t if is_valid\n#\t is_valid = ModelHelper::Validations.validate_combos([{:location_code => self.location_code}],self)\n#\t end\n#\t if is_valid\n#\t is_valid = set_location\n#\t end \n\t \n end", "title": "" }, { "docid": "05e5269df1cc19a068948824f3671c10", "score": "0.53811353", "text": "def after_validation_on_create() end", "title": "" }, { "docid": "99cc761f65eebb11efcd0163ded65cec", "score": "0.5372238", "text": "def before_validation_on_update\n if not default_value? and default_value_was\n errors.add :default_value, :cannot_be_disabled\n end\n errors.empty?\n end", "title": "" }, { "docid": "5164d85846f20d398c048f41e282fa88", "score": "0.5364265", "text": "def valid_selection\n if !self.value.blank?\n errors.add(:value, 'cannot be selected!') unless self.values.include?(self.value)\n end\n end", "title": "" }, { "docid": "1588676e970226a4456696fa6b4deb74", "score": "0.5359358", "text": "def before_validation!\n return unless model_instance\n unless valid?\n errors.each do |name, message|\n model_instance.errors.add(\"#{column_name}.#{name}\", message)\n end\n end\n end", "title": "" }, { "docid": "bc46ed26b09011cd7459cf48b2f0def8", "score": "0.53436065", "text": "def before_validation; end", "title": "" }, { "docid": "926e61a686edf30f6e061ac5781cd072", "score": "0.53079844", "text": "def before_validation_value\n 1\n end", "title": "" }, { "docid": "e445893f2eaec60908d7d6b5a3be03df", "score": "0.52841014", "text": "def validation_override(override_id)\n @override_id = override_id\n end", "title": "" }, { "docid": "45ce0e9ba5677a03ca144fcfabd21944", "score": "0.52662474", "text": "def validate_on_update\n end", "title": "" }, { "docid": "29d835c258a813107d9b14084f7e02ba", "score": "0.52648914", "text": "def valid_options\n [ :as, :autosave, :dependent, :foreign_key, :order ]\n end", "title": "" }, { "docid": "c39de5d8563e12b5911d38bb4e6d43d1", "score": "0.5259443", "text": "def validate\n super\n \tvalidates_unique [:choice_id, :question_id, :survey_id] \n end", "title": "" }, { "docid": "0190830cf9a2543dae5b0070d112fdb4", "score": "0.52496314", "text": "def _before_validation\n if new? && model.sti_key && !self[model.sti_key]\n set_column_value(\"#{model.sti_key}=\", model.sti_key_chooser.call(self))\n end\n super\n end", "title": "" }, { "docid": "1af1419885415ebf420c6572cfec9164", "score": "0.5235641", "text": "def collection_update(object, attribute, choices, id_attr, text_attr)\n\t\tfake_record(object, attribute) do |name,action|\n\t\t\tcollection_select name, attribute, choices, id_attr, text_attr,\n\t\t\t\t\t\t\t\t\t\t\t\t{}, :onchange => action\n\t\tend\n\tend", "title": "" }, { "docid": "abed4c030c997d174569958181f77876", "score": "0.5235181", "text": "def validate \n#validates that quantity_required is greater than 1\n errors.add(:quantity_required, \"should be at least 1\" ) if quantity_required.nil? || quantity_required < 1\n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend", "title": "" }, { "docid": "3de66373e01d21c3c9cd956021606f17", "score": "0.52150255", "text": "def after_validation\n super\n return unless @instance_hooks\n run_after_instance_hooks(:after_validation)\n end", "title": "" }, { "docid": "2938e3a2482008b9acddaba47165783a", "score": "0.5212244", "text": "def after_validation(*args, &block)\n options = args.extract_options!\n options[:prepend] = true\n options[:if] = Array(options[:if])\n if options[:on]\n options[:on] = Array(options[:on])\n options[:if].unshift(\"#{options[:on]}.include? self.validation_context\")\n end\n set_callback(:validation, :after, *(args << options), &block)\n end", "title": "" }, { "docid": "3f2ce66d9de37bd0dca5af34c7c1b2a7", "score": "0.5206497", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t \n\t#validates uniqueness for this record\n\t if self.new_record?\n\t\t validate_uniqueness\n end\n\n self.rfid = nil if self.rfid == \"\"\n\n if !unique_rf_id?\n errors.add_to_base(\"RFID already allocated\")\n end\n\nend", "title": "" }, { "docid": "b342e07769a032a2bee8fe6549246814", "score": "0.51840585", "text": "def validate_impossible_changes\n if @tagging\n errors.add(:tag_id, :cant_be_changed) if self.tag_id != @tagging.tag_id\n errors.add(:taggable_id, :cant_be_changed) if self.taggable_id != @tagging.taggable_id\n errors.add(:taggable_type, :cant_be_changed) if self.taggable_type != @tagging.taggable_type\n end\n end", "title": "" } ]
6ab75db7dfb51a0678057fa6f6c36843
Fetch info for a checkin
[ { "docid": "c5e377aac3449e4c3c377a52e3141936", "score": "0.830217", "text": "def checkin_info(id)\n connection.get(\"/checkins/#{id}\").body\n end", "title": "" } ]
[ { "docid": "869e377bbe08c60df1b3b636bda1148b", "score": "0.7075307", "text": "def checkins(checkin_id)\n if checkin_id\n url = '/checkins/' + checkin_id\n end\n response = get(url)\n response.checkin\n end", "title": "" }, { "docid": "259f81218af5f0d3d6ce3af3615a6482", "score": "0.70005065", "text": "def checkin\n Foursquared::Response::Checkin.new(client, response[\"checkin\"]) if response[\"checkin\"]\n end", "title": "" }, { "docid": "7fafe94314754c32da70a52290118171", "score": "0.6972449", "text": "def show\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "fc9a2a755e8fce15e6d5effe754d229c", "score": "0.6961754", "text": "def checkin(params={})\n self.class.get(\"http://api.foursquare.com/v1/checkin.json\", :query=>params)\n end", "title": "" }, { "docid": "1c79a993d8a2d8de5ac8252b4c01ebd6", "score": "0.6838162", "text": "def find_checkin_for_checkin_id(checkin_id = nil, createkupos=true)\n headers_hash = Hash.new\n headers_hash['Accept'] = 'application/json'\n params_hash = Hash.new\n params_hash['access_token'] = @access_token\n response = Typhoeus::Request.get(\"#{@@fb_host}/#{checkin_id}\", :params => params_hash, :headers => headers_hash, :disable_ssl_peer_verification => true)\n\n parsed_response = self.check_facebook_response_for_errors(response)\n if parsed_response.nil?\n return false\n end\n\n # if there are no recent checkins, don't try to serialize it\n if parsed_response.empty?\n return true\n end\n\n self.serialize_checkin_bulk([parsed_response],createkupos)\n\n return true\n end", "title": "" }, { "docid": "0388be29bb8c2239e21c1848faefdd7a", "score": "0.68327284", "text": "def checkin(details={})\n checkin_path = \"/checkins\"\n checkin_path += \"/test\" if Gowalla.test_mode?\n response = connection.post do |req|\n req.url checkin_path\n req.body = details\n end\n response.body\n end", "title": "" }, { "docid": "0388be29bb8c2239e21c1848faefdd7a", "score": "0.68327284", "text": "def checkin(details={})\n checkin_path = \"/checkins\"\n checkin_path += \"/test\" if Gowalla.test_mode?\n response = connection.post do |req|\n req.url checkin_path\n req.body = details\n end\n response.body\n end", "title": "" }, { "docid": "45753963e9b8e74b9b80213b4c942b59", "score": "0.678796", "text": "def checkin(id, options = {})\n get(\"checkins/#{id}\", options).checkin\n end", "title": "" }, { "docid": "dd07f3ddbb721c1284c51e6b25d48742", "score": "0.67006713", "text": "def checkins(params={})\n self.class.get(\"http://api.foursquare.com/v1/checkins.json\", :query=>params)\n end", "title": "" }, { "docid": "cf5b1d6560098d9b1e2627bc847fcd96", "score": "0.66907287", "text": "def show\n @checkout = Checkout.find(params[:id])\n @checkin = find_checkin(@checkout.serial_no)\n end", "title": "" }, { "docid": "15543ff335c0b506dc7057fc2ada4736", "score": "0.6651769", "text": "def show\n @checkin = checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @checkin }\n end\n end", "title": "" }, { "docid": "8b6b4028009b1959d22b785ce217fcaa", "score": "0.65799564", "text": "def show\n @checkin = Checkin.new\n @checkins = Checkin.all\n end", "title": "" }, { "docid": "4ed75ce4768c2e11fe58d5a35430f69e", "score": "0.6578157", "text": "def current_checkin(reset_cache = false)\n self.reset_current_checkin_cache if reset_cache\n cid = self.current_checkin_id\n Checkin.find(cid) if cid.present?\n end", "title": "" }, { "docid": "e131fe853cb9d6034e09548b4785dcfd", "score": "0.65112627", "text": "def checkins(options={})\n self.class.get(\"/v1/checkins\",:query=>options)\n end", "title": "" }, { "docid": "08a11f98b325e9754dae55ab299b80d4", "score": "0.6494091", "text": "def get_check_in\n return handle_response(client_error) unless valid?\n\n token = session.retrieve\n resp = request.get(path: \"/#{base_path}/appointments/#{uuid}\", access_token: token)\n\n handle_response(resp)\n end", "title": "" }, { "docid": "2858fcb13fd6ef6bb29ab5b5fc8982d8", "score": "0.6460973", "text": "def show\n @check_in = CheckIn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @check_in }\n end\n end", "title": "" }, { "docid": "2858fcb13fd6ef6bb29ab5b5fc8982d8", "score": "0.6460973", "text": "def show\n @check_in = CheckIn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @check_in }\n end\n end", "title": "" }, { "docid": "ad739cd13c01afe2275cfa4c42a88dae", "score": "0.63593364", "text": "def set_checkin\r\n @checkin = Checkin.find(params[:id])\r\n end", "title": "" }, { "docid": "dc1db867e9d19df900902ee6e2b3e7e8", "score": "0.6355679", "text": "def show\n @checkin = Checkin.find(params[:id])\n respond_with @checkin\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6314355", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "392805ac95b48d66a82d381848426b72", "score": "0.6310639", "text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end", "title": "" }, { "docid": "29971e66ba05b57f286d0c07baf3e8d3", "score": "0.6274478", "text": "def show\n #@checkin = Checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @checkin }\n end\n end", "title": "" }, { "docid": "29971e66ba05b57f286d0c07baf3e8d3", "score": "0.6274478", "text": "def show\n #@checkin = Checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @checkin }\n end\n end", "title": "" }, { "docid": "29971e66ba05b57f286d0c07baf3e8d3", "score": "0.6274478", "text": "def show\n #@checkin = Checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @checkin }\n end\n end", "title": "" }, { "docid": "20594efe0af1c8388aa689ba6ae81afd", "score": "0.62655574", "text": "def show\n @checkin = Checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @checkin }\n format.json { render :json => @checkin }\n end\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "246c694386112a0c83c4752559f528ee", "score": "0.6242409", "text": "def set_check_in\n @check_in = CheckIn.find(params[:id])\n end", "title": "" }, { "docid": "c4f688a8c232914730c86a6f191b023b", "score": "0.61578935", "text": "def show\n @check_in = CheckIn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @check_in }\n end\n end", "title": "" }, { "docid": "4a2ec8b231f4fe816634306a1d0889f2", "score": "0.6143757", "text": "def show\n @task = Task.find(params[:id])\n @check_ins = @task.check_ins\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "4ed983b0b293c8649b0ef4b40a479922", "score": "0.6110701", "text": "def show\n @raw_checkin = RawCheckin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @raw_checkin }\n end\n end", "title": "" }, { "docid": "2c0563ae1b29986440efad0249071306", "score": "0.60978645", "text": "def show\n checkin = current_user.checkins.order(\"id DESC\").limit(params[:id])\n\n respond_with(checkin, :include => {:location => {:only => [:id, :name, :longmin, :longmax, :latmin, :latmax]}},\n :only => [:created_at, :remarks])\n end", "title": "" }, { "docid": "2962e2d814cd9def764022e95b05d513", "score": "0.6066982", "text": "def show\n @checkin = Checkin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @checkin }\n end\n end", "title": "" }, { "docid": "ace625f02b61ffd8cf822bf3fe039dc6", "score": "0.60647315", "text": "def index\n @check_ins = CheckIn.all\n end", "title": "" }, { "docid": "ace625f02b61ffd8cf822bf3fe039dc6", "score": "0.60647315", "text": "def index\n @check_ins = CheckIn.all\n end", "title": "" }, { "docid": "ace625f02b61ffd8cf822bf3fe039dc6", "score": "0.60647315", "text": "def index\n @check_ins = CheckIn.all\n end", "title": "" }, { "docid": "9b05e95af0a910b1ba1796985fe4af25", "score": "0.606251", "text": "def user_checkins(options={})\n response = connection.get do |req|\n req.url \"users/self/checkins\", options\n end\n return_error_or_body(response, response.body.response.checkins)\n end", "title": "" }, { "docid": "06b465e08b4ca2872ac70edb4e209040", "score": "0.5996922", "text": "def refresh!(checkin)\n @untappd = NRB::Untappd::API.new(access_token: Config.untappd_access_token)\n checkin_data = @untappd.checkin_info(checkin_id: checkin.checkin_id)\n checkin = CheckinParser::parse_into_checkin(checkin_data)\n checkin.save\n end", "title": "" }, { "docid": "06e76bfb001afd3a798bbdba57a19909", "score": "0.5977019", "text": "def check_in\n post(\"/v1/checkin.json?vid=#{VENUE_ID}&twitter=#{self.update_twitter}&facebook=#{self.update_facebook}\")\n update_attribute(:checked_in_at, Time.now)\n end", "title": "" }, { "docid": "d2efd7a6f72cd681f1fb1b9451e7a362", "score": "0.59759444", "text": "def show\n @checkins = Checkin.roster(@room)\n @checkin = Checkin.new\n end", "title": "" }, { "docid": "b5c708a64161e33717f87afbe156f00f", "score": "0.5966761", "text": "def index\n @checkins = Checkin.all\n end", "title": "" }, { "docid": "a78003a674fe21e65a52b761bd64d65f", "score": "0.5925886", "text": "def index\r\n @checkins = Checkin.all\r\n end", "title": "" }, { "docid": "760b6bbcbb3ef3f2cc8161d23f5ff275", "score": "0.59231204", "text": "def checkin_history(params={})\n self.class.get(\"http://api.foursquare.com/v1/history.json\", :query=>params)\n end", "title": "" }, { "docid": "27e56978f66fea4f17ed71c6fbca3338", "score": "0.592136", "text": "def checkins(id=nil, since=nil, offset=nil)\n query = self.build_query_string([['user_id=',id],['since=',since],['offset=',offset]])\n results = self.class.get(\"/lbs_checkins/search?#{query}\", :body => {:client_key => CLIENT_KEY}).collect{|r| Hashie::Mash.new(r['lbs_checkin'])}\n end", "title": "" }, { "docid": "493a2bca0e4db030b9d7ee15642f1b2a", "score": "0.592116", "text": "def get_checkin\n @check_in = CheckIn.where(:user_id => current_user.id,:date => params[:date])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @check_in }\n end\n end", "title": "" }, { "docid": "f435ba96d0922bec032902a9914e2545", "score": "0.5899161", "text": "def do_check_in(check_in)\n \tupdate_columns(buddy: check_in.buddy, name: check_in.name, check_in: check_in.time, check_in_seconds: check_in.seconds_since_midnight, guest: check_in.guest)\n\t\t\t\t\t\n end", "title": "" }, { "docid": "6e9feed088418a721f25d39c75950b63", "score": "0.58108544", "text": "def checkin_params\r\n params[:checkin]\r\n end", "title": "" }, { "docid": "537472c983dede0489d80475ae5f1011", "score": "0.5806688", "text": "def get_inven_info\n response = HTTParty.get(\"#{@inven_url}\")\n hash = JSON.parse(response.body)\n puts response.body\n if hash[\"success\"] = true\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "70b77995de344dddee90b801e890efb7", "score": "0.58047646", "text": "def show\n @title = @check_in.name\n end", "title": "" }, { "docid": "a921f01ce5185abbcfe4e8aadd5ef4ad", "score": "0.57896996", "text": "def checkin(path, body, initheader = nil)\n request(Checkin.new(path, initheader), body)\n end", "title": "" }, { "docid": "8dc7482bb5c629771debb528651bbe58", "score": "0.57753676", "text": "def last_checkin; end", "title": "" }, { "docid": "43994178bafb57303549d1dc13388a12", "score": "0.5769296", "text": "def checkout_details\n request.run(:details, :token => token)\n end", "title": "" }, { "docid": "a8fd483aeff365093e65439787582702", "score": "0.57652026", "text": "def checkins( params={} )\n checkins = get_connections(\"checkins\", params)\n return map_connections checkins, :to => Facebook::Graph::Checkin\n end", "title": "" }, { "docid": "a8fd483aeff365093e65439787582702", "score": "0.57652026", "text": "def checkins( params={} )\n checkins = get_connections(\"checkins\", params)\n return map_connections checkins, :to => Facebook::Graph::Checkin\n end", "title": "" }, { "docid": "e8715ad53ccd21193b83a2e64e96eecc", "score": "0.5754603", "text": "def friend_checkin_fmt checkin, lat, lon, dnow\n s = ''\n\n venue = checkin['venue']\n user = checkin['user']\n\n user_shown = false\n\n if venue\n s += \"<a class=\\\"button\\\" href=\\\"/venue?vid=#{escapeURI venue['id']}\\\"><b>#{name_fmt user}</b> @ #{escapeHTML venue['name']}</a><br>\"\n user_shown = true\n else\n location = checkin['location'] || {}\n name = location['name']\n if name\n s += \"<b>#{name_fmt user}</b> @ #{escapeHTML name}<br>\" \n user_shown = true\n end\n end\n\n shout = checkin['shout']\n if shout \n s += \"<b>#{name_fmt user}</b> \" if not user_shown\n s += \"\\\"#{escapeHTML shout}\\\"<br>\" \n end\n\n s += \"#{comments_cmd checkin}<br>\" \n\n if user\n photo = user['photo']\n s += \"<img src=\\\"#{photo}\\\" alt=\\\"\\\" class=\\\"usericon\\\" style=\\\"float:right; padding:3px;\\\">\" if photo\n end\n\n dist = Float(checkin['distance']) rescue nil\n dist /= METERS_PER_MILE if dist\n\n location = if venue \n s += addr_fmt venue\n venue['location'] || {}\n else\n checkin['location'] || {}\n end\n\n vlat = location['lat']\n vlon = location['lng']\n\n compass = ''\n if vlat and vlon\n compass = ' ' + bearing(lat, lon, vlat, vlon)\n dist ||= distance(lat, lon, vlat, vlon)\n end\n\n s += '(%.1f mi%s)<br>' % [dist, compass] if dist \n\n d1 = Time.at(checkin['createdAt'] || 0)\n s += fuzzy_delta(dnow - d1)\n\n source = checkin['source']\n s += \"<br>via <a href=\\\"#{source['url']}\\\">#{escapeHTML source['name']}</a>\" if source\n\n s += '<br style=\"clear:both\">'\n\n s\nend", "title": "" }, { "docid": "e8a5394ec9f4ac0246026366892e543d", "score": "0.5746101", "text": "def show\n @checkin = Checkin.find(params[:id])\n @puzzle = @checkin.next_puzzle\n @location_coordinates = @checkin.location_coordinates\n @next_location_coordinates = @checkin.next_location_coordinates\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @checkin }\n end\n end", "title": "" }, { "docid": "7202a5a1fa361e1640239c977d3774e5", "score": "0.5735711", "text": "def recent_checkins options={}\n response = get(\"/checkins/recent\", options)[\"response\"]\n @checkins = response[\"recent\"].collect{|checkin| Foursquared::Response::Checkin.new(self, checkin)}\n end", "title": "" }, { "docid": "5518eaee729d5cb8f2079c283018e251", "score": "0.57273144", "text": "def find_people_via_checkins\n return DianpingPageParser.members_in_page url_checkins\n end", "title": "" }, { "docid": "2402bf2aed97bc2b609a1bcea94d05ae", "score": "0.57250696", "text": "def new\n @check_in = CheckIn.new\n @task = Task.find_all_by_user_id(current_user.id)\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @check_in }\n end\n end", "title": "" }, { "docid": "0c636275275d1fe496d6cceb588f4dd3", "score": "0.5716693", "text": "def correspond_checkin\n\t\tcheckout_time = self.checkout_time\n\t\tcheckin = Checkin.where(\"mentor_id = :mentor_id and school_id = :school_id\n and checkin_time <= :checkout_time\n and checkin_time >= :same_day_start\n and checkin_time <= :same_day_end\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:mentor_id => self.mentor_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:school_id => self.school_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:checkout_time => checkout_time,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:same_day_start => checkout_time.beginning_of_day,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:same_day_end => checkout_time.end_of_day).first\n\tend", "title": "" }, { "docid": "12abf7d3420b51b99bc2e791eb975664", "score": "0.57153946", "text": "def check_in_data\n token = redis_client.get(check_in_uuid: check_in.uuid)\n\n raw_data =\n if token.present?\n chip_service.refresh_appointments if appointment_identifiers.present?\n\n lorota_client.data(token:)\n end\n\n patient_check_in = CheckIn::V2::PatientCheckIn.build(data: raw_data, check_in:)\n\n return patient_check_in.unauthorized_message if token.blank?\n return patient_check_in.error_message if patient_check_in.error_status?\n\n patient_check_in.save unless patient_check_in.check_in_type == 'preCheckIn'\n patient_check_in.approved\n end", "title": "" }, { "docid": "f0ab25f52ef60d800462d535e5146103", "score": "0.56915736", "text": "def index\n checkin = lastcheckin = current_user.checkins.last\n respond_with(checkin, :include => {:location => {:only => [:id, :name, :longmin, :longmax, :latmin, :latmax]}},\n :only => [:created_at, :remarks])\n end", "title": "" }, { "docid": "6158cc970ae606b9f94d304632212031", "score": "0.56871355", "text": "def index\n #@checkins = Checkin.all\n \n if params[:user_id] \n @user= User.find(params[:user_id])\n @checkins = @user.checkins\n end\n \n if params[:item_id] \n @item= Item.find(params[:item_id])\n @checkins = @item.checkins\n end\n \n if params[:venue_product_id] \n #@item= Item.find(params[:item_id])\n sql=\"select c.id, c.created_at, p.first_name, i.price from checkins c, items i, venue_products v, users u,profiles p\n where c.user_id=u.id and p.user_id=u.id and c.item_id=i.id and i.venue_product_id=v.id and venue_product_id = ?\"\n @checkins = Checkin.find_by_sql([sql,params[:venue_product_id]])\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkins }\n end\n end", "title": "" }, { "docid": "c340c774e7618899ab970a26e6a406ec", "score": "0.5678629", "text": "def show\n render json @check_in \n end", "title": "" }, { "docid": "4e7fcab0433823463ee23ebc552c874c", "score": "0.56722116", "text": "def show\n @event = Event.find(params[:id])\n @checkins = Checkin.find_all_by_event_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "a97b2c9a70c1d1cc585f18da8f94a60e", "score": "0.5663632", "text": "def show\r\n begin\r\n @checkin = Checkin.find(params[:id])\r\n rescue ActiveRecord::RecordNotFound\r\n logger.error \"Attmpet to access invalid checkin #{params[:id]}\"\r\n redirect_to index_appointment_url, notice: 'Invalid Checkin'\r\n else\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.json {render json: @checkin}\r\n end\r\n end\r\n end", "title": "" }, { "docid": "9cc8fb5fccf0dc9358cfee1d30dd66a9", "score": "0.566292", "text": "def test_foursquare_checkins\n # Test retrieving a specific checkin id\n checkin_id = \"aaaaaaaaaaaaaaaaaaaaaaaa\"\n checkins = foursquare.checkins(checkin_id)\n assert checkins\n assert_equal checkin_id, checkins.id\n end", "title": "" }, { "docid": "244e8032dc98cfdeb939966a4509e669", "score": "0.5660706", "text": "def index\n @coordinator_check_ins = CoordinatorCheckIn.search(params[:search])\n end", "title": "" }, { "docid": "e3caf651a8adc96f46bd3e54bb985bee", "score": "0.5651989", "text": "def checkin\n post_data = ActiveSupport::JSON.decode(request.body.read)\n if valid_session?(post_data['user_id'])\n place = Place.where(id: params[:id]).first\n existing_checkin = Checkin.where(place_id: place.id, user_id: post_data['user_id'])\n # Check to see if user already checked in\n if existing_checkin.length == 0\n Checkin.create(place_id: place.id, user_id: post_data['user_id'])\n render :json => ActiveSupport::JSON.encode({ checkedin: true })\n else\n render :json => ActiveSupport::JSON.encode({ checkedin: false })\n end\n else\n render_denial\n end\n end", "title": "" }, { "docid": "0983ad5346608b1e68968c765ace3236", "score": "0.5651294", "text": "def history\n @checkins = Checkin.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "7d8ba844adc7ade40da13fe848c2c317", "score": "0.56500775", "text": "def checkin\n # Set the User variable\n user = User.find_by_authentication_token(params[:access_token])\n return invalid_user if !user\n\n # Handle the request based on the type (GET or PUT)\n if params[:locationID].blank? && request.method == \"GET\"\n checkins = Checkin.recent_checkin_locations_for(user)\n return render json: {\n :success => true,\n :authentication_token => user.authentication_token,\n :checkins => checkins,\n }, status: 201\n\n elsif request.method == \"PUT\"\n location = Location.find_by_id(params[:locationID])\n return invalid_location if location.blank?\n\n # Do not allow repeat checkins\n if user.is_checked_in_at?(location)\n return render status: 500, json: { success: false, message: \"You're already checked in there!\" }\n end\n\n # Check the User in at this Location\n checkin = user.checkin_at(location)\n\n # Add this user to this Location's contact list\n CustomersLocations.add_contact([user.id], location.id)\n\n return render json: {\n :success => true,\n :authentication_token => user.authentication_token,\n :numberOfCheckin => user.checkins.location_checkin(location.try(:id)).count,\n :points => checkin.points,\n :location_logo => location.try(:logo).try(:fullpath),\n :last_checkin_date => location.try(:checkins).try(:last).try(:updated_at)\n }, status: 201\n\n else\n return invalid_user\n end\n end", "title": "" }, { "docid": "2aa6d2a55a65458aff011ffb6185962c", "score": "0.5633127", "text": "def checkin_check\n @comic = Comic.find(params[:comic_id])\n end", "title": "" }, { "docid": "b03e6b311ffdd7c7fa12fd18f26a3ec6", "score": "0.561949", "text": "def fetch_infos\n tweets\n github_info\n rubygems_info\n end", "title": "" }, { "docid": "ce34c3c2fe876c01a37e2b568ec89065", "score": "0.5614422", "text": "def find_checkins_for_facebook_id(facebook_id = nil, since = nil)\n if facebook_id.nil? then facebook_id = @@peter_id end\n\n puts \"find checkins for facebook_id: #{facebook_id}\"\n\n headers_hash = Hash.new\n headers_hash['Accept'] = 'application/json'\n\n params_hash = Hash.new\n params_hash['access_token'] = @access_token\n params_hash['fields'] = 'id,from,tags,place,message,likes,comments,application,created_time'\n params_hash['limit'] = 2000 # set this to a really high limit to get all results in one call\n if !since.nil? then\n params_hash['since'] = since.to_i\n end\n \n response = Typhoeus::Request.get(\"#{@@fb_host}/#{facebook_id}/checkins\", :params => params_hash, :headers => headers_hash, :disable_ssl_peer_verification => true)\n\nputs response.body;\n\n parsed_response = self.check_facebook_response_for_errors(response)\n if parsed_response.nil?\n return false\n end\n \n # if there are no recent checkins, don't try to serialize it\n if parsed_response['data'].empty?\n return true\n end\n\n place_id_array = Array.new\n\n # Batch parse checkins\n place_id_array = self.serialize_checkin_bulk(parsed_response['data'])\n\n # Serialize unique list of place_ids\n if !place_id_array.empty?\n self.find_places_for_place_id_array(place_id_array.uniq)\n end\n\n # Update last_fetched_checkins timestamp for user\n self.update_last_fetched_checkins(facebook_id)\n\n # Correlate unique list of place_ids with yelp places\n # Note: Do in background later\n # if !place_id_array.empty?\n # puts \"Start Yelp correlation\"\n # API::YelpApi.new.correlate_yelp_to_place_with_place_place_id_array(place_id_array.uniq)\n # puts \"End Yelp correlation\"\n # end\n\n return true\n\n end", "title": "" }, { "docid": "c94ddfb717524b6d7256b8f9827622ee", "score": "0.5611708", "text": "def recent_checkins(ll, options = {})\n get(\"checkins/recent\", { :ll => ll }.merge(options)).recent\n end", "title": "" }, { "docid": "cb9643534671c5a8918bcade383bbabc", "score": "0.5607877", "text": "def fetch_details_from_github\n end", "title": "" }, { "docid": "7aa58ddeda845c24e3d458a8062b7872", "score": "0.5595916", "text": "def get_check_in_text\n if self.check_in_time\n self.check_in.strftime('%d/%m/%Y (Check in time %I:%M%p)')\n else\n self.check_in.strftime('%d/%m/%Y')\n end\n end", "title": "" }, { "docid": "19f941d6d7eb76d8bf3e5c37d7992151", "score": "0.5590613", "text": "def show\n if (current_user.rushes.pluck(:id).include? params[:rush_id].to_i) && (@location.rush_order <= @rush.user_rush(current_user).active_location)\n @checkins = @location.clue.clue_checkins.for_user(current_user)\n @checkin = ClueCheckin.new\n else\n redirect_to dashboard_url\n end\n end", "title": "" }, { "docid": "cf3b5696b07d83c2438781d570d04a16", "score": "0.55841684", "text": "def index\n @checkins = @user.checkins\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkins }\n end\n end", "title": "" }, { "docid": "b85792de448d806cfb68c97173052721", "score": "0.5558567", "text": "def set_check_in_record\n @check_in_record = CheckInRecord.find(params[:id])\n end", "title": "" }, { "docid": "96bf479b8b89d5c1f42fd6c70e44749f", "score": "0.5556287", "text": "def set_checkin_history( client )\n\t\n\t ## Delete existing cached checkins\n\t self.cached_checkins.destroy_all\n\t \n \tcheckins = client.user_checkins( :limit => 250 )\n \tcheckins.items.each do |c|\n \t \n \t ## Don't process private check-ins\n \t next if c.private\n \t \n \t checkin = Checkin.find_by_foursquare_guid( c.id )\n \t if checkin\n \t ## Checkin already exists. Do nothing.\n \t else\n \t if c.venue\n venue = Venue.find_by_foursquare_guid( c.venue.id )\n if venue\n if venue.company\n ## Create checkin\n checkin = Checkin.create(\n :foursquare_guid => c.id,\n :user => self,\n :venue => venue,\n :checked_in_at => Time.at( c.createdAt )\n )\n else\n ## No associated company. Create cached checkin.\n cached_checkin = CachedCheckin.create(\n :foursquare_guid => c.id,\n :user => self,\n :venue => venue,\n :checked_in_at => Time.at( c.createdAt )\n )\n end\n else\n company = Company.identify( c.venue.name )\n if company\n ## Excellent! Create new venue and new checkin.\n country = Country.identify( c.venue.location.cc, c.venue.location.country )\n #country = Country.find_by_code( c.venue.location.cc )\n ## Create country, if necessary\n #if !country\n # country = Country.create(\n # :code => c.venue.location.cc,\n # :name => c.venue.location.country\n # )\n #end\n ## Create venue\n venue = Venue.create(\n :foursquare_guid => c.venue.id,\n :name => c.venue.name,\n :company => company,\n :category => Category.identify( c.venue.categories ),\n #:zip_code => country.usa ? ZipCode.identify( c.venue.location.lat, c.venue.location.lng ) : nil,\n :country => country\n )\n ## Create checkin\n checkin = Checkin.create(\n :foursquare_guid => c.id,\n :user => self,\n :venue => venue,\n :checked_in_at => Time.at( c.createdAt )\n )\n else\n ## No venue and no company. Create cached checkin.\n cached_checkin = CachedCheckin.create(\n :foursquare_guid => c.id,\n :user => self,\n :venue_name => c.venue.name,\n :checked_in_at => Time.at( c.createdAt )\n )\n \n end\n end\n end\n \t end\n \t \n \tend ## end loop\n \t\n \tcalculate_points\n\n\tend", "title": "" }, { "docid": "92762309cc43ecf629c31de37b06665a", "score": "0.5553939", "text": "def checkin(conn); end", "title": "" }, { "docid": "118101f8c741cdc3ead5ac7a7ca3a99f", "score": "0.55436754", "text": "def checkin\n log_message({entity: @entity.inspect, params: params})\n @bin=@entity\n set_common_var\n\n Entity.setIconColorMgr('normal') #evenutally checkin color mgmt\n ctx=EntityCheckinAction.execute(entity: @entity)\n @at=ctx.actiontype # at will be nil if not first during day\n puts \"action type is #{@at}\"\n respond_to do |format|\n format.html {render \"checkin\"}\n format.json { render json: @entity}\n end\n end", "title": "" }, { "docid": "022707ecf12dc11cb536556198ca23dc", "score": "0.5536186", "text": "def details\n fetch_infos #called from lib/api_methods.rb:64\n end", "title": "" }, { "docid": "5a2adc640fae8540b7449b9a748340ee", "score": "0.5535308", "text": "def enrollee_checkins\n @checkin_param = params[:id]\n\n @user_checkin = UserCheckin.get_enrollee_checkins(@checkin_param)\n\n if @user_checkin.blank?\n if User.find_by_id(@checkin_param)\n render_error(409)\n else\n render_error(402)\n end\n else\n checkins_all = []\n @user_checkin.each do |ci|\n checkin = ci.get_enrollee_checkin_hash\n checkins_all.append checkin\n end\n\n render :json => { :result => checkins_all }\n end\n end", "title": "" }, { "docid": "1dfd765f3e81009b93a7f09a51d8ff47", "score": "0.55321246", "text": "def cabot_check_get(name)\n checks = JSON.parse(get_request(\"graphite_checks/\").body)\n check = checks.find {|h1| h1['name']==\"#{name}\"}\n\n return check\nend", "title": "" }, { "docid": "f75a5f9597467faf58f5502f4005a03a", "score": "0.55290085", "text": "def show\n @checkin = Checkin.find(params[:id])\n param=2\n \n if param==1 \n some_objects = []\n query=\"select \"\n #checkin list query=\"select u.firstname , u.lastName, c.created_at, i.price, v.`fs_venue_id` , p.name from checkins c, items i, venue_products v, products p, users u where c.user_id=u.id and c.item_id=i.id and i.venue_product_id=v.id and v.product_id=p.id and u.id=1\"\n mysql_res = ActiveRecord::Base.connection.execute(query)\n \n mysql_res.each do |res| \n some_objects << res \n end\n render json: some_objects\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { \n render json: @checkin.to_json(\n :only=>[:created_at],\n :include=>{\n :item=>{\n :only=>[:price],\n :include=>{:venue_product=>{:only=>[:fs_venue_id]}}},\n :comments=>{\n :only=>[:comments,:created_at],\n :include=>{\n :user=>{\n :only=>[:id],\n :include=>{:profile=>{:only=>[:first_name,:last_name]}}\n }\n }\n }\n }\n )\n }\n end\n end\n end", "title": "" }, { "docid": "de6918afefa1ec7ae68338c5cd481b02", "score": "0.5524699", "text": "def index\n @item_checkins = ItemCheckin.all.page(params[:page])\n end", "title": "" } ]
93fd85e77adcb28521a2efb66c7e68b8
returns that student's knowledge array.
[ { "docid": "3854151beb61f140ed0a064d5afb7e3a", "score": "0.7566128", "text": "def knowledge\n @knowledge\n end", "title": "" } ]
[ { "docid": "caa0f3038d0b0bfdb8e007454c700830", "score": "0.7500521", "text": "def knowledge\n @knowledge\n end", "title": "" }, { "docid": "caa0f3038d0b0bfdb8e007454c700830", "score": "0.7500521", "text": "def knowledge\n @knowledge\n end", "title": "" }, { "docid": "caa0f3038d0b0bfdb8e007454c700830", "score": "0.7500521", "text": "def knowledge\n @knowledge\n end", "title": "" }, { "docid": "caa0f3038d0b0bfdb8e007454c700830", "score": "0.7500521", "text": "def knowledge\n @knowledge\n end", "title": "" }, { "docid": "4bb9f39af5c184e1a4e08603e02085ff", "score": "0.640389", "text": "def all_vocab\n arr = []\n self.student_books.each do |student_book|\n if student_book.vocab_activities.length > 0 \n student_book.vocab_activities.each do |vocab_activity|\n hash = {}\n hash[:vocab] = vocab_activity\n hash[:book_title] = vocab_activity.student_book.book.title\n arr << hash\n end\n end\n end\n return arr\n end", "title": "" }, { "docid": "8c0d996b735d1bcbd760e12c9a8c5909", "score": "0.63878685", "text": "def initialize \n @knowledge = [] \n end", "title": "" }, { "docid": "300a8ed171361c0996899f4e2cf521f9", "score": "0.6279634", "text": "def vocab_activities \n arr = []\n self.student_books.each do |student_book|\n if student_book.vocab_activities.length > 0 \n student_book.vocab_activities.each do |vocab_activity|\n arr << vocab_activity\n end\n end\n end\n return arr\n end", "title": "" }, { "docid": "5deb9c6155a6349e1e8276547ac62ad7", "score": "0.6253216", "text": "def last_vocab_array\n arr = []\n self.student_books.each do |student_book|\n if student_book.vocab_activities.length > 0 \n arr << student_book.most_recent_vocab\n arr << student_book.second_most_recent_vocab\n end\n end\n return arr\n end", "title": "" }, { "docid": "6f42d145a74ff2698cf82398bfa37aa1", "score": "0.6195594", "text": "def initialize\n @knowledge = []\n end", "title": "" }, { "docid": "efa0df5dc94c680f86b6205b8960c3a1", "score": "0.6180064", "text": "def initialize\n @knowledge = [] # initializes with instance variable set to empty array\n end", "title": "" }, { "docid": "5ec3689d318ae194ccd7523db62c8231", "score": "0.61117667", "text": "def students\n\t@students ||= []\nend", "title": "" }, { "docid": "7d74b2d33080dce23a5be6552d14b0b3", "score": "0.61022836", "text": "def students\n\ta = Array.new\n\t\n\tsections.each do |section|\n\t\tsection.students.each do |stud|\n\t\t\tb = stud\n\t\t\ta.push b unless a.include? b\n\t\tend\n\tend\n\t\n\ta\n end", "title": "" }, { "docid": "3d904a3de305a406b3426981f2ea6437", "score": "0.61006725", "text": "def index\r\n @knowledge_bases = KnowledgeBase.all\r\n @knowledge_published =KnowledgeBase.where('published = ?',true,)\r\n @knowledge_unpublished =KnowledgeBase.where('published = ?', false)\r\n if current_user.role == \"student\" \r\n @user_knowledge = []\r\n # current_user.student.batches.each do |batch|\r\n # batch.course.topics.each do |topic|\r\n # @user_knowledge.push(KnowledgeBase.find_by(published: true, topic_id: topic.id))\r\n # end\r\n # end\r\n current_user.student.batches.each do |batch|\r\n @user_knowledge = KnowledgeBase.where(published: true, topic_id: batch.course.topics.pluck(:id))\r\n end\r\n end\r\nend", "title": "" }, { "docid": "2f368da001237407e71ea138dfdc8e11", "score": "0.6063939", "text": "def initialize\n @knowledge = [] # initialize with an empty array\n end", "title": "" }, { "docid": "58fc774bce2a69ec75cfdc01de0287f7", "score": "0.60295135", "text": "def students\n boating_tests.map { |bt| bt.student }\n end", "title": "" }, { "docid": "656206bbf0d0b26ea64895922cf5c78d", "score": "0.602702", "text": "def student_results\n @student = Student.find_by_id(params[:id])\n @st_exams = Array.new(@student.student_exams)\n end", "title": "" }, { "docid": "527c7ed27898f6ee56ed382568170233", "score": "0.59914386", "text": "def learn(knowledge)\n @knowledge << knowledge\n end", "title": "" }, { "docid": "cae2db1d1ed7637e101e413ead6003a1", "score": "0.59818023", "text": "def initialize\n\t\t@knowledge = []\n\tend", "title": "" }, { "docid": "0f8fb57b1f94ca26b0f1ea9ffb691a4b", "score": "0.5968907", "text": "def students\n @students\n end", "title": "" }, { "docid": "435447702e01f9535e0b96cbce2911b3", "score": "0.5968111", "text": "def get_teachings\n classe=self.student_class_school\n classe.teachings.to_a\n end", "title": "" }, { "docid": "ffe57b3a2520e6160dc36751fbd53213", "score": "0.594452", "text": "def get_student_details\n student_info = Array.new(5)\n student_info[1] = @std_name\n student_info[2] = @std_school\n student_info[3] = @std_grade\n student_info[4] = @std_email\n student_info[5] = @@rating\n return student_info\n end", "title": "" }, { "docid": "6b16374b341e00c58c93133f15b12748", "score": "0.59080106", "text": "def readinformation student\n [student[:firstname], student[:lastname], student[:course]]\nend", "title": "" }, { "docid": "f664edcf746e93ba6c256e23fbb5fd28", "score": "0.5876752", "text": "def getWord_array\n @@word_array\n end", "title": "" }, { "docid": "365a3622c275827bcd11946151d5e98e", "score": "0.58493584", "text": "def student\n return @student\n end", "title": "" }, { "docid": "ec9045cc331f90bb20274811f33c6bf6", "score": "0.58491105", "text": "def students\n self.boating_tests.collect{|test| test.student }\n end", "title": "" }, { "docid": "39b71722c05034b9c7a0f225f1d4cfd6", "score": "0.5838048", "text": "def word_array\t\t\n\t\t @word_array\n\tend", "title": "" }, { "docid": "f306dff1502ba670ce563403e3efe5ad", "score": "0.5831927", "text": "def all_students\n # binding.pry\n student_array = BoatingTest.all.select do |test_info|\n test_info.instructor == self \n end \n student_array.map(&:student)\n end", "title": "" }, { "docid": "e55d02942f420123f6aac9c49b9ea7dd", "score": "0.579516", "text": "def students_weighted_grades_array\n return @grades_array unless @grades_array.nil?\n\n course_information\n all_students = Student.includes(:memberships,\n groupings: { current_submission_used: [:submitted_remark, :non_pr_results] },\n grade_entry_students: :grades)\n student_list = all_students.all.map do |student|\n get_student_information(student)\n end\n\n @grades_array = student_list.map { |s| s[:weighted_marks][self.id] } # Note: this also returns the assigned value\n end", "title": "" }, { "docid": "82bead25d9daedbdd1eda92191b8a6c4", "score": "0.5762843", "text": "def learn(info)\n @knowledge << info\n end", "title": "" }, { "docid": "ab17a1a089032eab834cbcaee3cfc934", "score": "0.5710107", "text": "def students\n @students\nend", "title": "" }, { "docid": "ab17a1a089032eab834cbcaee3cfc934", "score": "0.5710107", "text": "def students\n @students\nend", "title": "" }, { "docid": "ab17a1a089032eab834cbcaee3cfc934", "score": "0.5710107", "text": "def students\n @students\nend", "title": "" }, { "docid": "66c2ebece271d9b7c89efc6653603939", "score": "0.570625", "text": "def skills\n return @skills\n end", "title": "" }, { "docid": "28511fc4fc51ee5d2b526d4024852bcb", "score": "0.5682833", "text": "def all_students\n self.all_tests.map {|test| test.student}\n # self.all_tests.map(&:student)\n end", "title": "" }, { "docid": "ae538a003299b334c3d01f200c4f49a8", "score": "0.56817245", "text": "def all_students\n students = self.enrollments.map do |enrollment|\n enrollment.student\n end\n students\n end", "title": "" }, { "docid": "18f1b4e95ecbe13ace4a4858d7eccb79", "score": "0.5668117", "text": "def all\n @students\n end", "title": "" }, { "docid": "5f73428fee59eb566d606b75c474c305", "score": "0.5664292", "text": "def get_student\n\t\tstudents_array = []\n\t\tstudents.each do |student|\n\t\t\tstudent.performances.each do |performance|\n\t\t\t\tstudents_array += [student] if performance.rate == 3\n\t\t\t\tstudents_array += [student, student] if performance.rate == 2\n\t\t\t\tstudents_array += [student, student, student] if performance.rate == 1\n\t\t\tend\n\t\tend\n\t\tstudents_array.sample\n\tend", "title": "" }, { "docid": "266904871068ed0340e463ffacec6f4e", "score": "0.5661478", "text": "def my_students\n students = self.students.map do |student|\n student.name\n end\n end", "title": "" }, { "docid": "81321c7d0faa3423aea299c366fe4bf6", "score": "0.5648411", "text": "def skills\n result = []\n for i in @skills\n result.push($data_skills[i])\n end\n return result\n end", "title": "" }, { "docid": "196541ac28a98047da4cfefcbb7ab411", "score": "0.56482303", "text": "def get_teachers\n ret=[]\n classe=self.student_class_school\n teachings=classe.teachings.to_a\n teachings.each do |teaching|\n ret << teaching.teaching_teacher\n end\n ret\n end", "title": "" }, { "docid": "37789a392ff9acf0d2cb4e2f12aaaa75", "score": "0.5647641", "text": "def assessments_array\n @assessments_array ||= Assessment.all.to_a\n end", "title": "" }, { "docid": "8ec048a601fe733862a45aef864f38c3", "score": "0.5622337", "text": "def student\n boating_test.map do |test|\n test.student\n end\nend", "title": "" }, { "docid": "1701d839ab7ff5f135e715131deda834", "score": "0.5620915", "text": "def student_list\n\t@student_list ||= []\nend", "title": "" }, { "docid": "4c51aae70c4119fc4d909ba6e574ce19", "score": "0.56022626", "text": "def student_in\n student_in_courses.collect(&:course)\n end", "title": "" }, { "docid": "daff115bd77ec28d030d96d34c8e8cf6", "score": "0.5585099", "text": "def access_subjects\n subjects_array(%w[subject function occupation genreform], parent: 'archdesc')\n end", "title": "" }, { "docid": "3702d49d7b88460d5f41e8137b499abb", "score": "0.5578644", "text": "def physical_exams\n get_data_elements('physical_exam')\n end", "title": "" }, { "docid": "e45eb2af647afb9886c19d5a5c0cc556", "score": "0.55734706", "text": "def students\n @students ||= student_tests.keys\n end", "title": "" }, { "docid": "7b9dd5b3adfc3413dd096e5f4012a255", "score": "0.55728984", "text": "def hateArray\n hate_array = []\n self.hate_speech.each { |speech| hate_array.push(speech.body) }\n return hate_array\n end", "title": "" }, { "docid": "42ca4a20b599b5e0f008312a7a47ac7c", "score": "0.55320144", "text": "def answers\n [].tap do |a|\n a << teaching_maths_or_physics\n a << current_school\n a << initial_teacher_training_subject\n a << initial_teacher_training_subject_specialism if eligibility.initial_teacher_training_subject_specialism.present?\n a << has_uk_maths_or_physics_degree if eligibility.has_uk_maths_or_physics_degree.present?\n a << qts_award_year\n a << employed_as_supply_teacher\n a << has_entire_term_contract if eligibility.has_entire_term_contract.present?\n a << employed_directly if eligibility.employed_directly.present?\n a << disciplinary_action\n a << formal_performance_action\n end\n end", "title": "" }, { "docid": "462466eda02a995432a45d741df6408c", "score": "0.55103797", "text": "def answers\n [].tap do |a|\n a << qts_award_year\n a << claim_school\n a << current_school\n a << subjects_taught\n a << had_leadership_position\n a << mostly_performed_leadership_duties if eligibility.had_leadership_position?\n end\n end", "title": "" }, { "docid": "02717f35c352e05ada0e3b5280d8b1d5", "score": "0.5501122", "text": "def index\n @knowledge_topics = KnowledgeTopic.all\n end", "title": "" }, { "docid": "2e5835fd68d133698cfb96584dc228aa", "score": "0.5500186", "text": "def students\n tuition_users.map(&:user)\n end", "title": "" }, { "docid": "3ad81f922bcdd9cc3e3fbc7069f2fc5d", "score": "0.548618", "text": "def all_the_stuff_array\n all_the_stuff_array = []\n all_the_stuff_array[0] = self.content\n just_questions_array = []\n just_questions_array\n self.answers.each do |a| \n just_questions_array << a.content\n end\n all_the_stuff_array[1] = just_questions_array\n return all_the_stuff_array\n end", "title": "" }, { "docid": "8d682690e14af8eaa587b215b62aa05d", "score": "0.5484842", "text": "def students\n Student.all.select{|student| student.cohort == self }\n end", "title": "" }, { "docid": "02cd35f8ecd3ae9838826d46a7298b95", "score": "0.5461189", "text": "def index\n @students_infos = StudentsInfo.all # 获取所以学生信息内容\n end", "title": "" }, { "docid": "8ee688cddc604fdeee4d58392d402492", "score": "0.54555446", "text": "def getQuestions()\n @@questions\n end", "title": "" }, { "docid": "2f73e0d273c8a17c0817dd3b8eddae9f", "score": "0.54398507", "text": "def index\n @learned_courses = LearnedCourse.where(student_id: current_user.id )\n end", "title": "" }, { "docid": "e135a3a0e6a74b7370284b90d5810267", "score": "0.5437822", "text": "def students_in_the_track\n self.students\n end", "title": "" }, { "docid": "972c897d573d7cde412232f3f347f567", "score": "0.54241693", "text": "def to_array\n [@name, @age, @college_student_id, @course_student_id]\n end", "title": "" }, { "docid": "0b3785c30cfd877800919eed6ee15af0", "score": "0.54044247", "text": "def grades_array\n return @grades_array if defined? @grades_array\n results = self.assignment.current_results\n .where(marking_state: Result::MARKING_STATES[:complete])\n @grades_array = self.marks.where.not(mark: nil).where(result_id: results.ids).pluck(:mark)\n end", "title": "" }, { "docid": "6485947c6a4c372b7450f90de4cf1365", "score": "0.5400576", "text": "def index\n @studies = Study.accessible(current_user).to_a\n end", "title": "" }, { "docid": "6485947c6a4c372b7450f90de4cf1365", "score": "0.5400576", "text": "def index\n @studies = Study.accessible(current_user).to_a\n end", "title": "" }, { "docid": "4286e88e58a23ac25cf7f5e9eadedb8a", "score": "0.539732", "text": "def scores\r\n\t\t@ary\r\n\tend", "title": "" }, { "docid": "35e943139edeb18971eb56b227d1cc5f", "score": "0.5393501", "text": "def sponsors_array\n sponsors_array = []\n self.studies.map do |study| \n sponsors_array << study.sponsors\n end\n sponsors_array.flatten\n end", "title": "" }, { "docid": "f963d5d3dd500f14a9bc45ae90b90bf1", "score": "0.53918767", "text": "def assessments\n get_data_elements('assessment')\n end", "title": "" }, { "docid": "3c25d0a18fb1b7a58e8360218c0f04ae", "score": "0.5387732", "text": "def index\n @learnings_students = LearningsStudent.all\n end", "title": "" }, { "docid": "3e64d80dce0c54b669bf9e1edf59df1a", "score": "0.5385451", "text": "def assessment_marks\n AssessmentMark.all(:conditions => {:student_id => self.id})\n end", "title": "" }, { "docid": "79269d773c58a5728c2ca11f5c1bff1c", "score": "0.5384727", "text": "def words\n @words\n end", "title": "" }, { "docid": "bcab35ddd27409a032b9b8f734797c3d", "score": "0.53793836", "text": "def questions\n @data[:questions]\n end", "title": "" }, { "docid": "1065c06cb193390cdceab8362fb014fc", "score": "0.537318", "text": "def children\n return students\n end", "title": "" }, { "docid": "fe101609014754800148cbd51214083b", "score": "0.53644776", "text": "def questions\n @questions\n end", "title": "" }, { "docid": "e5b76fa10b9152addd5753c0697e9ae7", "score": "0.53616786", "text": "def skill\n if @data == nil\n return nil\n else\n return @data[self.index]\n end\n end", "title": "" }, { "docid": "3fdaa7645acf1b1bc5d8ece516863b80", "score": "0.53577363", "text": "def words\n @words\n end", "title": "" }, { "docid": "4efd9292ce72d147a7f044bf61612c70", "score": "0.53565234", "text": "def schools\n self.dig_for_array(\"schools\")\n end", "title": "" }, { "docid": "35e199301b531dbf48707511372ab912", "score": "0.5346533", "text": "def skills\n\t\tresult = []\n\t\t@skills.each do |skill|\n\t\t\tresult << skill unless skill.skill.spell\n\t\tend\n\n\t\treturn result\n\tend", "title": "" }, { "docid": "89b332dc2f5b81dc844ea2f5a3bdcd92", "score": "0.5345945", "text": "def marks\n @marks\n end", "title": "" }, { "docid": "77a1e1f7c7df50e9a1b13e7340f53950", "score": "0.53406954", "text": "def assignment_scores(grade_hash, assignment_num)\nscores array= []\nscores array = grade hash [student]\n\n\n\nend", "title": "" }, { "docid": "40424c477bcb39837fafeef69daa6f33", "score": "0.53310776", "text": "def questions\n return @questions\n end", "title": "" }, { "docid": "4e13fbb80e462ca3713390a6468d995a", "score": "0.5326121", "text": "def subjects\n return @subjects\n end", "title": "" }, { "docid": "d12240be836cc064fcbeb7c36b117b00", "score": "0.5323901", "text": "def diagnostic_studies\n get_data_elements('diagnostic_study')\n end", "title": "" }, { "docid": "bb4ed00f0e4bc388dfdaaada184e8f92", "score": "0.53175914", "text": "def questions\n questions_hash = self.questions_hash()\n questions = []\n\n self.question_ids.each do |question_id|\n questions << questions_hash[question_id]\n end\n\n questions\n end", "title": "" }, { "docid": "c96d35387331260c91ee803322867956", "score": "0.5312015", "text": "def student\n enrolled_student.student\n end", "title": "" }, { "docid": "ea1f8fdf25e256083cd7dc9914a020e7", "score": "0.53107184", "text": "def schools\n return @schools\n end", "title": "" }, { "docid": "ea1f8fdf25e256083cd7dc9914a020e7", "score": "0.53107184", "text": "def schools\n return @schools\n end", "title": "" }, { "docid": "ea1f8fdf25e256083cd7dc9914a020e7", "score": "0.53107184", "text": "def schools\n return @schools\n end", "title": "" }, { "docid": "ea1f8fdf25e256083cd7dc9914a020e7", "score": "0.53107184", "text": "def schools\n return @schools\n end", "title": "" }, { "docid": "1eb50c9744eb5998b4153b69ef9ff134", "score": "0.53045326", "text": "def index\n check_not_learner\n @knowledgeElements = KnowledgeElement.all\n end", "title": "" }, { "docid": "58224aef8c4fd7ebd54e9d85d93e514e", "score": "0.5303307", "text": "def hidden_skills\n @hidden_skills ||= []\n end", "title": "" }, { "docid": "45c129cf8de780d1492b65119aa4bc7d", "score": "0.52909344", "text": "def skills\n all_skills = Array.new\n all_skills += job.skills unless job.skills.blank?\n all_skills << specie.skill unless specie.skill.blank?\n all_skills << specie.family.skill unless specie.family.skill.blank?\n return all_skills\n end", "title": "" }, { "docid": "df5417a5f40c47055f36eeaa76e20e27", "score": "0.5284812", "text": "def student_keys\n\nend", "title": "" }, { "docid": "b812f07990b7c0a6a251e2d09131aa94", "score": "0.52764267", "text": "def student_associations\n [:advisor, :program_detail, :cop_in, :cop_out, :coops, :audits,\n :senior_project, :labels]\n end", "title": "" }, { "docid": "76d3f7b4466b1c3d206579804f24b9c6", "score": "0.52688205", "text": "def students\n #look through all courses and select all courses that match the name and prof id as the course instance we're on\n course_objects = self.class.all.select do |course|\n (course.name == self.name) && (course.professor_id == self.professor_id)\n end\n #of those courses, we only want the students name\n student_names = course_objects.map do |obj|\n Student.find_student(obj.student_id).name\n end\n end", "title": "" }, { "docid": "65c3ac13a19c2db6092a7f9305e6b0c4", "score": "0.5268011", "text": "def studentArray(value)\n @students = Array.new unless defined? @students\n # \n if value.is_a?(Array)\n value.each{|student| @students << student}\n else\n @students << value\n end\nend", "title": "" }, { "docid": "e7ce4fd1918b019fda034bd9b972d6f7", "score": "0.52622724", "text": "def index\n @student_informations = StudentInformation.all\n end", "title": "" }, { "docid": "7aacbb6687ba99a2d8c6bc7b6882d559", "score": "0.52613604", "text": "def answers\n @student = @semester.users.find(params[:id])\n @word_answers = @student.word_answers.find(:all)\n @word_hash = split_into_hash_of_arrays(@word_answers) { |ans| ans.word } \n @completion_answers = @student.completion_answers.find(:all)\n @scenario_answers = @student.scenario_answers.find(:all)\n @discussion_posts = Post.find_discussion_posts(@student.id)\n @gallery_posts = Post.find_gallery_posts(@student.id)\n end", "title": "" }, { "docid": "e4d6c8f2a6f266cfbd74eabd7065358d", "score": "0.5258807", "text": "def assessments\n tests_and_quizzes\n end", "title": "" }, { "docid": "e4d6c8f2a6f266cfbd74eabd7065358d", "score": "0.5258807", "text": "def assessments\n tests_and_quizzes\n end", "title": "" }, { "docid": "8765ee0d93195d82a2c5d9b7f13dc25a", "score": "0.52576196", "text": "def results\n array\n end", "title": "" }, { "docid": "b16e507f9d9e0257820af5461a6b9638", "score": "0.5245444", "text": "def student\n end", "title": "" }, { "docid": "3212dc4bd651f315b06bf4a4e47fa3c2", "score": "0.5241397", "text": "def learn(knowledge_str)\n self.knowledge << knowledge_str\n end", "title": "" } ]
c84f53ca5f6416534a7fd2b4be99bb68
Prompts the user for text input.
[ { "docid": "f03ce6676694e004772a1d9ba358c3c5", "score": "0.0", "text": "def get_text(caption, prompt, options = {})\n Qt::InputDialog.getText(options[:parent], caption, prompt,\n options[:mode] || Qt::LineEdit::Normal,\n options[:text] || '')\n end", "title": "" } ]
[ { "docid": "eeffc2efad47105124e527e28bad03eb", "score": "0.7889738", "text": "def prompt(text)\n @output += %(#{text}\\n)\n print text\n STDIN.gets\n end", "title": "" }, { "docid": "9845c62e49837c6beba6f19403e33386", "score": "0.7507681", "text": "def ask_input(text, color=nil, *args)\n self.ask(\"#{text}\", color, *args)\n end", "title": "" }, { "docid": "92df750aa9fec80c25773921779e77af", "score": "0.7221365", "text": "def prompt\n\tputs \"Any Key to continue\"\n\tgets\nend", "title": "" }, { "docid": "77c96242926833346a716ddcf4dca51e", "score": "0.7125066", "text": "def ask! message\n print message\n\n STDIN.noecho(&:gets).chomp\n end", "title": "" }, { "docid": "bb336f9500c0d93c644d2541384e19b4", "score": "0.712417", "text": "def ask message\nprint message\nSTDIN.gets.chomp\nend", "title": "" }, { "docid": "e832ae2213c6ea32b255d55cd7ba563d", "score": "0.7101498", "text": "def prompt( message )\n\tprint message\n\tgets.chomp\nend", "title": "" }, { "docid": "213c97d0a1364990c72e99b2e4584f54", "score": "0.7070303", "text": "def prompt\n gets.strip\nend", "title": "" }, { "docid": "a1edb321c9148635c7388b8a593b2bfd", "score": "0.7066719", "text": "def ask_for(detail)\n puts \"Enter #{detail}\"\n STDIN.gets.chomp \nend", "title": "" }, { "docid": "89ad62d30b22ce54ba65bd5ab760c20d", "score": "0.70501244", "text": "def ask\n gets.strip\n end", "title": "" }, { "docid": "21736621c4784c2e8eb308d031b8b20e", "score": "0.70499855", "text": "def get_user_input(message)\n puts message\n gets.chomp\n end", "title": "" }, { "docid": "95489b343b48779bdba2778d06647b32", "score": "0.7034443", "text": "def prompt(message)\n\tprint message\n\tgets.chomp\nend", "title": "" }, { "docid": "c318f956f6304ed06098f9e49c5299a2", "score": "0.7021003", "text": "def ask message\n print message\n STDIN.gets.chomp\nend", "title": "" }, { "docid": "c318f956f6304ed06098f9e49c5299a2", "score": "0.7021003", "text": "def ask message\n print message\n STDIN.gets.chomp\nend", "title": "" }, { "docid": "c318f956f6304ed06098f9e49c5299a2", "score": "0.7021003", "text": "def ask message\n print message\n STDIN.gets.chomp\nend", "title": "" }, { "docid": "997236c2624fef0504f36a5dfcaa4638", "score": "0.7008114", "text": "def prompt(message)\n print \"#{message}: \"\n $stdin.gets\n end", "title": "" }, { "docid": "0d74a3a00f18aed5a56e614375448bff", "score": "0.69997644", "text": "def prompt(text)\n print text\n input = readline.chomp\n throw(:quit, lambda {return \"New Action to Render\"} ) if input == \"\"\n return input\nend", "title": "" }, { "docid": "8db4577c9923ce3f8b53fc8ae3159a31", "score": "0.69439244", "text": "def prompt(input)\n print \"#{input}: \".yellow\n STDIN.gets.chomp\n end", "title": "" }, { "docid": "e04145d044aac6e22b9c954aa84e4b61", "score": "0.6940657", "text": "def ask(string)\r\n log '', string\r\n STDIN.gets.strip\r\n end", "title": "" }, { "docid": "79e05fa361f5101ab217c5c6dce94d79", "score": "0.6934126", "text": "def asks_question(question)\n puts question\n gets.chomp\nend", "title": "" }, { "docid": "c6a770ae38394cd1e482fcbc2cec638d", "score": "0.69296736", "text": "def ask_user\n\tprint \"User: \".blue\n\tgets.chomp\nend", "title": "" }, { "docid": "9f4b4a9c032acda79244b8f1e4a40a84", "score": "0.6925907", "text": "def continue_prompt\r\n puts \"Press enter key to continue....\"\r\n continue = gets.chomp\r\n end", "title": "" }, { "docid": "fbca7815b73ba366e93788957ebbbdd2", "score": "0.6920662", "text": "def prompt(label)\n print \"#{label}: \"\n STDIN.gets\nend", "title": "" }, { "docid": "66d6a40b1787cb60a6c8f825724fa59c", "score": "0.69060844", "text": "def ask_name\n PROMPT.ask(\"Choose your name: \") do |q|\n q.required true\n q.modify :capitalize\n end\nend", "title": "" }, { "docid": "e983353d7f8e41fb5ae196b3e2e656a3", "score": "0.68999976", "text": "def ask_input\n\t\tputs \"where do you want to go ? N, S, W, E\"\n\t\tuser_input = gets.chomp\n\tend", "title": "" }, { "docid": "d1cf53b8ddf46c5a39215deaf5d0de6c", "score": "0.68914264", "text": "def user_input\n\tgets\nend", "title": "" }, { "docid": "ec2b13607e2c11fb341e77d9bdf18d7d", "score": "0.68887305", "text": "def entry_prompt\n type('Type your choice here, then press enter: '.yellow)\n end", "title": "" }, { "docid": "8a9b3ba1d724bf0a2136c33d327e4ade", "score": "0.68860424", "text": "def prompt(input)\n print \"\\e[36m#{input}:\\e[0m \"\n STDIN.gets.chomp\n end", "title": "" }, { "docid": "3943ac4ecf8443e954599d875099ff29", "score": "0.68857723", "text": "def set_text_input(input); end", "title": "" }, { "docid": "50955d8ce2d10847b7647b88af586274", "score": "0.6883301", "text": "def prompt(message)\n\tprint messaage\n\tgets.chomp # implicit return\nend", "title": "" }, { "docid": "d7de55e18383c3715fecbe089b235f54", "score": "0.68751854", "text": "def get_text(input)\n \n check = false\n until check == true\n puts \"Please enter your character's #{input}.\".colorize(:cyan).indent(10)\n print \"***>\".indent(10)\n user_input = gets.chomp\n puts \"Your character's #{input} is: #{user_input.capitalize.bold}\".colorize(:cyan).indent(10)\n check = confirm_text\n end\n user_input\n\nend", "title": "" }, { "docid": "677009799dd309fe510b18c31714f294", "score": "0.68735796", "text": "def ask_name\n puts \"What's your name?\"\n gets.chomp\nend", "title": "" }, { "docid": "c5b3761d531f693d06877b7a08e47694", "score": "0.68562585", "text": "def prompt(text)\n Kernel.puts(\"=> #{text}\")\nend", "title": "" }, { "docid": "1ca11c1fd9a12df006a2d0ba156b3dbc", "score": "0.6854234", "text": "def ask_user_for(something)\n # Print question asking for the name, price, or something else\n puts \"What is the #{something.capitalize}?\"\n print \"> \"\n # return the user´s input\n return gets.chomp\n end", "title": "" }, { "docid": "f8c7dd87332d3c8f81e4ab071d8a981b", "score": "0.68381464", "text": "def prompt(question)\n puts question\n gets.chomp\nend", "title": "" }, { "docid": "34e9c787b2bdfef93e42f228f5deb23a", "score": "0.68380433", "text": "def ask_for_(thing)\n puts \"What's the #{thing}?\"\n gets.chomp\n end", "title": "" }, { "docid": "9b733fbf5fce35b0938a4ac274eeef05", "score": "0.6815609", "text": "def prompt (name)\n puts \"What is your name?\"\n name = gets\n puts \"Hello #{name}!\"\n end", "title": "" }, { "docid": "96283cbaaa2fa115c3f384663ec811ca", "score": "0.6805885", "text": "def prompt(message)\n\tprint message\n\tgets.chomp #Implicit Return\nend", "title": "" }, { "docid": "0831caad6a5c279a53c8d7b0e1b598c1", "score": "0.6801101", "text": "def prompt_user\n puts \"Type \\'h\\' to hit or \\'s\\' to stay\"\nend", "title": "" }, { "docid": "95868fe43c64d2a646d21969e17b502d", "score": "0.67992836", "text": "def get_user_input(prompt)\n print \"#{prompt}: \"\n gets.chomp\nend", "title": "" }, { "docid": "ce836f2b9a59a3673cded027ba568e46", "score": "0.67957354", "text": "def ask(prompt)\n print \"#{prompt}: \"\n $stdin.gets.chomp\n end", "title": "" }, { "docid": "fc635ea243005d8312fadda07e214bbe", "score": "0.67853403", "text": "def prompt(text)\n puts \"==> #{text}\"\nend", "title": "" }, { "docid": "a3aab852cd5ff6dcb706ccb42c88b5e1", "score": "0.67674315", "text": "def prompt(text)\n puts \">> \" + text\nend", "title": "" }, { "docid": "d0709bcba8ce262085bedb6b6e96e31a", "score": "0.67533547", "text": "def ask_for_user_input(msg=nil, opts={})\n print msg if msg\n print \": \"\n STDOUT.flush\n if opts[:password]\n system \"stty -echo\"\n result = STDIN.gets\n system \"stty echo\"\n puts\n else\n result = STDIN.gets\n end\n result.chomp\nend", "title": "" }, { "docid": "397f65a43b3893b514545c784b525d1b", "score": "0.67495227", "text": "def prompt(message)\n\tprint message\n\tname = gets.chomp\nend", "title": "" }, { "docid": "975842d2e63552674eb086b011e099c5", "score": "0.6748223", "text": "def ask(what, title)\n @dialog.title = \"\\\"#{title}\\\"\"\n \n res = @dialog.inputbox(\"'#{what}'\")\n \n raise CancelPressed.new unless res\n \n res\n end", "title": "" }, { "docid": "8815d656d3cd5efa6e962335364dc486", "score": "0.67299306", "text": "def ask_for_ingredient\n puts \"What ingredient do you want to search for?\"\n print \"> \"\n gets.chomp\n end", "title": "" }, { "docid": "e949c5b433d3e00d6d61496d22516189", "score": "0.67290324", "text": "def prepare_input(prompt); end", "title": "" }, { "docid": "a8a5b972894902892dd4c5a7d2890d18", "score": "0.67250645", "text": "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "title": "" }, { "docid": "a8a5b972894902892dd4c5a7d2890d18", "score": "0.67250645", "text": "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "title": "" }, { "docid": "a8a5b972894902892dd4c5a7d2890d18", "score": "0.67250645", "text": "def prompt_user\n puts \"Type 'h' to hit or 's' to stay\"\nend", "title": "" }, { "docid": "757e8847285c7fab3b1f139c081ca0a7", "score": "0.67234117", "text": "def prompt(text)\n print \">> \" + text\nend", "title": "" }, { "docid": "e5c29e98b5f683d447b09d99a28048b3", "score": "0.6717807", "text": "def get_input(question)\n\t\tputs \"What's your #{question}?\"\n\t\tgets.chomp\nend", "title": "" }, { "docid": "4f945b68545ec3a3f4a74f07acbb1085", "score": "0.6716342", "text": "def prompt(message)\n print message\n gets.chomp\nend", "title": "" }, { "docid": "865f3868a3af4222a6c266b102810148", "score": "0.67136395", "text": "def prompt_user_song\n puts \"Please enter a song name or number:\"\nend", "title": "" }, { "docid": "a3cda4527968dbffa18c7adb7bcc4d5e", "score": "0.67122114", "text": "def make_selection\n\tprint \"\\nPlease make a selection \"\n\tgets.chomp\nend", "title": "" }, { "docid": "7d0d0fc77e89b8a60d2a18984cdd9c79", "score": "0.6708337", "text": "def user_input\n gets.chomp\nend", "title": "" }, { "docid": "7d0d0fc77e89b8a60d2a18984cdd9c79", "score": "0.6708337", "text": "def user_input\n gets.chomp\nend", "title": "" }, { "docid": "40634c384a744f64094d5620bf70cd02", "score": "0.67079645", "text": "def prompt\n puts\"=>\"\n gets.chomp\nend", "title": "" }, { "docid": "4c18a51272df1cf2d2d53f52fce8999e", "score": "0.6701201", "text": "def question_prompt(field, opts = {})\n trap(\"INT\") { exit 1 }\n begin\n print \"Please input #{field}: \"\n response = opts[:password] ? STDIN.noecho(&:gets).strip : STDIN.gets.strip\n end until not response.empty?\n response\nend", "title": "" }, { "docid": "56b2ed7d73bfb9dc4657fd2a8c1e4dc8", "score": "0.6699996", "text": "def input(thing)\n print \"Enter #{thing}: \"\n gets.chomp\nend", "title": "" }, { "docid": "00a8115ae2275cfa530c56c2b178c392", "score": "0.6696072", "text": "def prompt(var, text=nil)\n set(var) do\n Capistrano::CLI.ui.ask \"#{text||var} : \"\n end\n end", "title": "" }, { "docid": "5236973032471e7ef5c64d408e2b0992", "score": "0.668674", "text": "def ask(question)\n puts question\n gets.chomp\nend", "title": "" }, { "docid": "1027596253efb082ae4f7d1ad009a2ac", "score": "0.66790247", "text": "def continue_prompt\n puts \"Do you wish to continue?\"\n response = gets.chomp\n response.downcase\nend", "title": "" }, { "docid": "3b86563d85b15f4d6b87a4fb51c195b4", "score": "0.6673597", "text": "def get_user_input\n gets.chomp\nend", "title": "" }, { "docid": "3b86563d85b15f4d6b87a4fb51c195b4", "score": "0.6673597", "text": "def get_user_input\n gets.chomp\nend", "title": "" }, { "docid": "18928314edc66a4abf8f5122208c5fd4", "score": "0.6663888", "text": "def prompt(msg)\n print \"#{msg}: \"\n gets.chomp\nend", "title": "" }, { "docid": "18928314edc66a4abf8f5122208c5fd4", "score": "0.6663888", "text": "def prompt(msg)\n print \"#{msg}: \"\n gets.chomp\nend", "title": "" }, { "docid": "b33d0aa30a033662952c3a4e90810391", "score": "0.6660006", "text": "def prompt_user(message)\n puts message\n print \">> \"\n gets.chomp\nend", "title": "" }, { "docid": "9a08e6c549e000ce0b52f99470f7d831", "score": "0.66531676", "text": "def ask_name()\n puts \"What is your name?\"\n name = gets.chomp\n puts \"Hello #{name}!\"\nend", "title": "" }, { "docid": "17a64a84574a666868b028e4acf0a0d1", "score": "0.6647866", "text": "def prompt(msg)\n puts \" => #{msg}\"\n gets.chomp\nend", "title": "" }, { "docid": "82b3e05383167e30f90f82d7ba57dac1", "score": "0.6647141", "text": "def ask_name\r\n puts \"\\e[33mWhat is your name ?\"\r\n print \"\\e[39m> \"\r\n gets.chomp\r\n end", "title": "" }, { "docid": "fe6bf2623086998c9837122848b374c6", "score": "0.6644631", "text": "def pause_here\n puts \"\\n\\nHit ENTER to continue\"\n gets.chomp\nend", "title": "" }, { "docid": "301d96fceb29c224a3c18df73cd7a926", "score": "0.66332966", "text": "def set_prompt(text)\n @prompt = text\n draw\n end", "title": "" }, { "docid": "28a7aa37f67f5c53f7d0a0dc98efd2ab", "score": "0.6621272", "text": "def ask_user_for(something)\n puts \"What is the recipe #{something} ?\"\n return gets.chomp\n end", "title": "" }, { "docid": "f8846961b8737e1fb165764563f5d3c2", "score": "0.6611925", "text": "def read_from_console\n puts 'Enter URL, please:'\n @url = STDIN.gets.chomp\n\n puts 'Enter the name to this link, please:'\n @text = STDIN.gets.chomp\n end", "title": "" }, { "docid": "b7d4038dddb27a7a5fdb420b8d14b4f2", "score": "0.6603428", "text": "def get_user_input\n puts \"Please enter a search term\"\n gets.chomp\nend", "title": "" }, { "docid": "d2b495f7de0e47abcf47e68e9b111083", "score": "0.66022205", "text": "def ask( prompt )\n print prompt\n gets.chomp\nend", "title": "" }, { "docid": "e95bbef7c7b22f5c0c0c8a38eb7c6935", "score": "0.65987235", "text": "def input( message )\n selection = nil\n\n print message\n until yield(selection = gets.strip)\n print message\n end\n\n selection\n end", "title": "" }, { "docid": "2216a7a174cac5a92ac3724561208fb2", "score": "0.65952045", "text": "def prompt_greeting(namehere)\n print(namehere)\n gets\nend", "title": "" }, { "docid": "682462dbc00d7fb20b379676eba647dd", "score": "0.65896124", "text": "def gets\n print @prompt\n @io.gets\n end", "title": "" }, { "docid": "57e8059d4d542d0c8fdb2b4e376415e3", "score": "0.6580226", "text": "def pause_prompt\n puts \"Press ENTER to continue . . .\"\n STDIN.getc\nend", "title": "" }, { "docid": "0ce6c541e48b644f2e508b4f02d729f3", "score": "0.6578981", "text": "def plainTextInput()\n puts \"Please enter a single word (no spaces): \"\n word = gets.chomp #take user input\n puts \"The plain text word submission is: #{word}\"\n\n #begin encoding with user input\n textEncryptor(word, keyGenerator)\n\nend", "title": "" }, { "docid": "cd00b2ef3998d46f6fbebf6b20f6ac09", "score": "0.6574605", "text": "def get_user_input\n puts 'Welcome to Google Books Searcher'\n puts 'Enter a search term:'\n gets.chomp\nend", "title": "" }, { "docid": "7e28782f37219f1210caf91b0066b566", "score": "0.65713906", "text": "def wait(str='Press ENTER to continue.')\n puts\n self.warning(str)\n STDIN.gets\n end", "title": "" }, { "docid": "b5fa44f62adb9908e333183e87f97954", "score": "0.65634674", "text": "def prompt_input\n class_invariant\n print ps1\n command = gets.chomp\n class_invariant\n return command\n end", "title": "" }, { "docid": "3245792f8514fb4c759185c6c04a7b5f", "score": "0.65607285", "text": "def fetch_input(prompt)\n\tprint prompt\n\tgets.chomp #implicit return again\nend", "title": "" }, { "docid": "020dc4d5cc0ad0c2b889d3bbbe5fe8a0", "score": "0.65597194", "text": "def text_input; end", "title": "" }, { "docid": "1770761602229718e285b48d6944e705", "score": "0.6557237", "text": "def input(prompt)\n raw_input(prompt).strip\n end", "title": "" }, { "docid": "93d42f06cfc30f3a36b03fec3054eebb", "score": "0.6547691", "text": "def prompt_text(form, answer, hint)\n form.text_field :answer, :class => 'form-control input-lg', :placeholder => hint\n end", "title": "" }, { "docid": "1e7d724fe7035868320c2e30d23b790d", "score": "0.65447164", "text": "def ask_for_name\n puts \"what s the name of the task you want to create?\"\n name = gets.chomp\n end", "title": "" }, { "docid": "194fab60b786a2d9b158adf827e2ae0d", "score": "0.6542146", "text": "def user_input\n print '>> '.yellow\n case raw_input = gets.chomp\n when 'c', 'cancel' then tell_user \"\\n\";raise ProgramExceptions::Cancel.new\n else\n tell_user \"\\n\"\n return raw_input\n end\n rescue => error\n raise ProgramExceptions::Exit.new if\\\n error.class == ProgramExceptions::Exit ||\n (defined?(IRB) && error.class == IRB::Abort)\n raise error\n end", "title": "" }, { "docid": "41c7480a66ef20ff0aab7a92d3ab8a04", "score": "0.65413785", "text": "def user_input\n input = gets.chomp\n end", "title": "" }, { "docid": "080128c97a30a2018dae2e2e3e988228", "score": "0.6537494", "text": "def provide_user_option \r\n @user_choice = user_input \"\\nWhat would you like to do?\\nPress 1 to pick a file and play normally\\nPress 2 to play file in reverse\\nPress 3 if you'd like to exit\\n\"\r\nend", "title": "" }, { "docid": "f899fc2f93bdefeeb2e863952ef8e7c0", "score": "0.65344304", "text": "def greet\n print 'Enter your name : '\n name = gets.to_s.chomp\n puts \"Hello #{name}\"\nend", "title": "" }, { "docid": "001133a4b7b82c722554590abc8a07a6", "score": "0.65324867", "text": "def greet_screen\n separator\n welcome_user\n separator\n input = gets.chomp\n if input == \"concerts\"\n concert_screen\n elsif input == \"exit\"\n exit_screen\n else\n unrecognized_input\n end\n end", "title": "" }, { "docid": "90efa6f87a029b464d893852c28be34c", "score": "0.65299666", "text": "def get_user_input\n gets.strip\nend", "title": "" }, { "docid": "476be58077b88bb247c238c7d5321719", "score": "0.6527895", "text": "def prompt(string)\n puts \"=> #{string}\"\n gets.chomp\nend", "title": "" }, { "docid": "89f50e2916e2796c94d7d5c2e3d26f7d", "score": "0.6526371", "text": "def ask(question)\n $stdout.puts(question)\n $stdout.print('> ')\n $stdin.gets.chomp\nend", "title": "" }, { "docid": "848c61426493971510af8ed76c4a5030", "score": "0.65220046", "text": "def prompt; end", "title": "" }, { "docid": "848c61426493971510af8ed76c4a5030", "score": "0.65220046", "text": "def prompt; end", "title": "" }, { "docid": "848c61426493971510af8ed76c4a5030", "score": "0.65220046", "text": "def prompt; end", "title": "" } ]
e16b167238f1bc140c266d5c96ff43bd
Parses and returns the time at which the request was made
[ { "docid": "41990137a961e3db54ea6fa8aff48f3a", "score": "0.6510959", "text": "def parse_time\n time_str = @request[FTIME].sub(REGEX_TIME_FIX) { \"#{$1} #{$2}\" }\n Time.parse(time_str) rescue nil\n end", "title": "" } ]
[ { "docid": "ea454c187d76b5a1e323f84874801711", "score": "0.7224476", "text": "def get_request_timestamp\n\t\treturn @transport.get_path(\"meta\",\"datetime\")\n\tend", "title": "" }, { "docid": "bb208281ad90b1c90bf2c87e229035a0", "score": "0.70193946", "text": "def received_at\n request_datetime\n end", "title": "" }, { "docid": "cbd1b3e4b08e89dc1a95d644c585748d", "score": "0.6884951", "text": "def request_timestamp\n auth_info[\"date\"] || \"\"\n end", "title": "" }, { "docid": "3b5124cd4fa6eed032a2966df740102f", "score": "0.6790052", "text": "def request_timestamp\n request_time.strftime(\"%Y%m%dT%H%M%SZ\")\n end", "title": "" }, { "docid": "939104abcb86bac2ba7f3a96b694dabb", "score": "0.6729516", "text": "def received_at\n params['TIMESTAMP']\n end", "title": "" }, { "docid": "c70f774a06b5089f44282bd3fa81bfef", "score": "0.67256606", "text": "def time()\n return _request([\n 'time',\n '0'\n ])[0]\n end", "title": "" }, { "docid": "ad42d8f46dab7be29abb768a8a233463", "score": "0.667363", "text": "def received_at\n params['date'] + params['time']\n end", "title": "" }, { "docid": "a7df26b394767505f69984780ee7ea5a", "score": "0.6670794", "text": "def request_time\n @request_time ||= Time.now.utc\n end", "title": "" }, { "docid": "761bffc654c27f6d8bfe9ad88b1517f1", "score": "0.6647755", "text": "def request_timestamp(cli,request)\n\t\tprint_status(\"#{cli.peerhost} - #{current_time} - [HTTP GET] - #{request.uri}\")\n\tend", "title": "" }, { "docid": "ab5fcf5a41d9242cde5c874b8c5078e9", "score": "0.661575", "text": "def received_at\n params[:json]['message_time']\n end", "title": "" }, { "docid": "4a1aedced935f4425488725d00ece2d7", "score": "0.6605116", "text": "def received_at\n Time.parse(params['created']) if params['created']\n end", "title": "" }, { "docid": "e46e90237ef37b11964f843b8dbc869c", "score": "0.6582362", "text": "def time\n\t\tresponse = self.request( :time )\n\t\treturn nil if response.empty?\n\t\treturn Time.at( response.first[:time].to_i )\n\tend", "title": "" }, { "docid": "f9d2710b48511b321fb9261fcdb9a542", "score": "0.6573231", "text": "def time()\n return self._request([\n 'time',\n '0'\n ])[0]\n end", "title": "" }, { "docid": "a414f41c5bde450cf2e8a799e48f2aab", "score": "0.65645176", "text": "def requested_time\n val = params[:requested_time]\n val.present? ? Time.at(val.to_i) : Time.current\n end", "title": "" }, { "docid": "38ce871aa59c9a80f476a7e44f17a1dc", "score": "0.6564116", "text": "def remote_last_updated_at\n require 'rexml/document'\n doc = REXML::Document.new(request('update'))\n Time.iso8601(doc.root.attributes['time'])\n end", "title": "" }, { "docid": "59f7427cfdc2be48fc5bf368ef87a198", "score": "0.6480427", "text": "def time\n params['time']\n end", "title": "" }, { "docid": "037985f3a33e1722ad87be5125edd4e8", "score": "0.64752007", "text": "def time\n #Parse the raw time into a binary time structure...\n time = send_request(Packets::RequestTime.new)\n\n #And convert that to a ruby time.\n time.to_time()\n end", "title": "" }, { "docid": "488788c6c8b947c824a7f1e8b10f6c05", "score": "0.6467303", "text": "def time\n Time.parse(@data['date'])\n end", "title": "" }, { "docid": "c0ac85b056746af6a0239c5cebd7b904", "score": "0.6427002", "text": "def met_at\n return Time.parse(read) if met?\n nil\n end", "title": "" }, { "docid": "e10cd8199ec479e9dc34020074333090", "score": "0.64229995", "text": "def time_from_header(t)\n Time.httpdate(t).to_i if t\n rescue ArgumentError\n end", "title": "" }, { "docid": "5f88c954d652c81ae325870cb63fd341", "score": "0.64032614", "text": "def time\n reply.documents[0][TIME]\n end", "title": "" }, { "docid": "d3c933940de8d3cb277d703ff846f1f3", "score": "0.6398777", "text": "def httpdate\n Time.now.httpdate\n end", "title": "" }, { "docid": "2dee633f3f4eea625d427f6b99f8f1ae", "score": "0.637485", "text": "def request_datestamp\n request_time.strftime(\"%Y%m%d\")\n end", "title": "" }, { "docid": "dee2c589ab4ff5fc68063f303b39252b", "score": "0.63497204", "text": "def received_at\n params['']\n end", "title": "" }, { "docid": "e23e6c93942e2bd029730caaad1a884b", "score": "0.6343602", "text": "def time\n case method\n when :get\n ok(Time.now.to_s)\n when :post\n ok(Time.now.strftime(post[:format] || \"%Y-%m-%dT%H:%M%:%S%Z\"))\n else\n raise NotImplemented.new\n end\n end", "title": "" }, { "docid": "a0c14b3ed740927ab2cc13b8b894f12a", "score": "0.6343189", "text": "def processed_at\n @processed_at ||= begin\n groups = *mapping_for(:processed_at).match(/(\\d{2})\\/(\\d{2})\\/(\\d{4}) ([\\d:]+)/sm)\n Time.parse(\"#{groups[3]}-#{groups[2]}-#{groups[1]} #{groups[4]}\")\n end\n end", "title": "" }, { "docid": "aff4ea6428b31601690d4e1be76a4b95", "score": "0.6335799", "text": "def received_at\n params['']\n end", "title": "" }, { "docid": "43ae8f96d91e828718977caf42882334", "score": "0.6332", "text": "def start_on\n @data.has_key?('start_on') ? Time.parse(data['start_on']) : nil\n end", "title": "" }, { "docid": "e6098cba9d860d415194bb7c1348fa9b", "score": "0.63286483", "text": "def received_at\n params['Process_date'] + params['Process_time']\n end", "title": "" }, { "docid": "5f6b4e1390082540ab87dbc4f2009228", "score": "0.6324962", "text": "def get_response_time(uri)\n t0 = Time.now\n res = Net::HTTP.get_response(uri)\n\n Time.now - t0\nend", "title": "" }, { "docid": "331c71076a4d8b9ec5a1db00f7486113", "score": "0.63197553", "text": "def time\n request :public, :get, :time\n end", "title": "" }, { "docid": "379c926f5bb296b4960af428ac5b93ea", "score": "0.63150394", "text": "def time\n Time.parse(@timestamp)\n end", "title": "" }, { "docid": "0272508bc22d99c8dc8964c6f5679c13", "score": "0.6308702", "text": "def date_updated\n Time.parse(@attrs['DateUpdated'])\n end", "title": "" }, { "docid": "0272508bc22d99c8dc8964c6f5679c13", "score": "0.6308702", "text": "def date_updated\n Time.parse(@attrs['DateUpdated'])\n end", "title": "" }, { "docid": "55c7f69a86134079db983edc3c35d587", "score": "0.6301351", "text": "def fetch_date_time(response)\n\tbegin\t\t\t\n\t\tdate_time_val = response.string_between_markers(\"tweet-timestamp\",\"\\\\u003E\").strip\n\t\tdate_time_val = date_time_val.string_between_markers(\"js-permalink js-nav\\\\\\\" title=\\\\\\\"\",\"\\\\\\\"\")\n\t\tif date_time_val != nil and date_time_val.to_s != \"\"\n\t\t\tset_date_time(date_time_val)\t\t\n\t\t\tLogWriter.debug(\"date_time:\"+date_time_val)\t\n\t\t\treturn date_time_val\n\t\telse\t\t\t\n\t\t\tLogWriter.debug(\"date_time: UNKNOWN\")\n\t\t\treturn \"UNKNOWN\"\n\t\tend\n\trescue Exception => e#do not log the exception, since data time parsing breaks often.\n\t\t#LogWriter.error(\"DATE TIME PARSING EXCEPTION\"+e.to_s)#given that this often breaks, it is better to throw this more specific error message\n\t\treturn \"UNKNOWN\"\n\tend\n\tend", "title": "" }, { "docid": "823fa8cc384f143cb407007c3d52b3fc", "score": "0.6277348", "text": "def date_time\n @message[:date_time]\n end", "title": "" }, { "docid": "4e7647b9807c30c8144c678cd5b18e8d", "score": "0.6276137", "text": "def get_requested_at_smart_str\n if Time.current.to_date == self.requested_at.to_date\n get_formatted_time(self.requested_at)\n else\n get_formatted_datetime(self.requested_at)\n end\n end", "title": "" }, { "docid": "3731be378a099031f3b10e770e117d69", "score": "0.6269284", "text": "def system_modified_dtsi\n Time.parse get('system_modified_dtsi')\n end", "title": "" }, { "docid": "02dab33caca596d12fb0bf02928c93a0", "score": "0.62602156", "text": "def finish_on\n @data.has_key?('finish_on') ? Time.parse(data['finish_on']) : nil\n end", "title": "" }, { "docid": "d379ee0d8b72c51c57f80de19f969aae", "score": "0.6251569", "text": "def dispatched_at\n\n fields['dispatched_at']\n end", "title": "" }, { "docid": "222160d17b092fe5f65d766eb50ad54e", "score": "0.62294096", "text": "def system_datetime\r\n request(HTTPMethods::GET, PATH_SYSTEMDATETIME)\r\n end", "title": "" }, { "docid": "a4f42d64a0403c3955fed391c0140906", "score": "0.6229358", "text": "def get_time()\n return @noko.css(\"li.g:first-of-type table table\")[0].text\n end", "title": "" }, { "docid": "0c1c1de2571ae815743cde1a072aa1ba", "score": "0.6224882", "text": "def get_date()\n @time\n end", "title": "" }, { "docid": "c80f297f6e00810e97d336478a75a581", "score": "0.62133753", "text": "def last_seen_at() ; info_time(:last_seen) ; end", "title": "" }, { "docid": "e3659058bb6884d5d97416da7cad8465", "score": "0.6211447", "text": "def http_date\n tp = Time.now.gmtime.to_s.split\n \"#{tp[0]}, #{tp[2]} #{tp[1]} #{tp[5]} #{tp[3]} GMT\"\n end", "title": "" }, { "docid": "fac2a198c52adccd1a1986e3f252d255", "score": "0.6171655", "text": "def received_at\n DateTime.parse(params['TRANSTIME']) if params['TRANSTIME']\n rescue ArgumentError\n nil\n end", "title": "" }, { "docid": "2cf74a1e080680466694fa8fa7511de1", "score": "0.6157485", "text": "def last_parse\n datetime_from(\"sf:last_parse\")\n end", "title": "" }, { "docid": "c18004233635d1e08a4ec23f0d56df56", "score": "0.6125089", "text": "def timestamp\n @data['when'].to_time\n end", "title": "" }, { "docid": "7b73fc03325f8c82250e92b78c5b0a84", "score": "0.61178243", "text": "def received_at\n\tTime.parse params['payment_date']\n end", "title": "" }, { "docid": "be513fd9c87cbe40c0a2cf8c56d0792d", "score": "0.61038095", "text": "def launched_at # {{{\n DateTime.parse(@data[:launchTime])\n end", "title": "" }, { "docid": "d649ac54bd2aa08a8c0882a13bb532e1", "score": "0.6103339", "text": "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "1f481353c55d4c5ba967d778434d8a8a", "score": "0.60773826", "text": "def processed_at\n @data.has_key?('processed_at') ? Time.parse(data['processed_at']) : nil\n end", "title": "" }, { "docid": "8f94e0bed3d922687e962949f9deadb3", "score": "0.60753596", "text": "def open_datetime\n Time.parse(data.fetch('openDate'))\n end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "9d0ee356f46843f22f932f8f29002474", "score": "0.60750234", "text": "def timestamp; end", "title": "" }, { "docid": "4a8c58617ccf56432cfb0000f064ff32", "score": "0.6065142", "text": "def received_at\r\n params['TxTime']\r\n end", "title": "" }, { "docid": "a8ddf1f923b8c1041cfa9812251a5f06", "score": "0.6064722", "text": "def parse_time\n s0 = @scanner.pos\n if match_str('(') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s3 = parse_ms\n if s3 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n if match_str('/') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s5 = parse_hms\n s5 = parse_ms(with_hour: true) if s5 == :failed\n if s5 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n if match_str(')') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'now' => s3, 'total' => s5 }\n end\n end\n end\n end\n end\n s0\n end", "title": "" }, { "docid": "3e1d347df99bfcc7d6a7d35a4e4cc46b", "score": "0.60509664", "text": "def response_time\n @response_time\n end", "title": "" }, { "docid": "d182553e78ebe245540680e7f0826c49", "score": "0.6047474", "text": "def this_event_time\n @event[\"server_gmt\"].to_i\n end", "title": "" }, { "docid": "41d3191a7a65c5cc5ef0915ae63a5b59", "score": "0.6040252", "text": "def getTime(info)\n\treturn Time.at(info[\"currently\"][\"time\"]) + ((info[\"offset\"]+5)*3600)\nend", "title": "" }, { "docid": "fbec1c05f679cc774bb4a9b0e3b74183", "score": "0.60365766", "text": "def time\n if @time.nil?\n time_string = FeedTools::XmlHelper.try_xpaths(self.channel_node, [\n \"atom10:updated/text()\",\n \"atom03:updated/text()\",\n \"atom:updated/text()\",\n \"updated/text()\",\n \"atom10:modified/text()\",\n \"atom03:modified/text()\",\n \"atom:modified/text()\",\n \"modified/text()\",\n \"time/text()\",\n \"lastBuildDate/text()\",\n \"atom10:issued/text()\",\n \"atom03:issued/text()\",\n \"atom:issued/text()\",\n \"issued/text()\",\n \"atom10:published/text()\",\n \"atom03:published/text()\",\n \"atom:published/text()\",\n \"published/text()\",\n \"dc:date/text()\",\n \"pubDate/text()\",\n \"date/text()\"\n ], :select_result_value => true)\n begin\n unless time_string.blank?\n @time = Time.parse(time_string).gmtime\n else\n if self.configurations[:timestamp_estimation_enabled]\n @time = Time.now.gmtime\n end\n end\n rescue\n if self.configurations[:timestamp_estimation_enabled]\n @time = Time.now.gmtime\n end\n end\n end\n return @time\n end", "title": "" }, { "docid": "9a09ae9a109eab014b945dac923f3611", "score": "0.6027239", "text": "def started_at\n Time.parse(self.result_payload[\"started_at\"]) if self.result_payload && self.result_payload[\"started_at\"]\n end", "title": "" }, { "docid": "9c1c370d9a7b8510f61c827d9a9cc47d", "score": "0.6022641", "text": "def atime() end", "title": "" }, { "docid": "9c1c370d9a7b8510f61c827d9a9cc47d", "score": "0.6022641", "text": "def atime() end", "title": "" }, { "docid": "a1fc322b672701c3879e22abdb3f7cf8", "score": "0.60096365", "text": "def received_date_time\n return @received_date_time\n end", "title": "" }, { "docid": "a1fc322b672701c3879e22abdb3f7cf8", "score": "0.60096365", "text": "def received_date_time\n return @received_date_time\n end", "title": "" }, { "docid": "15aba746c7ac3625a6701cd148bde7c6", "score": "0.60074073", "text": "def timestamp\n params['TIMESTAMP']\n end", "title": "" }, { "docid": "f9a13b3290455607d68cf2af200e2a8a", "score": "0.60061884", "text": "def starttime; Time.parse(@starttime_str); end", "title": "" }, { "docid": "75f1b7c15fdedc59c9eec8ad39d14598", "score": "0.6002745", "text": "def last_modified time\n return unless time\n\n time = if Integer === time\n Time.at(time)\n elsif time.respond_to?(:to_time)\n time.to_time\n elsif !time.is_a?(Time)\n Time.parse time.to_s\n else\n time\n end\n\n @response[LAST_MOD] = time.httpdate\n return if @env[IF_NONE_MATCH]\n\n if status == 200 && @env[IF_MOD_SINCE]\n # compare based on seconds since epoch\n since = Time.httpdate(@env[IF_MOD_SINCE]).to_i\n halt 304 if since >= time.to_i\n end\n\n if @env[IF_UNMOD_SINCE] &&\n ((200..299).include?(status) || status == 412)\n\n # compare based on seconds since epoch\n since = Time.httpdate(@env[IF_UNMOD_SINCE]).to_i\n halt 412 if since < time.to_i\n end\n rescue ArgumentError\n end", "title": "" }, { "docid": "aa6c1db23884721be18710a86cd55b48", "score": "0.6001887", "text": "def time\n Time.parse(inner_author.date.to_s)\n end", "title": "" }, { "docid": "2c3ce32fa35c6785b6aae080bfe1e947", "score": "0.5992096", "text": "def web_modification_time(local_url)\n resp = nil\n Net::HTTP.start(local_url.host, 80) do |http|\n resp = http.head(local_url.path)\n end\n resp['Last-Modified'].nil? ? Time.at(0) : Time.parse(resp['Last-Modified'])\n end", "title": "" }, { "docid": "1e6c6134152d3dd4d06a576fe3503ec3", "score": "0.5991964", "text": "def launch_time\n DateTime.parse(\"2015-02-04 13:00:00 UTC\")\n end", "title": "" }, { "docid": "b37e5aba827e062cdfd81feb01c95dbf", "score": "0.5989878", "text": "def date\n request Net::NNTP::Date.new\n end", "title": "" }, { "docid": "e8250a9f4223c73e4624ff574d652c50", "score": "0.5953153", "text": "def last_updated_time\n data[:last_updated_time]\n end", "title": "" }, { "docid": "88608ec562c946b0954f6152844d805a", "score": "0.59527284", "text": "def timestamp\n @timestamp ||= Time.parse(@origdate)\n end", "title": "" }, { "docid": "13f4c949bd1f7bc77798e9841bc2bab7", "score": "0.594412", "text": "def last_update\n Time.parse(@record.SystemModstamp)\n end", "title": "" }, { "docid": "0e6da19d802b67a48bc9b3e7d8d9ca4c", "score": "0.59410256", "text": "def time\n Integer(connection.write(\"get_time\", false))\n rescue ArgumentError\n 0\n end", "title": "" }, { "docid": "0e6da19d802b67a48bc9b3e7d8d9ca4c", "score": "0.59410256", "text": "def time\n Integer(connection.write(\"get_time\", false))\n rescue ArgumentError\n 0\n end", "title": "" }, { "docid": "0e6da19d802b67a48bc9b3e7d8d9ca4c", "score": "0.59410256", "text": "def time\n Integer(connection.write(\"get_time\", false))\n rescue ArgumentError\n 0\n end", "title": "" }, { "docid": "8b82d7a797987075be4347fdaf26bcc7", "score": "0.58904004", "text": "def getServerTime()\r\n\t\t# get the time now\r\n\t\ttime = Time.now.to_i\r\n\t\ttime\r\n\tend", "title": "" }, { "docid": "f18a48699beab19c8a501cb3329964d6", "score": "0.58864754", "text": "def httpdate\n utc.httpdate\n end", "title": "" }, { "docid": "80f50a7814ba06d31c8cc1b70c9b6118", "score": "0.58810025", "text": "def request_start_time_from_header(header_string)\n Float(header_string.strip[2..-1])\n end", "title": "" }, { "docid": "1482002567672f0e6917c5314351cb70", "score": "0.58693725", "text": "def get_time()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('system', 'getTime', 'bigint', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "title": "" }, { "docid": "5f259233748bd6e12b70af0253de0715", "score": "0.58665365", "text": "def updated_time\n Time.parse(object[\"updated_time\"]) if object[\"updated_time\"]\n end", "title": "" }, { "docid": "fef37b48e4f8335298b43c64d7f5aa4d", "score": "0.58608973", "text": "def date; raw_changeset.time; end", "title": "" }, { "docid": "36d8b4095db6141c0d25be935d691371", "score": "0.58604544", "text": "def state_datetime\r\n if failed?\r\n failed_at\r\n elsif completed?\r\n completed_at\r\n else\r\n updated_at\r\n end\r\n end", "title": "" }, { "docid": "a6a683af09febb1b4d4496e1ee94f444", "score": "0.58559525", "text": "def get_server_date\n response = get_root\n response[\"Date\"]\n end", "title": "" }, { "docid": "81f90b31491814f52349846e56ef3aab", "score": "0.5853154", "text": "def event_date\n @event_date ||= begin\n raise NotFetchedError unless fetched?\n return nil unless [:event, :megaevent, :cito, :lfevent].include?(type.to_sym)\n\n if @data =~ /<span class=\"minorCacheDetails\">\\s*?Event Date:\\s*?\\w+, (\\d+) (\\w+) (\\d{4})<\\/span>/\n Time.parse([$1, $2, $3].join)\n else\n raise ParseError, \"Could not extract event date from website\"\n end\n end\n end", "title": "" }, { "docid": "df1e8f5d7a0e45466263fe8ef2941310", "score": "0.58467215", "text": "def time_class; end", "title": "" }, { "docid": "ddec3cec28f24433146879366997e9bb", "score": "0.583872", "text": "def date\n if value = self['date']\n begin\n # Rely on Ruby's standard time.rb to parse the time.\n (Time.rfc2822(value) rescue Time.parse(value)).localtime\n rescue\n # Exceptions during time parsing just cause nil to be\n # returned.\n end\n end\n end", "title": "" }, { "docid": "97c81a2e23d6122f5941cd757937cf1b", "score": "0.58340144", "text": "def get_timestamp headers\n headers['Fecha']\n end", "title": "" }, { "docid": "132a8ae5c41d112bdc54556a41b0cbe7", "score": "0.5829566", "text": "def date_out_of_service\n Time.parse(@attrs['DateOutOfServ'])\n end", "title": "" }, { "docid": "5b3b536dd75246f44f647ac6d8087584", "score": "0.58237755", "text": "def time\n Time.at(messaging['time'] / 1000)\n end", "title": "" }, { "docid": "fdea3e7b29c6c7eb98b77f20c1f185cb", "score": "0.5822353", "text": "def asctime\n end", "title": "" }, { "docid": "5cc8f2b4f4ea8385a524f9cf6b2420a8", "score": "0.5817687", "text": "def date_from_post_path\n m = REGEXP_DATE_ISO.match(self.identifier)\n time = m[2].nil? ? '19:00:00' : m[2..4].join(':')\n return m.nil? ? nil : [m[1], time].join('T')\n end", "title": "" }, { "docid": "c31ab3aafc4264f10fef0e649241ae39", "score": "0.5805698", "text": "def launch_time\n data[:launch_time]\n end", "title": "" } ]
f6e8c17dfc6e09e0bf5fd95829df53aa
Returns the path to a gemspec file located in the project location, if it exists. Otherwise returns +nil+.
[ { "docid": "1d118b50eb0aeef27c71668b7c73c32f", "score": "0.7115731", "text": "def gemspec_file_local\n @_gemspec_file_local ||= Dir[File.join(location, '*.gemspec')].first\n end", "title": "" } ]
[ { "docid": "339788a1ce2d8dce68b3537caf522fcf", "score": "0.7774781", "text": "def gemspec_path\n Pathname.glob('*.gemspec').first\n end", "title": "" }, { "docid": "194e94f64ddf40f169cd201d4c901e83", "score": "0.76483995", "text": "def gemspec_file\n gemspec_file_system || gemspec_file_local\n end", "title": "" }, { "docid": "dc19152144b72d3874799618e3cce4e8", "score": "0.7602377", "text": "def gemspec_file\n project_path( \"#{ name }.gemspec\" )\n end", "title": "" }, { "docid": "93a8d3fdcec79c5883baea27547091b0", "score": "0.7478315", "text": "def gemspec_path\n unless instance_variable_defined? :@gemspec\n path = \"#{name}.gemspec\"\n\n unless File.exist?(path)\n shell.say 'No gemspec found'\n exit 1\n end\n\n @gemspec_path = path\n end\n\n @gemspec_path\n end", "title": "" }, { "docid": "9c196398cc9244fe2b1b7e41e67164b5", "score": "0.71303064", "text": "def gemfile_path\n @gemfile_path ||= GEMFILES.map { |g| @config.pwd.join g }\n .find { |f| f.exist? }\n end", "title": "" }, { "docid": "093a415e35570b7fc16dc65d0ceabe79", "score": "0.6894003", "text": "def gemfile_path\n @gemfile_path ||= begin\n path = ::File.expand_path(new_resource.path)\n if ::File.file?(path)\n # We got a path to a real file, use that.\n path\n else\n # Walk back until path==dirname(path) meaning we are at the root\n while path != (next_path = ::File.dirname(path))\n possible_path = ::File.join(path, 'Gemfile')\n return possible_path if ::File.file?(possible_path)\n path = next_path\n end\n end\n end\n end", "title": "" }, { "docid": "c9117c893c50c6208aa796b60ded10c7", "score": "0.68459177", "text": "def gem_path\n @path || downloaded_gem_path\n end", "title": "" }, { "docid": "800ffcacc8a8b2128b293389b53033ff", "score": "0.68129146", "text": "def local_gemspec(path)\n glob = File.join(path, '{,*}.gemspec')\n Dir[glob].first\n end", "title": "" }, { "docid": "5051848b2671d5e878af1bcd58be33fe", "score": "0.6758722", "text": "def gem_path\n @path || downloaded_gem_path\n end", "title": "" }, { "docid": "9991031327dfc821501c6721e26a80b1", "score": "0.67093396", "text": "def specfile\n Dir[\"#{@path}/[Ss]pecfile\"].first\n end", "title": "" }, { "docid": "9ea943f74181cffe56218b097ef6b874", "score": "0.6699281", "text": "def gemspec_file_system\n @_gemspec_file_system ||= (\n pkgname = File.basename(location)\n gemsdir = File.dirname(location)\n specdir = File.join(File.dirname(gemsdir), 'specifications')\n Dir[File.join(specdir, \"#{pkgname}.gemspec\")].first\n )\n end", "title": "" }, { "docid": "6fb6a47af97ed6e01497684bd1f47810", "score": "0.6664102", "text": "def get_podspec_path(path)\n path = FileTools.get_podspec_dir(path)\n if path.present?\n Dir[File.join(FileTools.get_podspec_dir(path), '*.podspec')].first\n else\n ''\n end\n end", "title": "" }, { "docid": "6cb2df41330922d8bce7a05a8d677e41", "score": "0.65268433", "text": "def gem_path\n File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))\n end", "title": "" }, { "docid": "6c2e60560ca8ce0707b7c044d6d6d429", "score": "0.6515103", "text": "def gemspec_cached_path(spec_file_name)\n paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }\n paths.find {|path| File.file? path }\n end", "title": "" }, { "docid": "3d073a7f8373866e48b8947616a416d4", "score": "0.6500636", "text": "def gem?\n #return true if Dir[File.join(location, '*.gemspec')].first\n pkgname = File.basename(location)\n gemsdir = File.dirname(location)\n specdir = File.join(File.dirname(gemsdir), 'specifications')\n Dir[File.join(specdir, \"#{pkgname}.gemspec\")].first\n end", "title": "" }, { "docid": "2d89f7a324f6bb3f5902b5ba02db4262", "score": "0.6494881", "text": "def spec_file\n @spec_file ||= File.join spec_dir, \"#{full_name}.gemspec\"\n end", "title": "" }, { "docid": "32b4b199914e20c37d9a0e20e5c930d0", "score": "0.64674664", "text": "def get_path(gemname, version_req)\n return gemname if gemname =~ /\\.gem$/i\n specs = SourceIndex.from_installed_gems.search(gemname, version_req)\n selected = specs.sort_by { |s| s.version }.last\n return nil if selected.nil?\n # We expect to find (basename).gem in the 'cache' directory.\n # Furthermore, the name match must be exact (ignoring case).\n if gemname =~ /^#{selected.name}$/i\n filename = selected.full_name + '.gem'\n return File.join(Gem.dir, 'cache', filename)\n else\n return nil\n end\n end", "title": "" }, { "docid": "79413a3eb45bbe08afd96a1b28fa3753", "score": "0.64596444", "text": "def get_existing_spec_location\n [ \n \"#{Dir.pwd}/#{Default.default_specfile_name}\",\n Dir[\"#{Dir.pwd}/*/#{Default.default_specfile_name}\"],\n \"#{Default.remote_storage_path}/#{Default.default_specfile_name}\", \n \"#{Default.default_specfile_name}\", \n \"#{Default.base_config_directory}/#{Default.default_specfile_name}\",\n \"#{Default.poolparty_home_path}/#{Default.default_specfile_name}\", \n ENV[\"POOL_SPEC\"]\n ].flatten.reject {|a| a.nil?}.reject do |f|\n f unless ::File.readable?(f)\n end.first\n end", "title": "" }, { "docid": "71e898db9aedb6a38295d399d1eeebe2", "score": "0.6409331", "text": "def gem_path?(file); end", "title": "" }, { "docid": "4746ba6c77dd02431b4b6ff960b2bfbb", "score": "0.63863486", "text": "def gemspec(path)\n installed_gemspec(path) || local_gemspec(path)\n end", "title": "" }, { "docid": "fe612d01d3e2620118c414dc8dc1ee42", "score": "0.6348504", "text": "def find(path)\n @gemspecs.each do |spec|\n return spec if matching_file(spec, path)\n end\n nil\n end", "title": "" }, { "docid": "1d6ec362e324c422d11253fb3aec3488", "score": "0.63331676", "text": "def full_gem_path\n # TODO: This is a heavily used method by gems, so we'll need\n # to aleast just alias it to #gem_dir rather than remove it.\n @full_gem_path ||= find_full_gem_path\n end", "title": "" }, { "docid": "1d6ec362e324c422d11253fb3aec3488", "score": "0.63331676", "text": "def full_gem_path\n # TODO: This is a heavily used method by gems, so we'll need\n # to aleast just alias it to #gem_dir rather than remove it.\n @full_gem_path ||= find_full_gem_path\n end", "title": "" }, { "docid": "648d0d577342f7c1736ff808e0c7fb03", "score": "0.6315167", "text": "def installed_gemspec(path)\n #return true if Dir[File.join(path, '*.gemspec')].first\n pkgname = ::File.basename(path)\n gemsdir = ::File.dirname(path)\n specdir = ::File.join(File.dirname(gemsdir), 'specifications')\n gemspec = ::File.join(specdir, \"#{pkgname}.gemspec\")\n ::File.exist?(gemspec) ? gemspec : nil\n end", "title": "" }, { "docid": "789fe45c0f5830913532de9053248c86", "score": "0.62280613", "text": "def spec_file\n return @spec_file if defined?(@spec_file)\n return @spec_file = nil unless loaded_from && File.file?(loaded_from)\n @spec_file = begin\n file = { name: File.basename(loaded_from), dir: File.dirname(loaded_from) }\n Licensee::ProjectFiles::PackageManagerFile.new(File.read(loaded_from), file)\n end\n end", "title": "" }, { "docid": "d1e135bc15327346f1c7bae1611ba648", "score": "0.61977136", "text": "def find_requirable_file(file)\n root = full_gem_path\n\n require_paths.each do |lib|\n base = \"#{root}/#{lib}/#{file}\"\n Gem.suffixes.each do |suf|\n path = \"#{base}#{suf}\"\n return path if File.file? path\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "1879123b9f28b526c9e2b9b8e77df020", "score": "0.6165559", "text": "def template_path\n path = File.expand_path File.join(@template_options[CONFIG_PATH], @template_options[TEMPLATE_NAME])\n # TODO fix and throw some sort of cool exception\n if !File.exists? path\n path = nil\n end\n return path\n end", "title": "" }, { "docid": "766137f14a72cc4c180fffbd286fcb15", "score": "0.6161707", "text": "def resolve_project descriptor_path, conf\n trace { \"trying to resolve project, descriptor_path: #{descriptor_path.inspect}, conf: #{conf.inspect} [AppSpec#resolve_path]\" }\n\n project_path = conf['project_path']\n return File.join File.dirname(descriptor_path), project_path if project_path and valid_path descriptor_path\n\n trace { 'didn\\'t have both a project_path and a descriptor_path that was valid [AppSpec#resolve_project]' }\n return project_path if project_path\n find_first_project descriptor_path\n end", "title": "" }, { "docid": "0c12e6cea467abcef94b906a0d36f685", "score": "0.6151903", "text": "def specification_path(name, version)\n path = specs_dir + name + version.to_s\n specification_path = path + \"#{name}.podspec.json\"\n unless specification_path.exist?\n specification_path = path + \"#{name}.podspec\"\n end\n unless specification_path.exist?\n raise StandardError, \"Unable to find the specification #{name} \" \\\n \"(#{version}) in the #{name} source.\"\n end\n spec\n end", "title": "" }, { "docid": "79946e55507e2e38f72b235928489aca", "score": "0.61344504", "text": "def get_project_path\n return File.absolute_path File.join(root_dir, src)\n end", "title": "" }, { "docid": "b86fbd1d5475b1d4b3dad66c3121c909", "score": "0.6043511", "text": "def downloaded_gem_path\n self.class.downloaded_gem_path @name, @version\n end", "title": "" }, { "docid": "a2829ad2f865039dc107a4cc764b4735", "score": "0.6032637", "text": "def get_podspec_dir(path)\n get_dir(path, 'podspec')\n end", "title": "" }, { "docid": "7271002787cd979527c8a1cf6c000fa4", "score": "0.6023647", "text": "def template_path\n File.join gem_root, 'spec', 'fixtures', 'application'\n end", "title": "" }, { "docid": "d88e0395d52d3d0fe650818b83b19281", "score": "0.6023342", "text": "def gem_dir\n return Dir.pwd unless Gem.loaded_specs.include? 'cts-mpx'\n\n Gem.loaded_specs['cts-mpx'].full_gem_path\n end", "title": "" }, { "docid": "e21273b0276a89325b22a7e9128ffe1e", "score": "0.60223806", "text": "def ruby_spec_path\n File.join(RAILS_ROOT, 'vendor/gems/ruby/specifications')\n end", "title": "" }, { "docid": "174d853e6f8ab59b3e23a81f1b4277b6", "score": "0.60051066", "text": "def path\n @path ||= @project.dir.path\n end", "title": "" }, { "docid": "f6f2a07de3c3cc9c39628557d70fe1ac", "score": "0.5988304", "text": "def gemspec\n @gemspec ||= (\n require 'rubygems'\n ::Gem::Specification.load(gemspec_file)\n )\n end", "title": "" }, { "docid": "6e4c7590aef92476fff7eff5740feffe", "score": "0.5985333", "text": "def gem_root\n Pathname.new(__FILE__).dirname.parent.parent.expand_path\n end", "title": "" }, { "docid": "ef3dc9ca3dceedfabbe945a6156c6a7c", "score": "0.5970058", "text": "def path\n File.join @proj_path_base, @proj_filename\n end", "title": "" }, { "docid": "d7667cfc1f8b9d752724ef9fdf6033c4", "score": "0.59575003", "text": "def find_gem_name(base)\n spec = Dir[File.join(base, '*.gemspec')].first\n File.basename(spec, '.gemspec') if spec\n end", "title": "" }, { "docid": "4fa3e60b7dccd8d88625bd822f0dc2b5", "score": "0.595547", "text": "def package_path(extension='.gem')\n File.join(package_dir, package_basename(extension))\n end", "title": "" }, { "docid": "29a9cc98d2691aa59f8f9af5e11af7c7", "score": "0.59533393", "text": "def pkg_path\n \"pkg/#{spec.full_name}\"\n end", "title": "" }, { "docid": "74dd0599272c22a33050ca4bfdff0ff4", "score": "0.5951374", "text": "def downloaded_gem_path\n self.class.downloaded_gem_path @name, @version\n end", "title": "" }, { "docid": "d95552d0efcb284897e2d58b8ac383f0", "score": "0.5942046", "text": "def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend", "title": "" }, { "docid": "d95552d0efcb284897e2d58b8ac383f0", "score": "0.5942046", "text": "def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend", "title": "" }, { "docid": "d95552d0efcb284897e2d58b8ac383f0", "score": "0.5942046", "text": "def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend", "title": "" }, { "docid": "d95552d0efcb284897e2d58b8ac383f0", "score": "0.5942046", "text": "def name\n @name ||= Dir['*.gemspec'].first.split('.').first\nend", "title": "" }, { "docid": "d64e7671682b4f2a8ed27f7dbabe6c74", "score": "0.59416217", "text": "def gem_dir\n return Dir.pwd unless Gem.loaded_specs.include? 'cts-mpx'\n Gem.loaded_specs['cts-mpx'].full_gem_path\n end", "title": "" }, { "docid": "bc388c62b58af392652d29fa924421aa", "score": "0.5926265", "text": "def find_requireable_file(file)\n root = full_gem_path\n\n require_paths.each do |lib|\n base = File.join(root, lib, file)\n Gem.suffixes.each do |suf|\n path = \"#{base}#{suf}\"\n return path if File.file? path\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "7a952bd0de49e5415100004fd303fefc", "score": "0.5914288", "text": "def gemspec\n @gemspec ||= begin\n raise Error.new(\"Unable to automatically determine gem name from specs in #{base}. Please set the gem name via #{self.class.name}.install_tasks(gem_name: 'name')\") unless gem_name\n g = Bundler.load_gemspec(File.join(base, gem_name+'.gemspec'))\n # This is returning the path it would be in if installed normally,\n # override so we get the local path. Also for reasons that are entirely\n # beyond me, #tap makes Gem::Specification flip out so do it old-school.\n g.full_gem_path = base\n g\n end\n end", "title": "" }, { "docid": "7838cd71c1051d6b4bba5fa658ee045e", "score": "0.5898012", "text": "def relative_path\n File.join(@repo, @bundle)\n end", "title": "" }, { "docid": "9975bacca6b174136ca92148de425a36", "score": "0.58975816", "text": "def find_gemspec(name, path) # :nodoc:\n glob = File.join path, \"#{name}.gemspec\"\n\n spec_files = Dir[glob]\n\n case spec_files.length\n when 1 then\n spec_file = spec_files.first\n\n spec = Gem::Specification.load spec_file\n\n return spec if spec\n\n raise ArgumentError, \"invalid gemspec #{spec_file}\"\n when 0 then\n raise ArgumentError, \"no gemspecs found at #{Dir.pwd}\"\n else\n raise ArgumentError,\n \"found multiple gemspecs at #{Dir.pwd}, \" +\n \"use the name: option to specify the one you want\"\n end\n end", "title": "" }, { "docid": "9e579e9f4aafd397b9dae518f89b5b31", "score": "0.58715713", "text": "def gem_dir\n if File.directory?(dir = File.join(working_dir, 'gems'))\n dir\n end\n end", "title": "" }, { "docid": "9e579e9f4aafd397b9dae518f89b5b31", "score": "0.58715713", "text": "def gem_dir\n if File.directory?(dir = File.join(working_dir, 'gems'))\n dir\n end\n end", "title": "" }, { "docid": "43dd5f9194d45dc5f6ae80cb72e836a2", "score": "0.58519185", "text": "def lockfile_path\n return unless gemfile_path\n @lockfile_path ||= gemfile_path.dirname.join(\"#{gemfile_path.basename}.lock\")\n end", "title": "" }, { "docid": "605d5ef6d84c371c2cbe586682b7408d", "score": "0.5849418", "text": "def lookup_project\n puts \"Looking for Xcode project...\"\n # list all .xcodeproj files except Pods\n projects_list = Dir.entries(\".\").select { |f| (f.end_with? \".xcodeproj\") && (f != \"Pods.xcodeproj\") }\n projects_list.empty? ? nil : projects_list.first\nend", "title": "" }, { "docid": "7df9fd0d3213d10b808dc040c46abdfc", "score": "0.58341116", "text": "def get_path_to_rails_gem\n path = ''\n rails_gem_contents = `gem contents rails -v #{get_rails_version_from_project}`\n rails_gem_contents.each_line do |contents|\n path_elements = contents.split(File::SEPARATOR)\n path_elements.pop\n path = path_elements.join(File::SEPARATOR)\n break\n end\n path\n end", "title": "" }, { "docid": "6f7b6ea9df15725767d7761b2dd74709", "score": "0.5804606", "text": "def find_project\n Polymer::DSL.load Polymer::Project.find_config(Dir.pwd)\n end", "title": "" }, { "docid": "312ffea47fb4752163b6cc69a7ba85ba", "score": "0.5770494", "text": "def check_spec_path\n expected = \"#{spec.name}/#{spec.version}/#{spec.name}.podspec\"\n relative_path = spec_path.relative_path_from(source.repo).to_s\n unless relative_path == expected\n error \"Incorrect path, the path is `#{relative_path}` and should be `#{expected}`.\"\n end\n end", "title": "" }, { "docid": "ffdf6e00b8784c441f869850eeeed408", "score": "0.57620674", "text": "def find_readme\n\t\tfile = self.project_files.find {|file| file =~ /^README\\.(md|rdoc)$/ }\n\t\tif file\n\t\t\treturn Pathname( file )\n\t\telse\n\t\t\tself.prompt.warn \"No README found in the project files.\"\n\t\t\treturn DEFAULT_README_FILE\n\t\tend\n\tend", "title": "" }, { "docid": "f6179e44bb9035b95a9729212bf12002", "score": "0.5750163", "text": "def src\n\n sdk_path = find_sdk\n unless sdk_path == nil\n SDK_SRC_PATHS.each { |sp|\n p = sdk_path+sp\n return p if File.directory? p\n }\n end\n\n nil\n end", "title": "" }, { "docid": "5e0689c8b2fc406322f31aecedca6fe8", "score": "0.5747849", "text": "def project_root\n this_file_path.ascend do |p|\n rakefile = p.join( 'Rakefile' )\n return p if rakefile.exist?\n end\n end", "title": "" }, { "docid": "35b0e53ff198807a58bcf01e6dad22b4", "score": "0.5745981", "text": "def find_infoPlist_filePath(path)\n paths = Pathname.new(path).children.select { |pn| pn.extname == '.xcodeproj' }\n xcodePath = paths[0].to_s.split('/')[-1]\n projectName = xcodePath.split('.')[0]\n projectPath = ''\n Pathname.new(\"#{path}/#{projectName}\").children.select { |pn|\n if pn.to_s == \"#{path}/#{projectName}/Info.plist\"\n projectPath = \"#{path}/#{projectName}/Info.plist\"\n end\n }\n projectPath\n end", "title": "" }, { "docid": "ac345eb34b3127f0c9b305a95123ec81", "score": "0.57444006", "text": "def locate\r\n File.dirname(__FILE__)\r\n end", "title": "" }, { "docid": "ac345eb34b3127f0c9b305a95123ec81", "score": "0.57444006", "text": "def locate\r\n File.dirname(__FILE__)\r\n end", "title": "" }, { "docid": "660d7059d245efe6a1339f2c443fe424", "score": "0.5744257", "text": "def find_source_directory(gem_name, version=nil)\n if version == 'cwd'\n return Dir.pwd\n elsif version\n version_array = [\"= #{version}\"]\n else\n version_array = [\"> 0.0.0\"]\n end\n \n specs = Gem.source_index.find_name(gem_name,version_array)\n unless specs.to_a.size > 0\n raise InstallFailed, \"Can't locate version #{version}!\"\n end\n \n @install_version = specs.last.version\n message \"Installing #{app_name} #{@install_version}\"\n \n specs.last.full_gem_path\n end", "title": "" }, { "docid": "19e0c9bcddac83471a9939d11ce96736", "score": "0.57304573", "text": "def gem_name\n @gem_name ||= @source_path.sub_ext(\"\").basename.to_s\n end", "title": "" }, { "docid": "2c005d8a2d805a60003ca58682f76893", "score": "0.57284904", "text": "def resource(gem_name, path)\n if not loaded? gem_name\n raise PluginNotLoaded.new(\"Plugin #{gem_name} not loaded when getting resource #{path}\")\n end\n\n file = File.join(@gems[gem_name], \"resources\", path)\n\n if File.exist? file\n return file\n else\n return nil\n end\n end", "title": "" }, { "docid": "aaaef5d13de711e02b9087a18ec3ba40", "score": "0.5711958", "text": "def gem_build_complete_path # :nodoc:\n File.join extension_dir, 'gem.build_complete'\n end", "title": "" }, { "docid": "06e51d2a98f42e8de6b5ac2361a18b7d", "score": "0.57114905", "text": "def gem_path\n `gem environment gemdir`.chomp\nend", "title": "" }, { "docid": "87ce1b017d647a955f5feeeb60f0930e", "score": "0.5710898", "text": "def gem_dir\n return force_gem_dir if force_gem_dir\n if File.directory?(dir = default_gem_dir)\n dir\n end\n end", "title": "" }, { "docid": "efc7ebed33072c3cf4bb5ab7e3bb6d2f", "score": "0.5710172", "text": "def source_package_file\n pkg_file = nil\n pkg_dir = self.source_package_dir\n @source_urls.each do |url|\n poss_pkg_file = File.join(pkg_dir, File.basename(url[0]))\n if File::exists?(poss_pkg_file)\n pkg_file = poss_pkg_file\n break\n end\n end\n pkg_file\n end", "title": "" }, { "docid": "efc7ebed33072c3cf4bb5ab7e3bb6d2f", "score": "0.5710172", "text": "def source_package_file\n pkg_file = nil\n pkg_dir = self.source_package_dir\n @source_urls.each do |url|\n poss_pkg_file = File.join(pkg_dir, File.basename(url[0]))\n if File::exists?(poss_pkg_file)\n pkg_file = poss_pkg_file\n break\n end\n end\n pkg_file\n end", "title": "" }, { "docid": "3219891270211811b72cad0c2149b909", "score": "0.5706651", "text": "def find_gem(name, version)\n spec = source_index.find_name(name, version).last\n unless spec and (spec.installation_path rescue nil)\n alert_error \"Could not find gem #{name} (#{version})\"\n raise Gem::GemNotFoundException, \"Could not find gem #{name}, (#{version})\"\n end\n\n return spec\n end", "title": "" }, { "docid": "c4329a1479d91d739239a8d2a5138969", "score": "0.57064813", "text": "def path\n if !@path.nil? && File.exists?(@path)\n @path\n end\n end", "title": "" }, { "docid": "5fe73c7a9baab80c2207c0ae86e0194e", "score": "0.56957567", "text": "def find filename\n return filename if File.exists? filename\n filename = \"./haml/\"+filename\n return filename if File.exists? filename\n filename = @src_folder+\"/\"+filename\n return filename if File.exists? filename\n throw \"Could not find file: #{filename}\"\nend", "title": "" }, { "docid": "f250e833708876f411dff1c474ec2a3e", "score": "0.56945527", "text": "def find_rakefile(spec)\n rakefile = DEFAULT_RAKEFILES.\n map { |x| File.join(spec.full_gem_path, x) }.\n find { |x| File.exist?(x) }\n\n unless(File.exist?(rakefile) rescue nil)\n alert_error \"Couldn't find rakefile -- this gem cannot be tested. Aborting.\" \n raise Gem::RakeNotFoundError, \"Couldn't find rakefile, gem #{spec.name} (#{spec.version}) cannot be tested.\"\n end\n end", "title": "" }, { "docid": "a85b7a5394171aebe6dd99de3a626182", "score": "0.5693622", "text": "def repository_path(name)\n File.expand_path(\"../fixtures/#{name}\", __FILE__)\n end", "title": "" }, { "docid": "f6185a611138788021d1fec3b0b2b96a", "score": "0.569246", "text": "def specification\n Gem::Specification.find_by_name(name, requirement)\n rescue Gem::LoadError\n nil\n end", "title": "" }, { "docid": "2b10fe42cc83354cf76f8a1345167b29", "score": "0.56884396", "text": "def path_from_package(package_name)\n ret = package_from_name package_name\n ret && ret.root_path\n end", "title": "" }, { "docid": "0f40f302885de67f4851940db37b7bbb", "score": "0.5655428", "text": "def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end", "title": "" }, { "docid": "88d84e6af4cb98f45ef227b52b3bad03", "score": "0.5653155", "text": "def arch_spec_path\n File.join(RAILS_ROOT, 'vendor/gems', canonical_arch, 'specifications')\n end", "title": "" }, { "docid": "f1d04dd6a6fbc9bb01c4e238801ac44a", "score": "0.5614111", "text": "def platform_gemspec\n gemspecs.fetch(platform) { This.ruby_gemspec }\n end", "title": "" }, { "docid": "e3908f7f783f0fd95e5b3a5da79cffb7", "score": "0.56061894", "text": "def path\n @path ||= best_qmake\n end", "title": "" }, { "docid": "a0186151d7d5e34499eeabf4680c03f6", "score": "0.55904716", "text": "def fake_config_path_relative_to_project(file_name)\n File.join(\"spec/support/upsteem/deploy/fake_config\", file_name)\n end", "title": "" }, { "docid": "455efc04ca68cd6b65b57509a099f3c4", "score": "0.55880123", "text": "def autoproj_gemfile_path; File.join(autoproj_install_dir, 'Gemfile') end", "title": "" }, { "docid": "ecc09c90c253aa8cde4302d99862cf06", "score": "0.5584923", "text": "def local_path\n fetch_path(DevTools.gem_root)\n end", "title": "" }, { "docid": "6aa52d420a7bccc277870fd1fc19f15e", "score": "0.5583737", "text": "def FilePath\n if(FilePaths.length == 0)\n return nil\n end\n return FilePaths[0]\n end", "title": "" }, { "docid": "4fc39b251413903c3aae0e2e1f142614", "score": "0.5578984", "text": "def gemfile_exists? \n File.exists? \"Gemfile\"\nend", "title": "" }, { "docid": "4fc39b251413903c3aae0e2e1f142614", "score": "0.5578984", "text": "def gemfile_exists? \n File.exists? \"Gemfile\"\nend", "title": "" }, { "docid": "a96b62dee20ebdffc90788b54ebe34fd", "score": "0.55725163", "text": "def gemspec?; end", "title": "" }, { "docid": "4aff17bb788ddd354eea78da36268698", "score": "0.5568547", "text": "def project_path\n if(File.directory?(@library_path))\n # library is source dir\n File.join(project_lib, clean_name)\n else\n # library is a binary (like swc, jar, etc)\n File.join(project_lib, File.basename(@file_target.archive_path))\n end\n end", "title": "" }, { "docid": "288295db29051324e4ab1199bc82ee6a", "score": "0.5561428", "text": "def gem_dir\n @gem_dir ||= File.expand_path File.join(gems_dir, full_name)\n end", "title": "" }, { "docid": "79db128fff23105bbae4b25cf49e66e9", "score": "0.5561281", "text": "def min_file_path\n compiled_path || current_file_path\n end", "title": "" }, { "docid": "8b1b8af652b65046163379f4ebf3943d", "score": "0.5559842", "text": "def detect_configuration_file\n KNOWN_CONFIG_LOCATIONS.map{|f| projectize(f)}.detect{|f| File.exists?(f)}\n end", "title": "" }, { "docid": "a2bc052b982199cb83bb5d8f655f6f9f", "score": "0.5551059", "text": "def gem_dir\n directory = File.join(File.dirname(__FILE__), \"..\")\n File.expand_path(directory, File.dirname(__FILE__))\n end", "title": "" }, { "docid": "2cefcea94f49e94eff50bbd974d004a8", "score": "0.55432665", "text": "def fixture_path\n File.join(PROJECT_ROOT, 'spec', 'fixtures', 'integration', 'git')\n end", "title": "" }, { "docid": "539d1b9be3fcedf702887b31c4552038", "score": "0.55364186", "text": "def elm_package_path(package)\n File.join(@git_resolver.repository_path(package), 'elm-package.json')\n end", "title": "" }, { "docid": "93b6ef14e7998f3fd11bbce97608e0c7", "score": "0.5533899", "text": "def _local_source(path)\n existent = ::Dir[\"#{ENV['DEV_HOME']}/*/{piktur/#{path},gems/#{path},#{path}}\"][0]\n Pathname(existent)\n end", "title": "" }, { "docid": "f3050ff079b6bb7faeb85eb2887e47ca", "score": "0.5521038", "text": "def try_gem_path file\n @gem_paths.each do |gem_path|\n if file.start_with? gem_path and not gem_path.empty?\n file.sub! File.join(gem_path, 'gems'), ''\n file.sub! %r{/[^/]*/}, ''\n return true\n end\n end\n return false\n end", "title": "" } ]
15fde4b364da21ed9ee7943dc0f3e465
All we're doing really is adding a display function to a VerletParticle
[ { "docid": "e98022607c7f4afc29e637cf686722d4", "score": "0.5482481", "text": "def display\n fill(175)\n stroke(0)\n ellipse(x, y, 16, 16)\n end", "title": "" } ]
[ { "docid": "397cf82cec2e7d5c79c4b2af7a79db76", "score": "0.69397914", "text": "def render()\n\n\t\ti=0\n\t\tfor p in particles\n\t\t\tx = ( p.pos.x - @x0) * @scale\n\t\t\ty = ( p.pos.y - @y0) * @scale\n\t\t\trenderPoint( p.name, x, y, p.mass/3000.0, 1, 1)\n\t\t\ti=i+1\n\t\tend\n\tend", "title": "" }, { "docid": "287ddb0231e680400cdb74561c7d1e02", "score": "0.6383659", "text": "def render_particle(particle, opts)\n # Check if policy allows to view page\n can_view, msg = dc_user_can_view(@parent, particle)\n return msg unless can_view\n html = ''\n if @opts[:edit_mode] > 1\n opts[:editparams].merge!(title: \"#{t('drgcms.edit')}: #{particle.name}\", controller: 'cmsedit')\n html << dc_link_for_edit( opts[:editparams] )\n end\n#\n=begin\n if particle.piece_id\n opts[:id] = particle.piece_id\n piece = DcPieceRenderer.new(@parent, opts)\n html << piece.render_html\n @part_css << piece.render_css \n else\n html << particle.body\n @part_css << particle.css.to_s\n end\n=end\n @part_css << particle.css.to_s\n html << particle.body\nend", "title": "" }, { "docid": "3f981cea2bdc9a97a10bc5468f2a5fa3", "score": "0.63174", "text": "def display\n\t\tGL.Clear(GL::COLOR_BUFFER_BIT); \n\t\tGL.Begin(GL::POINTS)\n\t\t\n\t\tfor i in 0...$HEIGHT\n\t\t\tfor j in 0...$WIDTH\n\t\t\t\tparticle = $GRID[i][j]\n\t\t\t\tnext unless particle\n\t\t\t\tif particle.element == :vapor\n\t\t\t\t\tGL.Color(0.5, 0.5, 1.0)\n\t\t\t\telse\n\t\t\t\t\tGL.Color(1.0, 1.0, 1.0)\n\t\t\t\tend\n\t\t\t\tGL.Vertex3f((i - $HEIGHT/2) * 2.0, (j - $WIDTH/2) * 2.0, 0.0)\n\t\t\tend\n\t\tend\n\t\n\t\tGL.End\n\tend", "title": "" }, { "docid": "1923b0cd99f22e3cda95e19a88bc37f2", "score": "0.6110375", "text": "def show\n self.speed = CP::Vec2.new(0,0)\n self.destroyed = false\n objects.register self\n end", "title": "" }, { "docid": "7aa97e478f117262b34a9533d7a8d1e8", "score": "0.6066377", "text": "def display\n\t\tGL.Clear(GL::COLOR_BUFFER_BIT);\n\t\t\n\t\t#GLU.LookAt($x, $y, $z, 10.0, 0.0, 0.0, 0.0, 1.0, 0.0)\n\t\t\n\t\tfor i in 0...$HEIGHT\n\t\t\tfor j in 0...$WIDTH\n\t\t\t\tfor k in 0...$DEPTH\n\t\t\t\t\tparticle = $GRID[i][j][k]\n\t\t\t\t\t\n\t\t\t\t\tnext unless particle\n\t\t\t\t\t\n\t\t\t\t\tpos_x = (i - $HEIGHT/2) * 2.0\n\t\t\t\t\tpos_y = (j - $WIDTH/2) * 2.0\n\t\t\t\t\tpos_z = (k - $DEPTH/2) * 2.0\n\t\t\t\t\tGL::PushMatrix()\n\t\t\t\t\tGL::Translate(pos_x, pos_y, pos_z)\n\t\t\t\t\t\n\t\t\t\t\tif particle.element == :vapor\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::AMBIENT, $vapor_color);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::SHININESS, [0.2]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\tGL::Translate(pos_x, pos_y, pos_z);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::AMBIENT, $ice_color);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::SHININESS,[0.2]);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::EMISSION, $no_mat);\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tGLUT::SolidCube(2);\n\t\t\t\t\tGL::PopMatrix();\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend\n\t\tend\n\t\t\n\t\tGLUT.PostRedisplay\n\t\tGLUT.SwapBuffers\n\t\tGL.Flush\n\tend", "title": "" }, { "docid": "f0d41ec9cb38463fed31fe04acd0d27c", "score": "0.60399795", "text": "def pbDisplay(msg,&block)\r\n @scene.pbDisplayMessage(msg,&block)\r\n end", "title": "" }, { "docid": "7a381e6de4603e35a2f61dff97fb9b00", "score": "0.6033836", "text": "def render args\n args.outputs.solids << [@xy.x,@xy.y,@width,@height,255,0,255];\n #args.outputs.labels << [20,HEIGHT-50,\"velocity: \" +@velocity.x.to_s+\",\"+@velocity.y.to_s + \" magnitude:\" + @velocity.mag.to_s]\n end", "title": "" }, { "docid": "b9256cb54ffe468b1d08fe0eb7848ef8", "score": "0.5905495", "text": "def add_particle particle\n @particles << particle\n self\n end", "title": "" }, { "docid": "ba6a7ddff56d43f49501f42bf42b4450", "score": "0.5871683", "text": "def add_particle(p = Particle.new(@origin))\n @particles << p\n end", "title": "" }, { "docid": "915092e4ba00a5a93b1b5b640e970fd0", "score": "0.5858541", "text": "def initParticle(p)\n\n\t\t\n\t\t@angle = (@angle + rand(-@angleVariance..@angleVariance))\n\t\t#@angle = 90\n\t\t@vel_x = @speed * Math.cos(angle * Math::PI / 180)\n\t\t@vel_y = @speed * Math.sin(angle * Math::PI / 180)\n\n\t\t@color.red = @red + rand(-@redVariance..@redVariance)\n\t\t@color.blue = @blue + rand(-@blueVariance..@blueVariance)\n\t\t@color.green = @green + rand(-@greenVariance..@greenVariance)\n\t\tp.life = @life + rand(-@lifeVariance..@lifeVariance)\n\t\tp.additive = @additive\n\t\tp.x = @x\n\t\tp.y = @y\n\t\tp.vel_x = @vel_x\n\t\tp.vel_y = @vel_y\n\t\tp.img = @img\n\t\tp.color = @color.dup\n\t\tp.scale = @scale\n\t\tp.alphaDecayRate = @alphaDecayRate\n\t\tif (disableSpawns)\n\t\t\tp.life = 0\n\t\t\tp.alphaDecayRate = 500\n\t\tend\n\tend", "title": "" }, { "docid": "cb28a5d75c221e88f41bc63a8c47b2f2", "score": "0.5855143", "text": "def show\n visualized\n end", "title": "" }, { "docid": "14c702a14303d1d7bac178699a26d89f", "score": "0.5781516", "text": "def displays; end", "title": "" }, { "docid": "0061e86cb83b1bae336509ad09165e4d", "score": "0.57626915", "text": "def display; end", "title": "" }, { "docid": "e2ba18c5a2929a7fc0bbed9c0abfeb9e", "score": "0.57452863", "text": "def display\n\t\t@vertices.each { |v|\n\t\t\t# print \"Index: #{v[0]} || Vertex Info = [ id: #{v[1][:id]} nouns: #{v[1][:nouns]}\\t\\tfrom_id: #{v[1][:from_id]}\\tto_ids: #{v[1][:to_ids]}\\t\\tpoint_to: #{v[1][:point_to]}\\t\\tpoint_from: #{v[1][:point_from]} ]\\n\"\n\t\t\tprint v, \"\\n\"\n\t\t}\n\tend", "title": "" }, { "docid": "a5c0011a71cef0bc690a02288fdf9cb0", "score": "0.5710306", "text": "def plot_surface; end", "title": "" }, { "docid": "676b6137e5c2b41d020654b79cdec554", "score": "0.57077086", "text": "def visualize\n end", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "063facb8aae3b64c4acc7aa2e2dd6757", "score": "0.57043564", "text": "def update_visualization(point)\n\t\t\n\tend", "title": "" }, { "docid": "f20636ce94eaf8f3c16e509a84b6d4c1", "score": "0.56913936", "text": "def display\n stroke 0\n point(@x, @y)\n end", "title": "" }, { "docid": "c1cba7bb51941709368593f399150861", "score": "0.5680052", "text": "def display\n print(\"#{@number} #{@color} #{@shading} #{@shape}\")\n end", "title": "" }, { "docid": "0ba70b280b3c8a05c2fa1f2d5ecdd714", "score": "0.5672934", "text": "def add_particle(particle)\r\n @particles_list.push(particle)\r\n end", "title": "" }, { "docid": "2a08effaff6e05825d0486338ce99eb1", "score": "0.5668287", "text": "def show\n body.p = CP::Vec2.new(x,y)\n end", "title": "" }, { "docid": "cc63f0b8569dad0434b4b0749d28fe33", "score": "0.564727", "text": "def displays=(_arg0); end", "title": "" }, { "docid": "40db2f9bc8d2bc4ec589fe465eb0cbf6", "score": "0.56413966", "text": "def show\r\n set_piece()\r\n end", "title": "" }, { "docid": "8e33a3db8688908e329571ceb4d4e842", "score": "0.5640209", "text": "def display\n \n end", "title": "" }, { "docid": "8e33a3db8688908e329571ceb4d4e842", "score": "0.5640209", "text": "def display\n \n end", "title": "" }, { "docid": "f83d7edf83830d2027c157b369bf2398", "score": "0.5636765", "text": "def display\n stroke(rand(255), rand(255), rand(255))\n ellipse($x, $y, 1, 1);\n point($x, $y)\n end", "title": "" }, { "docid": "3f1051f0d300e78a7112dba4c6296098", "score": "0.5620133", "text": "def show\n set_piece()\n end", "title": "" }, { "docid": "cd4ea301f2828d9c0d40126844ba4d80", "score": "0.5615816", "text": "def render\n outputs.labels << [600, 620, 'Sadistic Self-Care Survival Game!', 5, 1]\n outputs.primitives << meters.map(&:render)\n outputs.primitives << [\n @task.render,\n { x: 340, y: 370, text: \"Money: $#{state.money}\", size_enum: 5, alignment_enum: align(:left) }.label,\n { x: 80, y: 90, text: state.granola_count }.label,\n @scene_button\n ]\n outputs.debug << [30, 30.from_top, \"#{args.inputs.mouse.point}\"].label\n \n # Sprites\n outputs.sprites << [\n [0, 0, 1280, 720, 'sprites/laptop.png'],\n @water_bottle,\n granola_bars,\n @store_icon\n ]\n end", "title": "" }, { "docid": "5c50339bb471878c729322f3e785f697", "score": "0.56106055", "text": "def show_article_piece(piece)\n \tputs piece\n\tend", "title": "" }, { "docid": "a76a3e85f2407fbf5aa057ddb3fddd43", "score": "0.56065726", "text": "def display\n stroke(rand(255), rand(255), rand(255))\n ellipse(@x, @y, 1, 1);\n point(@x, @y)\n end", "title": "" }, { "docid": "38527fd60222853f079fe2b0843b26b6", "score": "0.560538", "text": "def display\n Nonograms::Display.new(@results, @horizontal, @vertical)\n end", "title": "" }, { "docid": "2ed8efbd9879797313418b374077b329", "score": "0.5597862", "text": "def update\n @emitter.spawn\n @particles.update\n end", "title": "" }, { "docid": "6f391ed748783dd0306592948899ad04", "score": "0.5588576", "text": "def particles_visible?\n @particles_visible\n end", "title": "" }, { "docid": "0815ec3dd79436b76709dc1d83a8c186", "score": "0.5585223", "text": "def display # this is an instance method\n \"(#{@x}, #{@y})\"\n end", "title": "" }, { "docid": "b33294e0011cc66fd0b83376d48b7cbe", "score": "0.55679756", "text": "def draw \n\t\tsuper(\"Score: #{@points.to_s}\", X, Y, 3)\n\tend", "title": "" }, { "docid": "a362a7ab05b7305f97f57c87a7be6cd7", "score": "0.5551683", "text": "def display\n \"#%s. %s - %s points \\n\" % [@rank, @name, @points]\n end", "title": "" }, { "docid": "c5b04586562943ba101c62f14e5f9c01", "score": "0.55499035", "text": "def draw\n\t\t@visualize.call\n\tend", "title": "" }, { "docid": "c5b04586562943ba101c62f14e5f9c01", "score": "0.55499035", "text": "def draw\n\t\t@visualize.call\n\tend", "title": "" }, { "docid": "821f93b87de0c81e20362072c95e2116", "score": "0.55238736", "text": "def particles_visible?\n @particles_visible\n end", "title": "" }, { "docid": "1725b8ab925cae63ccd276e47f61cf69", "score": "0.5495537", "text": "def display\n stroke 0\n fill 175\n ellipse @x, 100, 32, 32\nend", "title": "" }, { "docid": "af466973794b4385226bd7f99454695f", "score": "0.5484189", "text": "def set_particle\n @particle = Particle.find(params[:id])\n end", "title": "" }, { "docid": "37a742db48b16abb753ad6c35f678f10", "score": "0.5484025", "text": "def display()\n\t\tputs @shape\n\t\tputs @number\n\t\tputs @shade\n\t\tputs @color\n\tend", "title": "" }, { "docid": "630e663a21f22be69d24f888dca2d8ca", "score": "0.54769754", "text": "def plot; end", "title": "" }, { "docid": "3b78deff81bb270f552e0f523ce6021a", "score": "0.5476472", "text": "def display\n end", "title": "" }, { "docid": "f47b919fd64981f952f0595365632767", "score": "0.5468487", "text": "def render\n outputs.labels << [10, 30, state.tick_count]\n render_alert\n render_room\n render_highlights\n end", "title": "" }, { "docid": "cf5cdc62c0dfe28bb2976191d935346f", "score": "0.5461492", "text": "def pv\n Rubyvis\nend", "title": "" }, { "docid": "006f42bcbd0f4aaa52abfd5f1de97753", "score": "0.5450064", "text": "def info_display\n puts \"Name: #{@name}\"\n puts \"Mass: #{@mass}\"\n if @life\n puts \"IT HAS LIFE!!! WOW!!!\"\n end\n puts \"Number of Moons: #{@moons} moon(s)\"\n puts \"Special Feature: #{@special_feature}\"\n puts \"Distance from the Sun: #{@distance_from_the_sun} km\"\n end", "title": "" }, { "docid": "cf7b264d7746768b656521c3888f29c5", "score": "0.5433275", "text": "def display\n @display ||= PaPiRus::Display.new(options: {epd_path: '/tmp/epd', width:8, height:3})\nend", "title": "" }, { "docid": "9686169c64c92130997514aff60358bb", "score": "0.5432732", "text": "def display() @elos.each { |p, elo| puts \"elo=#{'%4d' % elo} elo01=#{'%3.1f' % get_elo01(p)} #{p}\" }; true end", "title": "" }, { "docid": "4a9b0b5c51d550ba9d59b07cfe591367", "score": "0.54302806", "text": "def display\n if @display_type == :console\n @board.display @current_generation, @name\n elsif @display_type == :rubyvis\n board_data = @board.display @current_generation, @name\n # do something with board_data here\n end\n end", "title": "" }, { "docid": "255cc51b1aff72c15f1ad49ca6f558c2", "score": "0.54183424", "text": "def display\n raise NotImplementedError\n end", "title": "" }, { "docid": "a49954cc205f62b24bb57c39b4de7721", "score": "0.5409844", "text": "def points_to_display\n 100+self.point\n end", "title": "" }, { "docid": "8f61716f6c18db96ac1d0be7999eb4e0", "score": "0.5405411", "text": "def display\n stroke(0)\n stroke_weight(1)\n # Brightness is mapped to sum (NB: processing map function here)\n b = map(sum, 0, 1, 255, 0)\n fill(b)\n ellipse(xpos, ypos, r, r)\n \n # Size shrinks down back to original dimensions\n @r = lerp(r, 32, 0.1)\n end", "title": "" }, { "docid": "bb4c5f8d9f76ea5c0f3009872b3cc5f1", "score": "0.53977084", "text": "def run()\n raise StandardError \"display function need to implemented by child classes\"\n end", "title": "" }, { "docid": "fc745d8f252898dad461cf66afc1b84e", "score": "0.53962386", "text": "def draw_parameter(x, y, type)\n case type\n when 0\n name = Vocab::atk\n value = @actor.atk\n new_value = @new_atk\n when 1\n name = Vocab::def\n value = @actor.def\n new_value = @new_def\n when 2\n name = Vocab::spi\n value = @actor.spi\n new_value = @new_spi\n when 3\n name = Vocab::agi\n value = @actor.agi\n new_value = @new_agi\n end\n self.contents.font.color = system_color\n self.contents.draw_text(x + 4, y, 80, WLH, name)\n self.contents.font.color = normal_color\n self.contents.draw_text(x + 90, y, 30, WLH, value, 2)\n self.contents.font.color = system_color\n self.contents.draw_text(x + 122, y, 20, WLH, \">\", 1)\n if new_value != nil\n self.contents.font.color = new_parameter_color(value, new_value)\n self.contents.draw_text(x + 142, y, 30, WLH, new_value, 2)\n end\n end", "title": "" }, { "docid": "370540e91c2ccc11a574ba201c629f2c", "score": "0.5383279", "text": "def tick(args)\n setup(args) unless args.state.setup_done\n\n # !!! DON'T FORGET TO RENDER THE PIXEL ARRAY !!!\n args.state.pa1.render_as_sprite(args)\n args.state.pa2.render_as_sprite(args)\n # !!! DON'T FORGET TO RENDER THE PIXEL ARRAY !!!\n\n args.outputs.primitives << $gtk.framerate_diagnostics_primitives\n\nend", "title": "" }, { "docid": "356160a1d19a46c3f718bf32f2165871", "score": "0.53832096", "text": "def set_particle_instance\n @particle = ParticleInstance.find(params[:id])\n end", "title": "" }, { "docid": "3a3fe1ba999bc2e5a02b348071e234bf", "score": "0.5380654", "text": "def alpha\n @emitter.alpha\n end", "title": "" }, { "docid": "376797720af7d22c8cd6681045369ef8", "score": "0.5380524", "text": "def attach_and_display\n convert_to_string\n\n attach_side_message\n\n attach_x_coordinates\n\n add_spacings\n\n display\n end", "title": "" }, { "docid": "e70f660167c24c2e0adebb53b0da687d", "score": "0.53803706", "text": "def particle_displacement_screen\n @heading = 'Particle displacement = amplitude x cosine(angular velocity x time)'\n background('images/oscillations_large.png')\n\n # Particle displacement screen header\n ScreenHeader.new(self, '/title_screen/oscillations_screen', @@font, @heading)\n\n # Particle displacement screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 640, :width => 80) do\n end\n # Content column\n stack(:height => 640, :width => 1000) do\n ScreenLabel.new(self, @@font, @heading, 'Amplitude')\n flow do\n @amplitude = ScreenEditLine.new(self, @@font, @heading)\n @amplitude_unit = para(strong(' m'))\n @amplitude_unit.style(@@screen_unit_text_styles)\n end\n\n ScreenLabel.new(self, @@font, @heading, 'Angular velocity')\n flow do\n @angular_velocity = ScreenEditLine.new(self, @@font, @heading)\n @angular_velocity_unit = para(strong(' rads'), strong(sup('-1')))\n @angular_velocity_unit.style(@@screen_unit_text_styles)\n end\n\n ScreenLabel.new(self, @@font, @heading, 'Time')\n flow do\n @time = ScreenEditLine.new(self, @@font, @heading)\n @time_unit = para(strong(' s'))\n @time_unit.style(@@screen_unit_text_styles)\n end\n\n @calculate = button('Calculate')\n\n @result_display = flow\n\n @error_display = flow\n\n @calculate.click do\n @result_display.clear do\n @result = Joules.particle_displacement(@amplitude.text.to_f,\n @angular_velocity.text.to_f,\n @time.text.to_f)\n @particle_displacement = para(@result.to_s)\n @particle_displacement_unit = para(' m')\n @particle_displacement.style(@@screen_result_text_styles)\n @particle_displacement_unit.style(@@screen_result_text_styles)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "2cf61ae4da3c7b0118aa56cb5a589567", "score": "0.5373175", "text": "def draw_parameter( y, type)\n case type\n when 0\n value = @actor.atk\n new_value = @new_atk\n when 1\n value = @actor.def\n new_value = @new_def\n when 2\n value = @actor.spi\n new_value = @new_spi\n when 3\n value = @actor.agi\n new_value = @new_agi\n when 4\n value = @actor.hit\n new_value = @new_hit\n when 5\n value = @actor.eva\n new_value = @new_eva\n when 6\n value = @actor.cri\n new_value = @new_cri\n end\n self.contents.font.name = [POLICE_ITEM_NAME,\"Verdana\"]\n self.contents.font.size = 18\n self.contents.font.bold = true\n self.contents.font.color = normal_color\n self.contents.draw_text(POS_CAR_OLD[0], POS_CAR_OLD[1]+y, 30, WLH, value, 2)\n if new_value != nil\n self.contents.font.color = new_parameter_color(value, new_value)\n self.contents.draw_text(POS_CAR_NEW[0], POS_CAR_NEW[1]+y, 30, WLH, new_value, 2)\n end\n end", "title": "" }, { "docid": "b5ace004b2adbd529d340957220850d1", "score": "0.53693527", "text": "def display\n ellipse_mode(CENTER)\n stroke_weight(4)\n stroke(0)\n if @dragging\n fill(50)\n elsif @rollover\n fill(100)\n else\n fill(175, 200)\n end\n ellipse(location.x, location.y, mass * 2, mass * 2)\n end", "title": "" }, { "docid": "125dc2d05e17fbd623d3b4d0ec43b66c", "score": "0.5340948", "text": "def display\n fill(0, 150)\n stroke(0)\n stroke_weight(2)\n ellipse(x, y, 16, 16)\n end", "title": "" }, { "docid": "e5fd53ab80c38c43c47dc6f6f6a6eeff", "score": "0.53396523", "text": "def mpshow\n end", "title": "" }, { "docid": "a59474987d26db5242b7e9edee805247", "score": "0.5336036", "text": "def render_fps\n fps = @args.gtk.current_framerate.round\n if @show_fps\n @args.outputs.labels << [ 25, 710, \"FPS: #{fps}\", -4, 0, *Color::White ]\n end\n end", "title": "" }, { "docid": "6c8d069bd698e7496be382a95a1959eb", "score": "0.53308284", "text": "def display()\n\t\tputs \"Player: #{@name}\"\n\t\tputs \"Type: #{@pType}\"\n\t\tprint \"Current score: #{@score}\" \n\t\tprint \"Best score: #{@bestScore}\\n\"\n\tend", "title": "" }, { "docid": "bb82d4ca1cbbd6b8218f775b70decf69", "score": "0.5329243", "text": "def update\n\t\t@display.string = \"mouse pos: #{@p.inspect}\" # display mouse position\n\t\t@point_data.update\n\tend", "title": "" }, { "docid": "b87c4d3a7cb66e94357abe3f7dfbfebc", "score": "0.532307", "text": "def show\n @entity_manager = EntityManager.new\n\n p1_tank = @entity_manager.create_tagged_entity('p1_tank')\n @entity_manager.add_components p1_tank, [\n SpatialState.new(320, 240),\n Engine.new(0.05, false, 0, true),\n Motion.new,\n Renderable.new(:tank),\n PolygonCollidable.new,\n PlayerInput.new(PLAYER_INPUT),\n Fire.new(50, 50),\n HealPoints.new,\n Sound.new([:damage])\n ]\n\n # Initialize systems\n @input = InputSystem.new(self)\n @renderer = RenderingSystem.new(self)\n @engine = EngineSystem.new(self)\n @motion = MotionSystem.new(self)\n @collision = CollisionSystem.new(self)\n @bullets = BulletSystem.new(self)\n @sounds = SoundSystem.new(self)\n @enemies = EnemySystem.new(self)\n @lifelines = LifelineSystem.new(self)\n @camera_control = CameraSystem.new(self)\n\n # Initialize configs\n @sound_storage = SoundStorage.new\n @image_storage = ImageStorage.new\n\n @elapsed=0\n\n @camera = OrthographicCamera.new\n @camera.setToOrtho(false, 640, 480)\n \n @batch = SpriteBatch.new\n @font = BitmapFont.new\n end", "title": "" }, { "docid": "1f009d7d4d3f2b00f64df14428c309db", "score": "0.53196967", "text": "def display\n fill(127)\n stroke(0)\n stroke_weight(2)\n ellipse(x, y, 32, 32)\n end", "title": "" }, { "docid": "feb545998bb1820d64f521423a6e9532", "score": "0.5318587", "text": "def draw; end", "title": "" }, { "docid": "feb545998bb1820d64f521423a6e9532", "score": "0.5318587", "text": "def draw; end", "title": "" }, { "docid": "feb545998bb1820d64f521423a6e9532", "score": "0.5318587", "text": "def draw; end", "title": "" }, { "docid": "27e4f250c77fce220b16fb8d18da1da9", "score": "0.5309633", "text": "def draw(renderer, position)\n\tend", "title": "" }, { "docid": "d35a6c8111741eddc9500cce934952af", "score": "0.530414", "text": "def draw_new_param(x, y, param_id)\n new_value = @temp_actor.param(param_id)\n change_color(param_change_color(new_value - @actor.param(param_id)))\n draw_text(x, y, 32, line_height, new_value, 2)\n end", "title": "" }, { "docid": "a7dec285b4ced0daca600e724d9e2e30", "score": "0.53017545", "text": "def draw_new_param(x, y, param_id)\n new_value = @temp_actor.param(param_id)\n change_color(param_change_color(new_value - @actor.param(param_id)))\n draw_text(x, y, 42, line_height, new_value, 2)\n end", "title": "" }, { "docid": "7cf2c5826c7e33b6f4b98c9bb4312ab2", "score": "0.5292166", "text": "def draw(&proc)\n end", "title": "" }, { "docid": "d4330d97f61ae60e4126693c9efa6cb4", "score": "0.52913606", "text": "def display\n puts \"-\" * 40\n puts \"\"\n\tputs \"You drew #{@p_draw}.\"\n\tputs \"The computer drew #{@c_draw}.\"\n\tresults\nend", "title": "" }, { "docid": "4bc00ca63a5e825525669a3dd3e476c5", "score": "0.5282558", "text": "def create\n @particle = ParticleInstance.new(particle_params)\n\n respond_to do |format|\n if @particle.save\n format.html { redirect_to @particle, notice: 'Particle was successfully created.' }\n format.json { render :show, status: :created, location: @particle }\n else\n format.html { render :new }\n format.json { render json: @particle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2387dc6cc56a3dcdd55525ea50a562bd", "score": "0.52802336", "text": "def draw_current_param(x, y, param_id)\n change_color(normal_color)\n draw_text(x, y, 42, line_height, @actor.param(param_id), 2)\n end", "title": "" }, { "docid": "ee667fda3778b6f8d28080c56fcf83b0", "score": "0.5279144", "text": "def show \n @pt = @mod.protracker_module\n puts \"AHA #{@pt.sample_data[0].snapshot.length}\"\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277513", "text": "def display\n @display\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277494", "text": "def display\n @display\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277494", "text": "def display\n @display\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277494", "text": "def display\n @display\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277494", "text": "def display\n @display\n end", "title": "" }, { "docid": "40cada2e53dcaf8c629e510a3b1917c2", "score": "0.5277494", "text": "def display\n @display\n end", "title": "" } ]
55fd1f4510301ae4846bd4ed8fb0bdf0
tester for next_consonant p next_consonant("d") incorporate all three methods into one method
[ { "docid": "8fdadc152d85a31baac7c98170c6daa9", "score": "0.0", "text": "def alias_name(name)\n\t# run swap name to interchange first and last names and then run .chars\n\t\t# to turn characters into an array\n\tswapName = name_swap(name).chars\n\t# set variables for vowels and consonants and run .chars to form array\n\tallVowels = \"aeiouAEIOU\".chars\n\tallConsonants = \"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".chars\n\t# set a counter to use for the index and loop through each character of \n\t# the name\n\t\tcounter = 0\n\t\tswapName.map do |char|\n\t\t\t# check if each letter is a vowel or a consonant and then run \n\t\t\t\t# corresponding method to change character and insert into name\n\t\t\tif allVowels.include?(char) == true\n\t\t\t\tnewVowel = next_vowel(char)\n\t\t\t\tswapName[counter] = newVowel\n\t\t\telsif allConsonants.include?(char) == true\n\t\t\t\tnewConsonant = next_consonant(char)\n\t\t\t\tswapName[counter] = newConsonant\t\n\t\t\tend\n\t\t\tcounter = counter + 1\n\t\tend\n\t# convert name character array into string\n\tswapName.join('')\nend", "title": "" } ]
[ { "docid": "ef5e502654d89867d840fe890ab4109b", "score": "0.7367435", "text": "def next_consonant(input_consonant)\n if input_consonant.size > 1 then \n puts \"Warning (in next_consonant): the input should be a single letter. \\n\"\n end\n \n if is_consonant(input_consonant) == false then \n puts \"Warning: the input letter '#{input_consonant}' is not a consonant. \\n\"\n end \n \n input_consonant_lowercase = input_consonant.downcase\n if(input_consonant_lowercase == \"z\") then \n if(is_upcase(input_consonant)) then\n return \"B\"\n else \n return \"b\"\n end \n end \n consonants_table = \"bcdfghjklmnpqrstvwxyz\".split('')\n i0 = consonants_table.index(input_consonant_lowercase)\n \n if(is_upcase(input_consonant)) then\n return consonants_table[i0 + 1].upcase\n else \n return consonants_table[i0 + 1]\n end \nend", "title": "" }, { "docid": "9cb6444ee34ca8070402f56c2b975b5c", "score": "0.7300277", "text": "def next_consonant(consonant)\n vowels = %w{a e i o u}\n if vowels.include?(consonant.next)\n consonant.next.next\n else\n consonant.next\n end\nend", "title": "" }, { "docid": "dbb81849078fda9bb23410e6bd900587", "score": "0.72054356", "text": "def next_consonant(consonant)\n temp_consonant = consonant\n consonant_index = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n current_index = consonant_index.index(consonant)\n temp_consonant = consonant_index[current_index + 1]\n if temp_consonant == nil\n temp_consonant = \"b\"\n end\n return temp_consonant\nend", "title": "" }, { "docid": "b197d5cb3d333f8a8328c5275aebb2f7", "score": "0.71651816", "text": "def next_consonant(consonants)\n consonants.tr('bcdfghjklmnpqrstvwxyz', 'cdfghjklmnpqrstvwxyzb')\nend", "title": "" }, { "docid": "f1d75567459a3f35f710beed829dd51c", "score": "0.7106899", "text": "def next_consonant(consonat)\n if consonat != 'z' # handles edge case\n next_consonant = $consonants[$consonants.index(consonat) + 1]\n else\n next_consonant = $consonants[0]\n end\n next_consonant\nend", "title": "" }, { "docid": "2b2f467f245bb7609d89dcd76f6064ab", "score": "0.691468", "text": "def next_consonant (consonant)\n\tconsonant_ary = consonant.split('')\n\tconsonants = \"bcdfghjklmnpqrstvwxyz\".split('')\n\n\tfor i in 0..20\n\t\tif consonant_ary[0] == consonants[i]\n\t\t\treturn consonants[(i+1)%21]\n\t\tend\n\tend\nend", "title": "" }, { "docid": "0ab3e64584c97afbfd6d44d5b3dff5b3", "score": "0.6895492", "text": "def next_consonant (char)\n\t# name all consonants and turn into character arrays\n\tallConsonants = \"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".chars\n \t# create index variable for each character passed through\n consonantIndex = allConsonants.index(char)\t\n \t# set IF statements for edge casses. Else set character to 1\n \t\t# added to consonant index \n \tif char == \"z\"\t\n \t\tchar = \"b\"\n \telsif char == \"Z\"\t\n \t\tchar = \"B\"\n \telse \n \t\tchar = allConsonants[consonantIndex+1]\n \tend\nend", "title": "" }, { "docid": "486aac33b1cbad0285ad093dc822a6bf", "score": "0.68554646", "text": "def next_consonant(letter)\n#declate consonants\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n index = consonants.index(letter)\n#assign input to the next consonant\n letter = consonants[index + 1]\n\n#check for edge case\n if letter == nil\n#hardcode \"b\" for input of \"z\"\n letter = \"b\"\n end\n letter\nend", "title": "" }, { "docid": "58b9812a26d7591815a49a9ba318c169", "score": "0.6850996", "text": "def consonant_changer(consonant)\r\n if consonant == \"z\"\r\n consonant = \"b\"\r\n return consonant\r\n end\r\n consonant.next!\r\n if !$consonants.include?(consonant)\r\n consonant.next!\r\n end\r\n consonant\r\nend", "title": "" }, { "docid": "67e6bc26a1e908a1236eff5b78a3fe41", "score": "0.68279946", "text": "def next_consonant(char)\n\t# checks for edge case, then handles it or shifts to the next character with #next\n\tchar == \"z\" ? new_char = \"b\" : \tnew_char = char.next\n\t# keeps shifting with #next method until it finds a character not included in the 'vowel' string\n\twhile $vowels.include?(new_char)\n\t\tnew_char = new_char.next\n\tend\n\tnew_char\nend", "title": "" }, { "docid": "b1ee0fcaaf657b07d6136c83a974f3a2", "score": "0.6778454", "text": "def next_consonant(character)\t# assumes character is a consonant\n\tconsonants = \"bcdfghjklmnpqrstvwxyz\"\n\tconsonants_array = consonants.chars\n\tnew_character = \"\"\t\t# where our answer will go\n\tnew_index = nil\n\n\tour_index = consonants_array.index(character)\n\t\n\tif character != \"z\"\n\t\tnew_index = our_index + 1\n\telsif character == \"z\"\n\t\tnew_index = 0\n\tend\n\n\tnew_character = consonants_array[new_index]\n\n\tnew_character\t# returns the new character\nend", "title": "" }, { "docid": "570b3f9cd65fea3642c35e2f69f152d8", "score": "0.67413646", "text": "def next_consonant(character)\n\tconsonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n\t#take character in cons. array and go to next consonant\n\tif character == \"z\"\n\t\tcharacter = \"b\"\n\telse\n\tcharacter_index = consonants.index(character) + 1 \n\tcharacter = consonants[character_index]\n\tend\nend", "title": "" }, { "docid": "cd36e78f1f35b645a00c20cb8cf8a6a0", "score": "0.6695921", "text": "def next_consonant(char)\r\n\tconsonants = 'bcdfghjklmnpqrstvwxyz'.chars\r\n\tcon_index = 0\r\n\twhile con_index < consonants.length\r\n\t\tif char == consonants[con_index]\r\n\t\t\tthen char = consonants[con_index.next]\r\n\t\t\tbreak\r\n\t\telse\r\n\t\t\tchar = char\r\n\t\tend\r\n\t\tcon_index += 1\r\n\tend\r\n\tchar\r\nend", "title": "" }, { "docid": "6597041d1d1b6fbb128a9c31546601ff", "score": "0.6679749", "text": "def translate_consonant(y)\r\n b = y.split(\"\") \r\n while b[0].match (/[bcdfghjklmnpqrstvwxyz]/)\r\n if b[0..2] == ([\"s\",\"c\",\"h\"])\r\n e = b.slice(0..2)\r\n b.shift(3)\r\n b.push(e)\r\n elsif \r\n b[0].match (/[q]/)\r\n d = b.slice(0..1)\r\n b.shift(2)\r\n b.push(d) \r\n else \r\n c = b.slice(0)\r\n b.shift\r\n b.push(c)\r\n end\r\n end\r\n b.push(\"ay\")\r\n b.join(\"\") \r\nend", "title": "" }, { "docid": "964442592a06db465bc3f3c3e899df85", "score": "0.6673384", "text": "def randomConsonant()\n return @consonant[Random.rand(26)]\n end", "title": "" }, { "docid": "3e37b732eb7c4fcfae63f66818af49bd", "score": "0.66683906", "text": "def next_consonant(char)\r\n if char == \"z\"\r\n return \"b\"\r\n elsif char == \"Z\"\r\n return \"B\"\r\n elsif vowel?(char.downcase.next)\r\n return char.next.next\r\n else\r\n return char.next\r\n end\r\nend", "title": "" }, { "docid": "8b9ef69e8f9306024eca9322a694dc02", "score": "0.65771013", "text": "def next_consonant (ch)\r\n ch.downcase!\r\n consonants='bcdfghjklmnpqrstvwxyz '\r\n ch == 'z' ?\r\n 'b': consonants[consonants.index(ch)+1]\r\nend", "title": "" }, { "docid": "99210c7fcab577323a9d4836e2fce6ff", "score": "0.6558922", "text": "def switch_consonant(consonant)\n\t\tconsonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\t\tconsonant_index = consonants.find_index(consonant)\n\t\tif consonant_index == 20\n\t\t\tnext_index = 0\n\t\telse\n\t\t\tnext_index = consonant_index + 1\n\t\tend\n\t\tnext_consonant = consonants[next_index]\n\tend", "title": "" }, { "docid": "f9df38ff7ced7563f3a555d349db785a", "score": "0.6495095", "text": "def next_cons(consonant)\n consonants = \"bcdfghjklmnpqrstvwxyz\".split('')\n if consonant == \"z\"\n consonant = \"b\"\n else\n consonants.each_with_index do | char, i |\n return consonants[i + 1] if consonant == char\n end\n end\nend", "title": "" }, { "docid": "8bf94ee0c7887149453b9298437f75fa", "score": "0.64861506", "text": "def next_consonant(word)\n word.tr!('bcdfghjklmnpqrstvwxyz', 'cdfghjklmnpqrstvwxyz')\nend", "title": "" }, { "docid": "88d79adc117d96aa4e3393bcad345407", "score": "0.64753026", "text": "def next_consonant(letter)\n\ti = $consonants.index(letter)\n\tif i < 20\n\t\treturn $consonants[i+1]\n\telse\n\t\treturn $consonants[0]\n\tend\nend", "title": "" }, { "docid": "ac3fe15067d7a3943e6a779fcb32b9f5", "score": "0.64731306", "text": "def next_consonant(string)\r\n # multiply by 2 to handle edge cases\r\n consonants = 'bcdfghjklmnpqrstvwxyz' * 2\r\n string = string.downcase\r\n string.gsub(/[bcdfghjklmnpqrstvwxyz]/) do |character|\r\n char_index = consonants.index(character)\r\n character = consonants[char_index + 1]\r\n end\r\nend", "title": "" }, { "docid": "57854470ad486962f2edfd0c345bf11b", "score": "0.6462535", "text": "def consonant_next(i)\n\t\tconsonants = \"bBcCdDfFgGhHjJkKlLmMnNpPqQrRsStTvVwWxXyYzZ\"\n\t\tif i == \"z\"\n\t\t\ti = \"b\"\n\t\telsif i == \"Z\"\n\t\t\ti == \"B\"\n\t\telsif i == \" \"\n\t\t\ti = \" \"\n\t\telse\n\t\t\ti = consonants[consonants.index(i) +2]\n\t\tend\n\tend", "title": "" }, { "docid": "7363579341af7f164d34f5f8bb3b5672", "score": "0.64489466", "text": "def next_consonant(product)\n spot = 0 \n consonants = \"bcdfghjklmnpqrstvwxy\"\n while spot < product.length\n if product[spot] == \"z\"\n product[spot] = \"b\"\n elsif consonants.split('').include?(product[spot])\n next_spot = consonants.index(product[spot]) + 1 \n product[spot] = consonants[next_spot]\n end\n spot += 1 \n end\n product.reverse.join\nend", "title": "" }, { "docid": "1f8ca83c4a9aa8b34ba6440a16448f1d", "score": "0.6446782", "text": "def consonant(letter, vowels=\"aeiou\".split(''))\n if vowels.include? letter.next.downcase\n return letter.next.next\n # skip the next letter if it is a vowel and return the next consonant.\n\n else\n return letter.next\n # return the next letter consonant.\n end\nend", "title": "" }, { "docid": "332d98368c8ba01574d384d6443b4ffd", "score": "0.6426268", "text": "def next_consonant(name)\n consonant = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n name = name.split('')\n name_new = name.map do |letter|\n if consonant.include?(letter)\n consonant.rotate(1)[consonant.index(letter)]\n else\n letter\n end\n end\n name_new.join\n end", "title": "" }, { "docid": "6218c8afcc0ccb07050347bb1f194be5", "score": "0.64094675", "text": "def next_consonant(letter)\n\tconsonants = 'bcdfghjklmnpqrstvwxyz'\n\t\tif letter == 'z'\n\t\t\tnext_consonant = 'b'\n\t\telse \n\t\tnext_consonant = consonants[consonants.index(letter) + 1]\n\tend\nend", "title": "" }, { "docid": "5fd13cb21ad3def0f93975f2ec3583f2", "score": "0.6314892", "text": "def consonant_adv(str)\r\n\tconsonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\r\n\tstr = str.split('')\r\n\tstr_new = str.map do |char|\r\n\t\tif consonants.include?(char)\r\n\t\t\tconsonants.rotate(1)[consonants.index(char)]\r\n\t\telse\r\n\t\t\tchar\r\n\t\tend\r\n\tend\r\n\tstr_new.join\r\nend", "title": "" }, { "docid": "1fbbc2d8ca75b3ab7a6e6f10f0634492", "score": "0.63095903", "text": "def consonantConverter(c)\n # logic used to create consonants\n # consonants = ('a'..'z').to_a.join('').delete('aeiou')\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n\n if c == consonants[-1]\n consonants[0]\n else \n c_index = consonants.index(c)\n consonants[c_index + 1] \n end\nend", "title": "" }, { "docid": "4be91f32e62fdb3cc9fe7851f8b2c3b3", "score": "0.6301071", "text": "def next_consonant(char)\r\n #Define vowels and create a cipher hash so that the key has a next vowel value\r\n consonant_cipher = { 'b' => 'c', 'c' => 'd', 'd' => 'f', 'f' => 'g', 'g' => 'h', 'h' => 'j', 'j' => 'k', 'k' => 'l', 'l' => 'm', 'm' => 'n', 'n' => 'p', 'p' => 'q', 'q' => 'r', 'r' => 's', 's' => 't', 't' => 'v', 'v' => 'w', 'w' => 'x', 'x' => 'y', 'y' => 'z', 'z' => 'b'}\r\n #if the character has the key then replace the character with that key's value which is the next consonant\r\n if consonant_cipher.has_key?(char)\r\n char = consonant_cipher[char]\r\n end#if\r\nend", "title": "" }, { "docid": "515d49a0a71fb45b0f4e419e109fcf0d", "score": "0.6286102", "text": "def consonant_changer(consonants_input)\n consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']\n consonants_input.map! do |input_character_c|\n if input_character_c == consonants[0]\n input_character_c = consonants[1]\n elsif input_character_c == consonants[1]\n input_character_c = consonants[2]\n elsif input_character_c == consonants[2]\n input_character_c = consonants[3]\n elsif input_character_c == consonants[3]\n input_character_c = consonants[4]\n elsif input_character_c == consonants[4]\n input_character_c = consonants[5]\n elsif input_character_c == consonants[5]\n input_character_c = consonants[6]\n elsif input_character_c == consonants[6]\n input_character_c = consonants[7]\n elsif input_character_c == consonants[7]\n input_character_c = consonants[8]\n elsif input_character_c == consonants[8]\n input_character_c = consonants[9]\n elsif input_character_c == consonants[9]\n input_character_c = consonants[10]\n elsif input_character_c == consonants[10]\n input_character_c = consonants[11]\n elsif input_character_c == consonants[11]\n input_character_c = consonants[12]\n elsif input_character_c == consonants[12]\n input_character_c = consonants[13]\n elsif input_character_c == consonants[13]\n input_character_c = consonants[14]\n elsif input_character_c == consonants[14]\n input_character_c = consonants[15]\n elsif input_character_c == consonants[15]\n input_character_c = consonants[16]\n elsif input_character_c == consonants[16]\n input_character_c = consonants[17]\n elsif input_character_c == consonants[17]\n input_character_c = consonants[18]\n elsif input_character_c == consonants[18]\n input_character_c = consonants[19]\n elsif input_character_c == consonants[19]\n input_character_c = consonants[20]\n elsif input_character_c == consonants[20]\n input_character_c = consonants[0]\n else\n input_character_c\n end\n end\nend", "title": "" }, { "docid": "6bceffeb2598fd81594bbc2a5dc20168", "score": "0.6273818", "text": "def consonants string, number_of_times=1\n multiple_checks = []\n\n #checks for multiple consonants in a row\n if number_of_times > 1\n number_of_times.times do |i|\n multiple_checks << !is_vowel(string[i])\n end\n\n #checks if first letter is consonant\n else\n multiple_checks << !is_vowel(string)\n end\n !multiple_checks.include?(false)\nend", "title": "" }, { "docid": "15756b269a7412e41626c207ad1e4779", "score": "0.6272624", "text": "def next_consonant(letter)\n if letter == \"z\" \n then \n return \"a\"\n elsif (letter.ord < 97) or (letter.ord > 122)\n return letter\n elsif letter.match(/[dhnt]/) == nil\n return (letter.ord + 1).chr\n else \n return (letter.ord + 2).chr\n end\nend", "title": "" }, { "docid": "225aa7b56a172f817d60b98c126de232", "score": "0.62623256", "text": "def get_next_con (consonant_letter)\n\tconsonants = \"bcdfghjklmnpqrstvwxyz\"\n\tconsonant_index = consonants.index(consonant_letter) + 1\n\tif consonant_index == 21\n\t\tconsonant_index = 0\n\tend\n\n\tconsonant_letter = consonants[consonant_index]\n\nend", "title": "" }, { "docid": "f58fa97ae53055638d62a3afc11b51e0", "score": "0.6250366", "text": "def next_consonant(letter)\n return 'b' if letter == 'z'\n return 'B' if letter == 'Z'\n return ' ' if letter == ' '\n consonants = 'bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ'\n index = consonants.index(letter)\n consonants[index + 1]\n end", "title": "" }, { "docid": "560d13c7c5b59eb22844db27b7fc6e0c", "score": "0.62303793", "text": "def next_consonant(consonant_letter)\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n #1. look at consonant and find current_location of consonant_letter\n current_location = consonants.index(consonant_letter)\n #2. add 1 to current_location of consonant_letter to get next_location\n next_location = 1 + current_location\n #3. go to next_location to get next consonant_letter\n consonants[next_location]\n #4. account for edge cases\n if next_location == consonants.length\n result = \"b\"\n else\n result = consonants[next_location]\n end\n result\n end", "title": "" }, { "docid": "2659884076bc4ed3df647de8a1bfb295", "score": "0.6221786", "text": "def next_consonant(letter)\r\n\tvowels = \"bcdfghjklmnpqrstvwxyz\"\r\n\tif letter == \"z\"\r\n\t\treturn \"b\"\r\n\telse\r\n\t\tindex = vowels.index(letter)\r\n\t\treturn vowels[index + 1]\r\n\tend\r\nend", "title": "" }, { "docid": "8846fd72abf416f13e442567e52781de", "score": "0.6217882", "text": "def next_consonant(letter2)\n lower_letter = letter2.downcase\n consonant_position = \"bcdfghjklmnpqrstvwxyz\".index (lower_letter)\n if consonant_position.to_i == 20\n next_consonant = \"b\"\n elsif consonant_position != nil\n next_consonant = \"bcdfghjklmnpqrstvwxyz\"[( consonant_position.to_i + 1)]\n else next_consonant = lower_letter\n end\n end", "title": "" }, { "docid": "a44c933e37effe20ab901fa0afd25971", "score": "0.6204309", "text": "def consonant_validator(name)\n consonant=['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n x=0 \n while x<name.length \n y=0 \n while y<consonant.length\n if name[x].downcase==\"z\"\n name[x]=\"b\"\n break \n elsif name[x].downcase==consonant[y].downcase\n z=y+1 \n name[x]=consonant[z]\n break \nelse \n y+=1\nend \nend \nx+=1 \nend \nname\nend", "title": "" }, { "docid": "2384a6aaa665d5c043b9abfa51a3eac0", "score": "0.6199132", "text": "def next_consonant(name)\n consonant = [\"b\",\"c\",\"d\",\"f\",\"g\",\"h\",\"j\",\"k\",\"l\",\"m\",\"n\",\"p\",\"q\",\"r\",\"s\",\"t\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n name = name.split('')\n warped_name = name.map do |letter|\n if consonant.include?(letter)\n consonant.rotate[consonant.index(letter)]\n else \n letter\n end\n end\n warped_name.join\nend", "title": "" }, { "docid": "c851c8eec4b08d1bb395d8c68e40e083", "score": "0.6194001", "text": "def next_consonant(letter)\n vowels = ['a','e','i','o','u']\n new_letter = letter.next\n\n #edge case for z -- old mistake: returned a, now returns b\n if letter == 'z'\n return 'b'\n end\n\n if vowels.index(new_letter) != nil\n new_letter = new_letter.next #checking once is sufficient because there are no consecutive vowels in the alphabet\n end\n return new_letter\nend", "title": "" }, { "docid": "6b8e360b69ec6d0fc6c34968609ec3ed", "score": "0.61589915", "text": "def next_consonant(fullname)\n\tname_array = fullname.downcase.chars\n\tconsonants = \"bcdfghjklmnpqrstvwxyz\"\n\n\tname_array.map! do |char|\n\t\tif consonants.include?(char)\n\t\t\tchar_index = consonants.index(char) # find position of the character in the consonants string\n\n\t\t\t# 'z' will become 'b'\n\t\t\tif char == \"z\"\n\t\t\t\tchar = \"b\"\n\t\t\telse \n\t\t\t\tchar = consonants[char_index + 1]\n\t\t\tend\n\t\tend\n\t\tchar\n\tend\n\t\n\tnew_name_array = name_array.join(\"\")\t# put the array back together to get name\n\tnew_name_array.split.map! {|x| x.capitalize}.join(\" \") # capitalize each name\nend", "title": "" }, { "docid": "8a56126b9f42a2f8247e501af517f18a", "score": "0.61380166", "text": "def next_consonant(reverse_name)\n\tnew_name = reverse_name.downcase.chars # convert to lowercase\n\tconsonants = %w{b c d f g h j k l m n p q r s t v w x y z} # list of consonants\n\tnew_name.map! do |letter|\n\t\tif letter == \"z\" # edge case\n\t\t\tletter = \"b\"\n\t\telsif consonants.include?(letter)\n\t\t\tconsonants[consonants.index(letter) + 1]\n\t\telse \n\t\t\tletter\n\t\tend\n\tend \n\tnew_name.join('').split.map(&:capitalize).join(' ')\nend", "title": "" }, { "docid": "27cc3b08c2e065b33282fc2f4842a1cc", "score": "0.61357", "text": "def next_consonant(array_version)\n consonant_hash = {b: \"c\", c: \"d\", d: \"f\", f: \"g\", g: \"h\", h: \"j\", j: \"k\", k: \"l\", l: \"m\", m: \"n\", n: \"p\", p: \"q\", q: \"r\", r: \"s\", s: \"t\", t: \"v\", v: \"w\", w: \"x\", x: \"y\", y: \"z\", z: \"b\" }\n \n array_version.map do |letter|\n if consonant_hash.include?(letter)\n consonant_hash[letter.to_sym]\n else\n letter\n end \n\n # consonant_hash[letter.to_sym] || letter\n \n end\n \n \n end", "title": "" }, { "docid": "5cc8f0c6ab31bfad45acbd399e002ab7", "score": "0.60971886", "text": "def starts_with_consonant? s\n s = s.downcase\n answer = s.start_with?(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\")\n return answer\nend", "title": "" }, { "docid": "4bf23cdd12ae89afd73e74fbd28a270b", "score": "0.6053879", "text": "def consonant_next(name)\n\tfor i in 0..name.length-1\n\t# see if it is a vowel or space\n\t# if not a vowel or space advance to next letter\n\t\tvowels = \"AEIOUaeiou \"\n\t\t## logic: if the string in vowels doesn't have the letter from name, move to the next letter. \n\t\t## else if it does, then increment the letter by 2 letters to skip over the vowel.\n\t\t## else increment letter by 1 letter.\n\t\t### replace the z or Z to b or B...to address edge cases\n\t\tif vowels.include? name[i].downcase\n\t\t\tnext\n\t\telse\n\t\t\tif name[i] == \"z\" \n\t\t\t\tname[i] = \"b\"\n\t\t\telsif name[i] == \"Z\"\n\t\t\t\tname[i] = \"B\"\n\t\t\telsif vowels.include? name[i].next.downcase\n\t\t\t\tname[i] = name[i].next.next\n\t\t\telse\n\t\t\t\tname[i] = name[i].next\n\t\t\tend\n\t\tend\n\tend\n\treturn name\nend", "title": "" }, { "docid": "79ba48f4486692eeeeb439afe0720c1e", "score": "0.6045329", "text": "def next_consonat(string)\n\tstring.tr!(\"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\",\n\t\t\"cdfghjklmnpqrstvwxyzbCDFGHJKLMNPQRSTVWYZB\")\n\tstring\nend", "title": "" }, { "docid": "ba42c9858da0e04968988718055a32ec", "score": "0.60431063", "text": "def new_consonant(letter)\r\n\ti = 0\r\n\twhile i < (@consonants.length)\r\n\t\tif @consonants[i] == \"z\"\r\n\t\t\treturn @consonants[0]\r\n\t\telsif @consonants[i] == letter\r\n\t\t\treturn @consonants[i + 1]\r\n\t\tend\r\n\t\ti += 1\r\n\tend\r\nend", "title": "" }, { "docid": "0b4ba49d11f48ffb1479d0bfdc2d4ecf", "score": "0.6031731", "text": "def starts_with_consonant?(s)\n r = s =~ /\\A[b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z]/i\n if r.nil?\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "fef91dde8d7e48dd016b61dee00d69db", "score": "0.60124665", "text": "def is_consonant(input_letter)\n \n if input_letter.size > 1 then \n puts \"Warning (in is_consonant): the input should be a single letter. \\n\"\n end \n \n return (\"bcdfghjklmnpqrstvwxyz\".include?(input_letter.downcase))\nend", "title": "" }, { "docid": "4e59482d64b9848bc0bc376eba7f7980", "score": "0.59915483", "text": "def next_consonant (letter)\n consonant_array = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']\nif letter == 'z'\n return 'b'\nend\nnew_consonant = consonant_array.index(letter) + 1\nreturn consonant_array [new_consonant]\nend", "title": "" }, { "docid": "9a20d7501593dbd5e56d4fd148aef3f5", "score": "0.5923351", "text": "def next_conson(string)\r\n\tstring.tr!(\"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\",\r\n\t\t\"cdfghjklmnpqrstvwxyzbCDFGHJKLMNPQRSTVWYZB\")\r\n\tstring\r\nend", "title": "" }, { "docid": "994643259d1ded626fce8152c9c67ced", "score": "0.58845043", "text": "def starts_with_consonant? s\n if s.empty?\n return false\n elsif (s[0].match(/^B/) || s[0].match(/^C/) || s[0].match(/^D/) || s[0].match(/^F/) || s[0].match(/^G/) || s[0].match(/^H/) || s[0].match(/^J/) || s[0].match(/^K/) || s[0].match(/^L/) || s[0].match(/^M/) || s[0].match(/^N/) || s[0].match(/^P/) || s[0].match(/^Q/) || s[0].match(/^R/) || s[0].match(/^S/) || s[0].match(/^T/) || s[0].match(/^V/) || s[0].match(/^W/) || s[0].match(/^X/) || s[0].match(/^Y/) || s[0].match(/^Z/) || s[0].match(/^b/) || s[0].match(/^c/) || s[0].match(/^d/) || s[0].match(/^z/) || s[0].match(/^f/) || s[0].match(/^g/) || s[0].match(/^h/) || s[0].match(/^j/) || s[0].match(/^k/) || s[0].match(/^l/) || s[0].match(/^m/) || s[0].match(/^n/) || s[0].match(/^p/) || s[0].match(/^q/) || s[0].match(/^r/) || s[0].match(/^s/) || s[0].match(/^t/) || s[0].match(/^v/) || s[0].match(/^w/) || s[0].match(/^x/) || s[0].match(/^y/)) #== /[A-Z&&[^AEIOU]]/ || s[0]== /[a-z&&[^aeiou]]/\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "a8491c0afbc90120fa64af1a218f1e4b", "score": "0.58776134", "text": "def next_consonant(name_array)\r\n consonants = \"bcdfghjklmnpqrstvwxyz\"\r\n capital_consonants = \"bcdfghjklmnpqrstvwxyz\".upcase\r\n consonant_array = \"bcdfghjklmnpqrstvwxyz\".split('')\r\n capital_consonant_array = \"bcdfghjklmnpqrstvwxyz\".upcase.split('')\r\n\r\n name_array.map! do |letter|\r\n if consonant_array.include?(\"#{letter}\") == true\r\n letter = consonants[consonants.index(letter) + 1]\r\n elsif capital_consonant_array.include?(\"#{letter}\") == true\r\n letter = capital_consonants[capital_consonants.index(letter) + 1]\r\n else\r\n letter = letter\r\n end\r\n end\r\nend", "title": "" }, { "docid": "0bdd4697042b46766990e5c386c1d4e2", "score": "0.5865744", "text": "def consonant_changer(spy_name_and_vowel)\n\tcap_consonants = ['B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z']\n\tconsonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n\tfinal_spy_name = ''\n\tspy_name_and_vowel_array = spy_name_and_vowel.split('')\n\tspy_name_and_vowel_and_consonant = spy_name_and_vowel_array.map do |letter|\n\t\tif consonants.include?(letter)\n\t\t\tconsonants.rotate(1)[consonants.index(letter)]\n\t\telsif cap_consonants.include?(letter)\n\t\t\tcap_consonants.rotate(1)[cap_consonants.index(letter)]\n\t\telse letter\n\t\tend\nend\nfinal_spy_name = spy_name_and_vowel_and_consonant.join\np \"Your spy name is #{final_spy_name}!\"\nfinal_spy_name\nend", "title": "" }, { "docid": "1acac5f3628cc06cda3fe8b97fd5d139", "score": "0.5798376", "text": "def next_consonant(string)\n hash = {}\n new_con_array = []\n new_string = \"\"\n split_string = string.split(\"\")\n #=> [\"L\", \"o\", \"n\", \"g\"]\n\n cons = ['b','c','d','f','g','h','j',\n 'k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n\n cons.each do |letter|\n new_con_array << letter.next\n end\n\n cons.each do |letter|\n hash[letter] = letter.next\n end\n\n #=>[\"c\", \"d\", \"e\", \"g\", \"h\", \"i\", \"k\", \"l\",\n # \"m\", \"n\", \"o\", \"q\", \"r\", \"s\", \"t\", \"u\", \"w\", \"x\", \"y\", \"z\", \"aa\"]\n\n split_string.each do |i|\n case i\n when cons[0]\n i = new_con_array[0]\n when cons[1]\n i = new_con_array[1]\n when cons[2]\n i = new_con_array[2]\n when cons[3]\n i = new_con_array[3]\n when cons[4]\n i = new_con_array[4]\n when cons[5]\n i = new_con_array[5]\n when cons[6]\n i = new_con_array[6]\n when cons[7]\n i = new_con_array[7]\n when cons[8]\n i = new_con_array[8]\n when cons[9]\n i = new_con_array[9]\n when cons[10]\n i = new_con_array[10]\n when cons[11]\n i = new_con_array[11]\n when cons[12]\n i = new_con_array[12]\n when cons[13]\n i = new_con_array[13]\n when cons[14]\n i = new_con_array[14]\n when cons[15]\n i = new_con_array[15]\n when cons[16]\n i = new_con_array[16]\n when cons[17]\n i = new_con_array[17]\n when cons[18]\n i = new_con_array[18]\n when cons[19]\n i = new_con_array[19]\n when cons[20]\n i = new_con_array[20]\n end\n new_string << i\n end\n new_string\nend", "title": "" }, { "docid": "0f06d3d69e76236d6c5c46352a141249", "score": "0.57971513", "text": "def translate_w_consonant(word)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n i = 0\n while !vowels.include?(word[i])\n if word[i] + word[i + 1] == \"qu\"\n i += 2\n else\n i += 1\n end\n end\n word[i..-1] + word[0...i] + \"ay\"\nend", "title": "" }, { "docid": "7f84fce9edefcd8eb323fea1de2b0aa3", "score": "0.5688786", "text": "def double_consonants(str)\n doubled_consonants = ''\n str.chars.each do |char|\n if 'bcdfghjklmnpqrstvwxyz'.include?(char.downcase)\n 2.times do\n doubled_consonants << char\n end\n else\n doubled_consonants << char\n end\n end\n doubled_consonants\nend", "title": "" }, { "docid": "b1f64e1d5290cfb88ef6e2e3ef9de805", "score": "0.56832594", "text": "def double_consonants(string)\n string2consonants = \"\"\n\n string.chars.each do |char|\n CONSONANTS.include?(char.downcase) ? string2consonants << char * 2 : string2consonants << char\n end\n\n string2consonants\nend", "title": "" }, { "docid": "db937b502e3713bbfcafdbade9d5c213", "score": "0.56794107", "text": "def double_consonants(str)\n result = ''\n str.size.times do |idx|\n if str[idx] =~ /[a-z&&[^aeiou]]/i\n result << str[idx] * 2 \n else\n result << str[idx]\n end\n end\n \n result\nend", "title": "" }, { "docid": "d72bef7c74c10d26cff3a344095cacdc", "score": "0.56707865", "text": "def double_consonants(string)\r\n consonants = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'X', 'Z', 'W', 'Y',\r\n 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'x', 'z', 'w', 'y']\r\n new_string = ''\r\n string.each_char do |x|\r\n if consonants.include?(x)\r\n new_string << x * 2\r\n else \r\n new_string << x\r\n end\r\n end\r\n new_string\r\nend", "title": "" }, { "docid": "291a5b874d752246158f7a20e92978e0", "score": "0.56592774", "text": "def starts_with_consonant?(s)\n\t# nonconsonants = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u']\n\t# nonconsonants_lowercase = nonconsonants.map{|char| char.downcase}\n\t# return \t!nonconsonants.include?(s[0])\n\t# return !s[0].match(/[AEIOUaeiou][[:punct:]]/)\n\treturn false if s.empty?\n\treturn s[0].match(/[AEIOUaeiou[:punct:][:digit:]]/) ? false : true\n\t# return s[0].match(/[[AEIOUaeiou]&&[a-z][A-Z]]/) ? false : true\n\t# return false if s[0].match(/[AEIOUaeiou[:punct:]]/)\n\t# return true\nend", "title": "" }, { "docid": "d068e057eaab6d8ede6f0adeca632430", "score": "0.5621528", "text": "def starts_with_consonant? s\n return false if s.length == 0\n return ( s[0] =~ /[a-z]/i ) && ! ( s[0] =~ /[aeiou]/i )\n\nend", "title": "" }, { "docid": "ed1e1dee328716a73a6a529475d6c294", "score": "0.56193787", "text": "def starts_with_consonant? s\n # YOUR CODE HERE\n # psj :: !! it's easier to evaluate an array of vowels using #includes? than understand your regular expression\n # vh: agreed but was not passing test on special characters ex. /&%$# \n # this expression works too (s =~ /^(?=[^aeiou])(?=a-z)/i )==0\n # you had it something like this: , so we can add\n # BP : What I noticed on this is that the original way it was written,\n # any tests with numbers or special characters were returning true. ..and emptys and ints threw errors.\n # the other option could be to just test the consonants instead of vowels.. but that isn't very elegent \n \n vowels = %w(a e i o u)\n consonant =(\"a\"..\"z\").find_all {|letter| !vowels.include? letter}\nif (s.is_a?(String) && !s.empty?)\n return consonant.include? s[0].downcase\nelse \n return false\nend\nend", "title": "" }, { "docid": "a7fadb5b1034c47ee927b870c2fc79a4", "score": "0.561801", "text": "def starts_with_consonant? s\n if s.empty? == false\n s = s.downcase\n if s[0].match?(/[a-z]/) == true and s[0].match?(/[aeiou]/) == false\n return true\n end\n else\n return false\n end\nend", "title": "" }, { "docid": "a33143d1a35ddbe3f95031ddd241df01", "score": "0.561336", "text": "def is_consonant?(char)\n ('a'..'z').include?(char.downcase) && !%w(a e i o u).include?(char)\nend", "title": "" }, { "docid": "f840edeaba6d947356aa482f46054b78", "score": "0.56018853", "text": "def consonant_cancel(sentence)\n words = sentence.split\n new_words = words.map { |word| remove_starting_consonants(word) }\n return new_words.join(\" \")\n\nend", "title": "" }, { "docid": "f2bc674effca8918deac3f9181beecde", "score": "0.5594665", "text": "def starts_with_consonant? s\n a = s.downcase\n if a[0,1] == 'a' || a[0,1] == 'e' || a[0,1] == 'i' || a[0,1] == 'o' || a[0,1] == 'u' \n return false\n else \n return true\n end\nend", "title": "" }, { "docid": "4d9176f3f6b60b12ab54e727b3e0fb15", "score": "0.5585783", "text": "def translate_word(word)\n\n # Counts the number of consonants the word begins with.\n # If 0, word starts with a vowel.\n # num_starting_consonants = 0\n\n word.size.times do |index|\n if word[index] =~ /[aeiou]/\n case index\n when 0 # 0 consonants to start\n\n # Trivial case\n return \"#{word}ay\"\n\n when 1 # 1 consecutive consonant - Test for \"qu\"\n\n if word[0..1] == \"qu\"\n if word.size > 2\n return \"#{word[index+1..word.size-1]}quay\"\n else\n return \"quay\"\n end\n else\n return \"#{word[index..word.size-1]}#{word[0..index-1]}ay\"\n end\n\n when 2 # 2 consecutive consonants - Test for [consonant]qu\n\n if word[1..2] == \"qu\"\n if word.size > 3\n return \"#{word[index+1..word.size-1]}#{word[0]}quay\"\n else\n return \"#{word[0]}quay\"\n end\n else\n return \"#{word[index..word.size-1]}#{word[0..index-1]}ay\"\n end\n\n else # 3 or more consecutive consonants\n\n return \"#{word[index..word.size-1]}#{word[0..index-1]}ay\"\n\n end\n end\n end\n\n # 3 cases\n\n # 3 letter pattern\n\n # 2 letter pattern\n\n # 1 letter pattern\n\nend", "title": "" }, { "docid": "740247f09b425777519ca58cc6d78af7", "score": "0.55833405", "text": "def starts_with_consonant?(a_string)\n consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n the_first_char = a_string.chr.downcase\n consonants.include? the_first_char\nend", "title": "" }, { "docid": "c745e58e34569adfed41be51f394662d", "score": "0.55722404", "text": "def consonant_cancel(sentence)\n words = sentence.split\n new_words = words.map { |word| remove_first_consonant(word) }\n return new_words.join(\" \")\nend", "title": "" }, { "docid": "c745e58e34569adfed41be51f394662d", "score": "0.55722404", "text": "def consonant_cancel(sentence)\n words = sentence.split\n new_words = words.map { |word| remove_first_consonant(word) }\n return new_words.join(\" \")\nend", "title": "" }, { "docid": "300091e9eb1883ac40f2017dba345fe8", "score": "0.55704814", "text": "def consonant (letter)\n\tconsonant = \"bcdfghjklmnpqrstvwxyz\"\n\tcons_idx = consonant.index(letter)\n\treturn 'b' if letter == 'z'\n\tconsonant[cons_idx +1]\nend", "title": "" }, { "docid": "06efadb1d159fe05b74233b896c0ff39", "score": "0.5567465", "text": "def consonant?(letter)\n\t\"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".include?(letter)\nend", "title": "" }, { "docid": "a338eb33d70f1c7ff6d272f04fee6a1d", "score": "0.5557112", "text": "def starts_with_consonant? s\n # sanity check\n if s.empty?\n return false\n end\n \n # get the first letter\n _initial = s[0].downcase\n \n # check\n if _initial < 'a' || _initial > 'z'\n return false\n end\n \n return !VOWEL.include?(_initial)\nend", "title": "" }, { "docid": "1435423a33dbfba126c4b9b97bea9345", "score": "0.5521638", "text": "def consonant_cancel(sentence)\n\nend", "title": "" }, { "docid": "2c7c38147965253067c7e60b570ba0e3", "score": "0.55087376", "text": "def consonant_change(str)\n\tconsonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\tstr = str.split('')\n\tnew_str = str.map do |letter| \n\t\tif consonants.include? letter \n\t\t\tconsonants.rotate[consonants.index(letter)]\n\t\telse\n\t\t\tletter\n\t\tend\n\t\t\n\t\t\n\tend\n\tnew_str.join\nend", "title": "" }, { "docid": "69263b646c2e94a77490f815a6fb58fd", "score": "0.55076665", "text": "def starts_with_consonant? s\n \n if s.empty?\n return false\n end \n \n s = s.downcase\n \n if s[0] == \"a\" or s[0] == \"e\" or s[0] == \"i\" or s[0] == \"o\" or s[0] == \"u\" \n return false\n elsif s[0, 1] =~ /[[:alpha:]]/\n return true\n end\n \nend", "title": "" }, { "docid": "dc9b9e6f2b16ac7102b47170c3867426", "score": "0.54945755", "text": "def consonant_cancel(sentence)\n words = sentence.split(\" \")\n new_words = words.map {|word|remove_starting_consonants(word) }\n return new_words.join(\" \")\n\nend", "title": "" }, { "docid": "408a26271150b27a1e92fe246958b5d9", "score": "0.547768", "text": "def starts_with_consonant? s\n # YOUR CODE HERE\n s =~ /\\A[bcdfghjklmnprstvwxyz]/i\nend", "title": "" }, { "docid": "7c02e6c152bcf048c1a50d9fc718fd15", "score": "0.5470201", "text": "def random_consonants opts={}\n generate_random_string_using CONSONANTS, opts\n end", "title": "" }, { "docid": "1e6f9d7f772fd3ad59062b8e2991e128", "score": "0.5465271", "text": "def consonant?(char)\n char.match(/[bcdfghjklmnpqrstvwxyz]/i) ? true : false\nend", "title": "" }, { "docid": "ecd1afdda562a018e323de7968478aac", "score": "0.5455326", "text": "def starts_with_consonant? s\n /[bcdfghjklmnpqrstvwxyz]/i.match(s[0])\nend", "title": "" }, { "docid": "a1d97e645795a2bd337a4cca4666d49d", "score": "0.5453502", "text": "def double_consonants(string)\n result = []\n string.each_char do |char|\n result << char\n result << char if (char =~ CONSONANTS) == 0\n end\n p result.join\nend", "title": "" }, { "docid": "3d5c78768e3ca72a832c9f368c43588c", "score": "0.544172", "text": "def consonant(letter)\n consonant = \"bcdfghjklmnpqrstvwxyz\"\n original_index = consonant.index(letter)\n if letter == \" \"\n letter = \" \"\n elsif letter == \"z\"\n letter = \"b\"\n else\n letter = consonant[original_index+1]\n end\n letter\n end", "title": "" }, { "docid": "7d8848602330bcce4bad59db500b5e9d", "score": "0.5440993", "text": "def starts_with_consonant?(s)\n\tif s.empty?\n\t\tfalse\n\telse\n\t\t#s.upcase.start_with?(\"A\",\"E\",\"I\",\"O\",\"U\")\n\t\t#s.upcase[/\\A[AEIOU]/]\n\t\t!!s[/\\A[a-z]/i] and !s[/\\A[aeiou]/i]\n\tend\nend", "title": "" }, { "docid": "1e3fa51eaacd527b7d19d783565bd160", "score": "0.5429797", "text": "def starts_with_consonant? s\n if s == nil || s.length == 0\n return false\n end\n arr = ['a', 'e', 'i', 'o', 'u']\n a = s[0].downcase >= 'a' && s[0].downcase<= 'z' && arr.index(s[0].downcase) == nil\n return a\nend", "title": "" }, { "docid": "3a3cf3f5b654a19172d2dc82df0d964c", "score": "0.54252774", "text": "def double_consonants(text)\n double_string = ''\n text.each_char do |char|\n double_string << char\n double_string << char if char =~ /[a-z&&[^aeiou]]/i\n end\n double_string\nend", "title": "" }, { "docid": "407bb54fcbb6b9300b83725ee3c7bdf5", "score": "0.54115516", "text": "def starts_with_consonant?(s) \n\n consonants = /^[qwrtypsdfghjklzxcvbnm]/i\n s =~ consonants ? true : false\nend", "title": "" }, { "docid": "b72ec4e1bbcbdc4553ae5592d10f1e79", "score": "0.5407021", "text": "def starts_with_consonant? s\n !!(s[0] =~ /[bcdfghjklmnprstvwxyz]+/i)\n #!!(s[0] !~ /[aeiou]+/i)\nend", "title": "" }, { "docid": "eb1dfd142120b657477b4c8051731349", "score": "0.5402124", "text": "def double_consonants(string)\n characters = string.chars\n return_string = characters.map do |char|\n if char =~ /[^aeiou]/ && char =~ /[A-Za-z]/\n repeater(char)\n else\n char\n end\n end\n return_string.join\nend", "title": "" }, { "docid": "ba113e3662499a2c7a79b8a6ecadaec5", "score": "0.53958404", "text": "def consonant_changer(origional_name)\n origional_name_array = origional_name.downcase.chars\n consonants = %w{b c d f g h j k l m n p q r s t v w x y z}\n origional_name_array.map! do |char|\n if char == \"z\"\n char = \"b\"\n elsif consonants.include?(char)\n changed_consonants_index = consonants.index(char) +1\n changed_consonants = consonants[changed_consonants_index]\n else\n char\n end\nend\norigional_name_array.join('').split(\" \").each{|letter| letter.capitalize!}.join(\" \")\nend", "title": "" }, { "docid": "dc3efc560ea38bcbceeee8d08e2be589", "score": "0.539309", "text": "def translate(word)\n # Check for multiple words\n x = word.split\n s = x[0]\n total=\"\"\n mult_consonants(s, total)\n\n if x.length > 1\n y = x[1]\n total << \" \"\n mult_consonants(y, total)\n end\n\n if x.length > 2\n total << \" \"\n u = x[2]\n mult_consonants(u, total)\n end\n\n if x.length > 3\n total << \" \"\n v = x[3]\n mult_consonants(v, total)\n end\n total\nend", "title": "" }, { "docid": "9a821ef025b8532854165611b1ce1fa2", "score": "0.5392459", "text": "def consonant_cancel(sentence)\n new = []\n consonant = \"bcdfghjklmnpqrstvwxyz\"\n\n sentence.split(\" \").each do |word|\n word.each_char.with_index do |char, idx|\n if !(consonant.include?(char))\n new << word[idx..-1]\n break\n end \n end \n end \n new = new.join(\" \")\n return new\nend", "title": "" }, { "docid": "8029426da5804ce628bfce1eecf9c3fa", "score": "0.53924334", "text": "def next_cons(letter)\n\tif letter == 'z'\n\t\tnext_cons = 'b'\n\telse\n\t\ti = 0\n\t\tuntil $consonants[i] == letter\n\t\t\ti += 1\n\t\tend\n\t\tnext_vowel = $consonants[i+1]\n\tend\nend", "title": "" }, { "docid": "f9525d7893e0b8e5088bea34015c314a", "score": "0.53851163", "text": "def starts_with_consonant?(s)\n \n if (s.length==0)\n return false\n end\n \n if( (s =~ /^[aeiouAEIOU0-9\\W]/) != nil )\n return false\n end\n return true\nend", "title": "" }, { "docid": "b0e8661365d617c5b582cd350cb818a8", "score": "0.5379527", "text": "def consonant_cancel(sentence)\r\n words = sentence.split(\" \")\r\n new_arr = []\r\n vowel = \"aeiou\"\r\n words.each do |word|\r\n i = 0\r\n while i < word.length\r\n char = word[i]\r\n if char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\"\r\n new_arr << word[i..-1]\r\n end\r\n i += 1\r\n end\r\n end\r\n return new_arr[0...-1].join(\" \")\r\nend", "title": "" }, { "docid": "e2df17d78f7dee34cf20841cf0b6bf48", "score": "0.53673863", "text": "def starts_with_consonant? s\n # Regex (regular expressions) are used to check if s starts with a consonant by excluding vowels\n return s =~ /\\A[^aeiou]/\nend", "title": "" }, { "docid": "661280bea4e42cc3c162fc774f2167e4", "score": "0.53645384", "text": "def double_consonants3(str)\n result = \"\"\n str.each_char do |char|\n char =~ /[b-z&&[^eiou]]/i ? result << char * 2 : result << char\n end\n result\nend", "title": "" }, { "docid": "7390e171fc00feb959cb3ae0d7f46992", "score": "0.5363361", "text": "def starts_with_consonant?(s)\n\ts.downcase!\n\tletter = /[a-z]/.match(s.chr) != nil\n\tconsonant = /[^aeiou]/.match(s.chr) != nil\n\treturn letter && consonant\nend", "title": "" }, { "docid": "b072b2bc6413cf6875ac6d9d3f9d99a2", "score": "0.53630817", "text": "def starts_with_consonant?(s)\n \n vowels = %w(a e i o u)\n consonant =(\"a\"..\"z\").find_all { |letter| !vowels.include? letter}\n if s.is_a?(String) && !s.empty?\n return consonant.include? s[0].downcase\n\n else\n return false\n end\nend", "title": "" } ]
c5dc450ce6b121ac2c4d7f2e50991599
step over in X, lines along Y (vertical)
[ { "docid": "5d683c93ea914740c0300b7c36821fdb", "score": "0.0", "text": "def get_zigzag_flood_x(aface)\r\n result = []\r\n#@debug = true \r\n # create a 2D array to hold the rasterized shape\r\n # raster is on stepover boundaries and center of each square is where the zigzags will start and end.\r\n # set true for each centerpoint that is inside the face\r\n # raster 0,0 is bottom left of the shape, just outside the boundary\r\n bb = aface.bounds\r\n stepOverinuse = @bit_diameter * @stepOver\r\n ystart = bb.min.y - stepOverinuse / 2 # center of bottom row of cells\r\n yend = bb.max.y + stepOverinuse + 0.002\r\n \r\n xstart = bb.min.x - stepOverinuse / 2 # center of first column of cells\r\n xend = bb.max.x + stepOverinuse + 0.002 # MUST have a column after end of object else stuff gets skipped\r\n# if ($phoptions.use_fuzzy_pockets?) #always uses fuzzy, gives better results\r\n ylen = yend - ystart - 0.002\r\n stepOverinuse1 = getfuzzystepover(ylen)\r\n xlen = xend - xstart - 0.002\r\n stepOverinuse2 = getfuzzystepover(xlen)\r\n stepOverinuse = [stepOverinuse1, stepOverinuse2].min # always use lesser value\r\n# end\r\n debugfile(\"xstart #{xstart.to_mm},#{ystart.to_mm} #{xend.to_mm},#{yend.to_mm} #{stepOverinuse.to_mm}\" ) if (@debug)\r\n\r\n #use a hash as if it were a 2d array of cells rastered over the face\r\n if (@cells == nil)\r\n @cells = Hash.new(false)\r\n else\r\n @cells.clear\r\n end \r\n # now loop through all cells and test to see if this point is in the face\r\n pt = Geom::Point3d.new(0, 0, 0)\r\n xmax = ymax = 0.0\r\n#create the cell array \r\n createcellsX(xstart,xend, ystart,yend, stepOverinuse, aface) #creates cell hash and sets @cellxmax etc\r\n xmax = @cellxmax\r\n ymax = @cellymax\r\n \r\n entities = Sketchup.active_model.active_entities if (@debug)\r\n \r\n debugfile(\"xmax #{xmax} ymax #{ymax}\") if (@debug) # max cell index\r\n# puts \"xmax #{xmax} ymax #{ymax}\"\r\n#output array for debug \r\n if (@debug)\r\n y = ymax\r\n debugfile(\"START\") if (@debug)\r\n while (y >= 0) do\r\n x = 0\r\n s = \"y #{y}\"\r\n while (x <= xmax) do\r\n if (@cells[[x,y]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n x += 1\r\n end\r\n debugfile(s) if (@debug)\r\n y -= 1 \r\n end\r\n end\r\n \r\n # now create the zigzag points from the hash, search along Y for first and last points\r\n # keep track of 'going DOWN toward 0' or 'going UP' so we can test for a line that would cross the boundary\r\n # if this line would cross the boundary, start a new array of points\r\n r = 0\r\n prevpt = nil\r\n#@debug = true\r\n while (someleft(@cells,xmax,ymax)) # true if some cells are still not processed\r\n debugfile(\"R=#{r}\") if (@debug)\r\n result[r] = []\r\n x = 0\r\n goingright = true # goingUP\r\n px = -1 # previous x used, to make sure we do not jump a X level\r\n countx = 0\r\n while (x <= xmax) do\r\n countx += 1\r\n if (countx > 5000)\r\n puts \" countx break\"\r\n break\r\n end\r\n \r\n lefty = -1 # down\r\n y = 0\r\n while (y <= ymax) do # search to the right for a true\r\n if (@cells[[x,y]] == true)\r\n @cells[[x,y]] = false\r\n lefty = y\r\n break # found left side X val\r\n end\r\n y += 1\r\n end #while y\r\n righty = -1\r\n y += 1\r\n if y <= ymax \r\n while (y <= ymax) do # search to the right for a false\r\n if (@cells[[x,y]] == false)\r\n righty = y-1\r\n break # found right side X val\r\n end\r\n @cells[[x,y]] = false # set false after we visit\r\n y += 1\r\n end #while x\r\n end\r\n # now we have lefty and righty for this X, if righty > -1 then push these points\r\n debugfile(\" left #{lefty} right #{righty} y #{y}\") if (@debug)\r\n if (righty > -1)\r\n #if px,py does not cross any face edges\r\n# pt1 = Geom::Point3d.new(xstart + leftx*stepOverinuse, ystart + y * stepOverinuse, 0)\r\n# pt2 = Geom::Point3d.new(0, 0, 0)\r\n if (goingright)\r\n pt1 = Geom::Point3d.new(xstart + x * stepOverinuse, ystart + lefty * (stepOverinuse/2), 0)\r\n pt2 = Geom::Point3d.new(xstart + x * stepOverinuse, ystart + righty * (stepOverinuse/2), 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingUP #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n else\r\n if (px > -1)\r\n if ((x - px) > 1) # do not cross many x rows, start new set instead\r\n debugfile(\"isxrows goingUP #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n end\r\n end\r\n end\r\n end\r\n #check that this line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going up so create new point below cross\r\n np = Geom::Point3d.new(cross.x, cross.y - (stepOverinuse/2), 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the right of the crossing\r\n pt1 = Geom::Point3d.new(cross.x, cross.y + (stepOverinuse/2), 0)\r\n end\r\n \r\n entities.add_cpoint(pt1) if (@debug)\r\n result[r] << pt1\r\n pt = pt1\r\n if (lefty != righty)\r\n #pt = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt) if (@debug)\r\n else\r\n puts \"singleton #{x} #{y}\" if (@debug)\r\n end\r\n else\r\n #pt.x = xstart + rightx*stepOverinuse\r\n #pt.y = ystart + y * stepOverinuse\r\n pt1 = Geom::Point3d.new(xstart + x * stepOverinuse,ystart + righty*(stepOverinuse/2), 0)\r\n pt2 = Geom::Point3d.new(xstart + x * stepOverinuse,ystart + lefty *(stepOverinuse/2), 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingleft #{x} #{y}\") if (@debug)\r\n prevpt = nil\r\n r += 1\r\n result[r] = []\r\n debugfile(\"iscrossing left R=#{r}\") if (@debug)\r\n else \r\n if (px > -1)\r\n if ((x - px) > 1) # do not cross many X rows\r\n debugfile(\"isyrows goingleft #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n prevpt = nil\r\n debugfile(\"isyrows left R=#{r}\") if (@debug)\r\n end\r\n end\r\n end\r\n end\r\n \r\n #check that this vert line does not cross something, happens on sharp horozontal points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going left so create new point to the right of cross\r\n np = Geom::Point3d.new( cross.x,cross.y + stepOverinuse/2, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line on other side of gap\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the left of the crossing\r\n pt1 = Geom::Point3d.new( cross.x, cross.y - stepOverinuse/2, 0)\r\n end\r\n \r\n result[r] << pt1\r\n pt = pt1\r\n entities.add_cpoint(pt1) if (@debug)\r\n #pt.x = xstart + leftx*stepOverinuse\r\n if (lefty != righty)\r\n# pt = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt2) if (@debug)\r\n else\r\n puts \"Singleton #{x} #{y}\" if (@debug)\r\n end\r\n end\r\n prevpt = Geom::Point3d.new(pt.x, pt.y, 0)\r\n px = x\r\n end # if rightx valid\r\n x += 1\r\n goingright = !goingright\r\n end # while y\r\n \r\n #debug output\r\n if (@debug)\r\n if (someleft(@cells,xmax,ymax) )\r\n debugfile(\"someleft #{r}\") if (@debug)\r\n yc = ymax\r\n while (yc >= 0) do\r\n xc = 0\r\n s = \"Y #{yc}\"\r\n while (xc <= xmax) do\r\n if (@cells[[xc,yc]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n xc += 1\r\n end\r\n debugfile(s) if (@debug)\r\n yc -= 1 \r\n end\r\n end\r\n end\r\n r += 1\r\n prevpt = nil\r\n end # while someleft \r\n@debug = false\r\n puts \" result #{result.length} #{result[0].length} \" if (@debug)\r\n debugfile(\"result #{result.length}\") if (@debug)\r\n result.each { |rs|\r\n debugfile(\" #{rs.length}\") if (@debug)\r\n }\r\n return result\r\n end", "title": "" } ]
[ { "docid": "c6464514ec45767f740a1a1a09c0024f", "score": "0.6923412", "text": "def line(x0, y0, x1, y1)\n # clean params\n x0, y0, x1, y1 = x0.to_i, y0.to_i, x1.to_i, y1.to_i\n y0, y1, x0, x1 = y1, y0, x1, x0 if y0>y1\n sx = (dx = x1-x0) < 0 ? -1 : 1 ; dx *= sx ; dy = y1-y0\n\n # special cases\n x0.step(x1,sx) { |x| point x, y0 } and return if dy.zero?\n y0.upto(y1) { |y| point x0, y } and return if dx.zero?\n x0.step(x1,sx) { |x| point x, y0; y0 += 1 } and return if dx==dy\n\n # main loops\n point x0, y0\n\n e_acc = 0\n if dy > dx\n e = (dx << 16) / dy\n y0.upto(y1-1) do\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xFFFF\n x0 += sx if (e_acc <= e_acc_temp)\n point x0, (y0 += 1), intensity(@color,(w=0xFF-(e_acc >> 8)))\n point x0+sx, y0, intensity(@color,(0xFF-w))\n end\n point x1, y1\n return\n end\n\n e = (dy << 16) / dx\n x0.step(x1-sx,sx) do\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xFFFF\n y0 += 1 if (e_acc <= e_acc_temp)\n point (x0 += sx), y0, intensity(@color,(w=0xFF-(e_acc >> 8)))\n point x0, y0+1, intensity(@color,(0xFF-w))\n end\n point x1, y1\n end", "title": "" }, { "docid": "fe15cd4ca005bc2ff237df14de9d2e27", "score": "0.65267974", "text": "def shifted_vertical_line x\n vertical_line(x + grid.width + 1)\n end", "title": "" }, { "docid": "809fc4abc2aaa3ed43b9ca0f0c334ff1", "score": "0.6520765", "text": "def forward(steps)\n raise ArgumentError unless steps.is_a?(Numeric)\n @xy = [@xy.first + sin(@heading * DEG) * steps, @xy.last + cos(@heading * DEG) * steps]\n @track.last << @xy if @pen_is_down\n end", "title": "" }, { "docid": "79e968a2b25071a985effc919a19e408", "score": "0.64108056", "text": "def step\n @x = @x + @vx\n @y = @y + @vy\n self\n end", "title": "" }, { "docid": "f5e468d8a9b178a3729d28b60205eec2", "score": "0.6255707", "text": "def draw_line; draw_horizontal_line(@draw_y + (line_height / 2) - 1, 2); end", "title": "" }, { "docid": "455ba3c2b1b5fd37c6b55086c939705b", "score": "0.62481797", "text": "def shifted_horizontal_line y\n line = { x: grid.width + 1, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "ba2580e4986e9d632fe5ceadc7987ae4", "score": "0.61006325", "text": "def forward(steps)\n must_be_number(steps, 'distance')\n angle = heading * DEG\n x, y = xy\n self.xy = [x + steps * sin(angle), y + steps * cos(angle)]\n track.last << xy if pen_down?\n end", "title": "" }, { "docid": "167b7c03011a3aef375eecea314940ae", "score": "0.60886973", "text": "def draw_separation(x_start, y_start, y_min, y_max, x)\n @canvas.g.translate(x_start, y_start) do |lines|\n lines.styles(:stroke=>'#CCCCCC', :stroke_width=>1, :opacity=>0.05)\n lines.line(x, y_min, x, y_max)\n end\n end", "title": "" }, { "docid": "223da77bc6e5a9506219b009ccce8931", "score": "0.59594357", "text": "def line_to(x, y)\n cur_page.line_to(x, y)\n end", "title": "" }, { "docid": "81b2d218917af7607ed7f64e8358911a", "score": "0.58982533", "text": "def line x0, y0, x1, y1, c\n dx = (x1 - x0).abs\n sx = x0 < x1 ? 1 : -1\n dy = (y1 - y0).abs\n sy = y0 < y1 ? 1 : -1\n err = (dx > dy ? dx : -dy) / 2\n \n loop do\n set x0, y0, c\n break if x0 === x1 && y0 === y1\n e2 = err\n if e2 > -dx\n err -= dy\n x0 += sx\n end \n if e2 < dy\n err += dx\n y0 += sy \n end\n end \n end", "title": "" }, { "docid": "b7f0b3548c53bc4c8f5b3bf73dbba3e6", "score": "0.58540845", "text": "def vline x, c, y1 = 0, y2 = w\n line x, y1, x, y2, c\n end", "title": "" }, { "docid": "b7f0b3548c53bc4c8f5b3bf73dbba3e6", "score": "0.58540845", "text": "def vline x, c, y1 = 0, y2 = w\n line x, y1, x, y2, c\n end", "title": "" }, { "docid": "7af8dd238bc9b64c1658c00d925a6496", "score": "0.5802345", "text": "def draw_line(p1, p2)\n xs = arrange(p1.first, p2.first)\n ys = arrange(p1.last, p2.last)\n\n xs = xs * ys.size if ys.size > xs.size\n ys = ys * xs.size if xs.size > ys.size\n\n xs.zip(ys).each{|point| draw(point) }\n end", "title": "" }, { "docid": "4392e87ae7e438379d3f706d206ecdbd", "score": "0.57964104", "text": "def line_xiaolin_wu(x0, y0, x1, y1, stroke_color, inclusive = true)\n stroke_color = ChunkyPNG::Color.parse(stroke_color)\n\n dx = x1 - x0\n sx = dx < 0 ? -1 : 1\n dx *= sx\n dy = y1 - y0\n sy = dy < 0 ? -1 : 1\n dy *= sy\n\n if dy == 0 # vertical line\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n end\n\n elsif dx == 0 # horizontal line\n y0.step(inclusive ? y1 : y1 - sy, sy) do |y|\n compose_pixel(x0, y, stroke_color)\n end\n\n elsif dx == dy # diagonal\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n y0 += sy\n end\n\n elsif dy > dx # vertical displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dx << 16) / dy.to_f).round\n (dy - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n x0 += sx if e_acc <= e_acc_temp\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n if inclusive || i > 0\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w))\n end\n y0 += sy\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n\n else # horizontal displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dy << 16) / dx.to_f).round\n (dx - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n y0 += sy if e_acc <= e_acc_temp\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n if inclusive || i > 0\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w))\n end\n x0 += sx\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n end\n\n self\n end", "title": "" }, { "docid": "a1732e36b82be044d3035316f1c02755", "score": "0.5746859", "text": "def two_points_to_line(x1,y1,x2,y2) \n if real_close(x1,x2)\n VerticalLine.new x1\n else\n m = (y2 - y1).to_f / (x2 - x1)\n b = y1 - m * x1\n Line.new(m,b)\n end\n end", "title": "" }, { "docid": "1e1e375758e3f6f29190b0955636204e", "score": "0.57246506", "text": "def points_on_a_line(x0, y0, x1, y1)\n raise NotImplementedError\n dx = (x1 - x0).abs\n dy = -(y1 - y0).abs\n step_x = x0 < x1 ? 1 : -1\n step_y = y0 < y1 ? 1 : -1\n err = dx + dy\n coords = Array.new\n coords << [x0, y0]\n (\n begin\n e2 = 2 * err\n\n if e2 >= dy\n err += dy\n x0 += step_x\n end\n\n if e2 <= dx\n err += dx\n y0 += step_y\n end\n\n coords << [x0, y0]\n end\n\n ) until (x0 == x1 && y0 == y1)\n coords\n end", "title": "" }, { "docid": "bcc95023a77ce82a94d49e2934c26e7e", "score": "0.572176", "text": "def get_line(x0,x1,y0,y1)\n points = []\n steep = ((y1-y0).abs) > ((x1-x0).abs)\n if steep\n x0,y0 = y0,x0\n x1,y1 = y1,x1\n end\n if x0 > x1\n x0,x1 = x1,x0\n y0,y1 = y1,y0\n end\n deltax = x1-x0\n deltay = (y1-y0).abs\n error = (deltax / 2).to_i\n y = y0\n ystep = nil\n if y0 < y1\n ystep = 1\n else\n ystep = -1\n end\n for x in x0..x1\n if steep\n points << {:x => y, :y => x}\n else\n points << {:x => x, :y => y}\n end\n error -= deltay\n if error < 0\n y += ystep\n error += deltax\n end\n end\n return points\nend", "title": "" }, { "docid": "f759b59da5e5dd5fae12d799c94e0a7b", "score": "0.57187015", "text": "def draw_line(number)\n @dim.times do |i|\n if i+1 == number || @dim-i == number\n print draw_x\n else\n print draw_dot\n end\n end\n end", "title": "" }, { "docid": "18ba64acea4cf873ca4d373651486fee", "score": "0.5718342", "text": "def two_points_to_line(x1,y1,x2,y2) \n if real_close(x1,x2)\n VerticalLine.new x1\n else\n m = (y2 - y1).to_f / (x2 - x1)\n b = y1 - m * x1\n Line.new(m,b)\n end\n end", "title": "" }, { "docid": "f7d3a3b8ab46a320e96615d4b47bfb09", "score": "0.57100326", "text": "def render_grid_lines\n outputs.lines << (0..grid.width).map { |x| vertical_line(x) }\n outputs.lines << (0..grid.width).map { |x| shifted_vertical_line(x) }\n outputs.lines << (0..grid.height).map { |y| horizontal_line(y) }\n outputs.lines << (0..grid.height).map { |y| shifted_horizontal_line(y) }\n end", "title": "" }, { "docid": "c2bb952aba621b3155158dcc5ba753dd", "score": "0.57077926", "text": "def draw_witch(x)\n move_to_top\n @witch.each do |line|\n line_at x, line\n end\n end", "title": "" }, { "docid": "39e2c03ba0284be311ded33620ce9f6a", "score": "0.5705269", "text": "def next_y\n state.y + state.dy\n end", "title": "" }, { "docid": "7f626a3ef4ea2e6ba3b519a075009743", "score": "0.5699724", "text": "def two_points_to_line(x1,y1,x2,y2) \n if real_close(x1,x2)\n VerticalLine.new x1\n else\n m = (y2 - y1).to_f / (x2 - x1)\n b = y1 - m * x1\n Line.new(m,b)\n end\n end", "title": "" }, { "docid": "b680c4e1dd3020a92112e53db4d2c89e", "score": "0.5698212", "text": "def forward (from); from[:y] += from[:orientation]; from; end", "title": "" }, { "docid": "c0bcb94683eaf11ed627ec0c91706801", "score": "0.5683803", "text": "def objective_x; line_height / 2; end", "title": "" }, { "docid": "ebff17960bf230e67d03c649b4d5788c", "score": "0.56771594", "text": "def go_ahead(steps,width=1)\n x0 = @pos.x\n y0 = @pos.y\n x1 = (@pos.x + steps*Math.cos(@angle)).round()\n y1 = (@pos.y - steps*Math.sin(@angle)).round()\n if (@down)\n animiere(3) {\n TkcLine.new( Leinwand.gib_einzige_instanz(),x0,y0,x1,y1,:fill => :black, :width => [1,width] .max()) }\n end\n @pos = Point.new(x1,y1)\n end", "title": "" }, { "docid": "e54150a1c713bb33be2d2dc8444d4452", "score": "0.5670134", "text": "def forward(steps)\n\t\t# Calculate ending coordinates\n\t\trad = @degree * Math::PI / 180\n\n\t\tnew_x = (@cursor_x + steps*Math.cos(rad)).round\n\t\tnew_y = (@cursor_y + steps*Math.sin(rad)).round\n\t\n\t\tif(@opened_eye) then\n\t\t\tdraw_points(@cursor_x, @cursor_y, new_x, new_y)\n\t\tend\n\n\t\t# Update coordinates\n\t\t@cursor_x = new_x\n\t\t@cursor_y = new_y\n\tend", "title": "" }, { "docid": "0ad1666e799374079b2ee50b94e442b7", "score": "0.5665172", "text": "def hline y, c, x1 = 0, x2 = h\n line x1, y, x2, y, c\n end", "title": "" }, { "docid": "0ad1666e799374079b2ee50b94e442b7", "score": "0.5665172", "text": "def hline y, c, x1 = 0, x2 = h\n line x1, y, x2, y, c\n end", "title": "" }, { "docid": "ad67a4c328e2ffc6e79aa748e583bdca", "score": "0.5661322", "text": "def draw_alt_line\n @dim.times do |i|\n if i.even?\n print draw_x\n else\n if @type == \"allx\"\n print draw_x\n elsif @type == \"alt\"\n print draw_dot\n end\n end\n end\n end", "title": "" }, { "docid": "c35f207bb7f645ab495ca5fe3388f453", "score": "0.56447667", "text": "def get_line(x0,x1,y0,y1)\n \t\tpoints = []\n\t\tsteep = ((y1-y0).abs) > ((x1-x0).abs)\n\t\tif steep then\n\t\t\tx0,y0 = y0,x0\n\t\t\tx1,y1 = y1,x1\n\t\tend\n\t\tif x0 > x1\n\t\t\tx0,x1 = x1,x0\n\t\t\ty0,y1 = y1,y0\n\t\tend\n\t\tdeltax = x1-x0\n\t\tdeltay = (y1-y0).abs\n\t\terror = (deltax / 2).to_i\n\t\ty = y0\n\t\tystep = nil\n\t\tif y0 < y1 then\n\t\t\tystep = 1\n\t\telse\n\t\t\tystep = -1\n\t\tend\n\t\tfor x in x0..x1\n\t\t\tif steep then\n\t\t\t\tpoints << {:x => y, :y => x}\n\t\t\telse\n\t\t\t\tpoints << {:x => x, :y => y}\n\t\t\tend\n\t\t\terror -= deltay\n\t\t\tif error < 0 then\n\t\t\t\ty += ystep\n\t\t\t\terror += deltax\n\t\t\tend\n\t\tend\n\t\treturn points\n\tend", "title": "" }, { "docid": "9c680a9eda443a6c4a9864b2fb2a3c37", "score": "0.5642837", "text": "def horizontal_seperator y, x, x2\n [x, y, x2, y, 150, 150, 150]\n end", "title": "" }, { "docid": "508cfdd229c16b37f8574a27fad4a455", "score": "0.56171894", "text": "def two_points_to_line(x1,y1,x2,y2)\n if real_close(x1,x2)\n VerticalLine.new x1\n else\n m = (y2 - y1).to_f / (x2 - x1)\n b = y1 - m * x1\n Line.new(m,b)\n end\n end", "title": "" }, { "docid": "f064cbcfe1144716e04bf42c2f1a46cd", "score": "0.56046355", "text": "def flip_range_y(points); points.collect{ |v| Vertex.new(-v.x,v.y)}; end", "title": "" }, { "docid": "c243bae80040d31de92822bf728b9d83", "score": "0.5584268", "text": "def two_points_to_line(x1,y1,x2,y2)\n if real_close(x1,x2)\n VerticalLine.new x1\n else\n m = (y2 - y1).to_f / (x2 - x1)\n b = y1 - m * x1\n Line.new(m,b)\n end\n end", "title": "" }, { "docid": "a6fa3a9d79b6c978c87d3467234889a6", "score": "0.55825967", "text": "def draw_line(y)\n width = @options[:page_layout] == :portrait ? 530 : 770\n @pdf.stroke { @pdf.horizontal_line 0, width, :at => y }\n end", "title": "" }, { "docid": "1ff9c6950c2a745fdc6490c4f049c31b", "score": "0.5580907", "text": "def forward_steps\n forward = forward_dir\n steps = []\n row, col = pos\n\n step1 = [row + forward, col]\n\n unless valid_pos?(step1)\n steps << step1\n\n if at_start_rows?\n step2 = [row + forward * 2, col]\n \n steps << step2 if valid_pos?(step2)\n end\n end\n\n steps\n end", "title": "" }, { "docid": "403a501a423a0ad262cd3a83661d4ea0", "score": "0.5578626", "text": "def draw_vertical_segment\n @pixel_x = @cmd_options.first-1\n @color = @cmd_options.last\n\n @pixel_y1s = (@cmd_options[1]..@cmd_options[2]).to_a\n\n @pixel_y1s.each do |pixel_y|\n pixel_y -= 1\n @matrix[pixel_y][@pixel_x] = @color\n end\n end", "title": "" }, { "docid": "09dbc72d306099d5632a3bb0c6bd2289", "score": "0.5577335", "text": "def draw_vertical(start_line, end_line, start_char)\n start_line.upto(end_line) do |line_idx| \n @lines[line_idx][start_char] = PATH_CHAR \n end\n end", "title": "" }, { "docid": "c997d3dc8202975c8f79cbbb1256a700", "score": "0.55707115", "text": "def steps (x, y, path)\n if x == 0 && y == 0\n then puts (path)\n return\n end\n if x > 0\n then steps(x - 1, y, path + \"R\")\n steps(x - 1, y + 1, path + \"L\")\n end\n if y > 0\n then steps(x, y - 1, path + \"H\")\n end\nend", "title": "" }, { "docid": "20bbd6c367519899ac83a220a9be5318", "score": "0.55288965", "text": "def Line(x1, y1, x2, y2)\n\t\t#Draw a line\n\t\tout(sprintf('%.2f %.2f m %.2f %.2f l S', x1 * @k, (@h - y1) * @k, x2 * @k, (@h - y2) * @k));\n\tend", "title": "" }, { "docid": "7b7373b4ec11baf69ff762614f26c6f2", "score": "0.55219686", "text": "def line_to(x, y)\n update_bounds_rect(@x, @y, x, y)\n @x, @y = x, y\n @gui.line_to(x, y)\n self\n end", "title": "" }, { "docid": "590f9517a83884f2e1ca97e1ea6b7201", "score": "0.55207986", "text": "def horizontalLines\n (0...@height).inject([]) { |arr, row| arr << @modified.row(row) }\n end", "title": "" }, { "docid": "5e82bc1e6b3708f8b36af0c5c26064fb", "score": "0.55158174", "text": "def draw\n\t\tputs \"\\n\"\n\t\tmid = (@height/2.0).ceil\n\t\tfor line in 1..@height\n\t\t\tspace0 = (mid - (mid-line).abs).abs\n\t\t\tspace1 = (mid - line).abs * 2 - 1\n\t\t\tputs space1 > 0 ?\n\t\t\t\t \" \" * space0 + \"X \" + \" \" * space1 + \"X\" :\n\t\t\t\t \" \" * space0 + \"X\"\n\t\tend\n\tend", "title": "" }, { "docid": "4a04f39b501dba44f3c289ffa83ef72f", "score": "0.551489", "text": "def vertical_seperator x, y, y2\n [x, y, x, y2, 150, 150, 150]\n end", "title": "" }, { "docid": "5180b64d9ce33266fdef8fb10cb33257", "score": "0.5501346", "text": "def vertical_line x\n line = { x: x, y: 0, w: 0, h: grid.height }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "5180b64d9ce33266fdef8fb10cb33257", "score": "0.5501346", "text": "def vertical_line x\n line = { x: x, y: 0, w: 0, h: grid.height }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "96da1fefb9a2aff37922d9a5e19932cd", "score": "0.5495715", "text": "def line(x, y)\n [x.value, y.value]\n end", "title": "" }, { "docid": "310ce642971fb31b14ee84ec81f16540", "score": "0.5492543", "text": "def move_down(lines=1)\n self.y += CONSOLE_LINE_HEIGHT * lines\n end", "title": "" }, { "docid": "3de19a52001f6708a2b3a7fdd04a3f2b", "score": "0.54890025", "text": "def line(x, y, angle, length)\n cur_page.line(x, y, angle, length)\n end", "title": "" }, { "docid": "22b69dbfa5a3cf057679e16aaf090b03", "score": "0.54805607", "text": "def line x1, y1, x2, y2, c\n h = self.h\n screen.draw_line x1, h-y1, x2, h-y2, color[c], :antialiased\n end", "title": "" }, { "docid": "0dc889573f33fbf708bbad06cb39d0aa", "score": "0.54795575", "text": "def test_step_on_line\n h_step = [[2,1],[2,3],[2,5]]\n l_step = [[1,4],[2,3],[3,2]]\n r_step = [[1,2],[2,3],[3,4]]\n\n assert @chess._is_step_on_line(h_step, \"horizonal\")\n assert @chess._is_step_on_line(l_step, \"leftdown\")\n assert @chess._is_step_on_line(r_step, \"rightdown\")\n\n b_step = [[0,3],[3,0]]\n t_step = [[2,3],[3,2],[3,4]]\n assert !@chess._is_step_on_line(b_step, \"boundary\")\n assert !@chess._is_step_on_line(t_step, \"triangle\")\n end", "title": "" }, { "docid": "68e80f8aa6f143a3637898b53099b5f9", "score": "0.54583365", "text": "def lines_tech_demo\n outputs.labels << [5, 500, \"Lines (x, y, x2, y2, r, g, b, a)\"]\n outputs.lines << [5, 450, 100, 450]\n outputs.lines << [5, 430, 300, 430]\n outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes\n outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes\n outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes\n end", "title": "" }, { "docid": "cb3e94daf87cdfcfd5124574b9e1d2e3", "score": "0.5447982", "text": "def trace(begX, begY, endX, endY); MazeSolver.new(plane,graph).trace(begX, begY, endX, endY) end", "title": "" }, { "docid": "d3d36f600080ec0e062f457558452984", "score": "0.5439999", "text": "def vertical_line (board)\n transposed_board = board.transpose\n return horizontal_line (transposed_board)\n end", "title": "" }, { "docid": "de505af9d4235ea6887b2d7861f69058", "score": "0.53857684", "text": "def line(xx1, yy1, xx2, yy2)\n return \"some y out of range\" unless (0..@height).include?(yy1) && (0..@height).include?(yy2) \n return \"some x out of range\" unless (0..@width).include?(xx1) && (0..@width).include?(xx2)\n\n x1 = [xx1, xx2].min\n x2 = [xx1, xx2].max\n y1 = [yy1, yy2].min\n y2 = [yy1, yy2].max\n\n m = (y2.to_f - y1) / (x2 - x1)\n b = y2 - m * x2\n pixels = Array.new(@width, Array.new(@height, 0))\n\n (x1..x2).each do |x|\n column = Array.new(@height, 0)\n (y1..y2).each do |y|\n pixel = 0\n @density.times do |i|\n xx = (x + i.to_f / @density)\n yy = m * xx + b\n if yy >= y && yy < y + 1\n pixel = 1\n break\n end\n end\n column[y] = pixel\n end\n pixels[x] = column\n end\n\n PNM.create(pixels.transpose, {:type => :pbm})\n end", "title": "" }, { "docid": "e5198ccc6fca7308e1e7bd2effaa0472", "score": "0.53843534", "text": "def verticalLines\n (0...@width).inject([]) { |arr, column| arr << @modified.column(column) }\n end", "title": "" }, { "docid": "4b8d753ddb755de63dfaed81bcb09e5b", "score": "0.5375512", "text": "def move_vertically\n @vy += 1\n\n # Vertical movement\n if @vy > 0 && @y < 500 # TODO set externally\n @vy.times { @y += 1 }\n end\n if @vy < 0\n (-@vy).times { @y -= 1 }\n end\n end", "title": "" }, { "docid": "a788975f901fc3bac01dac76f9e740c0", "score": "0.53754926", "text": "def draw_horizontal_segment(x1, x2, y, colour)\n @image.draw_horizontal y.to_i, x1.to_i, x2.to_i, colour\n end", "title": "" }, { "docid": "1acb0ba4a94be78602c644d2ccdfaf1d", "score": "0.5370035", "text": "def horizontal_line y\n line = { x: 0, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "1acb0ba4a94be78602c644d2ccdfaf1d", "score": "0.5370035", "text": "def horizontal_line y\n line = { x: 0, y: y, w: grid.width, h: 0 }\n line.transform_values { |v| v * grid.cell_size }\n end", "title": "" }, { "docid": "d2e6d0255870c10245debba110d0b743", "score": "0.53682184", "text": "def get_line_coords(x, y)\n line = [[x,y]]\n loop do\n next_x, next_y = yield x, y\n @box[next_x] && @box[next_x][next_y] ? line << [next_x, next_y] : break\n x, y = next_x, next_y\n end\n line\n end", "title": "" }, { "docid": "28f833be06dbac90b34ac7782d1336d5", "score": "0.535979", "text": "def label_step(current_x)\n return current_x + label_increment\n end", "title": "" }, { "docid": "5a48b33bf34a81d3bf1bf5cfce6a9445", "score": "0.5357581", "text": "def draw_line(start, endpoint)\n start = start.to_coords if start.respond_to?(:to_coords)\n start = start.to_ary # ... end\nend", "title": "" }, { "docid": "86d7f6274fc196ed4ac0ae2751e1cdd0", "score": "0.53471726", "text": "def draw_horizontal_segment\n @pixel_y = @cmd_options[@cmd_options.length-2]-1\n @color = @cmd_options.last\n\n @pixel_xs = (@cmd_options[0]..@cmd_options[1]).to_a\n\n @pixel_xs.each do |pixel_x|\n pixel_x -=1\n @matrix[@pixel_y][pixel_x] = @color\n end\n end", "title": "" }, { "docid": "f7fcf8ac04938859f686ea12077fc04f", "score": "0.53416735", "text": "def how_to_render_lines args\n # Render a horizontal line at the bottom\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 }\n\n # Render a vertical line at the left\n args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 }\n\n # Render a diagonal line starting from the bottom left and going to the top right\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 }\nend", "title": "" }, { "docid": "82a9e8a09ce7bbaa9acd276e59d9a0e6", "score": "0.533959", "text": "def draw_vertical_segment(x, y1, y2, colour)\n @image.draw_vertical x.to_i, y1.to_i, y2.to_i, colour\n end", "title": "" }, { "docid": "3b0c10f2594d05315c35d9bc8f5f6d61", "score": "0.5331471", "text": "def lerp(x1, y1, x2, y2, x)\n return y1 + (x - x1) * ((y2 - y1) / (x2 - x1))\nend", "title": "" }, { "docid": "7f1d578384fceb2ab7b4930b870f8d34", "score": "0.5320418", "text": "def row_of( y )\n @top_line + y\n end", "title": "" }, { "docid": "7f1d578384fceb2ab7b4930b870f8d34", "score": "0.5320418", "text": "def row_of( y )\n @top_line + y\n end", "title": "" }, { "docid": "9a6de8fb337dd4a6afcfe3366ee7b76c", "score": "0.53157526", "text": "def new_step(step_x, step_y)\n Coordinates.new(@x_coordinate + step_x, @y_coordinate + step_y)\n end", "title": "" }, { "docid": "60bb337125a405c977a2cd9bf80d928e", "score": "0.52950394", "text": "def horizontal_line(y, options = {})\n with options do\n at = y + @bottom\n @pdf.stroke_horizontal_line left, @pdf.bounds.right - right, at: at\n end\n end", "title": "" }, { "docid": "77f02ae933f10237c51e982124c071fa", "score": "0.5288104", "text": "def draw_vertical_line(png, color, xPosition = 0)\n\tpng.polygon([xPosition, 0, xPosition, png.height], color)\nend", "title": "" }, { "docid": "899c73286afc03eca8061d17c5fe4eeb", "score": "0.52798927", "text": "def flip_range_xy(points); points.collect{ |v| Vertex.new(-v.y,-v.x)}; end", "title": "" }, { "docid": "d1b6cb72acc3ed63c6fd27bfaa127ea1", "score": "0.5278669", "text": "def vertical_line(options={:start_in => :limit_left, :size => :area_y})\n set RGhost::VerticalLine.new(options)\n end", "title": "" }, { "docid": "80724ceb76ca3c43e0c6d519506cbd21", "score": "0.527809", "text": "def vline(x, y1, y2, c)\n x, y1, y2 = x.to_i, y1.to_i, y2.to_i\n\n unless self.bounds?(x, y1) && self.bounds?(x, y2)\n puts \"ERR: Coordinates out of bounds\"\n return\n end\n\n (y1..y2).each {|y| self[y, x] = c}\n end", "title": "" }, { "docid": "def07e7f3d7ca18087a66def0ff9484b", "score": "0.52683765", "text": "def backward(steps)\n\t\t# Calculate ending coordinates\n\t\trad = @degree * Math::PI / 180\n\t\tnew_x = (@cursor_x - steps*Math.cos(rad)).round\n\t\tnew_y = (@cursor_y - steps*Math.sin(rad)).round\n\n\t\tif(@opened_eye) then\n\t\t\tdraw_points(@cursor_x, @cursor_y, new_x, new_y)\n\t\tend\n\n\t\t# Update coordinates\n\t\t@cursor_x = new_x\n\t\t@cursor_y = new_y\n\tend", "title": "" }, { "docid": "07219e241c42ac497d8341659e33d585", "score": "0.5265175", "text": "def draw_line(start_x, start_y, end_x, end_y, image)\n line = Magick::Draw.new\n line.polyline(start_x, start_y, end_x, end_y)\n line.draw(image)\nend", "title": "" }, { "docid": "29255824f558d2b0b73cdc53358772b6", "score": "0.5261444", "text": "def draw(view, x, y)\r\n view.line_width = 1\r\n view.line_stipple = STIPPLE_SOLID\r\n tr = Geom::Transformation.new([x, y, 0])\r\n @cache.each { |color, points|\r\n view.drawing_color = color\r\n view.draw2d(GL_LINES, points.map { |point| point.transform(tr) } )\r\n }\r\n nil\r\n end", "title": "" }, { "docid": "18cbd592342ef44092865ddedcbc5489", "score": "0.525764", "text": "def draw_lines\n @dim.times do |i|\n if @type.nil?\n draw_line(i+1)\n draw_edge\n puts\n elsif @type == \"allx\" || @type == \"alt\"\n draw_alt_line\n draw_edge\n puts\n end\n end\n end", "title": "" }, { "docid": "022fc014c62280854de67a22bc95dafc", "score": "0.52566767", "text": "def line(points, colour)\n\tpoints.each do |point|\n\t paint(point[0], point[1], colour)\n\tend\n end", "title": "" }, { "docid": "b3b9486b8dbfcad3f435265a6e4d374b", "score": "0.5256378", "text": "def onMouseMove(flags, x, y, view)\n if( @state == 0 )\n # We are getting the first end of the line. Call the pick method\n # on the InputPoint to get a 3D position from the 2D screen position\n # that is passed as an argument to this method.\n @ip.pick view, x, y\n if( @ip != @ip1 )\n # if the point has changed from the last one we got, then\n # see if we need to display the point. We need to display it\n # if it has a display representation or if the previous point\n # was displayed. The invalidate method on the view is used\n # to tell the view that something has changed so that you need\n # to refresh the view.\n view.invalidate if( @ip.display? or @ip1.display? )\n @ip1.copy! @ip\n\n # set the tooltip that should be displayed to this point\n view.tooltip = @ip1.tooltip\n end\n else\n # Getting the second end of the line\n # If you pass in another InputPoint on the pick method of InputPoint\n # it uses that second point to do additional inferencing such as\n # parallel to an axis.\n @ip2.pick view, x, y, @ip1\n view.tooltip = @ip2.tooltip if( @ip2.valid? )\n view.invalidate\n\n # Update the length displayed in the VCB\n if( @ip2.valid? )\n length = @ip1.position.distance(@ip2.position)\n Sketchup::set_status_text length.to_s, SB_VCB_VALUE\n end\n\n # Check to see if the mouse was moved far enough to create a line.\n # This is used so that you can create a line by either dragging\n # or doing click-move-click\n if( (x-@xdown).abs > 10 || (y-@ydown).abs > 10 )\n @dragging = true\n end\n end\n end", "title": "" }, { "docid": "a1bba6196d8ae61aab6b0389b8dae132", "score": "0.52497137", "text": "def lines\n points.each_cons(2).map {|a,b| Line.new a, b}\n end", "title": "" }, { "docid": "a1bba6196d8ae61aab6b0389b8dae132", "score": "0.52497137", "text": "def lines\n points.each_cons(2).map {|a,b| Line.new a, b}\n end", "title": "" }, { "docid": "f5c0b57e27fb172a847cb9caa3889805", "score": "0.5228207", "text": "def get_slope\n @speed_x = (@sx - @tx)/@slice.to_f\n @speed_y = (@sy - @ty)/@slice.to_f\n end", "title": "" }, { "docid": "f62ee2fe25cd2ec274c2ba6ada838ca0", "score": "0.5227721", "text": "def move_to_next_generation\n @x.times{ |r|\n @y.times{|c| \n @mat[r][c].step_generation\n }\n } \n end", "title": "" }, { "docid": "420cfc5df11b25b99a47c874f5f9b97c", "score": "0.52190566", "text": "def move(x:, y:, steps: 1)\n from_x = @x\n from_y = @y\n @x = x\n @y = y\n\n steps.times do |i|\n new_x = from_x + ((@x - from_x) * ((i + 1) / steps.to_f))\n new_y = from_y + ((@y - from_y) * ((i + 1) / steps.to_f))\n\n @page.command(\"Input.dispatchMouseEvent\",\n slowmoable: true,\n type: \"mouseMoved\",\n x: new_x.to_i,\n y: new_y.to_i)\n end\n\n self\n end", "title": "" }, { "docid": "59f30b0c84c27c7a3c8f60c76c11b32a", "score": "0.5216441", "text": "def reflect_horizontal\r\n self.v[:x] = -self.v[:x]\r\n end", "title": "" }, { "docid": "7481a509e96e9422c7a4fb7d1b4feef4", "score": "0.5214776", "text": "def draw_line(grids, length)\n grid(grids[0], grids[1]).bounding_box() do\n stroke_horizontal_line 0, 470*length, at: 5\n end\n end", "title": "" }, { "docid": "f520643bcbaa11a4fd3a2b5d831b8976", "score": "0.5214499", "text": "def perform_v2\n @n.downto(1) do |i|\n @line.insert(i-1, 'X')\n puts @line\n end\n reset\n end", "title": "" }, { "docid": "8e0f6dadb4d26bae05729bcc69eac49c", "score": "0.5206849", "text": "def lineto(x, y)\n CGContextAddLineToPoint(@ctx ,x, y)\n end", "title": "" }, { "docid": "fc074efd8e5ae3027442550829a78369", "score": "0.51991767", "text": "def render_grid_lines\n outputs.lines << (0..grid.width).map { |x| vertical_line(x) }\n outputs.lines << (0..grid.height).map { |y| horizontal_line(y) }\n end", "title": "" }, { "docid": "ade7f617d2bd5536401c36e43b8bcf8b", "score": "0.51549196", "text": "def old_plot xmax, xmin, ymax, ymin, xdiff, ydiff, iterations, old_points\n puts \"\\e[H\\e[2J\" # clear screen\n ymax.step(ymin, -ydiff) do |y|\n print_num y\n (xmin).step(xmax, xdiff) do |x|\n itr = mandelbrot(Complex(x,y), iterations)\n #color = itr ? itr/iterations.to_f : 1.0\n #print \"*\".grayscale(color)\n whiteness = itr ? itr/iterations.to_f : 1\n print \"*\".grayscale(whiteness)\n end\n puts\n end\n (-xmax).step(xmax, xdiff) do |x|\n print_num x\n end\nend", "title": "" }, { "docid": "37224183c40772f0a434e2bb12f53fe2", "score": "0.5154639", "text": "def print_line\n @pdf.stroke_horizontal_line @pdf.bounds.left, @pdf.bounds.right\n end", "title": "" }, { "docid": "27fa74b326ef2df9c8ff238328f43b69", "score": "0.5151652", "text": "def draw_grid(x_max,y_max,step)\r\n n_x = (x_max/step).round()\r\n n_y = (y_max/step).round()\r\n n_x_cur = 1\r\n n_y_cur = 1\r\n\r\n # Draw a grid with lines using 'step' spacing. \r\n while n_x_cur <= n_x do\r\n line(n_x_cur*step, step, n_x_cur*step, n_y*step, :stroke=>\"gray\" ) \r\n n_x_cur += 1\r\n end\r\n while n_y_cur <= n_y do\r\n line(0, n_y_cur*step, n_x*step, n_y_cur*step, :stroke=>\"gray\" ) \r\n n_y_cur += 1\r\n end\r\n \r\n draw_arrow_x(step, (n_y-1)*step, step, \"black\", 2, \"1 m\")\r\n draw_arrow_y(step, (n_y-1)*step, step, \"black\", 2, \"1 m\")\r\n \r\n end", "title": "" }, { "docid": "0b7e51b721dc025ccb663c958c06208c", "score": "0.5146972", "text": "def reflect_vertical\r\n self.v[:y] = -self.v[:y]\r\n end", "title": "" }, { "docid": "40f99740168f8e94ae0be51a0a80903f", "score": "0.5141077", "text": "def line(screen, p1, p2)\n\t\t# convert coords\n\t\tx1d, y1d = convert_coords(screen, p1[0], p1[1], p1[2])\n\t\tx2d, y2d = convert_coords(screen, p2[0], p2[1], p2[2])\n\t\t# draw line\n\t\tscreen.line(x1d, y1d, x2d, y2d)\n\tend", "title": "" }, { "docid": "a115b037226c4444686f89ecfaa3f93e", "score": "0.51400626", "text": "def egde(x1, y1, x2, y2)\n ConsoleDraw::Figures::Line.new(x1, y1, x2, y2).calculate_coordinates\n end", "title": "" }, { "docid": "158377df90728e6addec6c603cd6bf8a", "score": "0.512288", "text": "def line_multiplier(lines, inverse_slope)\n line_length = lines[0].size.to_f\n (lines.size * inverse_slope / line_length).ceil\nend", "title": "" }, { "docid": "406b7227c83199f5082facd442043954", "score": "0.5120293", "text": "def hline(x1, x2, y, c)\n x1, x2, y = x1.to_i, x2.to_i, y.to_i\n\n unless self.bounds?(x1, y) && self.bounds?(x2, y)\n puts \"ERR: Coordinates out of bounds\"\n return\n end\n\n (x1..x2).each {|x| self[y, x] = c}\n end", "title": "" }, { "docid": "632f631f6abaf6decf6676630e093d97", "score": "0.5116003", "text": "def draw_line(x1, y1, x2, y2)\n if (x2-x1).abs > 0.95 * @max_width || (y2-y1).abs > 0.95 * @max_height\n return\n end\n\n\n x1 = scale(x1)\n y1 = scale(y1)\n x2 = scale(x2)\n y2 = scale(y2)\n\n strokeWeight(1)\n\n stroke(255)\n line(x1, y1, x2, y2)\n #stroke(0xff, 0xff, 0xff)\n #ellipse(x2, y2, 2, 2)\n end", "title": "" } ]
9175e11b31c0f0367206f39fef3a71ec
by Ira Greenberg. 3D translucent colored grid uses nested pushMatrix() and popMatrix() functions. see topics preformance for enhanced version
[ { "docid": "55a90d6c907905231a71a35cb40d866e", "score": "0.4576139", "text": "def setup\n size 640, 360, P3D\n no_stroke \n @box_size = 40\n @margin = @box_size * 2\n @depth = 400\nend", "title": "" } ]
[ { "docid": "547502a08ced26b5e12e391e44d943dc", "score": "0.62634945", "text": "def grid3d(*)\n super\n end", "title": "" }, { "docid": "34201e24a9bc135aaedf756319495302", "score": "0.6007286", "text": "def p11\n\tgrid = Matrix[\n\t\t[8,\t2, 22,97,38,15,0, 40,0, 75,4, 5, 7, 78,52,12,50,77,91,8],\n\t\t[49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48,4, 56,62,0],\n\t\t[81,49,31,73,55,79,14,29,93,71,40,67,53,88,30,3, 49,13,36,65],\n\t\t[52,70,95,23,4, 60,11,42,69,24,68,56,1, 32,56,71,37,2, 36,91],\n\t\t[22,31,16,71,51,67,63,89,41,92,36,54,22,40,40,28,66,33,13,80],\n\t\t[24,47,32,60,99,3, 45,2, 44,75,33,53,78,36,84,20,35,17,12,50],\n\t\t[32,98,81,28,64,23,67,10,26,38,40,67,59,54,70,66,18,38,64,70],\n\t\t[67,26,20,68,2, 62,12,20,95,63,94,39,63,8, 40,91,66,49,94,21],\n\t\t[24,55,58,5, 66,73,99,26,97,17,78,78,96,83,14,88,34,89,63,72],\n\t\t[21,36,23,9, 75,0, 76,44,20,45,35,14,0, 61,33,97,34,31,33,95],\n\t\t[78,17,53,28,22,75,31,67,15,94,3, 80,4, 62,16,14,9, 53,56,92],\n\t\t[16,39,5, 42,96,35,31,47,55,58,88,24,0, 17,54,24,36,29,85,57],\n\t\t[86,56,0, 48,35,71,89,7, 5, 44,44,37,44,60,21,58,51,54,17,58],\n\t\t[19,80,81,68,5, 94,47,69,28,73,92,13,86,52,17,77,4, 89,55,40],\n\t\t[4,\t52,8, 83,97,35,99,16,7, 97,57,32,16,26,26,79,33,27,98,66],\n\t\t[88,36,68,87,57,62,20,72,3, 46,33,67,46,55,12,32,63,93,53,69],\n\t\t[4,\t42,16,73,38,25,39,11,24,94,72,18,8, 46,29,32,40,62,76,36],\n\t\t[20,69,36,41,72,30,23,88,34,62,99,69,82,67,59,85,74,4, 36,16],\n\t\t[20,73,35,29,78,31,90,1, 74,31,49,71,48,86,81,16,23,57,5, 54],\n\t\t[1,\t70,54,71,83,51,54,69,16,92,33,48,61,43,52,1, 89,19,67,48]\n\t]\n\tproducts = []\n\t(0...grid.row_count).each do |row|\n\t\t(0...grid.column_count).each do |col|\n\t\t\tright = col + 3 < grid.row_count\n\t\t\tdown = row + 3 < grid.column_count\n\t\t\tleft = col - 3 >= 0\n\t\t\tif right\n\t\t\t\tset = grid.minor(row..row,col..col+3)\n\t\t\t\tproducts << set.reduce(:*)\n\t\t\tend\n\t\t\tif down and right\n\t\t\t\tdiagonal = []\n\t\t\t\t(0..3).each do |x|\n\t\t\t\t\tdiagonal << grid.minor(row+x..row+x,col+x..col+x).component(0,0)\n\t\t\t\tend\n\t\t\t\tproducts << diagonal.reduce(:*)\n\t\t\tend\n\t\t\tif down\n\t\t\t\tset = grid.minor(row..row+3,col..col)\n\t\t\t\tproducts << set.reduce(:*)\n\t\t\tend\n\t\t\tif down and left\n\t\t\t\tdiagonal = []\n\t\t\t\t(0..3).each do |x|\n\t\t\t\t\tdiagonal << grid.minor(row+x..row+x,col-x..col-x).component(0,0)\n\t\t\t\tend\n\t\t\t\tproducts << diagonal.reduce(:*)\n\t\t\tend\n\t\tend\n\tend\n\tproducts.max\nend", "title": "" }, { "docid": "561c3c47cf9788938aface2be5fcc00b", "score": "0.5632169", "text": "def render\n # Every cell is an individual quad\n # using the propane grid convenience function instead of a nested loop\n grid(z.size - 1, z[0].size - 1) do |x, y|\n # one quad at a time\n # each quad's color is determined by the height value at each vertex\n # (clean this part up)\n no_stroke\n push_matrix\n begin_shape(PConstant::QUADS)\n translate(x * scl - w * 0.5, y * scl - h * 0.5, 0)\n fill(z[x][y] + 127, 220)\n vertex(0, 0, z[x][y])\n fill(z[x + 1][y] + 127, 220)\n vertex(scl, 0, z[x + 1][y])\n fill(z[x + 1][y + 1] + 127, 220)\n vertex(scl, scl, z[x + 1][y + 1])\n fill(z[x][y + 1] + 127, 220)\n vertex(0, scl, z[x][y + 1])\n end_shape\n pop_matrix\n end\n end", "title": "" }, { "docid": "162a534fd1698e7d0034a365b4ee1a99", "score": "0.5559433", "text": "def drawXZGrid\n\t\tif !@gridOn then return end\n\t\tglDisable(GL_LIGHTING)\n\t\tglBegin(GL_LINES)\n\t\tglColor(@gridColorXZ)\n\t\tfor i in (-@gridLines..@gridLines)\n\t\t\t# Draw two lines for each iteration\n\t\t\tglVertex( i*@gridSpacing, 0.0, -(@gridLines*@gridSpacing))\n\t\t\tglVertex( i*@gridSpacing, 0.0, (@gridLines*@gridSpacing))\n\t\t\tglVertex( -(@gridLines*@gridSpacing), 0.0, i*@gridSpacing)\n\t\t\tglVertex( (@gridLines*@gridSpacing), 0.0, i*@gridSpacing)\n\t\tend\n\t\tglEnd\n\t\tglEnable(GL_LIGHTING)\n\tend", "title": "" }, { "docid": "1b9cb7792cdd777c981eeaef553edfb5", "score": "0.5537424", "text": "def jb_visualize3d(an, bn, tn)\n Visualizer::Cube.new(an, bn, tn, self).visualize\n end", "title": "" }, { "docid": "3bda49beb0cb95cbc3d936b616beb00e", "score": "0.54311264", "text": "def light_up(quad)\n case quad\n when 1\n (0..3).each do |x_index|\n (0..3).each do |y_index|\n @device.change :grid, :x => x_index, :y => y_index, :green => :high\n end\n end\n when 2\n (4..7).each do |x_index|\n (0..3).each do |y_index|\n @device.change :grid, :x => x_index, :y => y_index, :green => :high, :red => :high\n end\n end\n when 3\n (0..3).each do |x_index|\n (4..7).each do |y_index|\n @device.change :grid, :x => x_index, :y => y_index, :red => :high\n end\n end\n when 4\n (4..7).each do |x_index|\n (4..7).each do |y_index|\n @device.change :grid, :x => x_index, :y => y_index, :green => :low, :red => :medium\n end\n end\n end\n end", "title": "" }, { "docid": "8ec457fccf0ae4c52bf5f6f0589aea56", "score": "0.5426616", "text": "def setup_grid\n empty_rows\n [:white, :light_yellow].each do |color|\n back_rows(color)\n pawn_rows(color)\n end\n end", "title": "" }, { "docid": "5ad44b68308e0315f245e615d6de0679", "score": "0.53655154", "text": "def inv_3d\n format_3d(inv_dims_3d) if targets_3d.present?\n end", "title": "" }, { "docid": "70776413b26e0326bc7797ca282faa2c", "score": "0.53486425", "text": "def drawYZGrid\n\t\tif !@gridOn then return end\n\t\tglDisable(GL_LIGHTING)\n\t\tglBegin(GL_LINES)\n\t\tglColor(@gridColorYZ)\n\t\tfor i in (-@gridLines..@gridLines)\n\t\t\t# Draw two lines for each iteration\n\t\t\tglVertex( 0.0, i*@gridSpacing, -(@gridLines*@gridSpacing))\n\t\t\tglVertex( 0.0, i*@gridSpacing, (@gridLines*@gridSpacing))\n\t\t\tglVertex( 0.0, -(@gridLines*@gridSpacing), i*@gridSpacing)\n\t\t\tglVertex( 0.0, (@gridLines*@gridSpacing), i*@gridSpacing)\n\t\tend\n\t\tglEnd\n\t\tglEnable(GL_LIGHTING)\n\tend", "title": "" }, { "docid": "9877774951697dfa703071014c0edd88", "score": "0.53415066", "text": "def test_with_irregular_array3D2; show([[[0,0,0]],\n [[0,0,0],[1,1,1]]]) end", "title": "" }, { "docid": "1605bfe21e64b93a2d4b0b51ac73877d", "score": "0.5293476", "text": "def test_with_irregular_array3D1; show([[[0,0,0],[1,1,1]],\n [[0,0,0]]]) end", "title": "" }, { "docid": "58b20ac3166f4e0247b2a32bb30d6fcc", "score": "0.52753353", "text": "def _grid\n b = Bitmap.new(360, 360)\n c1, c2 = Color.new(255, 255, 255), Color.new(0, 0, 0)\n b.fill_rect(0, 0, 48, 48, c1)\n b.fill_rect(24, 0, 24, 24, c2)\n b.fill_rect(0, 24, 24, 24, c2)\n c1.alpha = c2.alpha = 128\n b.fill_rect(1, 25, 22, 22, c1)\n b.fill_rect(25, 1, 22, 22, c1)\n b.fill_rect(1, 1, 22, 22, c2)\n b.fill_rect(25, 25, 22, 22, c2)\n b.blt(48, 0, b, Rect.new(0, 0, 48, 48))\n b.blt(0, 48, b, Rect.new(0, 0, 96, 48))\n b.blt(96, 0, b, Rect.new(0, 0, 96, 96))\n b.blt(0, 96, b, Rect.new(0, 0, 192, 96))\n b.blt(192, 0, b, Rect.new(0, 0, 192, 192))\n b.blt(0, 192, b, Rect.new(0, 0, 384, 192))\n return b\n end", "title": "" }, { "docid": "1055eb66d261d7b6ae3830c385942cf7", "score": "0.52685755", "text": "def grid\n \t\t\tfinal, y = Array.new, 0\n \t\t\t@@axis.fetch(:y).times do\n \t\t\t\tfinal[y], x = Array.new, 0\n \t\t\t\t@@axis.fetch(:x).times do\n \t\t\t\t\tfinal[y][x] = init_coord(x, y)\n \t\t\t\t\tx += 1\n \t\t\t\tend\n \t\t\t\ty += 1\n\t\t\tend\n\t\t\tfinal.reverse\n\t\tend", "title": "" }, { "docid": "a06288026020d343afb31c3ef1f5130e", "score": "0.5179428", "text": "def setup\n\t\tbackground(0)\n\t\tzahlen = (2*3*5*7)-1# <-- change integer here. # what is biggest array?\n\t\t@table = color_it(rsa_group(zahlen))\n\t\tsquare = [1000] * 2 ; size(*square)\n\t\tframe_rate 1 ; colorMode(HSB,360,100,100)\n\tend", "title": "" }, { "docid": "566d651c1d24e5b3429b654c9e794484", "score": "0.512349", "text": "def render_background\n render_unvisited\n render_grid_lines\n end", "title": "" }, { "docid": "7028af691f5b8ed301e84336999648c4", "score": "0.5118448", "text": "def render_unvisited\n outputs.solids << scale_up(grid.rect).merge(unvisited_color)\n outputs.solids << move_and_scale_up(grid.rect).merge(unvisited_color)\n end", "title": "" }, { "docid": "dba8f39b004c701a6ac7ce88e4ab13c3", "score": "0.50517046", "text": "def setup_easier\n (1...ROWS).each do |row|\n (1...COLUMNS).each do |col|\n set_neighbour_colour(col, row) if rand(-1...COLOR_TABLE.size) == -1\n end\n end\n end", "title": "" }, { "docid": "0d0f2b464a76ee6b277c160924503dba", "score": "0.5005968", "text": "def pixelate\n\t\t\tmax_level = @post.resolution_level - 1\n\t\t\tmax_resolution = 2**max_level;\n\n\t\t\timg = Magick::ImageList.new(@post.image.path(:medium))\n\t\t\tstep = img.columns / max_resolution\n\t\t\ttemplate = Magick::Image.new(step, step)\n\t\t\tpixel_matrices = Array.new(max_level + 1)\n\n\t\t\t# Initialize 3D array: [level][row][col]\n\t\t\tfor level in 0..max_level do\n\t\t\t\tpixel_matrices[level] = level == max_level ? Array.new(2**level) { Array.new(2**level) } : nil\n\t\t\tend\n\n\t\t\tfor r in 0...max_resolution do\n\t\t\t\tfor c in 0...max_resolution do\n\t\t\t\t\t# Cut image into blocks\n\t\t\t\t\tblock = img.export_pixels_to_str( c * step, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t r * step,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t step,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t step )\n\t\t\t\t\taverage_pixel = template.import_pixels(0,0,step, step, \"RGB\", block).scale(1,1).pixel_color(0,0)\n\n\t\t\t\t\t# Translate red,green,blue value into 8-bit depth from 16-bit depth (default RMagick)\n\t\t\t\t\tpixel_matrices[max_level][r][c] = [average_pixel.red, average_pixel.green, average_pixel.blue].map! { |x| convert_16bit_to_8bit_with_damping(x) }\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Compute the remaining levels\n\t\t\tfor level in max_level.downto(1) do\n\t\t\t\taverage = Array.new(2**(level-1)) { Array.new(2**(level-1)) { Array.new(3, 0.0) } }\n\t\t\t\tfor r in 0...2**level do\n\t\t\t\t\tfor c in 0...2**level do\n\t\t\t\t\t\taverage[r / 2][c / 2][0] += pixel_matrices[level][r][c][0] / 4\n\t\t\t\t\t\taverage[r / 2][c / 2][1] += pixel_matrices[level][r][c][1] / 4\n\t\t\t\t\t\taverage[r / 2][c / 2][2] += pixel_matrices[level][r][c][2] / 4\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tpixel_matrices[level-1] = Array.new(average)\n\t\t\tend\n\t\t\t@post.pixel_matrices = pixel_matrices\n\t\t\t@post.save\n\t\tend", "title": "" }, { "docid": "d83ee138be7a937dd327db97570374bd", "score": "0.49862877", "text": "def connect_spaces\n\n # set the tile-tile, tile-vtex, and tile-edge links\n @tiles.each do |tile|\n r, c = tile.row, tile.col\n\n # link the tile with its 6 neighboring tiles\n [[[ r-1 , c-1 ], :nw, :se],\n [[ r-1 , c ], :ne, :sw],\n [[ r , c+1 ], :e , :w ],\n [[ r+1 , c+1 ], :se, :nw],\n [[ r+1 , c ], :sw, :ne],\n [[ r , c-1 ], :w , :e ],\n ].each do |coords, dir1, dir2|\n other = @tile_map[coords]\n tile.set_tile(dir1, other)\n other.set_tile(dir2, tile) unless other.nil?\n end\n\n # link the tile with its 6 neighboring vertexes\n [[[ r-1 , c-1 , :down ], :nw, :se],\n [[ r , c , :up ], :n , :s ],\n [[ r-1 , c , :down ], :ne, :sw],\n [[ r+1 , c+1 , :up ], :se, :nw],\n [[ r , c , :down ], :s , :n ],\n [[ r+1 , c , :up ], :sw, :ne],\n ].each do |coords, dir1, dir2|\n vtex = @vtex_map[coords]\n tile.set_vtex(dir1, vtex)\n vtex.set_tile(dir2, tile) unless vtex.nil?\n end\n\n # link the tile with its 6 neighboring edges\n [[[ r , c , :vert ], :w , :e ],\n [[ r , c , :asc ], :nw, :se],\n [[ r , c , :desc ], :ne, :sw],\n [[ r , c+1 , :vert ], :e , :w ],\n [[ r+1 , c+1 , :asc ], :se, :nw],\n [[ r+1 , c , :desc ], :sw, :ne],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n tile.set_edge(dir1, edge)\n edge.set_tile(dir2, tile) unless edge.nil?\n end\n end\n\n # link the :up vertexes with neighboring edges\n @up_vtexs.each do |vtex|\n r, c = vtex.row, vtex.col\n [[[ r-1 , c , :vert ], :n , :s ],\n [[ r , c , :asc ], :sw, :ne],\n [[ r , c , :desc ], :se, :nw],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n vtex.set_edge(dir1, edge)\n edge.set_vtex(dir2, vtex) unless edge.nil?\n end\n end\n\n # link the :down vertexes with neighboring edges\n @down_vtexs.each do |vtex|\n r, c = vtex.row, vtex.col\n [[[ r+1 , c+1 , :vert ], :s , :n ],\n [[ r+1 , c+1 , :asc ], :ne, :sw],\n [[ r+1 , c , :desc ], :nw, :se],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n vtex.set_edge(dir1, edge)\n edge.set_vtex(dir2, vtex) unless edge.nil?\n end\n end\n end", "title": "" }, { "docid": "a5c1b33cf59123b1e81c50fe64a50b86", "score": "0.49813405", "text": "def create_grid\n grid = Array.new(8) { Array.new(8) { [] } }\n grid.map! do |row|\n if grid.index(row).even?\n row.each { |space| row.index(space).even? ? space << 'white' : space << 'black' }\n else\n row.each { |space| row.index(space).even? ? space << 'black' : space << 'white' }\n end\n row.map! do |space|\n space << [grid.index(row), row.index(space)]\n end\n end\n grid.reverse\n end", "title": "" }, { "docid": "fb0f931a96cff0d3867fcdfd40e4e95e", "score": "0.49732232", "text": "def three_row_grid\n grid = []\n grid << [\n Cell.new(:alive, 0, 0),\n Cell.new(:alive, 0, 1),\n Cell.new(:dead, 0, 2)\n ]\n grid << [\n Cell.new(:alive, 1, 0),\n Cell.new(:dead, 1, 1),\n Cell.new(:dead, 1, 2)\n ]\n grid << [\n Cell.new(:dead, 2, 0),\n Cell.new(:dead, 2, 1),\n Cell.new(:dead, 2, 2)\n ]\n grid\nend", "title": "" }, { "docid": "706eb64900b7174b7be3cf98fb4211d4", "score": "0.49474615", "text": "def initialize texture_size = [512,512]\n @texture_size = texture_size\n @texture = Array.new(@texture_size[0]) { Array.new(@texture_size[1]) { Array.new(3){1} } }\n @windows = [@texture_size[0]/8, @texture_size[1]/8]\n @texture_link = [0]\n \n @windows[0].times do |i|\n @windows[1].times do |j|\n px_origin = i*8\n py_origin = j*8\n # Got a little 8x8 window with pixel coords starting in px/py origin being topleft corner of window\n \n # Walls\n 8.times do |x|\n @texture[px_origin + x][py_origin] = [0,0,0]\n @texture[px_origin + x][py_origin+7] = [0,0,0]\n @texture[px_origin][py_origin + x] = [0,0,0]\n @texture[px_origin + 7][py_origin + x] = [0,0,0]\n end\n \n # Inside color, either mostly on or mostly off\n if rand > DARK_TO_LIGHT_RATIO\n cr = rand/4.0\n else\n cr = 3.0/4 + rand/4.0\n end\n c = [cr,cr,cr]\n \n # Inside\n 6.times do |x|\n 6.times do |y|\n px = px_origin + 1 + x\n py = py_origin + 1 + y\n \n @texture[px][py] = c\n end\n end \n end\n end\n \n loadTexture\n end", "title": "" }, { "docid": "ffe8a5e7c3fc119e99ca0991d589aa30", "score": "0.49185345", "text": "def setup_mans(row,color)\n 3.times do\n @grid[row].each_index do |col|\n Piece.new(self, [row,col], color) if (row+col).odd?\n end\n row += 1\n end\n end", "title": "" }, { "docid": "bf976eca23ef025a2c305435339532fd", "score": "0.49117368", "text": "def update\n update_grid = Array.new(@grid_height) { Array.new(@grid_width, 0) }\n update_grid.each_index do |row|\n update_grid[row].each_index do |col|\n num_neighbours = get_num_neighbours col, row\n if (@grid[row][col] == 1 && num_neighbours.between?(2, 3)) ||\n (@grid[row][col] == 0 && num_neighbours == 3)\n update_grid[row][col] = 1\n end\n end\n end\n @grid = update_grid\n end", "title": "" }, { "docid": "e8d2964eb4187f29e328c973d39b63cc", "score": "0.49044746", "text": "def draw_fixed_grid(rect, cols, rows, shade=active_shade, state=active_state)\n rect = Convert.Rect(rect)\n w = rect.width\n h = rect.height\n rows.times do |y|\n cols.times do |x|\n draw_shade_rect(r.step(6, x).step(2, y), shade, state)\n end\n end\n end", "title": "" }, { "docid": "8f6e11a407e3ac98b4c40134e083640c", "score": "0.48882985", "text": "def matz; end", "title": "" }, { "docid": "9af004c85aa464ee86ac5031bead096c", "score": "0.48880064", "text": "def colorable_grid_map(color_option = :even)\n\t\tcolor_cordinates = []\n\t\tpixel_grid = @avatar[:grid].map.with_index(0) do |num, i|\n\t\t\tif num % 2 == 0\n\t\t\t\thorizontal = (i % 5) * 50\n\t\t\t\tvertical = (i / 5) * 50\n\n\t\t\t\ttop_left = [horizontal, vertical]\n\t\t\t\tbottom_right = [horizontal + 50, vertical + 50]\n\t\t\t\t[ top_left, bottom_right ]\n\t\t\tend\n\t\tend\n\t\tpixel_grid.compact\n\tend", "title": "" }, { "docid": "5b47bea16902ca1e81887c6bcf22686e", "score": "0.4876093", "text": "def display_maze_with_png(grid)\n \nend", "title": "" }, { "docid": "99ee4ee27d2e6e97a60add02137f3e9c", "score": "0.48554152", "text": "def make_grid\n @grid = Array.new(4){Array.new(4)}\n end", "title": "" }, { "docid": "35111c6b278822cc846bef2ffef171b5", "score": "0.48488206", "text": "def inv_dims_3d\n targets_3d.map {|t| \"#{format_inv_targets(t)} #{t}\"} if targets_3d.present?\n end", "title": "" }, { "docid": "9b13b6e60f471791b2ba98d0a49ec435", "score": "0.48483953", "text": "def test_with_irregular_array3D4; show([[[0,1,0.5,0.7]]]) end", "title": "" }, { "docid": "ac7cafa0c1dbc6095d2820cbbe165160", "score": "0.48240337", "text": "def matrix\n end", "title": "" }, { "docid": "cb45f58feafdf4f4fa966facb3d8777a", "score": "0.48169616", "text": "def show_board\n @grid.each_with_index do |row, row_index|\n row.each_with_index do |square, col_index|\n piece = self[row_index, col_index]\n if row_index.even? && col_index.even?\n print \" #{piece.display} \".colorize( :color => :black, :background => :white ) if (piece && piece.color == :black)\n print \" #{piece.display} \".colorize( :color => :red, :background => :white ) if (piece && piece.color == :red)\n print \" \".colorize( :background => :white ) if piece.nil?\n elsif row_index.even? && col_index.odd? \n print \" #{piece.display} \".colorize( :color => :black, :background => :light_white ) if (piece && piece.color == :black)\n print \" #{piece.display} \".colorize( :color => :red, :background => :light_white ) if (piece && piece.color == :red)\n print \" \".colorize( :background => :light_white ) if piece.nil?\n elsif row_index.odd? && col_index.even? \n print \" #{piece.display} \".colorize( :color => :black, :background => :light_white ) if (piece && piece.color == :black)\n print \" #{piece.display} \".colorize( :color => :red, :background => :light_white ) if (piece && piece.color == :red)\n print \" \".colorize( :background => :light_white ) if piece.nil?\n elsif row_index.odd? && col_index.odd?\n print \" #{piece.display} \".colorize( :color => :black, :background => :white ) if (piece && piece.color == :black)\n print \" #{piece.display} \".colorize( :color => :red, :background => :white ) if (piece && piece.color == :red)\n print \" \".colorize( :background => :white ) if piece.nil?\n end\n end\n puts \"\"\n end\n end", "title": "" }, { "docid": "a702a470384dec87e337a4ede5290501", "score": "0.47985405", "text": "def initalize_3d(desviacion, cantidad, xpos, ypos, zpos, yd)\n @matrix = Array.new\n cantidad.times do\n @matrix.push([xpos + 2 * desviacion * rand - desviacion, ypos + 2 * desviacion * rand - desviacion, zpos + 2 * desviacion * rand - desviacion, yd])\n end\n end", "title": "" }, { "docid": "83393fb6d4dd892377b4d46b2e63609b", "score": "0.47885323", "text": "def step_three\n zeros = starred_zeros.select_cells { |cell| cell }\n zeros.each do |zero|\n covered_zeros.set_col(zero[1], true)\n end\n end", "title": "" }, { "docid": "85dfdc8c622d2a301461f935ea99d876", "score": "0.4782052", "text": "def Matrix3dTranspose(arg0)\n ret = _invoke(1610743899, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "37f9d311bca2659b116405d6c73d6d24", "score": "0.47672454", "text": "def grid(face, n)\n dx = 2.0/n\n dy = 2.0/n\n a = Array.new\n n += 1\n\n n.times do |j|\n y = -1.0 + j*dy\n n.times do |i|\n x = -1.0 + i*dx\n lon, lat = QuadSphere::CSC.inverse(face, x, y)\n sx = Math::cos(lat) * Math::cos(lon)\n sy = Math::cos(lat) * Math::sin(lon)\n sz = Math::sin(lat)\n a << [sx,sy,sz]\n end\n end\n\n a\n end", "title": "" }, { "docid": "421eeec7e00140fd8108e7bc57da5a8d", "score": "0.4766999", "text": "def clear_image\n tmp = [];\n @rows.times do |row|\n @cols.times do |col|\n tmp << @default_color\n end\n end\n @matrix = tmp.each_slice(@cols).to_a\n #display_image\n end", "title": "" }, { "docid": "eed44bf2c8ede98a991273ede2f0df0f", "score": "0.47542053", "text": "def blurred\r\n unos = []\r\n # nested loops for rows and columns\r\n @paint.each_with_index do |row, rownum| # iterating over elements in the main array for rows \r\n row.each_with_index do |element, colnum| # iterating over elements in each subarray for columns\r\n if element == 1\r\n unos << [rownum, colnum]\r\n end\r\n end\r\n end\r\n\r\n unos.each do |rownum, colnum| \r\n # assigning \"1\" above \"1\"s, except for first row\r\n @paint[rownum -1][colnum] = 1 unless rownum == 0\r\n # assigning \"1\" below \"1\"s, except for last row\r\n @paint[rownum +1][colnum] = 1 unless rownum >= @paint.length-1\r\n # assigning \"1\" to the left of \"1\"s, except for first column\r\n @paint[rownum][colnum -1] = 1 unless colnum == 0\r\n # assigning \"1\" to the right of \"1\"s, except for last column\r\n @paint[rownum][colnum +1] = 1 unless colnum >= @paint[rownum].length-1\r\n end\r\n end", "title": "" }, { "docid": "ee737c49f4a671e576080e4cc0f05e48", "score": "0.47506157", "text": "def render\n\n # Sets a black background on the screen (Comment this line out and the background will become white.)\n # Also note that black is the default color for when no color is assigned.\n outputs.solids << grid.rect\n\n # The position, size, and color (white) are set for borders given to the world collection.\n # Try changing the color by assigning different numbers (between 0 and 255) to the last three parameters.\n outputs.borders << state.world.map do |x, y|\n [x * state.tile_size,\n y * state.tile_size,\n state.tile_size,\n state.tile_size, 255, 255, 255]\n end\n\n # The top, bottom, and sides of the borders for collision_rects are different colors.\n outputs.borders << state.world_collision_rects.map do |e|\n [\n [e[:top], 0, 170, 0], # top is a shade of green\n [e[:bottom], 0, 100, 170], # bottom is a shade of greenish-blue\n [e[:left_right], 170, 0, 0], # left and right are a shade of red\n ]\n end\n\n # Sets the position, size, and color (a shade of green) of the borders of only the player's\n # box and outputs it. If you change the 180 to 0, the player's box will be black and you\n # won't be able to see it (because it will match the black background).\n outputs.borders << [state.x,\n state.y,\n state.tile_size,\n state.tile_size, 0, 180, 0]\n end", "title": "" }, { "docid": "6e9cf619a894cfd7da3754cc6239f337", "score": "0.47419843", "text": "def vflip\n g = Grid.new\n self.each do |point,v|\n g[Point.new( point.x, @height - point.y - 1 )] = v \n end\n g\n end", "title": "" }, { "docid": "fc58eb421eaabaf1fb98981c2c3c7099", "score": "0.4737538", "text": "def render_block x,y,i,a=255\n boxsize = 30\n grid_x = (1280 - (@grid_w * boxsize)) / 2\n grid_y = (720 - ((@grid_h-2) * boxsize)) / 2\n @args.outputs.solids << [grid_x + (x*boxsize), (720-grid_y) - (y*boxsize),boxsize,boxsize,*@color_index[i],a]\n if i != 8\n @args.outputs.borders << [grid_x + (x*boxsize), (720-grid_y) - (y*boxsize),boxsize,boxsize,*@color_index[8],a]\n else\n @args.outputs.borders << [grid_x + (x*boxsize), (720-grid_y) - (y*boxsize),boxsize,boxsize,*@color_index[7],a]\n end\n end", "title": "" }, { "docid": "dd73c74d8c6cbb2442d44b4bc5bf2381", "score": "0.47356114", "text": "def Matrix3dIdentity\n ret = _invoke(1610743889, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "83f4d850d0616f0235e167a18b752e79", "score": "0.47307387", "text": "def paintMatrix(a)\n\t\n\tputs \" | 1 | 2 | 3 | 4 | 5 | 6\".green\n\tputs \"\"\n\tfor i in 0..5\n\t\tif ( i != 0 )\n\t\tputs \" \"\n\t\tend\n\t\tfor j in 0..5\n\t\t\t\tprint \" | \".blue\n\t\t\t\tprint \"#{a[i][j]}\"\n\t\tend\n\t\tputs \"\"\n\tend\n\tputs\"\"\n\tend", "title": "" }, { "docid": "77dbc955e7315e8055c38b656b17c535", "score": "0.47171792", "text": "def setup\n size 200, 200 \n no_stroke\n background 0 \n c = load_image \"cait.jpg\" \n xoff, yoff = 0, 0\n p = 2\n pix = p * 3 \n (c.width * c.height).times do |i| \n pixel = c.pixels[i] \n fill red( pixel ), 0, 0\n rect xoff, yoff, p, pix \n fill 0, green( pixel ), 0\n rect xoff+p, yoff, p, pix \n fill 0, 0, blue( pixel )\n rect xoff+p*2, yoff, p, pix \n xoff += pix\n if xoff >= (width-pix)\n xoff = 0\n yoff += pix\n end\n end \nend", "title": "" }, { "docid": "8333a3dabd5e4cf8ff0919abe6575268", "score": "0.47163978", "text": "def setup\n size 500, 756, OPENGL\n no_stroke\n color_mode RGB, 1\n fill 0.3\n frame_rate 24\n background 0\n \n control_panel do |c|\n c.slider :opacity, 0.01..1.0, 0.3\n c.slider :rotation_x, 0.01..1.0, 0.2\n c.slider :rotation_y, 0.01..1.0, 0.3\n c.slider :growth_factor, 0.01..2.0, 1.0\n \n c.checkbox :paused\n c.checkbox :trails\n end\n \n @boxes = [\n {:y => 4, :speed => 1, :size => 68, :opacity => 1.0},\n {:y => 1, :speed => 15, :size => 60, :opacity => 1.8},\n {:y => 3, :speed => 4, :size => 32, :opacity => 1.2},\n {:y => 41, :speed => 23, :size => 40, :opacity => 1.2}, \n {:y => 1, :speed => 6, :size => 47, :opacity => 1.5},\n {:y => 1, :speed => 2, :size => 30, :opacity => 1.5},\n {:y => 5, :speed => 16, :size => 14, :opacity => 2.0},\n {:y => 1, :speed => 17, :size => 42, :opacity => 1.0},\n {:y => 4, :speed => 25, :size => 90, :opacity => 1.2}, \n {:y => 6, :speed => 1, :size => 23, :opacity => 1.0},\n {:y => 42, :speed => 15, :size => 20, :opacity => 1.0},\n {:y => 1, :speed => 10, :size => 38, :opacity => 1.5},\n {:y => 11, :speed => 5, :size => 20, :opacity => 2.0},\n {:y => 24, :speed => 26, :size => 33, :opacity => 1.0},\n {:y => 1, :speed => 8, :size => 24, :opacity => 2.0},\n {:y => 24, :speed => 13, :size => 20, :opacity => 1.5},\n {:y => 38, :speed => 27, :size => 31, :opacity => 1.8},\n {:y => 11, :speed => 14, :size => 12, :opacity => 1.0},\n {:y => 1, :speed => 29, :size => 85, :opacity => 1.2},\n {:y => 21, :speed => 11, :size => 50, :opacity => 1.2},\n {:y => 1, :speed => 18, :size => 33, :opacity => 1.3},\n {:y => 5, :speed => 8, :size => 18, :opacity => 2.3},\n {:y => 17, :speed => 26, :size => 64, :opacity => 1.0},\n {:y => 3, :speed => 7, :size => 45, :opacity => 1.0},\n {:y => 65, :speed => 13, :size => 99, :opacity => 1.2},\n {:y => 8, :speed => 2, :size => 83, :opacity => 1.2}, \n {:y => 12, :speed => 20, :size => 47, :opacity => 1.6},\n {:y => 11, :speed => 3, :size => 32, :opacity => 1.3},\n {:y => 1, :speed => 15, :size => 47, :opacity => 0.9},\n {:y => 7, :speed => 19, :size => 60, :opacity => 1.8},\n ]\n\n @column_width = (width/@boxes.size)\nend", "title": "" }, { "docid": "09c86bfe58f00bbf52979b5517be8306", "score": "0.47056335", "text": "def setup \n size 640, 360, P3D \n @r_size = width / 6.0\n @a = 0.0 \n no_stroke\n fill 204, 204 \nend", "title": "" }, { "docid": "61db7fe7e9dcf96cc87d82e6c3a02e03", "score": "0.47035596", "text": "def test_with_irregular_array3D3; show([[[0,1]]]) end", "title": "" }, { "docid": "a1c2cb181c145ed6cbb0fac7e98de666", "score": "0.46976244", "text": "def make_quadtree(pixels, width, height)\n $count = 0\n def make_quadtree_r(pixels, x, y, w, h)\n sum = 0\n (0..w-1).each do |x_off|\n (0..h-1).each do |y_off|\n sum += pixels[x+x_off][y+y_off]\n end\n end\n # all black or white test\n if sum == 0\n $count += 1\n sides = [\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x,y), CP::Vec2.new(x+w,y), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x+w,y), CP::Vec2.new(x+w,y+h), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x+w,y+h), CP::Vec2.new(x,y+h), 0.1),\n CP::Shape::Segment.new($static_body, CP::Vec2.new(x,y+h), CP::Vec2.new(x,y), 0.1),\n ]\n sides.each{|x| x.e = 1.0; $space.add_static_shape(x)}\n Quadtree.new(0, nil, nil, nil, nil)\n elsif sum == 255*w*h\n $count += 1\n Quadtree.new(1, nil, nil, nil, nil)\n else\n Quadtree.new(nil, \n make_quadtree_r(pixels, x, y, w/2, h/2),\n make_quadtree_r(pixels, x+w/2, y, w/2, h/2),\n make_quadtree_r(pixels, x, y+h/2, w/2, h/2),\n make_quadtree_r(pixels, x+w/2, y+h/2, w/2, h/2))\n end\n end\n tree = make_quadtree_r(pixels, 0, 0, width, height)\n puts \"Number of nodes: #{$count} vs #{width*height} for full data (#{$count.to_f/(width*height)*100}%)\"\n tree\nend", "title": "" }, { "docid": "de64300ba7d6b5a01432580dc63ac6c5", "score": "0.46874568", "text": "def XtestForCollidingNormalsBetweenBlendAndConcaveNeighbor\n grid = Grid.new(100,100,100,100)\n grid.addNode(0,0,0)\n grid.addNode(1,0,0)\n grid.addNode(0,0,1)\n grid.addNode(0,1,0)\n grid.addFace(0,1,2,1)\n grid.addFace(0,2,3,1)\n grid.addNode(0,1,1)\n grid.addNode(-1,1,0)\n grid.addFace(3,4,5,1)\n grid.addFace(1,0,3,11)\n grid.addFace(1,0,3,11)\n layer = Layer.new(grid).populateAdvancingFront([1])\n layer.constrainNormal(11)\n grid.removeFace(3)\n grid.removeFace(4)\n layer.blend(200.0)\n layer.preventBlendNormalDirectionFromPointingAtNeighbors(0.4)\n\n assert_equal [0,1,7], layer.triangleNormals(0)\n assert_equal [6,2,3], layer.triangleNormals(1)\n assert_equal [3,4,5], layer.triangleNormals(2)\n\n # 5\n # |\\\n # Y 3-4\n # | |\\\n # +--Z 6-2\n # +--Z 0-7\n # | |/\n # X 1\n\n tol = 1.0e-5\n norm = layer.normalDirection(3)\n assert_in_delta( -0.707107, norm[0], tol)\n assert_in_delta( -0.707107, norm[1], tol)\n assert_in_delta( 0.000000, norm[2], tol)\n norm = layer.normalDirection(6)\n assert_in_delta( -0.707107, norm[0], tol, \"6-X\")\n assert_in_delta( -0.707107, norm[1], tol, \"6-Y\")\n assert_in_delta( 0.000000, norm[2], tol, \"6-Z\")\n norm = layer.normalDirection(2)\n assert_in_delta( -0.707107, norm[0], tol, \"3-X\")\n assert_in_delta( -0.707107, norm[1], tol, \"3-Y\")\n assert_in_delta( 0.000000, norm[2], tol, \"3-Z\")\n\n end", "title": "" }, { "docid": "7562605a0a38c4fbd47b53f9b52f506d", "score": "0.46843597", "text": "def render_grid\n\t\t@grid_w.times.with_index do |x|\n\t\t\t@grid_h.times.with_index do |y|\n\t\t\t\tif !@has_enviroment_rendered\n \t \t\trender_wall x, y if @grid[x][y]==1\n\t\t\t\tend\n\t\t \trender_player x, y if @grid[x][y]==2\n \tend\n end\n #each_cell do |x, y, v|\n # render_wall x, y if !@has_environment_rendered && v == 1 \n # render_player x, y if v == 2\n #end\n\t\t@has_enviroment_rendered = true\n\tend", "title": "" }, { "docid": "68cd76bb8609de93c38b63aa6555ccf1", "score": "0.46786994", "text": "def set_chamber_done(grid, chamber)\n (0..chamber.height - 1).each do |j|\n (0..chamber.width - 1).each do |i|\n grid[chamber.grid_y + j][chamber.grid_x + i].show_base_background = true\n end\n end\nend", "title": "" }, { "docid": "d1589cded2882144b33fee53fc5fc981", "score": "0.46780485", "text": "def setup\n \n size 640, 360, P3D\n \n no_stroke\n color_mode RGB, 1\n fill 0.4\n \nend", "title": "" }, { "docid": "963e7d24f3e6162bea393e80186dc73c", "score": "0.46772817", "text": "def testInitialize_2SW_1NE_depth2\n ps = [UniquePoint3.new(0,0,0), UniquePoint3.new(3,3,0), UniquePoint3.new(8,8,8)]\n q = QuadTreeAccelerator.new(ps)\n assert_equal(\n\"(0,[[0,0,0],[8,8,8]],[])\n SW\n (1,[[0,0,0],[4.0,4.0,8]],[])\n SW\n (2,[[0,0,0],[2.0,2.0,8]],[[0,0,0]])\n NE\n (2,[[2.0,2.0,0],[4.0,4.0,8]],[[3,3,0]])\n NE\n (1,[[4.0,4.0,0],[8,8,8]],[[8,8,8]])\n\", q.to_s)\n end", "title": "" }, { "docid": "1985faafc4d356e5ddec39b9deb3504d", "score": "0.46732113", "text": "def change_grid(x:, y:, color:)\n return if (x > max_x) || (x < 0)\n return if (y > max_y) || (y < 0)\n col = effective_color(x: x, y: y, color: color)\n grid_apply_color(x, y, col)\n end", "title": "" }, { "docid": "26e2aefda83385095bfa6308c935a02f", "score": "0.46731243", "text": "def axes3d(*)\n super\n end", "title": "" }, { "docid": "44ffa89773ddc646dfe54047ca9c8ca9", "score": "0.4669655", "text": "def render_background\n render_unvisited\n render_grid_lines\n render_labels\n end", "title": "" }, { "docid": "130a4fc3d6522f12947d3e6a90c8fdaa", "score": "0.46656048", "text": "def inqcolormap\n inquiry_int { |pt| super(pt) }\n end", "title": "" }, { "docid": "20df7796c1dcf86507a25d2719207643", "score": "0.46636757", "text": "def mat_window; @materials_window; end", "title": "" }, { "docid": "9abe005b057aec9dce3ffb75c51802cf", "score": "0.46611127", "text": "def default_grid\n array = Array.new(8) { Array.new(8) }\n\n array[0][0] = Rook.new('white', [0,0], 'slide')\n array[1][0] = Knight.new('white', [1,0], 'step')\n array[2][0] = Bishop.new('white', [2,0], 'slide')\n array[3][0] = Queen.new('white', [3,0], 'slide')\n array[4][0] = King.new('white', [4,0], 'step')\n array[5][0] = Bishop.new('white', [5,0], 'slide')\n array[6][0] = Knight.new('white', [6,0], 'step')\n array[7][0] = Rook.new('white', [7,0], 'slide')\n array[0..7].each_with_index { |column, index| \n column[1] = Pawn.new('white', [index,1], 'step') }\n\n array[0][7] = Rook.new('black', [0,7], 'slide')\n array[1][7] = Knight.new('black', [1,7], 'step')\n array[2][7] = Bishop.new('black', [2,7], 'slide')\n array[3][7] = Queen.new('black', [3,7], 'slide')\n array[4][7] = King.new('black', [4,7], 'step')\n array[5][7] = Bishop.new('black', [5,7], 'slide')\n array[6][7] = Knight.new('black', [6,7], 'step')\n array[7][7] = Rook.new('black', [7,7], 'slide')\n array[0..7].each_with_index { |column, index| \n column[6] = Pawn.new('black', [index,6], 'step') }\n\n array\n end", "title": "" }, { "docid": "480eef980b9675f09257ea0dfe15a6b1", "score": "0.46547154", "text": "def back_rows(color)\n back_pieces = [Rook, Knight, Bishop, Queen, King, Bishop, Knight, Rook]\n i = (color == :white) ? 7 : 0\n\n back_pieces.each_with_index do |piece, j|\n @grid[i][j] = piece.new(color, [i, j], @grid)\n end\n end", "title": "" }, { "docid": "f90009d2bea29412c2a95545ed3e436e", "score": "0.4654384", "text": "def cur_normal_matrix\n MSPhysics::Newton::CurvySlider.get_cur_normal_matrix(@address)\n end", "title": "" }, { "docid": "fb47538aa01855f6195d2489bb8740f9", "score": "0.46494856", "text": "def build_gr(entities,r,t)\n\ngr_group = entities.add_group\n\norigin = Geom::Point3d.new(0,0,0)\nv1 = Geom::Vector3d.new($gr_width/2,0,0)\nv2 = Geom::Vector3d.new(0,0,$gr_width*$gr_pitch/12)\nv3 = Geom::Vector3d.new(0, $gr_length,0)\n\nf1 = gr_group.entities.add_face(origin,origin-v3,origin-v3+v2+v1,origin+v2+v1)\nf1.material = $roofColor\nf2 = gr_group.entities.add_face(origin-v3+v2+v1,origin+v2+v1, origin+v1+v1, origin+v1+v1-v3)\nf2.material = $roofColor\n\nif($gr_wall[1] == 2)\n\tf5 = gr_group.entities.add_face([0,-$gr_length,0],[6, -$gr_length,0],[6, 6-$gr_length,0],[0,6-$gr_length,0])\n\tf5.pushpull $gr_height\n\tf6 = gr_group.entities.add_face([$gr_width,-$gr_length,0],[$gr_width-6, -$gr_length,0],[$gr_width-6, 6-$gr_length,0],[$gr_width,6-$gr_length,0])\n\tf6.pushpull $gr_height\nend\n\nif($gr_wall[0] == 1)\n\tf3 = gr_group.entities.add_face([0,0,0],[0,0,-$gr_height],[0,-$gr_length, -$gr_height],[0, -$gr_length,0])\n\tf3.material = $wallColor\nend\n\nif($gr_wall[2] == 1)\n\tf3 = gr_group.entities.add_face([$gr_width,0,0],[$gr_width,0,-$gr_height],[$gr_width,-$gr_length, -$gr_height],[$gr_width, -$gr_length,0])\n\tf3.material = $wallColor\nend\n\nentities.transform_entities r, gr_group\nentities.transform_entities t, gr_group\n\nend", "title": "" }, { "docid": "6c68676f17bf852f65fc8e8eb92d2ae4", "score": "0.46493277", "text": "def normal_matrices\n MSPhysics::Newton::CurvySlider.get_normal_matrices(@address)\n end", "title": "" }, { "docid": "b94e3e71a352b897241caa9eaf87356b", "score": "0.4643598", "text": "def grid\n Matrix.build(@row_count, @column_count) { Cell.new }.to_a\n end", "title": "" }, { "docid": "498472d9a46208e82f3b1227920150c6", "score": "0.46372902", "text": "def rotate!\n @grid = @grid.transpose.map{|c| c.reverse}\n end", "title": "" }, { "docid": "d97f187fa1f17aaa97f74824241be48b", "score": "0.4631648", "text": "def gl_view\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glenable\n glEnable(GL_TEXTURE_2D) # enables two-dimensional texturing to perform\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/gldepthfunc\n # https://www.youtube.com/watch?v=uJzXDkgm5Fw\n glEnable(GL_DEPTH_TEST)\n # If enabled, do depth comparisons and update the depth buffer.\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glmatrixmode\n glMatrixMode(GL_PROJECTION)\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glloadidentity\n glLoadIdentity # * HAS TOO * be loaded in order after glMatrixMode setting...\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/gluperspective\n gluPerspective(@fov, @ratio, @near, @far)\n #---------------------------------------------------------\n # Camera placement and viewing arangements:\n # The modelview matrix is where camera object information is stored.\n glMatrixMode(GL_MODELVIEW); glLoadIdentity # same as with before matrix ^\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glulookat\n gluLookAt(@x,@y,@z, # Camera Location // eye\n @tx,@ty,@tz, # Viewing Target Location // direction\n # Vector Direction of Movement. // up\n @vert_orintation[0], @vert_orintation[1], @vert_orintation[2]\n ) # Defining the Viewing perspective is done in this block.\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glrotatef\n # glRotatef(angle, X axis scale, Y axis scale, Z axis scale)\n glRotatef(@angle[0], @vert_orintation[0], @vert_orintation[1], @vert_orintation[2])\n end", "title": "" }, { "docid": "a4b87760a2e9241c2c2c0907434300e7", "score": "0.4622334", "text": "def flatten_grid\n height = grid.row_size\n width = grid.column_size\n for i in 0...height\n for j in 0...width\n @grid[i,j].flatten!\n end\n end\n end", "title": "" }, { "docid": "84a430127124286310202c8ab32aae54", "score": "0.46222812", "text": "def get_zigzag_flood_y(aface)\r\n result = []\r\n#@debug = true \r\n # create a 2D array to hold the rasterized shape\r\n # raster is on stepover boundaries and center of each square is where the zigzags will start and end.\r\n # set true for each centerpoint that is inside the face\r\n # raster 0,0 is bottom left of the shape, just outside the boundary\r\n bb = aface.bounds\r\n stepOverinuse = @bit_diameter * @stepOver\r\n ystart = bb.min.y - stepOverinuse / 2 # center of bottom row of cells\r\n yend = bb.max.y + stepOverinuse / 2 + 0.002\r\n \r\n xstart = bb.min.x - stepOverinuse / 2 # center of first column of cells\r\n xend = bb.max.x + stepOverinuse + 0.002 # MUST have a column after end of object else stuff gets skipped\r\n# if ($phoptions.use_fuzzy_pockets?) #always uses fuzzy, gives better results\r\n ylen = yend - ystart - 0.002\r\n stepOverinuse1 = getfuzzystepover(ylen)\r\n xlen = xend - xstart - 0.002\r\n stepOverinuse2 = getfuzzystepover(xlen)\r\n stepOverinuse = [stepOverinuse1, stepOverinuse2].min # always use lesser value\r\n# end\r\n debugfile(\"xstart #{xstart.to_mm},#{ystart.to_mm} #{xend.to_mm},#{yend.to_mm} #{stepOverinuse.to_mm}\" ) if (@debug)\r\n\r\n #use a hash as if it were a 2d array of cells rastered over the face\r\n if (@cells == nil)\r\n @cells = Hash.new(false)\r\n else\r\n @cells.clear\r\n end \r\n # now loop through all cells and test to see if this point is in the face\r\n pt = Geom::Point3d.new(0, 0, 0)\r\n xmax = ymax = 0.0\r\n#create the cell array \r\n createcells(xstart,xend, ystart,yend, stepOverinuse, aface) #creates cell has and sets @cellxmax etc\r\n xmax = @cellxmax\r\n ymax = @cellymax\r\n \r\n entities = Sketchup.active_model.active_entities if (@debug)\r\n \r\n debugfile(\"xmax #{xmax} ymax #{ymax}\") if (@debug) # max cell index\r\n# puts \"xmax #{xmax} ymax #{ymax}\"\r\n#output array for debug \r\n if (@debug)\r\n y = ymax\r\n debugfile(\"START\") if (@debug)\r\n while (y >= 0) do\r\n x = 0\r\n s = \"y #{y}\"\r\n while (x <= xmax) do\r\n if (@cells[[x,y]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n x += 1\r\n end\r\n debugfile(s) if (@debug)\r\n y -= 1 \r\n end\r\n end\r\n\r\n # now create the zigzag points from the hash, search along X for first and last points\r\n # keep track of 'going left' or 'going right' so we can test for a line that would cross the boundary\r\n # if this line would cross the boundary, start a new array of points\r\n r = 0\r\n prevpt = nil\r\n#@debug = true\r\n while (someleft(@cells,xmax,ymax)) # true if some cells are still not processed\r\n debugfile(\"R=#{r}\") if (@debug)\r\n result[r] = []\r\n y = 0\r\n goingright = true\r\n py = -1 # previous y used, to make sure we do not jump a Y level\r\n county = 0\r\n while (y <= ymax) do\r\n county += 1\r\n if (county > 500)\r\n puts \" county break\"\r\n break\r\n end\r\n \r\n leftx = -1\r\n x = 0\r\n while (x <= xmax) do # search to the right for a true\r\n if (@cells[[x,y]] == true)\r\n @cells[[x,y]] = false\r\n leftx = x\r\n break # found left side X val\r\n end\r\n x += 1\r\n end #while x\r\n rightx = -1\r\n x += 1\r\n if x <= xmax \r\n while (x <= xmax) do # search to the right for a false\r\n if (@cells[[x,y]] == false)\r\n rightx = x-1\r\n break # found right side X val\r\n end\r\n @cells[[x,y]] = false # set false after we visit\r\n x += 1\r\n end #while x\r\n end\r\n # now we have leftx and rightx for this Y, if rightx > -1 then push these points\r\n debugfile(\" left #{leftx} right #{rightx} y #{y}\") if (@debug)\r\n if (rightx > -1)\r\n #if px,py does not cross any face edges\r\n# pt1 = Geom::Point3d.new(xstart + leftx*stepOverinuse, ystart + y * stepOverinuse, 0)\r\n# pt2 = Geom::Point3d.new(0, 0, 0)\r\n if (goingright)\r\n pt1 = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n pt2 = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingright #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n else\r\n if (py > -1)\r\n if ((y - py) > 1) # do not cross many y rows, start new set instead\r\n debugfile(\"isyrows goingright #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n end\r\n end\r\n end\r\n end\r\n #check that this line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going right so create new point to the left of cross\r\n np = Geom::Point3d.new(cross.x - (stepOverinuse/2), cross.y, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the right of the crossing\r\n pt1 = Geom::Point3d.new(cross.x + (stepOverinuse/2), cross.y, 0)\r\n end\r\n \r\n entities.add_cpoint(pt1) if (@debug)\r\n result[r] << pt1\r\n pt = pt1\r\n if (leftx != rightx)\r\n #pt = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt) if (@debug)\r\n else\r\n puts \"singleton #{x} #{y}\" if (@debug)\r\n end\r\n else\r\n #pt.x = xstart + rightx*stepOverinuse\r\n #pt.y = ystart + y * stepOverinuse\r\n pt1 = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n pt2 = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingleft #{x} #{y}\") if (@debug)\r\n prevpt = nil\r\n r += 1\r\n result[r] = []\r\n debugfile(\"iscrossing left R=#{r}\") if (@debug)\r\n else \r\n if (py > -1)\r\n if ((y - py) > 1) # do not cross many y rows\r\n debugfile(\"isyrows goingleft #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n prevpt = nil\r\n debugfile(\"isyrows left R=#{r}\") if (@debug)\r\n end\r\n end\r\n end\r\n end\r\n \r\n #check that this horiz line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going left so create new point to the right of cross\r\n np = Geom::Point3d.new(cross.x + stepOverinuse/2, cross.y, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line on other side of gap\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the left of the crossing\r\n pt1 = Geom::Point3d.new(cross.x - stepOverinuse/2, cross.y, 0)\r\n end\r\n \r\n result[r] << pt1\r\n pt = pt1\r\n entities.add_cpoint(pt1) if (@debug)\r\n #pt.x = xstart + leftx*stepOverinuse\r\n if (leftx != rightx)\r\n# pt = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt2) if (@debug)\r\n else\r\n puts \"Singleton #{x} #{y}\" if (@debug)\r\n end\r\n end\r\n prevpt = Geom::Point3d.new(pt.x, pt.y, 0)\r\n py = y\r\n end # if rightx valid\r\n y += 1\r\n goingright = !goingright\r\n end # while y\r\n \r\n #debug output\r\n if (@debug)\r\n if (someleft(@cells,xmax,ymax) )\r\n debugfile(\"someleft #{r}\") if (@debug)\r\n yc = ymax\r\n while (yc >= 0) do\r\n xc = 0\r\n s = \"Y #{yc}\"\r\n while (xc <= xmax) do\r\n if (@cells[[xc,yc]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n xc += 1\r\n end\r\n debugfile(s) if (@debug)\r\n yc -= 1 \r\n end\r\n end\r\n end\r\n r += 1\r\n prevpt = nil\r\n end # while someleft \r\n@debug = false\r\n puts \" result #{result.length} #{result[0].length} \" if (@debug)\r\n debugfile(\"result #{result.length}\") if (@debug)\r\n result.each { |rs|\r\n debugfile(\" #{rs.length}\") if (@debug)\r\n }\r\n return result\r\n end", "title": "" }, { "docid": "3473fc0d82d210c4e24d36496d36da69", "score": "0.46126938", "text": "def mode3d\n begin_mode3d\n begin\n yield\n ensure\n self.class.end_mode3d\n end\n end", "title": "" }, { "docid": "9bde74a6651549205d4e148cb764baef", "score": "0.46092805", "text": "def display_board\n row_idx = -1\n numera = [1,2,3,4,5,6,7,8,9]\n @display = @grid.map do |row|\n \n col_idx = -1\n row_idx += 1 \n row.map do |col| \n col_idx += 1 \n if @flag_pair.include? ((row_idx.to_s) + (col_idx.to_s))\n col = 'F'.orange\n elsif col == :B\n col = 'H'.green\n elsif (@known_empty.include? ((row_idx.to_s) + (col_idx.to_s))) && (numera.include? col)\n col = col.to_s.red\n elsif @known_empty.include? ((row_idx.to_s) + (col_idx.to_s))\n col = 'O'.blue\n else\n col = 'H'.green\n end \n end \n end\n end", "title": "" }, { "docid": "ab0d50ee276b04fe6397d78f8b1d9939", "score": "0.4606941", "text": "def image_board(color_board) ; @board = color_board ; end", "title": "" }, { "docid": "ab0d50ee276b04fe6397d78f8b1d9939", "score": "0.4606941", "text": "def image_board(color_board) ; @board = color_board ; end", "title": "" }, { "docid": "530cb501a45d7830f2ea26803ff93310", "score": "0.4606341", "text": "def Matrix3dFromPoint3dRows(arg0, arg1, arg2)\n ret = _invoke(1610743895, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "370431d50067378bc229661b6ace4bad", "score": "0.45850128", "text": "def Point3dFromMatrix3dInverseTransposeTimesPoint3d(arg0, arg1)\n ret = _invoke(1610743903, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "d17b312eb0776f4af7f44a0e3fafed6d", "score": "0.4579193", "text": "def draw_internal_grid( view )\r\n subdivisions = final_subdivs()\r\n for patch in @patches\r\n patch.draw_internal_grid( subdivisions, view )\r\n end\r\n nil\r\n end", "title": "" }, { "docid": "3be13dcb22d30b38e784b9c73196589a", "score": "0.45769435", "text": "def test_update_with_object3D2;\n a=[[[1,0,1],[0,1,0]]]\n show(a)\n a[0][1]=nil\n end", "title": "" }, { "docid": "9753416cbc39513266c60c4b9d8fd50d", "score": "0.45683622", "text": "def draw_canvas_border(grid)\n grid[0].each do |grid_cell|\n grid_cell.top_wall = true\n end\n grid[grid.length - 1].each do |grid_cell|\n grid_cell.bottom_wall = true\n end\n\n (0..grid.length - 1).each do |j|\n grid[j][0].left_wall = true\n grid[j][grid[j].length - 1].right_wall = true\n end\nend", "title": "" }, { "docid": "835587f33f749107c10305cd169d81ae", "score": "0.45674333", "text": "def Transform3dFromMatrix3dAndFixedPoint3d(arg0, arg1)\n ret = _invoke(1610743934, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "1b999bece0928c6b85fac0d81ee1d372", "score": "0.45623586", "text": "def print_grid # prints 3 X 3 grid with values\n puts \"\\n\"\n @grid.each_slice(3) { |row| puts row.join(' | ') }\n puts \"\\n\"\n end", "title": "" }, { "docid": "d2cb9b55ae0f271cc1459e53e6c2ff3d", "score": "0.45609966", "text": "def InitGL(width, height) # We call this right after our OpenGL window \n # is created.\n\n glClearColor(0.0, 0.0, 0.0, 0.0) # This Will Clear The Background \n # Color To Black\n glClearDepth(1.0) # Enables Clearing Of The Depth Buffer\n glDepthFunc(GL_LESS) # The Type Of Depth Test To Do\n glEnable(GL_DEPTH_TEST) # Enables Depth Testing\n glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity() # Reset The Projection Matrix\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0) # Calculate The Aspect Ratio \n # Of The Window\n glMatrixMode(GL_MODELVIEW)\nend", "title": "" }, { "docid": "7c493bec97435bb5ba95c6730b663650", "score": "0.456035", "text": "def mutate()\n\t\t# make a copy of grid and fill it with zeros\n\t\ttemp = Array.new(@rows)\n\t\tfor i in (0...@rows)\n\t\t\ttemp[i] = Array.new(@cols)\n\t\t\ttemp[i].fill(0)\n\t\tend\n\n #\n\t\t# TO DO: set values in temp grid to next generation\n\t\t#\n\t\tfor k in 0...@rows\n\t\t\tfor h in 0...@cols\n\t\t\t\tif (@grid[k][h]==1 && getNeighbors(k, h) < 2)\n\t\t\t\t\ttemp[k][h] = 0\n\t\t\t\telsif (@grid[k][h]==1 && getNeighbors(k, h) >3)\n\t\t\t\t\ttemp[k][h] = 0\n\t\t\t\telsif (@grid[k][h]==0 && getNeighbors(k, h) == 3)\n\t\t\t\t\ttemp[k][h] = 1\n\t\t\t\telse\n\t\t\t\t\ttemp[k][h] = @grid[k][h]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\n\n\n # DO NOT DELETE THE CODE BELOW\n\t\t@grid = temp\n\tend", "title": "" }, { "docid": "f34e7b08b2c1ad508e5d46a76b24b3cf", "score": "0.4556873", "text": "def initialize()\n\t\t@gridColorXZ = [1.0, 0.0, 0.0, 0.0] #Red\n\t\t@gridColorXY = [1.0, 1.0, 0.0, 0.0] #Yellow\n\t\t@gridColorYZ = [0.0, 0.0, 1.0, 0.0] #Blue\n\t\t@gridLines = 10 # The number of lines in HALF the grid (just to make counting easier)\n\t\t@gridSpacing = 5.0\n\t\t@gridOn = true\n\tend", "title": "" }, { "docid": "ac58bc013159f6e39854ff420ec42596", "score": "0.45513928", "text": "def define_axes!\n\t\tsouth_neighbor, east_neighbor = northwest_corner.all_possible_neighbors\n\n\t\teast_edge = northwest_corner.matching_edge east_neighbor\n\t\tnorthwest_corner.orient! :east, east_edge\n\t\teast_neighbor.orient! :west, east_edge.reverse\n\t\t@tile_layout[0][1] = east_neighbor\n\n\t\tsouth_neighbor.orient! :north, northwest_corner.south_edge.reverse\n\t\t@tile_layout[1][0] = south_neighbor\n\tend", "title": "" }, { "docid": "c37db313c262c70cb231ba8fa6e56481", "score": "0.45418224", "text": "def render_matrix\n Matrix.rows render_rows\n end", "title": "" }, { "docid": "ee821cdd0e023ba3136cd64d63ccbeb9", "score": "0.454028", "text": "def build_geometry\n @outp = []\n @normp = []\n @inp = Array.new(NI){|i| Array.new(NJ){|j| Vec3D.new(i, j, rand(-3.0..3))}}\n uitang = Vec3D.new\n ujtang = Vec3D.new\n\n (0 ... RESI).each do |i|\n mui = i.fdiv(RESI - 1)\n row = []\n row_n = []\n (0 ... RESJ).each do |j|\n muj = j.fdiv(RESJ - 1)\n vect = Vec3D.new\n uitang.x, uitang.y, uitang.z = 0, 0, 0\n ujtang.x, ujtang.y, ujtang.z = 0, 0, 0\n (0 ... NI).each do |ki|\n bi = bezier_blend(ki, mui, NI)\n dbi = d_bezier_blend(ki, mui, NI)\n (0 ... NJ).each do |kj|\n bj = bezier_blend(kj, muj, NJ)\n dbj = d_bezier_blend(kj, muj, NJ)\n\n vect += inp[ki][kj] * bi * bj\n\n uitang += inp[ki][kj] * dbi * bj\n\n ujtang += inp[ki][kj] * bi * dbj\n end\n end\n vect += Vec3D.new(-NI / 2, -NJ / 2, 0)\n vect *= 100\n row << vect.to_a\n uitang.normalize!\n ujtang.normalize!\n row_n << uitang.cross(ujtang).to_a\n end\n @outp << row\n @normp << row_n\n end\nend", "title": "" }, { "docid": "a9f07ad1e5e245cf500f2d9626e3844b", "score": "0.45380405", "text": "def drawGrid(cX, cY, gX, gY)\n\t# Convert number of intersections into city blocks that start at 0\n\tgX = gX - 2\n\tgY = gY - 2\n\t\n\tg = \"\\t\"\t\n\tfor i in 0..gY\n\t\tcY == 0 && cX == i ? g << \"X____\" : g << \" ____\"\n\tend\n\tg << \"\\n\\t\"\n\tfor i in 0..gY * 2\n\t\tif i % 2 == 0\n\t\t\tfor y in 0..gX\n\t\t\t\ty == gX ? g << \"| |\" : g << \"| \"\n\t\t\tend\n\t\telse\n\t\t\tfor y in 0..gX\n\t\t\t\ty == gX ? g << \"|____|\" : g << \"|____\"\n\t\t\tend\n\t\tend\n\t\tg << \"\\n\\t\"\n end\t\n\tfor i in 0..gY\n\t\ti == gY ? g << \"|____|\" : g << \"|____\"\t\n\tend\n\n\treturn g\nend", "title": "" }, { "docid": "de44c82f418d1cea764b635322b3a6e3", "score": "0.45336315", "text": "def rotate_matrix(len, mtx)\n (0..(len / 2)).each do |layer|\n first = layer\n last = len - 1 - layer\n (first..last - 1).each do |i|\n top = mtx[first][i]\n mtx[first][i] = mtx[last - i][first] # TOP <-- LEFT\n mtx[last - i][first] = mtx[last][last - i] # LEFT <-- BOTTOM\n mtx[last][last - i] = mtx[i][last] # BOTTOM <-- RIGHT\n mtx[i][last] = top\n end\n end\n mtx\nend", "title": "" }, { "docid": "16a9546ceb9d42bd2597f0ae3614317d", "score": "0.45305035", "text": "def build_grid\n header = [\" \", \" a \", \" b \", \" c \", \" d \", \" e \", \" f \", \" g \", \" h \"]\n grid_display = @board.grid.map.with_index do |row, index|\n [8 - index] + build_row(row, index)\n end\n grid_display.unshift(header)\n end", "title": "" }, { "docid": "77719d1f4903e152a2f13f846002ed97", "score": "0.4530462", "text": "def test04()\n begin\n origModes = \"kCGBlendModeNormal kCGBlendModeMultiply kCGBlendModeScreen \"+\n \"kCGBlendModeOverlay kCGBlendModeDarken kCGBlendModeLighten \" + \n \"kCGBlendModeColorDodge kCGBlendModeColorBurn kCGBlendModeSoftLight \" +\n \"kCGBlendModeHardLight kCGBlendModeDifference kCGBlendModeExclusion \" +\n \"kCGBlendModeHue kCGBlendModeSaturation kCGBlendModeColor \" +\n \"kCGBlendModeLuminosity kCGBlendModeClear kCGBlendModeCopy \" +\n \"kCGBlendModeSourceIn kCGBlendModeSourceOut kCGBlendModeSourceAtop \" +\n \"kCGBlendModeDestinationOver kCGBlendModeDestinationIn \" +\n \"kCGBlendModeDestinationOut kCGBlendModeDestinationAtop kCGBlendModeXOR \" +\n \"kCGBlendModePlusDarker kCGBlendModePlusLighter\"\n blendModes = MIMeta.listcgblendmodes\n unless origModes.eql? blendModes\n raise \"Blend modes are different, new:\" + blendModes\n end\n\n origPresets = \"AlphaOnly8bpcInt Gray8bpcInt Gray16bpcInt Gray32bpcFloat \" +\n \"AlphaSkipFirstRGB8bpcInt AlphaSkipLastRGB8bpcInt \"+\n \"AlphaPreMulFirstRGB8bpcInt AlphaPreMulBGRA8bpcInt AlphaPreMulLastRGB8bpcInt \" +\n \"AlphaPreMulLastRGB16bpcInt AlphaSkipLastRGB16bpcInt \" +\n \"AlphaSkipLastRGB32bpcFloat AlphaPreMulLastRGB32bpcFloat \" +\n \"CMYK8bpcInt CMYK16bpcInt CMYK32bpcFloat PlatformDefaultBitmapContext\"\n presets = MIMeta.listpresets\n unless origPresets.eql? presets\n raise \"Presets are different, new:\" + presets\n end\n\n origCommands = [:getproperty, :setproperty, :getproperties, :setproperties,\n :create, :close, :closeall, :addimage, :export, :drawelement, :snapshot,\n :finalizepage, :getpixeldata, :calculategraphicsizeoftext, :renderfilterchain,\n :assignimagetocollection, :removeimagefromcollection, :processframes,\n :createtrack, :addinputtowriter, :addimagesampletowriter,\n :finishwritingframes, :cancelwritingframes, :addmovieinstruction,\n :inserttracksegment, :insertemptytracksegment]\n\n commands = MIMeta.listallcommands\n unless origCommands.eql? commands\n raise \"Command lists are different, new:\" + commands.to_s\n end\n\n origObjects = [:bitmapcontext, :imageimporter, :imageexporter,\n :imagefilterchain, :pdfcontext, :nsgraphiccontext,\n :movieimporter, :movieeditor, :videoframeswriter]\n objectTypes = MIMeta.listobjecttypes\n\n unless origObjects.eql? objectTypes\n raise \"List of objects is different, new:\" + commands.to_s\n end\n\n origInputVideoWriterPresets = \"h264preset_sd jpegpreset h264preset_hd \" +\n \"prores4444preset prores422preset\"\n \n videoWriterPresets = MIMeta.listvideoframewriterpresets\n unless origInputVideoWriterPresets.eql? videoWriterPresets\n raise \"List of video writer presets is different, new:\" + videoWriterPresets.to_s\n end\n\n origUserInterfaceFonts = \"kCTFontUIFontMiniEmphasizedSystem \" +\n \"kCTFontUIFontSmallToolbar kCTFontUIFontWindowTitle \" +\n \"kCTFontUIFontMenuTitle kCTFontUIFontSystem kCTFontUIFontMenuItem \" +\n \"kCTFontUIFontEmphasizedSystem kCTFontUIFontToolbar kCTFontUIFontMessage \" +\n \"kCTFontUIFontEmphasizedSystemDetail kCTFontUIFontSmallEmphasizedSystem \" +\n \"kCTFontUIFontUserFixedPitch kCTFontUIFontMiniSystem kCTFontUIFontLabel \" +\n \"kCTFontUIFontControlContent kCTFontUIFontSystemDetail kCTFontUIFontViews \"+\n \"kCTFontUIFontUser kCTFontUIFontSmallSystem kCTFontUIFontApplication\" +\n \"kCTFontUIFontToolTip\"\n \n userInterfaceFonts = MIMeta.listuserinterfacefonts\n unless userInterfaceFonts.eql? userInterfaceFonts\n raise \"User iterface fonts are different, new:\" + userInterfaceFonts\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: #{Smig.get_exitstring}\"\n end\n puts e.message\n puts e.backtrace.to_s\n puts #{Smig.exitstring}\"\n# exit 240\n end\nend", "title": "" }, { "docid": "b9496d650a6704275f50b3723aeac68d", "score": "0.4530186", "text": "def init_white_panel!\n grid.cells[grid.pos] = 1\n end", "title": "" }, { "docid": "2d19e412ca7d0421025d21cd2965fdef", "score": "0.45291716", "text": "def Matrix3dInverse(arg0)\n ret = _invoke(1610743900, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "7158a80e584bb2273545ed673175380f", "score": "0.4523477", "text": "def create_spaces\n ((@tiles, @tile_map),\n (@up_vtexs, @up_vtex_map),\n (@down_vtexs, @down_vtex_map),\n (@asc_edges, @asc_edge_map),\n (@desc_edges, @desc_edge_map),\n (@vert_edges, @vert_edge_map)) =\n [[Tile, nil, 1..5, [3,4,5,4,3], [1..3, 1..4, 1..5, 2..5, 3..5]],\n [Vtex, :up, 1..6, [3,4,5,6,5,4], [1..3, 1..4, 1..5, 1..6, 2..6, 3..6]],\n [Vtex, :down, 0..5, [4,5,6,5,4,3], [0..3, 0..4, 0..5, 1..5, 2..5, 3..5]],\n [Edge, :asc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 2..6, 3..6, 4..6]],\n [Edge, :desc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 1..5, 2..5, 3..5]],\n [Edge, :vert, 1..5, [4,5,6,5,4], [1..4, 1..5, 1..6, 2..6, 3..6]]\n ].map {|cls, align, row_interval, row_counts, col_intervals|\n rows = row_counts.zip(row_interval.to_a).map {|c, r| [r]*c}.flatten\n cols = col_intervals.map {|ival| ival.to_a}.flatten\n count = rows.length\n list = (0...count).to_a.map {|i| cls.new}\n list.each {|obj| obj.alignment = align} unless align.nil?\n list.zip(rows, cols).each {|obj, row, col| obj.row, obj.col = row, col}\n map = Hash[list.map {|obj| [[obj.row, obj.col], obj]}]\n [list, map]\n }\n\n @vtexs = @up_vtexs + @down_vtexs\n @edges = @asc_edges + @desc_edges + @vert_edges\n @all_spaces = @tiles + @vtexs + @edges\n\n @vtex_map = Hash[@vtexs.map {|v| [v.coords, v]}]\n @edge_map = Hash[@edges.map {|e| [e.coords, e]}]\n\n @all_spaces.zip((0...(@all_spaces.length)).to_a).each do |obj, id|\n obj.id = id\n end\n end", "title": "" }, { "docid": "23c7fe24e4333859f6d3d672f606f5fc", "score": "0.45220098", "text": "def grid_image\n s = ''\n s << \" %s %s %s \\n\" % [own(256), own(128), own(64)]\n s << \" %s %s %s \\n\" % [own(32), own(16), own(8)]\n s << \" %s %s %s \\n\" % [own(4), own(2), own(1)]\n s\n end", "title": "" }, { "docid": "ab1f1665e76ea21cbc0bf9a0d02d7df1", "score": "0.45196292", "text": "def Transform3dFromMatrix3dTimesTransform3d(arg0, arg1)\n ret = _invoke(1610743925, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "8f4ebf1d5b7e523032fd741c107bb185", "score": "0.45122972", "text": "def draw\n lastpixel = RuTui::Pixel.new(rand(255), rand(255), \".\")\n @map = Marshal.load( Marshal.dump( @smap )) # Deep copy\n\n # get all the objects\n @objects.each do |o|\n next if o.x.nil? or o.y.nil?\n o.each do |ri,ci,pixel|\n if !pixel.nil? and o.y+ri >= 0 and o.x+ci >= 0 and o.y+ri < @map.size and o.x+ci < @map[0].size\n # -1 enables a \"transparent\" effect\n if pixel.bg == -1\n pixel.bg = @map[o.y + ri][o.x + ci].bg if !@map[o.y + ri][o.x + ci].nil?\n pixel.bg = RuTui::Theme.get(:background).bg if pixel.bg == -1\n end\n if pixel.fg == -1\n pixel.fg = @map[o.y + ri][o.x + ci].fg if !@map[o.y + ri][o.x + ci].nil?\n pixel.fg = RuTui::Theme.get(:background).fg if pixel.fg == -1\n end\n\n @map[o.y + ri][o.x + ci] = pixel\n end\n end\n end\n\n out = \"\" # Color.go_home\n # and DRAW!\n @map.each do |line|\n line.each do |pixel|\n if lastpixel != pixel\n # out += RuTui::Ansi.clear_color if lastpixel != 0\n out << RuTui::Ansi.clear_color if lastpixel != 0\n if pixel.nil?\n # out += \"#{RuTui::Ansi.bg(@default.bg)}#{RuTui::Ansi.fg(@default.fg)}#{@default.symbol}\"\n out << \"#{RuTui::Ansi.bg(@default.bg)}#{RuTui::Ansi.fg(@default.fg)}#{@default.symbol}\"\n else\n # out += \"#{RuTui::Ansi.bg(pixel.bg)}#{RuTui::Ansi.fg(pixel.fg)}#{pixel.symbol}\"\n out << \"#{RuTui::Ansi.bg(pixel.bg)}#{RuTui::Ansi.fg(pixel.fg)}#{pixel.symbol}\"\n end\n lastpixel = pixel\n else\n if pixel.nil?\n # out += @default.symbol\n out << @default.symbol\n else\n # out += pixel.symbol\n out << pixel.symbol\n end\n end\n end\n end\n\n # draw out\n print out.chomp\n $stdout.flush\n end", "title": "" }, { "docid": "b50f933eae838323a990792279e7ddbd", "score": "0.45113286", "text": "def apply_rules_part2(grid)\n new_grid = deep_copy_grid(grid)\n (0..(grid.length - 1)).each do |row|\n (0..(grid[0].length - 1)).each do |col|\n\n if grid[row][col] == 'L' && num_visible_occupied(grid, row, col) == 0\n new_grid[row][col] = '#'\n elsif grid[row][col] == '#' && num_visible_occupied(grid, row, col) >= 5\n new_grid[row][col] = 'L'\n end\n\n end\n end\n\n new_grid\n end", "title": "" }, { "docid": "d4e47e7e49e54be5e94f1732392706a8", "score": "0.4510783", "text": "def setup\n size 640, 300, P3D\n @lens_d = 160\n @lens_list = []\n @xx, @yy, @dx, @dy = 0, 0, 3, 3\n \n # Create buffered image for lens effect.\n @lens_effect = create_graphics(width, height, P2D)\n \n # Load background image.\n @lens_effect.begin_draw\n @lens_effect.image(load_image('red_smoke.jpg'), 0, 0, width, height)\n @lens_effect.end_draw\n image(@lens_effect, 0, 0, width, height)\n \n # Create buffered image for warping.\n @lens_image = create_graphics(@lens_d, @lens_d, P2D)\n @lens_image2 = create_graphics(@lens_d, @lens_d, P2D)\n \n compute_lens_transformation\nend", "title": "" }, { "docid": "87943eea4b4f369ae087e605d45b82cd", "score": "0.4509729", "text": "def setup\n @matrix = Array.new(bordered_image.height) { Array.new(bordered_image.width, 0) }\n\n max_row_index = (bordered_image.height - invader.height)\n max_column_index = (bordered_image.width - invader.width)\n\n return max_row_index, max_column_index\n end", "title": "" }, { "docid": "4b2b36be06a72cb3908a5c9f9751bc4c", "score": "0.45084652", "text": "def setwindow3d(*)\n super\n end", "title": "" } ]
b2c36e89f2b929bc18211a0fb3cec509
Install in your DO_PATH a remote task === Examples You can install/update task with rake plugin:configuration plugin "configuration", "
[ { "docid": "f2875db879f371c6fe676b72f67d08a0", "score": "0.6755239", "text": "def plugin(name, repo)\n desc \"install #{name} plugin\"\n local(\"plugin:#{name}\" => :setup) do\n log \"\\e[36m## Installing plugin %s\\e[0m\" % name\n Dir.mkdir(DO_PATH) unless File.exist?(DO_PATH)\n sh \"curl --location --progress-bar #{repo} > #{File.join(DO_PATH, '%s.rake' % name)}\"\n end\n end", "title": "" } ]
[ { "docid": "5ad5375e1f494b407fab089f4e964ee2", "score": "0.72853726", "text": "def plugin(name, repo)\n desc \"install #{name} plugin\"\n namespace :plugin do\n task(name => 'setup') do\n log \"\\e[36m## Installing plugin %s\\e[0m\" % name\n Dir.mkdir(DO_PATH) unless File.exist?(DO_PATH)\n path = File.join(DO_PATH, '%s.rake' % name)\n sh :curl, '--location', '--progress-bar', repo, '>', path\n load_recipe(path)\n end\n end\n end", "title": "" }, { "docid": "ae8a52b6014ce81f7cd59fab07d72e57", "score": "0.6600198", "text": "def plugin(name, repo=nil, type=:git)\n PLUGINS << name\n namespace \"plugin\" do\n namespace name do\n plugin_dir = \"bundle/#{name}\"\n\n if File.directory?(plugin_dir)\n task :install do\n # noop, already installed\n end\n else\n\n if repo\n task :install do\n puts\n puts \"*\" * 80\n puts \"*#{\"Installing #{name}\".center(78)}*\"\n puts \"*\" * 80\n puts\n if repo\n clone type, repo, plugin_dir\n else\n directory plugin_dir\n end\n Dir.chdir(plugin_dir) { yield } if block_given?\n end\n else\n directory plugin_dir do\n puts\n puts \"*\" * 80\n puts \"*#{\"Installing #{name}\".center(78)}*\"\n puts \"*\" * 80\n puts\n Dir.chdir(plugin_dir) { yield } if block_given?\n end\n task :install => plugin_dir\n end\n\n end\n\n # desc \"update the #{name} plugin\"\n task :update do\n puts\n puts \"*\" * 80\n puts \"*#{\"Updating #{name}\".center(78)}*\"\n puts \"*\" * 80\n puts\n Dir.chdir(plugin_dir) do\n if File.directory?(\".git\")\n pull type\n end\n yield if block_given?\n end\n end\n end\n\n end\n\n # hook up the plugin tasks\n task :install_plugins => [\"plugin:#{name}:install\"]\n task :update_plugins => [\"plugin:#{name}:update\"]\n\nend", "title": "" }, { "docid": "cdd8e79fdf5b9a67674a9ae3c2a210ca", "score": "0.6557056", "text": "def define\n desc \"Create Ruby on Rails plug-in package\"\n task :rails_plugin do\n @dest = \"#@package_dir/#{@name}_#{@version}\"\n makedirs(@dest,:verbose=>false)\n @plugin_files.each do |fn|\n cp(fn, @dest,:verbose=>false)\n add_file(File.basename(fn))\n end\n \n @package_files.each do |fn|\n puts \". #{fn}\" if verbose\n f = File.join(@dest, fn)\n fdir = File.dirname(f)\n unless File.exist?(fdir)\n mkdir_p(fdir,:verbose=>false)\n add_folder(\"#{fdir}/\")\n end\n if File.directory?(fn)\n mkdir_p(f,:verbose=>false)\n add_folder(\"#{fn}/\")\n else\n cp(fn, f, :verbose=>false)\n add_file(fn)\n end\n end\n \n generate_index_files()\n end\n end", "title": "" }, { "docid": "38e7394c98057dbb6e9d7019c18561a4", "score": "0.65475863", "text": "def define\n desc \"Create Rails plug-in package\"\n task :rails_plugin do\n @dest = \"#@package_dir/#{@name}_#{@version}\"\n makedirs(@dest,:verbose=>false)\n @plugin_files.each do |fn|\n cp(fn, @dest,:verbose=>false)\n add_file(File.basename(fn))\n end\n\n @package_files.each do |fn|\n puts \". #{fn}\" if verbose\n f = File.join(@dest, fn)\n fdir = File.dirname(f)\n unless File.exist?(fdir)\n mkdir_p(fdir,:verbose=>false)\n add_folder(\"#{fdir}/\")\n end\n if File.directory?(fn)\n mkdir_p(f,:verbose=>false)\n add_folder(\"#{fn}/\")\n else\n cp(fn, f, :verbose=>false)\n add_file(fn)\n end\n end\n\n generate_index_files()\n end\n end", "title": "" }, { "docid": "4868502fdd627d1536e408609cf8b28d", "score": "0.6532954", "text": "def install_plugin(plugin_url)\n system(\"#{ruby_bin} #{plugin_script} install #{plugin_url}\")\n end", "title": "" }, { "docid": "96782af23452175077cef197baca003b", "score": "0.62974006", "text": "def install_tasks\n load 'falkorlib/tasks/git.rake'\n load 'falkorlib/tasks/gitflow.rake'\n end", "title": "" }, { "docid": "88a601df8e2495c5d9eef66434d01ea3", "score": "0.61410373", "text": "def install\n AdminModule.configuration.credentials.keys.each do |e|\n valid_actions.each do |action|\n AdminModule::Rake::PpmTasks.new(\"am:#{e}:ppm:#{action}\", \"#{action} #{e} ppms\") do |t|\n t.env = e\n t.action = action\n end\n end\n end\n end", "title": "" }, { "docid": "f5f583bd95a04ccf58ce82483a9d8d48", "score": "0.60430104", "text": "def install\n plugin_title = @argv[1]\n graph_title = @argv[2]\n iptables_tags = @argv[3]\n\n target = File.expand_path(__FILE__)\n fname = \"#{File.basename target}_#{plugin_title}\"\n\n # plugin symlink\n system \"ln -s #{target} /etc/munin/plugins/#{fname}\"\n\n # munin_node_conf\n munin_node_conf = \"\\n[#{fname}]\\nuser root\\n\"\n munin_node_conf += \"env.GRAPH_TITLE #{graph_title}\\n\\n\"\n munin_node_conf += \"env.TAGS #{iptables_tags}\\n\\n\"\n\n File.open('/etc/munin/plugin-conf.d/munin-node', 'a').write munin_node_conf\n end", "title": "" }, { "docid": "2f861fd7e811efb7c91937ca9fbf2cad", "score": "0.59637755", "text": "def install\n end", "title": "" }, { "docid": "f65a79d1e1c92a80e420c29a0110b978", "score": "0.5963575", "text": "def install\n end", "title": "" }, { "docid": "f65a79d1e1c92a80e420c29a0110b978", "score": "0.5963575", "text": "def install\n end", "title": "" }, { "docid": "a409d59d3c6a59af1fb37d27e9a95cbb", "score": "0.5928617", "text": "def setup_plugin\n if options[:list] || plugin_file.nil?\n list_plugins\n else # executing the plugin instructions\n self.destination_root = options[:root]\n if in_app_root?\n self.behavior = :revoke if options[:destroy]\n execute_runner(:plugin, plugin_file)\n else\n say \"You are not at the root of a Padrino application! (config/boot.rb not found)\"\n end\n end\n end", "title": "" }, { "docid": "b314644ed819278cc2098b45f070a04b", "score": "0.592753", "text": "def install\n invoke \"totem:lodestar:install:javascripts\"\n invoke \"totem:lodestar:install:stylesheets\"\n invoke \"totem:lodestar:install:images\"\n invoke \"totem:lodestar:install:configs\", [file_name]\n invoke \"totem:lodestar:install:databases\", [file_name]\n invoke \"totem:lodestar:install:routes\"\n invoke \"totem:lodestar:install:documents\"\n invoke \"totem:lodestar:install:travis_ci\", [file_name]\n invoke \"totem:lodestar:install:views\", [file_name]\n end", "title": "" }, { "docid": "007ab463a5a216ee87463ad0a89f56d9", "score": "0.5896712", "text": "def install_plugin(plugin, opts = {})\n @logger.info \"install #{plugin}\"\n dependency = Gem::Dependency.new plugin, opts[:version]\n path = dependency.name =~ /\\.gem$/i ? dependency.name : Gem::RemoteFetcher.fetcher.download_to_cache(dependency) \n raise \"Gem '#{plugin}' not fetchable.\" unless path\n basename = File.basename path, '.gem'\n # remvoe version\n basename = basename.gsub(/-[\\d]+\\.[\\d]+\\.[\\d]+$/, \"\")\n target_dir = File.join(@plugin_dir, basename)\n if opts[:force] == true\n @logger.info \"remove old #{target_dir}\"\n FileUtils.rm_r target_dir if File.exist?(target_dir)\n else\n raise \"#{target_dir} alrady exist\" if File.exist?(target_dir)\n end\n FileUtils.mkdir_p target_dir\n if opts[:unpack]\n installer = Gem::Installer.new(path, :unpack=>true)\n installer.unpack target_dir\n else\n installer = Gem::DependencyInstaller.new\n installer.install path\n installed_dir = Gem::Installer.new(path).dir\n init_rb = File.join(installed_dir, \"init.rb\")\n FileUtils.cp(init_rb, target_dir)\n end\n @logger.info \"#{path} installed: #{target_dir}'\"\n end", "title": "" }, { "docid": "1467b95eb67a7f3a7343adadcbbfba46", "score": "0.5893584", "text": "def install\n run \"bundle exec backup generate:config --config-path=config/backup\" unless File.exists?(\"config/backup/config.rb\")\n template \"general.rb\", \"config/backup/models/general.rb\"\n if File.exists? \".env\"\n append_file \".env\" do\n File.read(File.expand_path(find_in_source_paths('env.env')))\n end\n else\n template \"env.env\", \".env\"\n end\n run \"bundle exec wheneverize .\" unless File.exists?(\"config/schedule.rb\")\n append_file \"config/schedule.rb\" do\n File.read(File.expand_path(find_in_source_paths('schedule.rb')))\n end\n end", "title": "" }, { "docid": "b85340e30d938c91a3c7fed9b489c78e", "score": "0.5878032", "text": "def install uri\n execute(:install, uri)\n end", "title": "" }, { "docid": "57ee3c93d0c8132df548fa6f234f186e", "score": "0.5865218", "text": "def install\n \n end", "title": "" }, { "docid": "8e9711709a5d55e9845272876fb1f2fa", "score": "0.58644134", "text": "def install\n #python executable files\n end", "title": "" }, { "docid": "3c67db51929a96289089e9699784f7eb", "score": "0.5855978", "text": "def exec_setup\n exec_task_traverse 'setup'\n end", "title": "" }, { "docid": "a0e248391f17d5d979bbd79451b076b8", "score": "0.58546245", "text": "def install\n bin.install \"job\"\n end", "title": "" }, { "docid": "1c543db37dd6f89877cfcf8a96a6c8f0", "score": "0.5829638", "text": "def install\n # Delayed so that Rake doesn't need to be loaded to run this file.\n extend ::Rake::DSL\n\n # Rename the original release task.\n release_task = ::Rake.application.lookup('release')\n if release_task\n release_actions = release_task.actions.dup\n task 'release:original' => release_task.prerequisites.dup do\n release_actions.map(&:call)\n end\n release_task.clear\n end\n\n # No-op Bundler's release:source_control_push task.\n source_control_push_task = ::Rake.application.lookup('release:source_control_push')\n source_control_push_task.clear if source_control_push_task\n\n # Tag the release.\n task 'release:tag' do\n tag_release!(commit: false)\n end\n\n # Make the new release tasks.\n desc \"Bump, tag, and release #{gem_name}\"\n task 'release' do\n release_gem!(:patch)\n end\n\n desc \"Bump minor, tag, and release #{gem_name}\"\n task 'release:minor' do\n release_gem!(:minor)\n end\n\n desc \"Bump major, tag, and release #{gem_name}\"\n task 'release:major' do\n release_gem!(:major)\n end\n end", "title": "" }, { "docid": "99ec261c4113cdebdae67033ba86c99c", "score": "0.582548", "text": "def define\n namespace :install do\n @project.builds.each do |build,packages|\n path = packages[:gem]\n\n task build => path do\n status \"Installing #{File.basename(path)} ...\"\n\n install(path)\n end\n end\n end\n\n desc \"Installs all built gem packages\"\n gemspec_tasks :install\n\n task :install_gem => :install # backwards compatibility with Hoe\n end", "title": "" }, { "docid": "004ecdafae61c072397bb0ac9b051ded", "score": "0.5818935", "text": "def plugin options = {}\n options.to_options!\n chroot do\n util.spawn \"#{ Bj.ruby } ./script/plugin install http://codeforpeople.rubyforge.org/svn/rails/plugins/bj --force\", options\n end\n end", "title": "" }, { "docid": "4c63b6944155760c4a4a8b35ec6af69e", "score": "0.5805616", "text": "def _run_plugin(clazz, env, cwd, task)\n clusterId = task['clusterId']\n hostname = task['config']['hostname']\n provider = task['config']['provider']['description']\n imagetype = task['config']['imagetype']\n hardware = task['config']['hardwaretype']\n taskName = task['taskName'].downcase\n log.info \"Creating node #{hostname} on #{provider} for #{clusterId} using #{imagetype} on #{hardware}\" if taskName == 'create'\n\n object = clazz.new(env, task)\n FileUtils.mkdir_p(cwd)\n Dir.chdir(cwd) do\n result = object.runTask\n log.info \"#{clusterId} on #{hostname} could not be deleted: #{result['message']}\" if taskName == 'delete' && result['status'].nonzero?\n result\n end\n end", "title": "" }, { "docid": "c36232950a393e0dfcaede8c81ae2c67", "score": "0.5803009", "text": "def install\n bin.install \"bin/vh-config\"\n end", "title": "" }, { "docid": "3010833f7daa8972c7e0392e2d3aabd4", "score": "0.5788427", "text": "def action_install\n grunt_package.run_action(:install)\n wh_package.run_action(:install)\n new_resource.installed = true\n end", "title": "" }, { "docid": "0a573a39a1c88dc3ed721b968d1fc639", "score": "0.57654047", "text": "def package_plugin(name)\n `cd #{@repository_path}; rake feather:package path=#{name} target=#{@build_path}`\n end", "title": "" }, { "docid": "eeaa1dda4aa128ee9b8ee0de1f594506", "score": "0.57142556", "text": "def action_install\n remote_file.run_action(:create)\n package.run_action(:install)\n new_resource.installed = true\n end", "title": "" }, { "docid": "eff20afef857d1ea7e4427296f26e477", "score": "0.5710302", "text": "def install\n desc \"Update README (table of contents)\"\n task :doc do\n builder.doc\n end\n\n desc \"Clean gem artifacts\"\n task :clean do\n builder.clean\n end\n\n task :validate do\n builder.validate\n end\n\n desc \"Build #{gem_spec.package_file_name} package\"\n task build: %i[clean doc validate] do\n builder.build gem_spec\n end\n\n desc \"Install #{gem_spec.package_file_name} package\"\n task install: :build do\n builder.install gem_spec\n end\n\n desc \"Build, tag as #{gem_spec.version_label} (#{signed_label}), \" \\\n \"and push #{gem_spec.package_file_name} to RubyGems\"\n task publish: :build do\n publisher.publish\n end\n end", "title": "" }, { "docid": "0616832d3e7576a9dd9ebf56a442be8d", "score": "0.5705559", "text": "def add_remote_task(task_name)\n heroku.run_task(task_name)\n end", "title": "" }, { "docid": "c1d0b97bff9654765c454b0822fbb4b0", "score": "0.5705506", "text": "def remote_rake(task)\n on primary(:app) do\n within current_path do\n with rails_env: fetch(:rails_env) do\n rake task\n end\n end\n end\n end", "title": "" }, { "docid": "2c15dbe0c661bf9887f7fd1fc3ecf83d", "score": "0.56862175", "text": "def install\n # nothing to do\n end", "title": "" }, { "docid": "a52d437206a26290626db1294d2de70f", "score": "0.56793517", "text": "def define\n desc \"Create & migrate the DB for your named TIMESHEET\"\n task \"#{@name}:prepare\", [:timesheet] => [\"#{@name}:env\"] do |t, args|\n Enrar::Migrator.new.migrate!\n end\n\n desc \"Print the URL for the provided TIMESHEET\"\n task \"#{@name}:url\", [:timesheet] => [\"#{@name}:env\"] do |t, args|\n require 'socket'\n ip = Socket::getaddrinfo(Socket.gethostname,\"echo\",Socket::AF_INET)[0][3]\n puts \"http://#{ip}:#{@config[:port] || 8912}/\"\n end\n\n task \"#{@name}:env\", [:timesheet] do |t, args|\n @timesheet = File.expand_path('~/.secretary') unless args[:timesheet]\n @config = Vim::Secretary::Config.from_timesheet(@timesheet)\n end\n\n self\n end", "title": "" }, { "docid": "bce39f11eb907a200d15e8954bcb333a", "score": "0.5667722", "text": "def install\n end", "title": "" }, { "docid": "c9f0580e3b61d1b3a571882956fdb5ab", "score": "0.5665884", "text": "def execute_installation\n #start logging\n set_log_file @options[:log]\n \n download_and_decompress(@options[:prefix], [REDIS_URL, SQLITE3_URL, NGINX_URL])\n \n install_redis if @options[:redis]\n install_sqlite\n configure_nginx @options\n\n install_all_gems\n install_rhoconnect\n \n #remove downloaded tarballs\n cleanup options[:prefix]\n end", "title": "" }, { "docid": "f3f7ff6c408dae969bba0d44ca72cd40", "score": "0.5665111", "text": "def install\n yaourt('--noconfirm', '-Sy', @resource[:name])\n end", "title": "" }, { "docid": "beb7ee341fac907c28419b41064d3346", "score": "0.5659422", "text": "def install\n plugin = Mortar::Plugin.new(shift_argument)\n validate_arguments!\n\n action(\"Installing #{plugin.name}\") do\n begin\n record_usage(\"plugin_install\", plugin.name)\n if options[:branchname]\n plugin.install(options[:branchname])\n else\n plugin.install\n end\n Mortar::Plugin.load_plugin(plugin.name)\n rescue StandardError => e\n error e.message\n end\n end\n end", "title": "" }, { "docid": "28add4f3d40dd4d973f0a9476463de21", "score": "0.5649668", "text": "def install(env); end", "title": "" }, { "docid": "009d0919d0721c285882e75217e97943", "score": "0.56433237", "text": "def configure_tasks\n end", "title": "" }, { "docid": "b49cf64dc3b8f112b98e40348ec853c4", "score": "0.55973506", "text": "def install_custom!\n remote_file local_path do\n source new_resource.source.to_s\n checksum new_resource.checksum unless new_resource.checksum.nil?\n end\n dpkg_package local_path\n end", "title": "" }, { "docid": "5ea78ebb4c3690d3d82dcf84a28d80e5", "score": "0.55756366", "text": "def install\n AdminModule.configuration.credentials.keys.each do |e|\n valid_actions.each do |action|\n AdminModule::Rake::SnapshotTasks.new(\"am:#{e}:snapshot:#{action}\", \"#{action} #{e} snapshot defn(s)\") do |t|\n t.env = e\n t.action = action\n end\n end\n end\n end", "title": "" }, { "docid": "52c23406bc88131b4d120e07cfc2a3d9", "score": "0.5571175", "text": "def install\n command = resource_or_provider_command\n self.class.validate_command(command)\n\n command_options = get_install_command_options\n execute([command, command_options])\n end", "title": "" }, { "docid": "67be58a6d081f66a071d9287939e454b", "score": "0.5551163", "text": "def run_install(install_path)\n require 'fileutils'\n install_path ||= '.'\n FileUtils.mkdir_p install_path unless File.exists?(install_path)\n install_file \"#{CC_ROOT}/config/config.example.yml\", \"#{install_path}/config.yml\"\n install_file \"#{CC_ROOT}/config/config.example.ru\", \"#{install_path}/config.ru\"\n install_file \"#{CC_ROOT}/config/database.example.yml\", \"#{install_path}/database.yml\"\n install_file \"#{CC_ROOT}/actions\", \"#{install_path}/actions\", true\n end", "title": "" }, { "docid": "006872ac026c8a6dcffd346e901ab26e", "score": "0.5537979", "text": "def _install\n args = Array.new\n # If the project contains a makefile, it is a candidate for a derivative build.\n # In such case, protect 'libraries', 'modules' and 'themes' subdirectories\n # from deletion.\n if component.makefile\n args << '-f' << 'P /libraries/***' # this syntax requires rsync >=2.6.7.\n args << '-f' << 'P /modules/***'\n args << '-f' << 'P /profiles/***'\n args << '-f' << 'P /themes/***'\n end\n if component.drupal?\n args = Array.new\n args << '-f' << 'R /profiles/default/***' # D6\n args << '-f' << 'R /profiles/minimal/***' # D7\n args << '-f' << 'R /profiles/standard/***' # D7\n args << '-f' << 'R /profiles/testing/***' # D7\n args << '-f' << 'P /profiles/***'\n args << '-f' << 'R /sites/all/README.txt'\n args << '-f' << 'R /sites/default/default.settings.php'\n args << '-f' << 'P /sites/***'\n end\n args << '-a'\n args << '--delete'\n component.ignore_paths.each { |p| args << \"--exclude=#{p}\" }\n dst_path = platform.local_path + platform.dest_path(component)\n dont_debug { dst_path.mkpath }\n args << component.local_path.to_s + '/'\n args << dst_path.to_s + '/'\n begin\n runBabyRun 'rsync', args\n rescue => ex\n odie \"Installing or updating #{component.name} failed: #{ex}\"\n end\n end", "title": "" }, { "docid": "385a63bae5a8fec16fb9bf340c458032", "score": "0.5528398", "text": "def action_install(type)\n from = Automation::Converter.to_unix_path(prompt('Install from : '))\n package_rb = File.join(from, 'package.rb')\n require package_rb\n\n raise Automation::ConsoleError.new(\"No definition found for package '#{package_rb}'\") unless PACKAGE_CLASS.has_key?(package_rb)\n plugin = PACKAGE_CLASS[package_rb].new\n plugin.install(from)\n puts \"Installed '#{type}' - #{plugin.name}\"\n end", "title": "" }, { "docid": "186244719affc947edd2420d13155b6d", "score": "0.54939145", "text": "def prepare_deploy(t, args)\n set_verbosity(args)\n\n plugins_dir = Pathname.new(\"#{args.plugin_dir || '/var/tmp/bundles/plugins/ruby'}\").expand_path\n mkdir_p plugins_dir, :verbose => @verbose\n\n plugin_path = plugin_path(plugins_dir, false) # \"#{plugins_dir}/#{name}\"\n if plugin_path.exist?\n if args.force == \"true\"\n safe_unlink plugin_path # if link (deploy:dev) just remove the link\n if plugin_path.exist?\n @logger.info \"Deleting previous plugin deployment #{plugin_path}\"\n rm_rf plugin_path, :verbose => @verbose if plugin_path.exist?\n else\n @logger.info \"Unlinked previous plugin deployment #{plugin_path}\"\n end\n else\n raise \"Cowardly not deleting previous plugin deployment #{plugin_path} - override with rake #{t.name}[true]\"\n end\n end\n plugins_dir\n end", "title": "" }, { "docid": "91c0ae7992e3813b2d1b8d024f40f10a", "score": "0.54890287", "text": "def plugin(name, options)\n puts \"installing plugin #{name}\"\n in_root do\n if options[:svn] || options[:git]\n `script/plugin install #{options[:svn] || options[:git]}`\n else\n puts \"! no git or svn provided for #{name}. skipping...\"\n end\n end\n end", "title": "" }, { "docid": "de6a26a1b35a3a5505b2577a9d00aa8d", "score": "0.5482786", "text": "def install\n pluginpath = Pathname.new(\"#{ENV['HOME']}/.packer.d/plugins\")\n\n unless File.directory?(pluginpath)\n mkdir_p(pluginpath)\n end\n\n cp_r Dir[\"*\"], pluginpath\n bin.install Dir['*']\n end", "title": "" }, { "docid": "a35d19011fa1b74b4afb12e383306770", "score": "0.5482068", "text": "def create_tasks\n Application.features[self].each{ |f|\n extend Rake::DSL\n taskname = \"#{f.to_s.split('::').last}\"\n desc \"Feature\"\n task taskname => [\"#{taskname}:install\"] do\n end\n namespace taskname do\n desc \"install #{taskname}\"\n task :install do\n puts \"----> installing #{taskname}\"\n puts \"#{self} | #{f}\"\n Application.install[f.name].each{ |c|\n puts \"#{c}\"\n }\n end\n end \n } if Application.features[self]\n end", "title": "" }, { "docid": "a4f81e7b8332752f6d524383a8e19cfc", "score": "0.5473086", "text": "def install(pkg)\n package pkg do\n action :install\n end\nend", "title": "" }, { "docid": "ad18d80f53a1f563c5bb83244062e2ad", "score": "0.5464733", "text": "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "title": "" }, { "docid": "d70d6d44f1922825f3c1f7aebf828078", "score": "0.54637766", "text": "def puppet_installation\n `cd #{self.project_root} && BUNDLE_GEMFILE=Gemfile bundle exec cap #{self.environment} deploy:prepare_installation:puppet -S phase=node_prepare HOSTS=#{self.hostname}`\n end", "title": "" }, { "docid": "1bbcd1f9223f9589b8b5d48a4e3eb29f", "score": "0.5458816", "text": "def remote_rake_executable\n rake.remote_executable\n end", "title": "" }, { "docid": "87c8729004fbe3af4d51f406ec7fcf0c", "score": "0.5454447", "text": "def action_create\n\n install_prerequisites\n\n node.set['pedant'][new_resource.variant]['etc_dir'] = new_resource.config_dir\n\n directory new_resource.config_dir do\n owner new_resource.user\n group new_resource.group\n mode \"0755\"\n recursive true\n end\n\n source_dir = \"#{new_resource.checkout_dir}/#{new_resource.variant}\"\n\n git new_resource.variant do\n destination source_dir\n repository \"git@github.com:opscode/#{new_resource.variant}.git\"\n revision new_resource.revision\n user new_resource.git_user\n end\n\n node.set['pedant'][new_resource.variant]['dir'] = \"/srv/#{new_resource.variant}\"\n\n link node['pedant'][new_resource.variant]['dir'] do\n to source_dir\n end\n\n template \"#{new_resource.config_dir}/pedant_config.rb\" do\n source new_resource.config_template\n owner new_resource.user\n group new_resource.group\n mode \"0644\"\n variables(new_resource.variables)\n end\n\n execute \"bundle install\" do\n cwd node['pedant'][new_resource.variant]['dir']\n # user \"opscode\"\n end\n\nend", "title": "" }, { "docid": "b454c140f05cd7024a554c5044287287", "score": "0.5447291", "text": "def setup_tasks\n namespace(:npm) do\n desc 'Build package.json from template'\n task :'package.json' do\n template = ERB.new(File.read(File.join(src, 'package.json.erb')))\n generated = template.result_with_hash(scope: SCOPE, gemspec: gemspec, contributors: contributors)\n File.write(File.join(src, 'package.json'), JSON.pretty_generate(JSON.parse(generated)))\n end\n\n desc 'Ensure the destination directory exist'\n task :dest do\n FileUtils.mkdir_p(dest)\n end\n\n desc 'Build package tarball into the pkg directory'\n task build: %i[package.json dest] do\n system(\"cd #{src} && npm pack --pack-destination #{dest}/\")\n end\n\n desc 'Build and push package to npmjs.com'\n task release: %i[build] do\n system(\"npm publish #{tarball} --access public\")\n end\n end\n end", "title": "" }, { "docid": "c95138e0e9e3ca6271844df140dec633", "score": "0.5439393", "text": "def main\n generate_config unless $dont_gen_conf\n\n if $just_gen_conf\n puts \"\\nSkips installing, just generated the config file!\".pink\n exit(0)\n end\n \n install_dependencies if $install_req\n\n install_to_directory\nend", "title": "" }, { "docid": "4dfdff5c63a02da0b6a51174735b1bf2", "score": "0.5432215", "text": "def prepare_for_installation; end", "title": "" }, { "docid": "2861160e820ce7dbb188fe3cbf19db15", "score": "0.54258984", "text": "def _install\n args = Array.new\n args << '-a'\n args << '--delete'\n component.ignore_paths.each { |p| args << \"--exclude=#{p}\" }\n dst_path = platform.local_path + platform.contrib_path + component.target_path\n dont_debug { dst_path.mkpath }\n args << component.local_path.to_s + '/'\n args << dst_path.to_s + '/'\n begin\n runBabyRun 'rsync', args\n rescue => ex\n odie \"Installing or updating library #{component.name} failed: #{ex}\"\n end\n end", "title": "" }, { "docid": "4a7384af940616cc842751be94a6c607", "score": "0.5425272", "text": "def install\n cd(@project_name) do\n puts `rake db:automigrate`\n puts `rake action=\"all\" dev:gen:view`\n puts `thor merb:gem:install`\n puts `bin/rake doc:diagrams`\n end\n end", "title": "" }, { "docid": "b2995f288d8eccd0c690079609eb299b", "score": "0.54247373", "text": "def install\n\t install_dir(plugin_dirs) do |file|\n\t\tnext if file =~ /ROBOT/\n\t\tfile\n\t end\n\tend", "title": "" }, { "docid": "89f74211c9ce6d0dc9350c27ae7bc8a1", "score": "0.5414665", "text": "def from_instructions\n \"cd #{Dubya.root_path} && bundle exec rake update\"\n end", "title": "" }, { "docid": "7b4bb02678df6118acc5c5c9626e2e1c", "score": "0.54023665", "text": "def define\n logger.debug \"Defining tasks for #{name} #{version}\"\n\n namespace \"#{name}\" do\n define_download\n define_verify\n define_unpack\n define_patch\n define_build\n define_install\n\n task :done => \"#{name}:install\"\n task :default => \"#{name}:done\"\n end\n\n desc \"Build and Install #{name} #{version}\"\n task name => \"#{name}:default\"\n end", "title": "" }, { "docid": "eb12a9afd25aa7a28878db538e668f43", "score": "0.5393737", "text": "def install_plugins\n download_plugins\n generate_goodies_includes\nend", "title": "" }, { "docid": "6bad589108f7d192361de468e444717e", "score": "0.53918505", "text": "def action_install\n run_package_action(:install)\n end", "title": "" }, { "docid": "3393f4554f032269ce3c93def998f4c2", "score": "0.5389915", "text": "def install\n bin.install \"testscript\"\n end", "title": "" }, { "docid": "c7c0b80532a57792c27249b9f139b1bd", "score": "0.5386764", "text": "def install_plugin(plugin)\n system \"vagrant plugin install #{plugin}\" unless Vagrant.has_plugin? plugin\nend", "title": "" }, { "docid": "c7c0b80532a57792c27249b9f139b1bd", "score": "0.5386764", "text": "def install_plugin(plugin)\n system \"vagrant plugin install #{plugin}\" unless Vagrant.has_plugin? plugin\nend", "title": "" }, { "docid": "e8ccc6cb08ee1e7582377009fcb2a10b", "score": "0.536539", "text": "def install(local: false)\n\tpath = self.build\n\t\n\t@helper.install_gem(path, local)\nend", "title": "" }, { "docid": "bccc1f54d1db3fd0eefb9b657ada836f", "score": "0.5364081", "text": "def install\n Dir.chdir(DATA) do\n read_config\n end\n Install.new(@config)\n end", "title": "" }, { "docid": "1a749004567b49254b43763abaf8ffef", "score": "0.5363138", "text": "def install\n bin.install \"email-backup\"\n end", "title": "" }, { "docid": "d43ca8e796882f760a704091c2933e6d", "score": "0.5359702", "text": "def capify_this_shit\n inject_into_file 'Capfile', after: '# Include tasks from other gems included in your Gemfile' do\n <<-RUBY\n\nrequire 'capistrano/rails'\nrequire 'capistrano/bundler'\nrequire 'capistrano/rails/migrations'\n\n RUBY\n end\n end", "title": "" }, { "docid": "1ef948575f1337a5db0cd85387728bab", "score": "0.53520447", "text": "def install\n bin.install \"tcho\"\n end", "title": "" }, { "docid": "4488e54509621dc7b54b1d40632cdeac", "score": "0.5340706", "text": "def execute\n Tools.public_send(command, options.configuration_path)\n end", "title": "" }, { "docid": "c377227771025a94999e6424e8396b7f", "score": "0.5339956", "text": "def run_if_installed(output = true, &blk)\n return yield if Config.installed?\n inform \"You need to run `dotify setup` before you can run this task.\" if output\n end", "title": "" }, { "docid": "5ee91310be856b573efad992684e0cf6", "score": "0.5338036", "text": "def post_install; end", "title": "" }, { "docid": "39efe4c477bcd540238f4f7a4c352642", "score": "0.53365177", "text": "def install_gem; end", "title": "" }, { "docid": "0137af4d6f90c841820f24cde5479453", "score": "0.5327383", "text": "def publish!\n mkdir_p File.join(self.publish_path, self.to_s)\n self.targets.each do |tgt|\n install File.join(self.to_s, tgt), File.join(self.publish_path, self.to_s, tgt)\n end\n end", "title": "" }, { "docid": "e1d52cabba64f9ef5cb1ba099f5ad088", "score": "0.53198993", "text": "def manual_package_install(pkg_dependencies=[])\n\n unless pkg_dependencies.nil?\n pkg_dependencies.each do |pkg|\n\n if pkg =~ /\\.rpm/\n filename = $1 if pkg =~ /\\/(\\w+[a-zA-Z0-9\\-\\_\\.]+\\.rpm)\\z/\n p \"FILENAME: #{filename}\"\n remote_file \"#{Chef::Config[:file_cache_path]}/#{filename}\" do\n source \"#{pkg}\"\n action :create_if_missing\n end\n end\n\n package pkg do\n action :install\n if pkg =~ /\\.rpm/\n source \"#{Chef::Config[:file_cache_path]}/#{filename}\"\n provider Chef::Provider::Package::Rpm\n end\n end\n\n end\n end\n\nend", "title": "" }, { "docid": "ec2249b0299477d2607c15171ec09c1a", "score": "0.53168935", "text": "def define_maven_package_task\n [ MVN_STATE_FILE, MVN_STATE_FILE_INSTALL ].each do |sf|\n file sf => maven_dependencies do\n run_maven\n end\n end\n\n task :install => MVN_STATE_FILE_INSTALL\n end", "title": "" }, { "docid": "6c65f75b109e87a8ebe239ae304e95ca", "score": "0.5309985", "text": "def install\n nil\n end", "title": "" }, { "docid": "d3e0e302e140cd4c43e3e857ee89a438", "score": "0.52964437", "text": "def install\n bin.install \"#{PACKAGE_NAME}\"\n end", "title": "" }, { "docid": "ad249f07e4904b3e71c4c07f9dffda1a", "score": "0.529554", "text": "def install!\n error = nil\n return if @installed\n\n return if @installing\n @installing = true\n\n # $stderr.puts \" #{self} install! #{@file.inspect}\"\n\n # Create a new builder, use the plugin's\n # block to execute the DSL.\n Builder.factory.new(:plugin => self, :default_doc => documentation, &@block)\n\n @installed = true\n\n rescue Exception => err\n error = err\n raise Error.new(:message => \"In plugin #{name.inspect} (in #{file}): #{err.message}\", :error => err)\n \n ensure\n @installing = false\n if @installed && ! error\n # $stderr.puts \" #{self} plugin_installed!\"\n\n # Notify callback.\n self.plugin_installed!\n\n # Notify any active observers (i.e. Loader) so\n # it can associate existing plugins with the proper Components.\n # See comp.spec.\n @manager.notify_observers(:plugin_installed, self)\n end\n end", "title": "" }, { "docid": "7129e792ae1f0e12ce5882baeac9bacd", "score": "0.52895945", "text": "def post_install\n end", "title": "" }, { "docid": "9fa541bad6f591ba58ba270b0bc1055f", "score": "0.52863646", "text": "def create_task step, steps\n task = Rake::Task::define_task( step[ :task ] => steps.collect{ | s | s[ :task ] } ) do | task, arguments |\n tags = build_tags step, steps\n\n if cloud.exists? tags\n puts \"image \\'#{step[ :name ]}\\' already up to date and exists:\"\n tags.each{ | key, value | puts \"\\'#{key}\\' => \\'#{value}\\'\" } \n else\n puts \"starting instance for: \\'#{step[ :name ]}\\'\"\n instance = cloud.start_instance initial_image_id( step, steps )\n puts \"instance for: \\'#{step[ :name ]}\\' started.\"\n\n begin\n dns_name = cloud.dns_name instance\n expand_step = step.dup.merge( setup_name: expand_path( step[ :setup_name ] ) )\n expand_step[ :tags ] = tags \n \n puts \"excuting installation for: \\'#{step[ :name ]}\\'\"\n setup.execute expand_step, dns_name \n puts \"installation for: \\'#{step[ :name ]}\\' done.\"\n\n puts \"storing image for: \\'#{step[ :name ]}\\'\"\n cloud.store_image instance, tags\n puts \"image for: \\'#{step[ :name ]}\\' stored\"\n rescue\n cloud.stop_instance instance\n raise\n end \n end \n end\n\n task.add_description( step[ :description ] ) if step.key? :description\n task\n end", "title": "" }, { "docid": "b7894da593f0092eab2b38cf8d00912e", "score": "0.52794904", "text": "def install\n bin.install \"telepresence\"\n end", "title": "" }, { "docid": "1c97f057d4cd4c778c083b9fcea983c6", "score": "0.5277084", "text": "def install\n # # Changes log level to default value\n # inreplace \"etc/baetyl/conf.yml\" do |s|\n # s.gsub! \"level: debug\", \"\"\n # end\n\n bin.install Dir[\"bin/*\"]\n etc.install Dir[\"etc/*\"]\n end", "title": "" }, { "docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2", "score": "0.52711666", "text": "def plugin_setup!; end", "title": "" }, { "docid": "ab9caed6d748893aca15a2726e0742b8", "score": "0.5269711", "text": "def define_tasks\n # Run the command on the local system\n def run(cmd)\n Kernel.system(cmd.runnable)\n end\n # Basic setup action\n def setup_application\n @options ||= PoolParty.options(ARGV.dup)\n end\n \n # Require the poolparty specific tasks\n compiled_rakefile\n \n desc \"Reload the static variables\"\n task :reload do\n reload!\n end\n true\n end", "title": "" }, { "docid": "697e95f2250b9c741a2cf1a264574041", "score": "0.52610683", "text": "def install\n inreplace 'lib/ansible/constants.py' do |s|\n s.gsub! '/usr/share/ansible', '/usr/local/share/ansible/'\n end\n\n system \"/usr/local/bin/python\", \"setup.py\", \"build\"\n\n bin.install Dir['build/scripts-2.7/*']\n (lib+'python2.7/site-packages/ansible').mkpath\n (lib+'python2.7/site-packages/ansible').install Dir['build/lib/ansible/*']\n\n (share+'ansible').mkpath\n (share+'ansible').install Dir['library/*']\n end", "title": "" }, { "docid": "59fde7fb1ee3d331a316a16be0fd7ace", "score": "0.52586657", "text": "def define_task\n desc @desc\n task @name do\n config.mode == 'shell' ? run_shell : run\n end\n end", "title": "" }, { "docid": "a953573c171a18957124fd0849badf5b", "score": "0.5258071", "text": "def run_puppet_install_helper_on(hosts,type_arg=find_install_type,version=ENV[\"PUPPET_VERSION\"])\n\n type = type_arg || find_install_type\n\n # Short circuit based on rspec-system and beaker variables\n if ENV[\"RS_PROVISION\"] == \"no\" or ENV[\"BEAKER_provision\"] == \"no\"\n Array(hosts).each do |host|\n case type\n when \"pe\"\n configure_pe_defaults_on(host)\n when /foss|agent/\n configure_foss_defaults_on(host)\n end\n end\n return\n end\n\n # Example environment variables to be read:\n # PUPPET_VERSION=3.8.1 <-- for foss/pe/gem\n # PUPPET_VERSION=4.1.0 <-- for agent/gem\n # PUPPET_VERSION=1.0.1 <-- for agent\n #\n # PUPPET_INSTALL_TYPE=pe\n # PUPPET_INSTALL_TYPE=foss\n # PUPPET_INSTALL_TYPE=agent\n\n # Ensure windows 2003 is always set to 32 bit\n Array(hosts).each do |host|\n if host[\"platform\"] =~ /windows-2003/i\n host[\"install_32\"] = true\n end\n end\n\n case type\n when \"pe\"\n # This will skip hosts that are not supported\n install_pe_on(Array(hosts),options.merge({\"pe_ver\" => version}))\n when \"foss\"\n opts = options.merge({\n :version => version,\n :default_action => \"gem_install\",\n })\n\n install_puppet_on(hosts, opts)\n # XXX install_puppet_on() will only add_aio_defaults_on when the nodeset\n # type == 'aio', but we don't want to depend on that.\n if opts[:version] and not version_is_less(opts[:version], '4.0.0')\n add_aio_defaults_on(hosts)\n add_puppet_paths_on(hosts)\n end\n Array(hosts).each do |host|\n if fact_on(host,\"osfamily\") != \"windows\"\n on host, \"mkdir -p #{host[\"distmoduledir\"]}\"\n # XXX Maybe this can just be removed? What PE/puppet version needs\n # it?\n on host, \"touch #{host.puppet[\"hiera_config\"]}\"\n end\n if fact_on(host, \"operatingsystem\") == \"Debian\"\n on host, \"echo 'export PATH=/var/lib/gems/1.8/bin/:${PATH}' >> ~/.bashrc\"\n end\n if fact_on(host, \"operatingsystem\") == \"Solaris\"\n on host, \"echo 'export PATH=/opt/puppet/bin:/var/ruby/1.8/gem_home/bin:${PATH}' >> ~/.bashrc\"\n end\n end\n when \"agent\"\n # This will fail on hosts that are not supported; use foss and specify a 4.x version instead\n install_puppet_agent_on(hosts,options.merge({:version => version}))\n # XXX install_puppet_agent_on() will only add_aio_defaults_on when the\n # nodeset type == 'aio', but we don't want to depend on that.\n add_aio_defaults_on(hosts)\n add_puppet_paths_on(hosts)\n else\n raise ArgumentError, \"Type must be pe, foss, or agent; got #{type.inspect}\"\n end\n end", "title": "" }, { "docid": "a970e84771efd1ce60d3945a762c25de", "score": "0.52495915", "text": "def install\n cd_and_sh( pkg_dir, install_commands )\n end", "title": "" }, { "docid": "c8a4b8cc5fdd43ce1fbd83c7efd0769d", "score": "0.524148", "text": "def send_config_files_to_nodes(c)\n run_array_of_tasks(rsync_tasks(\"#{base_tmp_dir}/*\", \"#{remote_base_tmp_dir}\"))\n end", "title": "" }, { "docid": "e06fd4883163af5123fae300e389ec75", "score": "0.5236046", "text": "def createTask(project, target)\n task \"#{project}.#{target}\" do\n print \"#######################################################\\n\"\n invokeRake project, target\n end\nend", "title": "" }, { "docid": "e06fd4883163af5123fae300e389ec75", "score": "0.5236046", "text": "def createTask(project, target)\n task \"#{project}.#{target}\" do\n print \"#######################################################\\n\"\n invokeRake project, target\n end\nend", "title": "" }, { "docid": "b30150dc9921bf052ab8d7a812d3070f", "score": "0.5231128", "text": "def install_apply\n namespace nsprefix do\n desc 'Apply a terraform plan that will provision your resources; ' \\\n 'specify optional CSV targets'\n task :apply, [:target] => [\n :\"#{nsprefix}:init\",\n :\"#{nsprefix}:write_tf_vars\",\n :\"#{nsprefix}:plan\"\n ] do |t, args|\n @before_proc.call(t.name, @tf_dir) unless @before_proc.nil?\n cmd_arr = %w[terraform apply]\n cmd_arr << '-auto-approve' if tf_version >= Gem::Version.new('0.10.0')\n cmd_arr << \"-var-file #{var_file_path}\"\n cmd = cmd_with_targets(\n cmd_arr,\n args[:target],\n args.extras\n )\n terraform_runner(cmd)\n\n update_consul_stack_env_vars unless @consul_env_vars_prefix.nil?\n @after_proc.call(t.name, @tf_dir) unless @after_proc.nil?\n end\n end\n end", "title": "" }, { "docid": "31775e0718882b0c23472169b1399cf2", "score": "0.5229921", "text": "def teleport\n read_config\n assemble_tgz\n ssh_tgz\n end", "title": "" }, { "docid": "0786795cb20e74c04ea55807fa8760a7", "score": "0.5228538", "text": "def fetch_and_deploy_from local_filename\n if local_filename.end_with?('.tsv')\n logger.info \"Deploying contents of config file: #{local_filename}\"\n process_config_file local_filename\n\n elsif local_filename.end_with?('.gz')\n Chef::Log.info \"Deploying R package: #{local_filename}\"\n execute \"install custom R package #{local_filename}\" do\n command \"R CMD INSTALL #{local_filename}\"\n end\n\n elsif local_filename.end_with?('.deb')\n Chef::Log.info \"Deploying Debian package: #{local_filename}\"\n package_base = Regexp.new(\".*/([^/]+)_([^_/]+)\\.deb$\").match(local_filename)[1]\n dpkg_package \"#{package_base}\" do\n action :install\n source local_filename\n end\n end\n end", "title": "" }, { "docid": "9bc1a3328f719f4c3966fb049fbb25f4", "score": "0.52203053", "text": "def cli_install(executable_path)\n puts \"Creating symlinks at the Smuxi plugin hook locations…\"\n puts\n\n install(executable_path) do |hook_executable_file|\n puts \"Creating `#{hook_executable_file}`\"\n end\n\n puts\n puts \"Plugin `#{name}` installed.\"\n\n exit\n end", "title": "" }, { "docid": "be597ed031faec3ae74866a7258575f0", "score": "0.5218688", "text": "def run\n apply_cli_options!\n # this is where cloudy stuff would go...\n prepare_config\n prepare_installers\n\n transport.connect do |session|\n ui.msg( \"Installing config files\" )\n config_generator.install_config(session)\n ui.msg( \"Executing installer...\" )\n installer.install(session)\n config_generator.run_chef(session, installer)\n end\n end", "title": "" } ]
4c5baf75cae823cd6d9439fd7ea9c094
It is always the last entry in ICAP responses.
[ { "docid": "b2be4225e5cc8ec9a2df0b1e04ea5077", "score": "0.0", "text": "def <=>(_)\n 1\n end", "title": "" } ]
[ { "docid": "f172746dc9be855bcddac7a6371c4d73", "score": "0.6682197", "text": "def last\n @raw_responses[@raw_responses.length - 1]\n end", "title": "" }, { "docid": "d34f830f249b5f7ec9a027eff912f8bc", "score": "0.66556215", "text": "def lastresp; end", "title": "" }, { "docid": "48ee45bcc68436eb15b5046de5876e2e", "score": "0.66259885", "text": "def last_responses; end", "title": "" }, { "docid": "6a2adede27d7d6fa1b479bfa9f91b501", "score": "0.63500357", "text": "def last_responses=(_arg0); end", "title": "" }, { "docid": "3a5f17ffe4f1e74e2988710648c54ef7", "score": "0.59345406", "text": "def response\n responses.last\n end", "title": "" }, { "docid": "65874a98c17ca62e362341cac35d05ca", "score": "0.5905691", "text": "def last_response; end", "title": "" }, { "docid": "65874a98c17ca62e362341cac35d05ca", "score": "0.5905691", "text": "def last_response; end", "title": "" }, { "docid": "65874a98c17ca62e362341cac35d05ca", "score": "0.5905691", "text": "def last_response; end", "title": "" }, { "docid": "65874a98c17ca62e362341cac35d05ca", "score": "0.5905691", "text": "def last_response; end", "title": "" }, { "docid": "65874a98c17ca62e362341cac35d05ca", "score": "0.5905691", "text": "def last_response; end", "title": "" }, { "docid": "7e41ef3971bb01a6ca9d07ab5d1eb128", "score": "0.5880421", "text": "def response_line\n \"ICAP/#{@icap_version} #{@icap_status_code} #{ICAP_STATUS_CODES[@icap_status_code]}\\r\\n\"\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "980780c2ae9681cbda99c8e0cd441388", "score": "0.58155394", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "9ebaed923fe3d2ae2b1c27d8055cd340", "score": "0.5778487", "text": "def last_response\n @last_response if defined? @last_response\n end", "title": "" }, { "docid": "a8b60d1728175cc99c13e9fc061703cb", "score": "0.57480973", "text": "def last_response\n @last_response\n end", "title": "" }, { "docid": "f1eb009b051b2af985066ecd18027f7f", "score": "0.574251", "text": "def last_response\n @last_response\n end", "title": "" }, { "docid": "5895216a5ae0422e3060e94cf1eefa8a", "score": "0.57299674", "text": "def response\n last_response\n end", "title": "" }, { "docid": "6de95ac5f8490f6d8c3f96a67c724c81", "score": "0.5683211", "text": "def last_header\n headers.last\n end", "title": "" }, { "docid": "5711cb6f5de9d323736657574d5a755a", "score": "0.5531906", "text": "def last_response=(_arg0); end", "title": "" }, { "docid": "5eb547c5298a35aed57b2315bade71f8", "score": "0.5469822", "text": "def last_http_response\n @http_response\n end", "title": "" }, { "docid": "89e48709e98102ad1726e6ecc3827b76", "score": "0.54559094", "text": "def resp_group\n last_entry.nil? ? group : last_entry.resp_group\n end", "title": "" }, { "docid": "e96049a555d22de618c47ecfa6d15fe9", "score": "0.5376143", "text": "def finish\n write! \"0#{Response::CRLF * 2}\"\n end", "title": "" }, { "docid": "70bb2ea78257b8d3386c96bfe03e0513", "score": "0.53481245", "text": "def last_response_code; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.5335026", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.5335026", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.5335026", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.5335026", "text": "def responses; end", "title": "" }, { "docid": "4161c8221f5f18a75e00c83833f51906", "score": "0.53242683", "text": "def process_single_getk_response\n bytes, status, cas, key, value = @response_processor.getk_response_from_buffer(@buffer)\n advance(bytes)\n [status, cas, key, value]\n end", "title": "" }, { "docid": "1bcc96fa4bfee8d6cc5faefc266052d8", "score": "0.5314514", "text": "def last\n keys.last\n end", "title": "" }, { "docid": "b097c62c95403a6bdcf3914ae2a04b20", "score": "0.53114986", "text": "def last\n unless @last_item.nil?\n @last_item.payload\n end\n end", "title": "" }, { "docid": "799b3b5f76986ea1bfa8f8a735867698", "score": "0.52999616", "text": "def last(key)\n raise \"implement me!\"\n end", "title": "" }, { "docid": "d635b7c04823b98d194d9dca45bd06df", "score": "0.52746147", "text": "def set_LastResponse(value)\n set_input(\"LastResponse\", value)\n end", "title": "" }, { "docid": "44f5f39e645d735fa0e849fa1040a1be", "score": "0.5269801", "text": "def last_message\n last_response.message\n end", "title": "" }, { "docid": "d2d042ed3f5f50d4eeba1cdd16851041", "score": "0.5248429", "text": "def last\n @msg_frames.last\n end", "title": "" }, { "docid": "985eae4a4b6bf308d332abad6e97e252", "score": "0.5228106", "text": "def recv_response # :nodoc:\n stat = ''\n while true\n line = @io.readline(false)\n stat << line\n break unless line[3] == ?-\n end\n stat\n end", "title": "" }, { "docid": "b53d405399a1759c5b176730324829eb", "score": "0.5227237", "text": "def peek()\n @rv.last()\n end", "title": "" }, { "docid": "d7306e14a6c2d5185b772592ccb8c7e2", "score": "0.52245927", "text": "def last_response\n @client.last_response\n end", "title": "" }, { "docid": "181430d0c098f9fbe8bef3004c812aba", "score": "0.52180576", "text": "def last_request; end", "title": "" }, { "docid": "181430d0c098f9fbe8bef3004c812aba", "score": "0.52180576", "text": "def last_request; end", "title": "" }, { "docid": "904df33157a3e458f231be171cbad6e6", "score": "0.5208678", "text": "def sw\n\t\t\t@response[-2, 2].unpack('n').pop\n\t\tend", "title": "" }, { "docid": "97cfa3de8aecff9169b5b724e6acdd3d", "score": "0.5202185", "text": "def last_result_set; end", "title": "" }, { "docid": "99acf113bf5f97fd3166cca01bc44d6c", "score": "0.520044", "text": "def buffer\n @bufs.last\n end", "title": "" }, { "docid": "46900b6e86493e05ee6188d604ef5549", "score": "0.5191185", "text": "def last_response\n hash = @_res.scan(/h=([\\w_\\=\\/]+)[\\s]/).first\n\t timestamp = @_res.scan(/t=([\\w\\-:]+)[\\s]/).first\n\t status = @_res.scan(/status=([a-zA-Z0-9_]+)[\\s]/).first\n\t info = @_res.scan(/info=([\\w\\t\\S\\W]+)/).first\n\t \n\t return { \"h\" => hash, \"t\" => timestamp, \"status\" => status, \"info\" => info }\n end", "title": "" }, { "docid": "9c2ec0a8bf596bc3483e6f66bab36c75", "score": "0.5186601", "text": "def last\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "9c2ec0a8bf596bc3483e6f66bab36c75", "score": "0.5186601", "text": "def last\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "28c6eb0edbd4347af243a4e9b11ae2d2", "score": "0.5172831", "text": "def last_response\n raise Error.new(\"No response yet. Request a page first.\") unless @last_response\n\n @last_response\n end", "title": "" }, { "docid": "645402194cc00be6694bfc5055c96aba", "score": "0.5156086", "text": "def sw1\n\t\t\t@response[-2, 1].unpack('C').pop\n\t\tend", "title": "" }, { "docid": "184681995ca5c17e9b0334b414865979", "score": "0.5124197", "text": "def last\n response = self.class.get(\"#@uri/last\")\n raise ServiceError, response.body unless response.code.eql? 200\n NISTRandomnessBeacon::Record.new(response.parsed_response['record'])\n end", "title": "" }, { "docid": "2bb841315939b23cf8ab3f18c03acdc3", "score": "0.5120753", "text": "def last\n last_key.get\n end", "title": "" }, { "docid": "50e20194aee43aa964f1e3b4fa361c91", "score": "0.5102937", "text": "def last\n @entries.last\n end", "title": "" }, { "docid": "234d9243bb868dfe5f498edbb216a212", "score": "0.5094887", "text": "def parse_response_line; end", "title": "" }, { "docid": "0d366737fb7ad2ef28c632892b40ee6f", "score": "0.50865096", "text": "def tail\n scope.query([value.statement.subject, RDF::Vocab::IANA.last]).to_a.first.object\n end", "title": "" }, { "docid": "deb008afd2520c3b0d33f7921595aa15", "score": "0.50861156", "text": "def last_result; end", "title": "" }, { "docid": "deb008afd2520c3b0d33f7921595aa15", "score": "0.50861156", "text": "def last_result; end", "title": "" }, { "docid": "035e4dba95439866316c63945368348d", "score": "0.5084256", "text": "def last\n entry(-1, Array, false)\n end", "title": "" }, { "docid": "763be9643babdafa55f94a25104c23ce", "score": "0.508002", "text": "def parse\n # parse ICAP headers\n icap_parser = ICAPRequestParser.new(@io)\n icap_data = icap_parser.parse\n return nil unless icap_data\n if icap_data[:header]['Encapsulated']\n encapsulation = icap_data[:header]['Encapsulated']\n encapsulated_parts = encapsulation.split(',').map do |part|\n part.split('=').map(&:strip)\n end\n else\n encapsulated_parts = []\n end\n parsed_data = {icap_data: icap_data, encapsulated: encapsulated_parts}\n parts = []\n service_name = icap_data[:request_line][:uri].path\n service_name = service_name[1...service_name.length]\n service = @server.services[service_name]\n if service\n disable_preview = !service.supports_preview?\n preview_size = service.preview_size\n else\n disable_preview = true\n preview_size = nil\n end\n encapsulated_parts.each do |ep|\n parts << case ep[0]\n when 'null-body'\n NullBody.new\n when 'req-hdr'\n http_parser = HTTPHeaderParser.new(@io,true)\n parsed_data[:http_request_header] = http_parser.parse\n when 'res-hdr'\n http_parser = HTTPHeaderParser.new(@io,false)\n parsed_data[:http_response_header] = http_parser.parse\n when 'req-body'\n bp = BodyParser.new(@io, disable_preview, (icap_data[:header]['Preview'] || nil))\n p_data = bp.parse\n parsed_data[:http_request_body] = RequestBody.new(p_data[0],p_data[1])\n when 'res-body'\n bp = BodyParser.new(@io, disable_preview, (icap_data[:header]['Preview'] || nil))\n p_data = bp.parse\n parsed_data[:http_response_body] = ResponseBody.new(p_data[0],p_data[1])\n else\n nil\n end\n end\n\n parsed_data\n end", "title": "" }, { "docid": "9212be72bfc55f9a340f35dacb423589", "score": "0.5078541", "text": "def last\n tail.data\n end", "title": "" }, { "docid": "9263a5d0eda8d362264a1635fd47b20a", "score": "0.506799", "text": "def successful_prior_auth_capture_response\n '$1$,$1$,$1$,$This transaction has been approved.$,$advE7f$,$Y$,$508141794$,$5b3fe66005f3da0ebe51$,$$,$1.00$,$CC$,$auth_only$,$$,$Longbob$,$Longsen$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$2860A297E0FE804BCB9EF8738599645C$,$P$,$2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$'\n end", "title": "" }, { "docid": "220ca55ebfe7078c9a5bec94330af566", "score": "0.50563294", "text": "def response\n @content_data.string[0..-3]\n end", "title": "" }, { "docid": "220ca55ebfe7078c9a5bec94330af566", "score": "0.50563294", "text": "def response\n @content_data.string[0..-3]\n end", "title": "" }, { "docid": "685add7658269d7320746bf2e2d249a8", "score": "0.5055085", "text": "def store_eof\n record = 0x000A\n length = 0x0000\n header = [record,length].pack(\"vv\")\n\n append(header)\n end", "title": "" }, { "docid": "41d6f3e828d54e55da39fb7d313475e1", "score": "0.50547534", "text": "def last_key\n @chunk_reader.last_key\n end", "title": "" }, { "docid": "e7475997edad9723f56d7cf3f2cb1066", "score": "0.50502497", "text": "def response\n @content_data.string[0..-3]\n end", "title": "" }, { "docid": "1ad1da7b8aad3301c2e6f608d000ff01", "score": "0.5049587", "text": "def finish_response\n @socket << \"0#{CRLF * 2}\"\n end", "title": "" }, { "docid": "622c954291d270e1848029de460039ab", "score": "0.5049471", "text": "def response_to(packet)\n response = nil\n\n while response.nil? && run?\n temp = read(false)\n\n if temp.struct == :response && temp.response_id == packet.id\n response = temp\n end\n end\n\n response\n end", "title": "" }, { "docid": "8c9b9dddfca24a24c06ec734a8b5191c", "score": "0.5044964", "text": "def last; end", "title": "" }, { "docid": "8c9b9dddfca24a24c06ec734a8b5191c", "score": "0.5044964", "text": "def last; end", "title": "" }, { "docid": "8c9b9dddfca24a24c06ec734a8b5191c", "score": "0.5044964", "text": "def last; end", "title": "" }, { "docid": "9b35ab8a3b308dc0f47e4274cc9909d3", "score": "0.5010204", "text": "def maidr_last_item\n return case maidr_last_type\n when 0 then $data_items[maidr_last_id]\n when 1 then $data_weapons[maidr_last_id]\n when 2 then $data_armors[maidr_last_id]\n else nil\n end\n end", "title": "" }, { "docid": "1ca0059bb5beb31f824ba8bab70426ae", "score": "0.50029886", "text": "def extra_iiif2_information_response_keys(_options = {})\n {}\n end", "title": "" }, { "docid": "7a292d08ef290f49b88aba50120bc2b7", "score": "0.5001392", "text": "def last_protocol\n unless self.protocols.last.nil?\n @protocols = self.protocols.last\n end\n end", "title": "" }, { "docid": "b7538294fbfac24f8089ca7cc4ef9a32", "score": "0.5000476", "text": "def response_preamble\n end", "title": "" }, { "docid": "b7538294fbfac24f8089ca7cc4ef9a32", "score": "0.5000476", "text": "def response_preamble\n end", "title": "" }, { "docid": "4d8cb65f82e730b3389796012c322c74", "score": "0.49963355", "text": "def parse257(resp); end", "title": "" }, { "docid": "b0a72ab7d88aa7f8b58f8be6945d4c41", "score": "0.49956566", "text": "def [](key)\n h = get_last_header(key)\n h && h.value || nil\n end", "title": "" }, { "docid": "c2f1d567d37fc656f2c2ae4f82dc315b", "score": "0.49899656", "text": "def last\n return nil if empty?\n @lcdr.value\n end", "title": "" }, { "docid": "c7e6198853b0f36d9fb21658f36ebee6", "score": "0.49878493", "text": "def last_endpoint\n\t\treturn self.socket&.last_endpoint\n\tend", "title": "" }, { "docid": "f1dbe3340dda425070d88239e5759431", "score": "0.4983042", "text": "def response\n if hash.last then PaypkgResponse.new(hash.last) else nil end\n end", "title": "" }, { "docid": "89a0dda239a4c5ac751775667544acba", "score": "0.49803418", "text": "def receive_single_response\n\n $test_logger.log(\"Receive single response from device\")\n \n #Receive sync word\n response = raw_receive(4)\n act_sync = response.unpack(\"V\")[0]\n is_sync = act_sync == BioPacket::DEFAULT_SYNC\n raise \"Sync word not found at first 4 bytes as '#{act_sync.to_s}'! expected '#{BioPacket::DEFAULT_SYNC.to_s(16)}'\" if !is_sync\n\n #Read next two words to find packet length\n response << raw_receive(8)\n pkt_len = (response[-4..-1].unpack(\"V\")[0] & 0xffff0000) >> 16\n\n #Read rest of the packet (as per the length)\n response << raw_receive(pkt_len*4 - 8)\n\n response\n end", "title": "" }, { "docid": "6f44157afbb2fa540c1790eec3f190b1", "score": "0.49793047", "text": "def last_response_data\n begin\n JSON.parse(last_response.body, { symbolize_names: true })\n rescue JSON::ParserError => e\n {}\n end\nend", "title": "" }, { "docid": "66008c36f02a93aaac24df8eb7143166", "score": "0.49775034", "text": "def unwrap_response(resp)\n case resp.trp_command.to_i\n when TRP::Message::Command::HELLO_RESPONSE\n resp.hello_response\n when TRP::Message::Command::COUNTER_GROUP_TOPPER_RESPONSE\n resp.counter_group_topper_response\n when TRP::Message::Command::COUNTER_ITEM_RESPONSE\n resp.counter_item_response\n when TRP::Message::Command::OK_RESPONSE\n resp.ok_response\n when TRP::Message::Command::PCAP_RESPONSE\n resp.pcap_response\n when TRP::Message::Command::SEARCH_KEYS_RESPONSE\n resp.search_keys_response\n when TRP::Message::Command::UPDATE_KEY_RESPONSE\n resp.update_key_response \n when TRP::Message::Command::PROBE_STATS_RESPONSE\n resp.probe_stats_response \n when TRP::Message::Command::QUERY_ALERTS_RESPONSE\n resp.query_alerts_response \n when TRP::Message::Command::QUERY_RESOURCES_RESPONSE\n resp.query_resources_response \n when TRP::Message::Command::COUNTER_GROUP_INFO_RESPONSE\n resp.counter_group_info_response \n when TRP::Message::Command::SESSION_TRACKER_RESPONSE\n resp.session_tracker_response \n when TRP::Message::Command::QUERY_SESSIONS_RESPONSE\n resp.query_sessions_response \n when TRP::Message::Command::AGGREGATE_SESSIONS_RESPONSE\n resp.aggregate_sessions_response \n when TRP::Message::Command::GREP_RESPONSE\n resp.grep_response \n when TRP::Message::Command::KEYSPACE_RESPONSE\n resp.key_space_response \n when TRP::Message::Command::TOPPER_TREND_RESPONSE\n resp.topper_trend_response \n when TRP::Message::Command::QUERY_FTS_RESPONSE\n resp.query_fts_response \n when TRP::Message::Command::TIMESLICES_RESPONSE\n resp.time_slices_response \n when TRP::Message::Command::METRICS_SUMMARY_RESPONSE\n resp.metrics_summary_response \n when TRP::Message::Command::CONTEXT_INFO_RESPONSE\n resp.context_info_response\n when TRP::Message::Command::CONTEXT_CONFIG_RESPONSE\n resp.context_config_response\n when TRP::Message::Command::LOG_RESPONSE\n resp.log_response\n when TRP::Message::Command::DOMAIN_RESPONSE\n resp.domain_response\n when TRP::Message::Command::NODE_CONFIG_RESPONSE\n resp.node_config_response\n when TRP::Message::Command::ASYNC_RESPONSE\n resp.async_response\n when TRP::Message::Command::FILE_RESPONSE\n resp.file_response\n when TRP::Message::Command::GRAPH_RESPONSE\n resp.graph_response\n when TRP::Message::Command::RUNTOOL_RESPONSE\n resp.run_tool_response\n when TRP::Message::Command::TOOL_INFO_RESPONSE\n resp.tool_info_response\n else\n raise \"#{resp.trp_command.to_i} Unknown TRP command ID\"\n end\n end", "title": "" }, { "docid": "56a2a546bd6eaea0b083db319dd14177", "score": "0.49720165", "text": "def extra_iiif2_information_response_keys(options = {})\r\n end", "title": "" }, { "docid": "f79fd4220a46eac353d7fb8ccaed5791", "score": "0.49717402", "text": "def last\n\t\t@contents.last\n\tend", "title": "" }, { "docid": "fea0a7c7c37dae261fed255123c326fe", "score": "0.49633884", "text": "def last_request\n client.http.body\n end", "title": "" }, { "docid": "f16da181a8cc81a4b741c3a54a2878ba", "score": "0.49608293", "text": "def last_response\n raise Rack::Test::Error.new(\"No response yet. Request a page first.\") unless @last_response\n @last_response\n end", "title": "" }, { "docid": "16976b273b42a74e9fe56debd39a1540", "score": "0.49600095", "text": "def rpc_ring_last(sid)\n s = _valid_session(sid,\"ring\")\n { \"seq\" => 0 }\n end", "title": "" }, { "docid": "d1134d9ac97731b7b7bf1aaa71f59096", "score": "0.4957726", "text": "def receive_decoding_tables_pos; end", "title": "" }, { "docid": "789ab0c2b6c410c572dd22af17a56a74", "score": "0.49521193", "text": "def last\n @data.last\n end", "title": "" }, { "docid": "17baeccf162b2857175ceb6739d8fef8", "score": "0.49505886", "text": "def index_of_last_described_event\n events = self.info_request_events\n events.each_index do |i|\n revi = events.size - 1 - i \n m = events[revi] \n if not m.described_state.nil?\n return revi\n end\n end\n return nil\n end", "title": "" }, { "docid": "a551497a2b276eb6cbfe9aff95b4a832", "score": "0.49425673", "text": "def last; @last; end", "title": "" }, { "docid": "feda2cfa71ce8e54445a8d97c6bf219f", "score": "0.49344134", "text": "def last_response\n crawler.last_response\n end", "title": "" }, { "docid": "bc2affb93aa8cc00f281be054a5a2c43", "score": "0.4933709", "text": "def last\n get(-1)\n end", "title": "" }, { "docid": "f5c5089f042d5a06ef61d3fb86440673", "score": "0.49328786", "text": "def parsed_last_response\n JSON.parse(last_response.body)['data']\n .inject({}) { |m,(k,v)| m[k.to_sym] = v; m } #symbolize keys\n end", "title": "" }, { "docid": "a3f859a7427c409d2754846c5480007d", "score": "0.4932855", "text": "def response_maps; end", "title": "" }, { "docid": "953f49674d74ee3b0b01813825ab1573", "score": "0.49322268", "text": "def read_response\n response = {}\n line = @socket.gets\n while line != \"\\r\\n\"\n k,v = line.split(\": \")\n response[k.downcase.to_sym] = v.gsub(\"\\r\\n\", \"\")\n line = @socket.gets\n end\n @logger.response response.inspect\n response\n end", "title": "" }, { "docid": "ff6a7b65e2d81cf155712cab8abb28c0", "score": "0.4930659", "text": "def last()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "ff6a7b65e2d81cf155712cab8abb28c0", "score": "0.4930659", "text": "def last()\n #This is a stub, used for indexing\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0ebb7fb5a0aa401d449e7a6e13c82833", "score": "0.0", "text": "def set_ad_group\n @ad_group = AdGroup.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@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.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
62de3ac5ecebe4689001381dcbdf9bd7
Serve image from web server, bypassing apache and passenger. (This is only used when an image hasn't been transferred to the image server successfully.) type:: Size: 'thumb', '320', etc. id:: Image id.
[ { "docid": "f2a9cf3698f9666735d6f24a26a2cef5", "score": "0.6751603", "text": "def image\n size = params[:type].to_s\n id = params[:id].to_s\n file = \"#{IMG_DIR}/#{size}/#{id}.jpg\"\n if !File.exists?(file)\n if size == 'thumb'\n file = \"#{IMG_DIR}/place_holder_thumb.jpg\"\n else\n file = \"#{IMG_DIR}/place_holder_320.jpg\"\n end\n end\n file =\"#{RAILS_ROOT}/test/fixtures/images/sticky.jpg\" if TESTING\n send_file(file, :type => 'image/jpeg', :disposition => 'inline')\n end", "title": "" } ]
[ { "docid": "24e1180223354810ff2de3afc4b403d1", "score": "0.69040465", "text": "def show\n if params[:size] == \"large\"\n size = LARGE_SIZE\n else \n size = params[:size] || \"200x200\"\n end\n size = size[0..-($1.length.to_i + 2)] if size =~ /[0-9]+x[0-9]+\\.([a-z0-9]+)/ # trim file extension\n \n id = params[:id].to_i\n \n if cache_exists?(id, size) # look in file system cache before attempting db access\n send_file(full_cache_path(id, size), :type => 'image/jpeg', :disposition => 'inline')\n else\n # resize (keeping image side ratio), encode and cache the picture\n @avatar.operate do |image|\n image.resize size\n @image_binary = image.image.to_blob\n end\n \n # cache data\n cache_data!(@avatar, @image_binary, size)\n \n send_data(@image_binary, :type => 'image/jpeg', :disposition => 'inline')\n end\n end", "title": "" }, { "docid": "73c70bdd34fc5b92ec65c6ce38e9f75a", "score": "0.6898914", "text": "def render_dynamic_image\n\t\tminTime = Time.rfc2822(request.env[\"HTTP_IF_MODIFIED_SINCE\"]) rescue nil\n\n\t\trender_missing_image and return unless Image.exists?(params[:id])\n\n\t\timage = Image.find(params[:id])\n\n\t\tif minTime && image.created_at? && image.created_at <= minTime\n\t\t\trender :text => '304 Not Modified', :status => 304\n\t\t\treturn\n\t\tend\n\t\t\n\t\tunless image.data\n\t\t\tlogger.warn \"Image #{image.id} exists, but has no data\"\n\t\t\trender_missing_image and return\n\t\tend\n\n\t\tif size = params[:size]\n\t\t if size =~ /^x[\\d]+$/ || size =~ /^[\\d]+x$/\n\t\t size = Vector2d.new(size)\n\t\t\t image_size = Vector2d.new( image.size )\n\t\t\t size = image_size.constrain_both(size).round.to_s\n\t\t\tend\n \t\timagedata = image.get_processed(size, params[:filterset])\n\t else\n \t\timagedata = image\n end\n\n\t\tDynamicImage.dirty_memory = true # Flag memory for GC\n\n\t\tif image\n\t\t\tresponse.headers['Cache-Control'] = nil\n\t\t\tresponse.headers['Last-Modified'] = imagedata.created_at.httpdate if imagedata.created_at?\n\t\t\tsend_data( \n\t\t\t\timagedata.data, \n\t\t\t\t:filename => image.filename, \n\t\t\t\t:type => image.content_type, \n\t\t\t\t:disposition => 'inline'\n\t\t\t)\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "c132831a1e186dd12033d458398a047c", "score": "0.68951374", "text": "def serve\n @photo = Photo.find(params[:id])\n send_data(@photo.data, type: @photo.mime_type, filename: \"#{@photo.filename}.jpg\", disposition: \"inline\")\n end", "title": "" }, { "docid": "899722ba6ba44865f4e53d2115332b3e", "score": "0.6816492", "text": "def show\n size = params[:size] || \"200x200\"\n size = size[0..-($1.length.to_i + 2)] if size =~ /[0-9]+x[0-9]+\\.([a-z0-9]+)/ # trim file extension\n \n id = params[:id].to_i\n\n send_cached_data(\"public/pictures/show/#{size}/#{id}.jpg\",\n :type => 'image/jpeg', :disposition => 'inline') {\n\n find_picture\n\n # resize and encode the picture\n @picture.resize!(:size => size)\n @picture.to_jpg!\n\n @picture.data\n }\n\n end", "title": "" }, { "docid": "572b7e262d2fb2d4e75cd14ca5ced072", "score": "0.67872536", "text": "def thumbnail\n\n image = Rails.cache.fetch(\"/image_thumbnail/#{params[:id]}\", :expires_in => 10.minutes) do\n puts \"miss!\"\n user_client.thumbnail(params[:id], min_height: 256, min_width: 256)\n end\n\n send_data image, :type => 'image/png', :disposition => 'inline'\n end", "title": "" }, { "docid": "0fd1aa494ae6b095e34290251fc4adda", "score": "0.6757148", "text": "def thumbnail\n\n image = Rails.cache.fetch(\"/image_thumbnail/#{params[:id]}\", :expires_in => 10.minutes) do\n\n puts \"miss!\"\n user_client.thumbnail(params[:id], min_height: 256, min_width: 256)\n end\n\n send_data image, :type => 'image/png', :disposition => 'inline'\n end", "title": "" }, { "docid": "0e790cd10d83bdb0fb3bb5ad6fbb6dab", "score": "0.6719797", "text": "def handle_image\n path = File.join(File.dirname(__FILE__), 'gateway.png')\n content = File.read(path)\n size = content.respond_to?(:bytesize) ? content.bytesize : content.size\n return [200, {'Content-Type' => 'image/png', 'Content-Length' => size.to_s}, [content]]\n end", "title": "" }, { "docid": "d810049c5ad139e3c08d1141576b352a", "score": "0.6657934", "text": "def thumb\n @market_image = MarketImage.find(params[:id])\n respond_to do |format|\n format.jpg # thumb.jpg.flexi\n end\n end", "title": "" }, { "docid": "083ae48f2e7c4ce218b85f7eac784c4d", "score": "0.66346765", "text": "def image\n p = Photo.find( params[:id] )\n send_data( p.data, :filename => p.name, :type => p.format, :disposition => 'inline' )\n end", "title": "" }, { "docid": "b26999c8e9a3817026fce81fc8de258f", "score": "0.6624268", "text": "def image\n response.headers['Cache-Control'] = \"public, max-age=#{12.hours.to_i}\"\n response.headers['Content-Type'] = 'image/jpeg'\n response.headers['Content-Disposition'] = 'inline'\n metaPath = File.join(@@modelPath, \"#{params[:id]}/meta\")\n if File.exists?(File.join(metaPath, \"#{params[:num]}.png\"))\n render :text => open(\n File.join(metaPath, \"#{params[:num]}.png\"), \"rb\").read\n else\n render :text => open(\n \"#{Rails.root}/app/assets/images/generating_images.png\", \"rb\").read\n end\n end", "title": "" }, { "docid": "66a4832d8caa67f5fef4204d30b5c597", "score": "0.6620393", "text": "def show\n render(:nothing => true, :status => 404) and return unless @attachment.diskfile =~ /\\.(jpeg|jpg|gif|png)$/i\n send_file @attachment.diskfile, :filename => @attachment.filename, :type => \"image/#{$1}\", :disposition => 'inline'\n rescue\n render_404\n end", "title": "" }, { "docid": "6b88ec0217d6a31bca9dc447b1665f6d", "score": "0.6607445", "text": "def get_resized_image\r\n if params[:url].present?\r\n random_string = SecureRandom.urlsafe_base64(32)\r\n begin\r\n if params[:width].present? && params[:height].present? && params[:width].to_i < 1280 && params[:height].to_i < 1280\r\n image = Dragonfly.app.fetch_url(params[:url]).thumb(\"#{params[:width]}x#{params[:height]}#\")\r\n else\r\n image = Dragonfly.app.fetch_url(params[:url])\r\n end\r\n if image.image.present?\r\n ct = image.format\r\n expires_in(2.days, public: true)\r\n send_data(image, filename: random_string, type: \"image/#{ct}\", disposition: 'inline')\r\n else\r\n # This block does not execute mostly...\r\n image = Dragonfly.app.fetch_url(Rails.application.config.default_image)\r\n expires_in(1.week, public: true)\r\n send_data(image, filename: random_string, type: 'image/jpeg', disposition: 'inline')\r\n end\r\n rescue\r\n begin\r\n image = Dragonfly.app.fetch_url(Rails.application.config.default_image)\r\n expires_in(1.week, public: true)\r\n send_data(image, filename: random_string, type: 'image/jpeg', disposition: 'inline')\r\n rescue # in case cdn is down\r\n render json: ErrorResponse.new(\r\n code: 400,message: 'Invalid Image Url'\r\n ), adapter: :json, status: :bad_request\r\n end\r\n end\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,message: 'Image URL or dimensions not Found'\r\n ), adapter: :json, status: :not_found\r\n end\r\n end", "title": "" }, { "docid": "d491739c938568b14aa4013d9524e9af", "score": "0.6567678", "text": "def render_image image_data_or_file, type = :file\n if @image_format\n respond_to do |format|\n headers['Cache-Control'] = (@image.node.private? ? 'private' : 'public') # this can be cached by proxy servers\n\n options = {\n :type => Image::MIME_TYPES[@image_format],\n :disposition => 'inline'\n }\n\n format.send(@image_format) do\n if type == :data\n send_data image_data_or_file, options\n elsif type == :file\n send_file image_data_or_file, options\n end\n end\n end\n else\n respond_to do |format|\n format.rss { head 404 }\n format.any\n end\n end\n end", "title": "" }, { "docid": "90c41312689ac06f8b6885fb01576fab", "score": "0.65276444", "text": "def show_image\n if not params[:model].nil? and not params[:id].nil?\n @object = params[:model].singularize.classify.constantize.find(params[:id])\n send_data @object.image, :type => 'image/jpg', :disposition => 'inline' if not @object.nil?\n end\n end", "title": "" }, { "docid": "ff16c9857fe83e600d81404040360623", "score": "0.6520319", "text": "def show\n respond_with(params[:id]) do |format|\n format.any {\n send_a_file(\"/images/#{params[:id]}.jpg\")\n }\n end\n end", "title": "" }, { "docid": "76f29980681becf70d0709b6118b8ae6", "score": "0.6495523", "text": "def show\n params[:size] ||= \"200x200\"\n if params[:size] == \"large\"\n size = LARGE_SIZE\n else\n size = params[:size]\n end\n\n @avatar.resize_image(size)\n\n avatar_format = Avatar.image_storage_format.to_s\n\n respond_to do |format|\n format.html do\n send_file(@avatar.full_cache_path(size), :type => \"image/#{avatar_format}\", :disposition => 'inline')\n end\n end\n\n end", "title": "" }, { "docid": "753abad5f573868875799ebc74c96e8c", "score": "0.6440127", "text": "def show\n # get image\n image_file = Neofiles::Image.find params[:id]\n\n # prepare headers\n data = image_file.data\n options = {\n filename: CGI::escape(image_file.filename),\n type: image_file.content_type || 'image/jpeg',\n disposition: 'inline',\n }\n quality = [[Neofiles::quality_requested(params), 100].min, 1].max if Neofiles::quality_requested?(params)\n quality ||= 75 unless nowm?(image_file)\n\n image = MiniMagick::Image.read(data)\n\n if params[:format].present?\n width, height = params[:format].split('x').map(&:to_i)\n raise Mongoid::Errors::DocumentNotFound unless width.between?(1, CROP_MAX_WIDTH) and height.between?(1, CROP_MAX_HEIGHT)\n end\n\n crop_requested = Neofiles.crop_requested? params\n resizing = width && height\n need_resize_without_crop = resizing && (image_file.width > width || image_file.height > height)\n\n image.combine_options('convert') do |convert|\n resize_image convert, width, height, crop_requested, need_resize_without_crop if resizing\n\n unless nowm?(image_file)\n wm_width, wm_height = resizing ? Neofiles::resized_image_dimensions(image_file, width, height, params) : [image_file.width, image_file.height]\n add_watermark convert, image, wm_width, wm_height if wm_width && wm_height\n end\n\n compress_image convert, quality if quality || resizing\n end\n\n # use pngquant when quality is less than 75\n ::PngQuantizator::Image.new(image.path).quantize! if options[:type] == 'image/png' && quality && quality < 75\n\n data = image.to_blob\n\n # stream image headers & bytes\n send_file_headers! options\n headers['Content-Length'] = data.length.to_s\n self.status = 200\n self.response_body = data\n\n rescue NotAdminException\n self.response_body = I18n.t 'neofiles.403_access_denied'\n self.content_type = 'text/plain; charset=utf-8'\n self.status = 403\n ensure\n image.try :destroy! #delete mini_magick tempfile\n end", "title": "" }, { "docid": "d504865834d109fd3fae2b3281144b1e", "score": "0.6417182", "text": "def ipad_thumbnail\n\n validation_ans = validate_params params\n return render json: {message: validation_ans}, status: 400 if validation_ans\n\n begin\n image = MiniMagick::Image.open(params[:url])\n rescue SocketError, URI::InvalidURIError => e\n render json: { message: \"Url not found : #{e.message}\", backtrace: e.backtrace}, status: 500\n return\n rescue MiniMagick::Invalid => e\n render json: { message: \"Url is not an image\", backtrace: e.backtrace}, status: 500\n return\n rescue Exception => e\n render json: { message: \"Fail to open image\", backtrace: e.backtrace}, status: 500\n return\n end\n\n begin\n ratio = [\n get_ipad_ratio(image[:width], params[:width]),\n get_ipad_ratio(image[:height], params[:height])\n ].min\n\n new_image_name = \"#{get_random_string}-#{params[:width]}-#{params[:height]}.jpeg\"\n\n image.combine_options do |c|\n c.resize(\"#{(image[:width]*ratio).to_i}x#{(image[:height]*ratio).to_i}\")\n c.background(BACKGROUND_COLOR)\n c.gravity('center')\n c.extent \"#{params[:width]}x#{params[:height]}\"\n end\n image.format \"jpeg\"\n image.write \"storage/#{new_image_name}\"\n\n send_file(\"storage/#{new_image_name}\",\n :filename => \"thumbnail-#{params[:width]}-#{params[:height]}.jpeg\",\n :type => \"mime/type\")\n rescue Exception => e\n render json: { message: \"Fail to manipulate the image\", backtrace: e.backtrace}, status: 500\n return\n end\n end", "title": "" }, { "docid": "0ed8791340cfbfbcb03e18b9811d09b8", "score": "0.6416509", "text": "def code_image\n @image_data = Image.find(params[:id])\n @image = @image_data.data\n send_data(@image, :type => @image_data.filetype, \n :filename => @image_data.filename, \n :disposition => 'inline') \n end", "title": "" }, { "docid": "ad6ee66f0725af9586e0bcdb95977b76", "score": "0.6407678", "text": "def serve\n response = if head?\n @source_headers.delete(\"Content-Length\")\n [200, @source_headers, []]\n else\n [200, @source_headers.merge(\"Content-Length\" => ::File.size(@thumb.path).to_s), self]\n end\n\n throw :halt, response\n end", "title": "" }, { "docid": "ad6ee66f0725af9586e0bcdb95977b76", "score": "0.6407678", "text": "def serve\n response = if head?\n @source_headers.delete(\"Content-Length\")\n [200, @source_headers, []]\n else\n [200, @source_headers.merge(\"Content-Length\" => ::File.size(@thumb.path).to_s), self]\n end\n\n throw :halt, response\n end", "title": "" }, { "docid": "dbe20f6b11fae88671b7dc127ef394c5", "score": "0.63803345", "text": "def show\n unit = Unit.find(params[:id]) \n @image = unit.image\n send_data(@image,:type => \"image/gif\", :filename => unit.name + \".jpg\",\n :disposition => 'inline')\n end", "title": "" }, { "docid": "05814a188db7f5ae65c086fb149fbe7c", "score": "0.63615006", "text": "def display\n @image = Image.find(params[:image_id])\n send_file @image.url_url(params[:version]).to_s, :disposition => 'inline', :type=>\"application/jpg\", :x_sendfile=>true\n end", "title": "" }, { "docid": "5907f27a20797b95581988150c07c9ce", "score": "0.6338267", "text": "def show\n # send_data @image.tempfile.open.read, :type => 'image/png',:disposition => 'inline'\n end", "title": "" }, { "docid": "728300e61a0c2cec1a22ebe8afdc4b0e", "score": "0.6318215", "text": "def client_gallery_image\n #Get the photo from params\n if params[:id].blank?\n \"\"\n else\n photo = Photo.find(params[:id])\n if photo.nil?\n \"\"\n else\n #Render the photo\n send_data photo.photo, :filename => photo.orig_file_name\n end\n end\n end", "title": "" }, { "docid": "c9e34fa77a83fd6abfdd9435353de1f6", "score": "0.6310631", "text": "def show\n\n size = params[:size].nil? ? 16.to_s : params[:size]\n @icon = Icon.find_by_content_type(params[:id])\n\n iconPath = nil\n unless @icon.nil?\n iconPath = Rails.root.join('public', 'images', 'mimetypes', size, @icon.file_name)\n iconPath = nil if !File.exists?(iconPath)\n end\n\n iconPath = Rails.root.join('public', 'images', 'mimetypes', size, 'default.png') if iconPath.nil?\n\n send_file iconPath, :type => 'image/png', :disposition =>'inline'\n end", "title": "" }, { "docid": "8c2a09fff842def5053ee3650d13d753", "score": "0.6305421", "text": "def content_type\n \"image/jpg\"\n end", "title": "" }, { "docid": "8c2a09fff842def5053ee3650d13d753", "score": "0.6305421", "text": "def content_type\n \"image/jpg\"\n end", "title": "" }, { "docid": "a8a350c25452295b481758aed0b18f3b", "score": "0.6263637", "text": "def mstile_150\n serve_image :mstile_150\n end", "title": "" }, { "docid": "aa9ea96cd9d33776236796355226c382", "score": "0.6245264", "text": "def get_image\n\t\tsource_file = Item.new(Path.new(params[:source]+\".\"+params[:type]))\n\t\tbegin\n\t\t\tsend_file source_file.path, :filename => source_file.path.basename.to_s, :type => \"image/#{params[:type]}\"\n\t\trescue \n\t\t\tnot_found\n\t\tend\n\tend", "title": "" }, { "docid": "0b2c8ff6ba12fab2fac92d9a3489cd31", "score": "0.62395805", "text": "def image\n model = Admin::UploadedAsset.find(params[:id])\n style = params[:style] ? params[:style] : 'original'\n send_data model.file.file_contents(style),\n filename: model.file_file_name,\n content_type: model.file_content_type\n end", "title": "" }, { "docid": "03af4437195282cc024959598f85daaf", "score": "0.62386817", "text": "def thumb\n @property_image = PropertyImage.find(params[:id])\n respond_to do |format|\n format.jpg # thumb.jpg.flexi\n end\n end", "title": "" }, { "docid": "d3865946a985b59d19e97bde5c174ed6", "score": "0.62185025", "text": "def show\n\n matches = params[:size].match(\"([0-9]+)x([0-9]+).*\") if params[:size]\n\n default_size = 200\n min_size = 16\n max_size = 200\n\n if matches\n\n width = matches[1].to_i\n height = matches[2].to_i\n\n if ((width < min_size) || (width > max_size) || (height < min_size) || (height > max_size))\n width = default_size\n height = default_size\n end\n\n else\n width = 200\n height = 200\n end\n \n send_cached_data(\"public/pictures/show/#{width.to_i}x#{height.to_i}/#{params[:id].to_i}.jpg\",\n :type => 'image/jpeg', :disposition => 'inline') {\n find_picture\n img = Magick::Image.from_blob(@picture.data).first\n img = img.change_geometry(\"#{width}x#{height}>\") do |c, r, i| i.resize(c, r) end\n\n img.format = \"jpg\"\n img.to_blob\n }\n\n end", "title": "" }, { "docid": "1df6749d9c17750f9379767236c83077", "score": "0.6218188", "text": "def get \n expires_in 12.hours, :public => true\n \n if params[:id] == \"false\"\n send_data Rails.root.join(\"public\", \"files\", \"404.png\"), :type => \"image/png\", :disposition => \"inline\"\n return \n end\n \n filepath = Rails.root.join( \"public\", \"files\", File.basename(params[:id]) + \".\" + params[:ext] )\n \n if File.exists? filepath\n \n if params[:ext] == \"jpg\" \n content_type = 'image/jpeg' \n end\n if params[:ext] == \"png\" \n content_type = 'image/png'\n end\n \n return send_data File.read(filepath), :type => content_type, :disposition => \"inline\"\n end\n \n render :nothing => true\n end", "title": "" }, { "docid": "7278d53b4589b0cb7afd1f211e083fae", "score": "0.621113", "text": "def get_image\n img = Image.find(params[:id])\n\n if img.nil?\n redirect_to(THETIS_RELATIVE_URL_ROOT + '/404.html' )\n return\n end\n\n parent_item = img.item\n if parent_item.nil? or !parent_item.check_user_auth(@login_user, 'r', true)\n Log.add_check(request, '[Item.check_user_auth]'+request.to_s)\n redirect_to(:controller => 'frames', :action => 'http_error', :id => '401')\n return\n end\n\n response.headers[\"Content-Type\"] = img.content_type\n response.headers[\"Content-Disposition\"] = \"inline\"\n render(:text => img.content)\n end", "title": "" }, { "docid": "e6b0639aa41d9630c53144cfa7b0672c", "score": "0.61947364", "text": "def home_image\n #Get the photo from params\n if params[:id].blank?\n \"\"\n else\n photo = Photo.find(params[:id])\n if photo.nil?\n \"\"\n else\n #Render the photo\n send_data photo.photo, :filename => photo.orig_file_name\n end\n end\n end", "title": "" }, { "docid": "6e6b68ce0f06a1547f12fb8d7e70e70b", "score": "0.6194261", "text": "def get_player_image(username, type, size)\n url = \"http://i.fishbans.com/#{type}/#{username}/#{size}\"\n response = get(url, false)\n ChunkyPNG::Image.from_blob(response.body)\n end", "title": "" }, { "docid": "3d05cc6a7b5fe66d19ea54c4182d28c4", "score": "0.6190397", "text": "def thumbnail(image, args={})\n if image.is_a?(Image)\n id = image.id\n else\n id = image.to_s.to_i\n image = nil\n end\n\n # Get URL to image.\n size = (args[:size] || default_thumbnail_size).to_sym\n if size == :original\n # Must pass in image instance to display original!\n file = image.original_file\n else\n file = Image.file_name(size, id)\n end\n if image && !image.transferred && size != :thumbnail\n # Serve image from web server if it hasn't transferred yet. Since apache can't know\n # about this, we have to fake it into thinking it's not serving an image. Route it\n # through ajax controller to reduce overhead to minimum.\n file = \"/ajax/image/#{file.sub(/\\.jpg$/,'')}\"\n elsif DEVELOPMENT and !File.exists?(\"#{IMG_DIR}/#{file}\")\n # Serve images I'm locally missing directly from image server.\n file = Image.url(size, id)\n end\n\n # Create <img> tag.\n opts = {}\n opts[:border] = args[:border] if args.has_key?(:border)\n opts[:style] = args[:style] if args.has_key?(:style)\n str = image_tag(file, opts)\n str += args[:append].to_s\n\n # Decide what to link it to.\n case link = args[:link] || :show_image\n when :show_image\n link = { :controller => 'image', :action => 'show_image', :id => id,\n :params => args[:query_params] || query_params }\n link[:obs] = args[:obs] if args.has_key?(:obs)\n when :show_observation\n link = { :controller => 'observer', :action => 'show_observation',\n :id => args[:obs], :params => args[:query_params] || query_params }\n raise \"missing :obs\" if !args.has_key?(:obs)\n when :show_user\n link = { :controller => 'observer', :action => 'show_user',\n :id => args[:user] }\n raise \"missing :user\" if !args.has_key?(:user)\n when :show_term\n link = { :controller => 'glossary', :action => 'show_term',\n :id => args[:term] }\n raise \"missing :term\" if !args.has_key?(:term)\n when :none\n link = nil\n when Hash\n else\n raise \"invalid link\"\n end\n\n # Enclose image in a link?\n link_args = {}\n link_args[:target] = args[:target] if args[:target]\n result = link ? link_to(str, link, link_args) : str\n\n # Include AJAX vote links below image?\n if @js && @user && args[:votes]\n table = image_vote_tabs(image || id, args[:vote_data])\n result += '<br/>' + content_tag(:div, table, :id => \"image_votes_#{id}\")\n did_vote_div = true\n end\n\n # Include original filename.\n if args[:original] and\n image and !image.original_name.blank? and (\n check_permission(image) or\n (image and image.user and image.user.keep_filenames == :keep_and_show)\n )\n result += '<br/>' unless did_vote_div\n result += h(image.original_name)\n end\n\n # Wrap result in div.\n if args[:nodiv]\n result\n else\n content_tag(:div, result, :class => args[:class] || 'thumbnail')\n end\n end", "title": "" }, { "docid": "f85f839efa3134aed2905d8df93fddae", "score": "0.6187072", "text": "def show\n @picture = Picture.find(params[:id])\n content = @picture.content\n if params[:size].present?\n if params[:size] == 'small'\n content = @picture.small\n elsif params[:size] == 'thumbnail'\n content = @picture.thumbnail\n end\n end\n send_data(content, :type => @picture.mime_type, :filename => @picture.name, :disposition => 'inline')\n end", "title": "" }, { "docid": "d8da2f58cc73adbd791d1865d59bb724", "score": "0.6172722", "text": "def show\n @site = Site.find_by_name(params[:site])\n if @site.nil?\n head(:not_found) and return \n end\n @folder = @site.folders.by_name(params[:folder]).first\n if @folder.nil?\n head(:not_found) and return \n end\n @image = @folder.images.by_id(params[:id]).first\n if @image.nil?\n return head(:not_found)\n end\n path = @image.image.path(params[:style])\n p \"file path = #{path}\"\n #unless File.exist?(path) && params[:format].to_s == File.extname(path).gsub(/^\\.+/, '')\n unless File.exist?(path)\n head(:bad_request) and return \n end\n send_file_options = {:type => @image.image.content_type ,\n :disposition => 'inline'\n }\n# case ::AppConfig::Application.instance.send_file_mathod\n# when 'x_sendfile'; send_file_options[:x_sendfile] = true\n# when 'x_accel_redirect' then \n# head(:x_accel_redirect => path.gsub(Rails.root, ''), :content_type => send_file_options[:type]) and \n# return\n# end\n send_file(path, send_file_options)\n end", "title": "" }, { "docid": "a67fed75ba4d84c0a2e4de8798eb2adc", "score": "0.61651635", "text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.jpg # show.jpg.flexi \n format.png #show.png.flexi\n format.html # show.html.erb\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "82a3b98dc8dc5f06d7d47fb10b6fcb11", "score": "0.61596507", "text": "def send_image(args)\n\n file_path, file_name = args[:file_path], args[:file_name]\n type_file = `file -b '#{file_path}'`\n unless type_file[/png|gif|jpg|jpeg/i]\n raise ImageHostingNotSupportError, \"Not support format image\"\n end\n if File.size(file_path) > 2.megabytes\n raise ImageHostingNotSupportError, \"Big image\"\n end\n\n begin\n boundary = ActiveSupport::SecureRandom.hex.upcase\n\n form = Tempfile.new(boundary)\n form << \"--\" << boundary << \"\\r\\n\"\n file_to_post_param(form, \"img\", file_path, file_name)\n form << \"\\r\\n--\" << boundary << \"--\\r\\n\"\n form.seek(0)\n get_cookeis\n response = HTTParty.post \"http://www.stooorage.com/\", {\n :body => form.read,\n :headers => {\n 'Content-Length' => form.length.to_s,\n 'Content-Type' => \"multipart/form-data; boundary=#{boundary}\",\n 'Accept-Language' =>\t'en-us,en;q=0.5' }\n }\n\n rescue\n raise ImageHostingServiceAvailableError\n ensure\n form = nil\n GC.start\n end\n\n begin\n doc = Nokogiri.parse(response)\n result = doc.css(\"div.links\").map {|x|\n [x.css(\"div\").first.text.strip,\n x.css(\"div:last\").css(\"input\").attr(\"value\").to_s.strip] }\n\n raise ImageHostingLinksError if result.blank?\n rescue\n raise ImageHostingLinksError\n end\n\n return result\n\n rescue => ex\n raise ex\n end", "title": "" }, { "docid": "26bbaabd29a420291f4bb867e1842e06", "score": "0.6158213", "text": "def thumb\n document = current_user.documents.find params[:document_id]\n serve_image document.thumb.url, document.created_at, document.cache_key\n end", "title": "" }, { "docid": "4f2461d77a4f8a1a2831b23b1ffb6943", "score": "0.613572", "text": "def medium\n\n if stale?(:etag => @asset.cache_key, :last_modified => @asset.preview.created_at.utc)\n \n respond_to do |format|\n format.png {\n \n # Send the file down the pipe...\n send_file @asset.thumbnails[:medium].path, :type => \"image/png\", :disposition => \"inline\", :status => 200\n }\n end\n end\n \n end", "title": "" }, { "docid": "05a6714a631346c64b13e4ace4195090", "score": "0.6129189", "text": "def large_glider\n @market_segment_image = MarketSegmentImage.find(params[:id])\n respond_to do |format|\n format.jpg # large_glider.jpg.flexi\n end\n end", "title": "" }, { "docid": "4e609afa72e470ef74d6c1c3187e8940", "score": "0.61273104", "text": "def host\n return unless self.image_path.present?\n\n # Create tiny thumbnail\n #\n image = MiniMagick::Image.open(self.image_url)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 36,:height => 36})\n\n FileSystem.store(\n thumbnail_path,\n open(image.path),\n \"Content-Type\" => \"image/png\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create medium thumbnail\n #\n image = MiniMagick::Image.open(self.image_url)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 100,:height => 100})\n\n FileSystem.store(\n medium_path,\n open(image.path),\n \"Content-Type\" => \"image/png\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create large thumbnail\n #\n image = MiniMagick::Image.open(self.image_url)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 180,:height => 180})\n\n FileSystem.store(\n large_path,\n open(image.path),\n \"Content-Type\" => \"image/png\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n\n self.is_processed = true\n self.save(false)\n\n rescue => ex\n LoggedException.add(__FILE__,__method__,ex)\n end", "title": "" }, { "docid": "a1382e8aa0721ec7ac265056b153c8f9", "score": "0.61221397", "text": "def show\n image = Image.find_by_hash(params[:id])\n if image.nil?\n return render json: {status: \"Image Doesn't exist\"}, status: 400\n end\n send_data(image.file.download, type: image.file.content_type, filename: image.file.filename.to_s, disposition: 'inline')\n end", "title": "" }, { "docid": "99b314de2ac630bf30fdc8e314558dbe", "score": "0.60874957", "text": "def photo\n url = params[:url]\n image = @client.http_get(url).body\n send_data image, :disposition => 'inline', :content_type => 'image'\n end", "title": "" }, { "docid": "86ca1ef7ceccf79c2c2e4eeff2548dda", "score": "0.6083449", "text": "def my_image_tag image\n return image_tag image.url :big unless image.content_type == 'image/gif'\n image_tag image.url\n end", "title": "" }, { "docid": "cc2b7b71d8a0d6cf7488250f914cbb48", "score": "0.6081977", "text": "def showImage1\n\t@image_data = Applicant.find(params[:id])\n\t@image = @image_data.itr\n\tsend_data @image, :type => \"image/jpg\", :disposition => 'inline'\n end", "title": "" }, { "docid": "f0fb4379ced7eaf77f0bde4c617ab48b", "score": "0.60740376", "text": "def portrait_image\n #Get the photo from params\n if params[:id].blank?\n \"\"\n else\n photo = Photo.find(params[:id])\n if photo.nil?\n \"\"\n else\n #Render the photo\n send_data photo.photo, :filename => photo.orig_file_name\n end\n end\n end", "title": "" }, { "docid": "e84ce9cd70a8011a187737ef667ca4ff", "score": "0.60649216", "text": "def showImage4\n\t@image_data = Applicant.find(params[:id])\n\t@image = @image_data.picture\n\tsend_data @image, :type => \"image/jpg\", :disposition => 'inline'\n end", "title": "" }, { "docid": "739f18a0d341d763ded556d97d42b7b9", "score": "0.60096914", "text": "def image(image_id)\n response, status = BeyondApi::Request.get(@session, \"/shop/images/#{image_id}\")\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "739f18a0d341d763ded556d97d42b7b9", "score": "0.60096914", "text": "def image(image_id)\n response, status = BeyondApi::Request.get(@session, \"/shop/images/#{image_id}\")\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "e6d1a5c754c1ed2c1aa73e5011a17b5a", "score": "0.60066754", "text": "def large\n \n \n if stale?(:etag => @asset.cache_key, :last_modified => @asset.preview.created_at.utc)\n \n respond_to do |format|\n format.jpg {\n \n # Send the file down the pipe...\n send_file @asset.thumbnails[:large].path, :type => \"image/jpg\", :disposition => \"inline\", :status => 200\n }\n end\n end\n \n end", "title": "" }, { "docid": "bdc2433cab4a74ff3545921edea199c5", "score": "0.59967667", "text": "def display_image\n image_url.variant resize_to_limit: [360, 400]\n end", "title": "" }, { "docid": "5d1058d282f2f815beacc65b36c6f5dc", "score": "0.5984601", "text": "def image_preview options = {}\n if options[:file].nil? || !options.key?(:file)\n puts \"Please, set filename for preview\"\n exit\n else\n file = options[:file]\n end\n size = options[:size] || 'XS'\n req = Net::HTTP::Get.new file + \"/?preview&size=#{size}\"\n req.basic_auth @login, @pass\n req['Host'] = \"webdav.yandex.#{@location}\"\n req['User-Agent'] = \"yadisk-ruby-cli\"\n res = http.request req\n if res.code == \"200\"\n data = res.body\n basename = File.basename file\n ext = File.extname(basename)\n output = basename.gsub(ext, \"-preview-#{size}#{ext}\")\n File.new(\"#{output}\", 'wb').write(data)\n puts \"#{file} preview is successfully downloaded\"\n else\n puts \"Invalid returned data from server\"\n end\n end", "title": "" }, { "docid": "8780293b5b023ed1375e2c712e4e920b", "score": "0.5983958", "text": "def small\n \n if stale?(:etag => @asset.cache_key, :last_modified => @asset.preview.created_at.utc)\n \n respond_to do |format|\n format.png {\n \n # Send the file down the pipe...\n send_file @asset.thumbnails[:small].path, :type => \"image/png\", :disposition => \"inline\", :status => 200\n }\n end\n end\n end", "title": "" }, { "docid": "18930da614053a3be613829fb1afefd8", "score": "0.5978289", "text": "def show_image\n\t\t@product = Product.find(params[:id])\n\t\tif @product.image.nil?\n\t\t\tsend_data open(\"#{Rails.root}/lib/seeds/images/no_image.jpg\", \"rb\").read, type: 'image/jpg'\n\t\telse\n\t\t\tsend_data @product.image, type: 'image/jpg'\n\t\tend\n\tend", "title": "" }, { "docid": "6f81714dcc4e77f33d6d46af33dbb2fc", "score": "0.5972032", "text": "def original\n @property_image = PropertyImage.find(params[:id])\n respond_to do |format|\n format.html # original.html.erb\n format.png # original.png.flexi\n end\n end", "title": "" }, { "docid": "7ec1d724dbe6685d09708f04039b1db3", "score": "0.5969822", "text": "def show\n @question_image = QuestionImage.find(params[:id])\n\n @image = @question_image.image_data\n send_data @image, :type => @question_image.content_type, \n :filename => @question_image.file_name, \n :disposition => 'inline'\n #respond_to do |format|\n # format.html # show.html.erb\n # format.xml { render :xml => @question_image }\n #end\n end", "title": "" }, { "docid": "a711a689231768adf156857a09afc806", "score": "0.59585196", "text": "def show_image\n\t\t@shop_product = ShopProduct.find(params[:id])\n\t\tif @shop_product.image.nil?\n\t\t\tsend_data open(\"#{Rails.root}/lib/seeds/images/no_image.jpg\", \"rb\").read, type: 'image/jpg'\n\t\telse\n\t\t\tsend_data @shop_product.image, type: 'image/jpg'\n\t\tend\n\tend", "title": "" }, { "docid": "48cd0047d12c0f83fe3e5db01499817a", "score": "0.5946235", "text": "def send_image(img, format)\n content_type format.to_sym\n img\n end", "title": "" }, { "docid": "157d6b7d6a43ebfdee9e42af16a7abd4", "score": "0.5937533", "text": "def serve_image(path, created_at, etag)\n if stale? last_modified: created_at.utc, etag: etag\n expires_in 1.year, public: false\n send_file path, inline: true\n end\n end", "title": "" }, { "docid": "35dcd4a9f568979ed5fed84e80853598", "score": "0.5933897", "text": "def download\n @image = Image.find(params[:id])\n send_file(RAILS_ROOT+\"/public\"+@image.image.url.split(\"?\")[0], :disposition => 'inline', :stream => false)\n end", "title": "" }, { "docid": "19baff2d7e4dd995fdd1a9b789b1a0bd", "score": "0.59334034", "text": "def image\n response.headers[\"Expires\"] = 1.hour.from_now.httpdate\n Rails.logger.info { \"cache miss for profile picture of #{params[:uid]}\" }\n result = nil\n bind_ldap(false) do |ldap_conn|\n result = get_image(ldap_conn, params[:uid])\n end\n type, image = result\n\n if type == :gravatar # if no image is in LDAP\n url = \"https://gravatar.com/avatar/#{Digest::MD5.hexdigest(image)}?size=200&d=mm\"\n if @uid == params[:uid] # user is logged in through webauth and is viewing themself\n # steals the image from gravatar and uploads it to LDAP so we can do caching\n image = nil\n open(url, 'rb') do |name|\n Rails.logger.info { \"uploading #{@uid}'s image to LDAP\" }\n update = generate_image_update(name)\n ldap_write(update, [], true)\n end\n end\n\n # always write the image so that it gets cached\n image = nil\n open(url, 'rb') { |f| image = f.read }\n send_data(image, filename: \"#{params[:uid]}.jpg\", type: \"image/jpeg\") \n else # image is in LDAP\n send_data(image, filename: \"#{params[:uid]}.jpg\", type: \"image/jpeg\")\n end\n end", "title": "" }, { "docid": "9b6511d5b48d2537d186cccba72f9615", "score": "0.5930611", "text": "def showImage2\n\t@image_data = Applicant.find(params[:id])\n\t@image = @image_data.electricity\n\tsend_data @image, :type => \"image/jpg\", :disposition => 'inline'\n end", "title": "" }, { "docid": "6c2a961748cff9715e78a867f1059f1f", "score": "0.5930188", "text": "def thumbnail_url(pid = nil)\n if pid.nil?\n if params[:pid].blank?\n send_data({}, {:status => 404})\n return\n end\n pid = params[:pid]\n end\n\n file = TiffFile.find(pid)\n\n if file.datastreams['thumbnail'].nil?\n send_data({}, {:status => 404})\n return\n end\n\n send_data(file.thumbnail.content, {:filename => file.thumbnail.label, :type => file.thumbnail.mimeType, :disposition => 'inline'})\n end", "title": "" }, { "docid": "eec5adf89024858c39b5a49b61ebcc70", "score": "0.5928259", "text": "def image id \n if id.nil? || id == 0\n \"/no_image/no_image.png\"\n else\n Asset.find(id).img.url(:original)\n end\n end", "title": "" }, { "docid": "d9046276611156f5a7f7b511316c844e", "score": "0.59227586", "text": "def show_image(image_id)\n if image_id.nil?\n image_tag IMAGE_NOT_FOUND\n else\n @image_path = get_file_path image_id\n image_tag @image_path\n end\n end", "title": "" }, { "docid": "872a3ff7e068ac16ce22195f49afd250", "score": "0.5922754", "text": "def showImage3\n\t@image_data = Applicant.find(params[:id])\n\t@image = @image_data.admission\n\tsend_data @image, :type => \"image/jpg\", :disposition => 'inline'\n end", "title": "" }, { "docid": "4bf1537ba916d7c320ba0cff11ee2101", "score": "0.59191126", "text": "def retrieve_image(type = :original)\n image_src = 'http://placehold.it/650x500'\n\n # TODO add fixed sizes as small, large, original, etc.\n case type\n when :thumbnail\n image_src = 'http://placehold.it/130x100'\n when :small\n image_src = 'http://placehold.it/390x300'\n when :medium\n image_src = 'http://placehold.it/650x500'\n end\n\n image_src = image.url(type) if image?\n image_src\n end", "title": "" }, { "docid": "cd391471eb2df57130637740a7dc85ba", "score": "0.5917191", "text": "def upload_image\n @uploader = ImageUploader.new\n if @uploader.cache!(params[:file])\n render json: { :image => @uploader.thumb.url }\n end\n rescue => e\n render :json => [e.to_s], :status => :unprocessable_entity\n end", "title": "" }, { "docid": "b188fe62b28564aebd896a43a60cea33", "score": "0.5908422", "text": "def post_file_to_server id, content, size, page_count\n @s.execute_file_post @s.url_for(\"system/pool/createfile.#{id}.page#{page_count}-#{size}\"), \"thumbnail\", \"thumbnail\", content, \"image/jpeg\"\n alt_url = @s.url_for(\"p/#{id}/page#{page_count}.#{size}.jpg\")\n @s.execute_post alt_url, {\"sakai:excludeSearch\" => true}\n log \"Uploaded image to curl #{alt_url}\"\nend", "title": "" }, { "docid": "3eab3517edd019cec7632f134fbad47d", "score": "0.5890671", "text": "def show\n @avatar = Avatar.find(params[:id])\n send_file @avatar.image.path, :filename => @avatar.image.original_filename, :type => @avatar.image.content_type, :disposition => 'inline'\n end", "title": "" }, { "docid": "758314711f671a30f92981afbaa5999b", "score": "0.5883335", "text": "def show\n @photo = Photo.where(\"id = ? and kazoku_id = ?\", \n params[:id], @current_user.kazoku.id).first\n\n if params.has_key?(\"data\") then\n image = Magick::Image.from_blob(@photo.content.data).first\n if scale = params[:scale] then\n image = image.change_geometry(scale) do |cols,rows,img|\n img.resize(cols, rows)\n end\n end\n send_data(image.to_blob, :type => @photo.mime_type, :disposition => 'inline')\n\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @photo }\n end\n end\n end", "title": "" }, { "docid": "6ae2ad2b78bed5eef25d030bb3a20f5a", "score": "0.58757114", "text": "def imagable(entity, size, options = {})\n options[:dest] = entity.image.public_filename unless options[:dest] or entity.image.blank?\n options[:alt] = entity.name unless options[:alt]\n options[:width] = options[:width] if options[:width]\n options[:height] = options[:height] if options[:height]\n img_src = if entity.image\n begin\n entity.image.thumb(size.to_s).public_filename\n rescue\n \"/images/upload_error/#{size.to_s}.jpg\"\n end\n else\n return \"\" if options[:no_default]\n \"/images/upload_default/#{size.to_s}.jpg\"\n end\n\n if options[:dest] and options[:no_link].blank? and entity.image\n o = link_to image_tag(img_src, :alt => options[:alt]), options[:dest]\n else\n o = image_tag(img_src, :alt => options[:alt])\n end\n \n o\n\tend", "title": "" }, { "docid": "64a501966674827e4e2626dca819e53d", "score": "0.58655053", "text": "def thumbnail\n @party = Party.get_party(params[:id])\n @rightholderid = params[:id]\n @image = nil\n if @party.image.blank?\n freebase = Freebase.get(params[:name], params[:life_dates])\n @image = RightsholderImage.new(freebase.id, freebase.src) if !freebase.blank?\n else\n @image = RightsholderImage.new(\"http://nla.gov.au/\" + @party.image, \"http://nla.gov.au/\" + @party.image.strip + \"-t\")\n end\n\n end", "title": "" }, { "docid": "b19675bb72d1da6bbdcbce3d058bb4e4", "score": "0.58637226", "text": "def show\n @slide = Slide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @slide }\n format.jpg { send_file @slide.original_file_name, :type => 'image/jpeg', :disposition => 'inline' }\n end\n end", "title": "" }, { "docid": "248547b071a0c4f69698056f430dc7c5", "score": "0.58634967", "text": "def process_image\n\n end", "title": "" }, { "docid": "2680b1c8e1fa529e61b29c63ce4cd722", "score": "0.5857137", "text": "def send_image_url\n _form_field_entry = FormFieldEntry.find(params[:id])\n _entry_data = _form_field_entry.img_data\n @data_img_src = _entry_data\n render :template => 'web/load/send_image_url', :layout => false\n end", "title": "" }, { "docid": "624253b38cc7db50543f152ae4bca791", "score": "0.5853255", "text": "def download_image(url,src_url,dest_path)\n if !src_url.include?(\"http://\")\n src_url = \"http://\" + URI.parse(url).host + src_url\n end\n content_type = http_content_type(src_url)\n content_type = content_type.gsub(\"image/\", \"\")\n content_type = content_type.gsub(\"pjpeg\",\"jpg\")\n content_type = content_type.gsub(\"jpeg\",\"jpg\")\n vortex_url = download_resource(src_url,dest_path,content_type)\n return vortex_url\nend", "title": "" }, { "docid": "5149493db1453f206df6086f24f887f1", "score": "0.58524966", "text": "def image_for_id_at_size(id, size) \n \"#{CANMORE_URL}/images/#{size}/#{id}/\"\n end", "title": "" }, { "docid": "ba309f08928bf249bcc0781aa13d883c", "score": "0.5846218", "text": "def image(type = 'thumb')\n self.original_pic_url(type)\n end", "title": "" }, { "docid": "5efbefb63babe92a9f33f5eb5209c44f", "score": "0.5843039", "text": "def show_image\n #caches_page :show_image\n \n #host = 'chart.googleapis.com'\n if @qrcode = Qrcode.find(params[:qrcode_id])\n if @qrcode.image.nil?\n host = 'chart.googleapis.com'\n res = Net::HTTP.get_response(host, @qrcode.image_url)\n if @image = res.body\n send_data(@image, :disposition => 'inline')\n else\n puts \"SOMETHING WENT WRONG\"\n end\n else\n @image = @qrcode.image\n send_data(@image, :disposition => 'inline')\n end \n end\n end", "title": "" }, { "docid": "c6795096b734900a513d0b7c80d986c2", "score": "0.58425105", "text": "def thumbnail(image, args={})\n if image.is_a?(Image)\n id = image.id\n else\n id = image.to_s.to_i\n image = nil\n end\n\n # Get URL to image.\n size = (args[:size] || default_thumbnail_size).to_sym\n if size == :original\n # Must pass in image instance to display original!\n file = image.original_file\n else\n file = Image.file_name(size, id)\n end\n if DEVELOPMENT and !File.exists?(\"#{IMG_DIR}/#{file}\")\n # Serve images I'm locally missing directly from image server.\n file = Image.url(size, id)\n end\n\n # Create <img> tag.\n opts = {}\n opts[:border] = args[:border] if args.has_key?(:border)\n opts[:style] = args[:style] if args.has_key?(:style)\n str = image_tag(file, opts)\n str += args[:append].to_s\n\n # Decide what to link it to.\n case link = args[:link] || :show_image\n when :show_image\n link = { :controller => 'image', :action => 'show_image', :id => id,\n :params => query_params }\n link[:obs] = args[:obs] if args.has_key?(:obs)\n when :show_observation\n link = { :controller => 'observer', :action => 'show_observation',\n :id => args[:obs], :params => query_params }\n raise \"missing :obs\" if !args.has_key?(:obs)\n when :show_user\n link = { :controller => 'observer', :action => 'show_user',\n :id => args[:user] }\n raise \"missing :user\" if !args.has_key?(:user)\n when :none\n link = nil\n when Hash\n else\n raise \"invalid link\"\n end\n\n # Enclose image in a link?\n result = link ? link_to(str, link) : str\n\n # Include AJAX vote links below image?\n if @js && @user && args[:votes]\n table = image_vote_tabs(image || id, args[:vote_data])\n result += '<br/>' + content_tag(:div, table, :id => \"image_votes_#{id}\")\n end\n\n if args[:nodiv]\n result\n else\n content_tag(:div, result, :class => args[:class] || 'thumbnail')\n end\n end", "title": "" }, { "docid": "32345e8a9d83ed056a1f15dd82ab2c85", "score": "0.58397263", "text": "def thumb\n @map = Map.find(params[:id])\n\n send_file(@map.upload.path(:thumb), disposition: :inline)\n end", "title": "" }, { "docid": "b22efb2192e82877a27e3055390244a0", "score": "0.5837545", "text": "def get_file_thumb\r\n\r\n @file_import = FileImport.find_by_id(params[:id])\r\n filename = nil\r\n document = nil\r\n mime\t = nil\r\n case params[:sid].to_s\r\n when \"file\"\r\n filename = @file_import.file__thumb_path\r\n filename ||= @file_import.file__name\r\n document = @file_import.file\r\n end\r\n if filename\r\n mime = MIME::Types.type_for(filename)\r\n file_type = mime.first ? mime.first.content_type : 'application/octet-stream'\r\n disposition\t= 'inline' if mime.first && ['text', 'image'].include?(mime.first.media_type)\r\n disposition ||= 'attachment'\r\n extension = filename.split('.').last\r\n if mime.first.nil? || mime.first.media_type != 'image'\r\n icon = Rails.root.join('public', 'images', 'file_icons', \"#{extension}.png\").to_s\r\n icon = Rails.root.join('public', 'images', 'file_icons', \"defaut.png\").to_s unless File.exist?(icon)\r\n\r\n # sends thumbnail file\r\n\r\n send_data(File.open(icon).read, :filename => File.basename(icon), :type => 'image/png', :disposition => 'inline')\r\n return\r\n end\r\n if document && FileImport.columns.find{|e| e.name == params[:sid]}\r\n\r\n # sends thumbnail blob in the database\r\n\r\n send_data(@file_import.thumbnail(params[:sid]), :filename => filename, :type => file_type, :disposition => 'inline')\r\n else\r\n\r\n # makes thumbnail and send\r\n\r\n thmb = @file_import.thumbnail(params[:sid])\r\n if thmb\r\n send_data(thmb, :filename => filename, :type => file_type, :disposition => 'inline')\r\n else\r\n render :nothing => true\r\n end\r\n end\r\n else\r\n render :nothing => true\r\n end\r\n end", "title": "" }, { "docid": "1fac4d037771daeecd9fcbf2ab81f2b5", "score": "0.58292526", "text": "def get_thumbnail\n fileset = get_the_fileset\n if fileset.nil? == false\n filename = \"#{CurationConcerns.config.derivatives_path}/#{thumbnail_from_fileset( fileset )}\"\n if File.exist?( filename )\n send_file filename, :type => 'image/jpeg', :disposition => 'inline'\n else\n puts \"==> ERROR: cannot locate thumbnail for fileset #{fileset.id} (#{filename})\"\n render_nothing\n end\n else\n puts \"==> ERROR: cannot locate fileset #{params[:id]}\"\n render_nothing\n end\n\n end", "title": "" }, { "docid": "fb675c9244db487aa17d3cc77fcacf29", "score": "0.58283836", "text": "def work_image_tag(original_path, size = :work_show, use_image_server = true)\n image_tag work_image_url(original_path, size, use_image_server) \n end", "title": "" }, { "docid": "5a99f3c6691b80e5e6c29b76d914027c", "score": "0.58265203", "text": "def render_image( file, options = {} )\n format = if options.is_a?(Hash) then options[:force_format] else nil end\n mime_type = if options.is_a?(String) then options else options[:mime_type] end\n mime_type ||= file.mime_type\n path = if file.is_a?( String ) then file else file.path end\n headers[\"Content-Type\"] = mime_type unless format\n \n if block_given? or format\n img = ::Magick::Image::read(path).first\n img = yield( img ) if block_given?\n img.format = format.to_s.upcase if format\n render :text => img.to_blob, :layout => false\n else\n send_file( path )\n end\n end", "title": "" }, { "docid": "1999894ec3a16107da249ccc13cb4eb5", "score": "0.5824475", "text": "def display_image\n return nil unless solr_document.image? && current_ability.can?(:read, id)\n\n latest_file_id = lookup_original_file_id\n\n return nil unless latest_file_id\n\n url = Hyrax.config.iiif_image_url_builder.call(\n latest_file_id,\n request.base_url,\n Hyrax.config.iiif_image_size_default\n )\n\n # @see https://github.com/samvera-labs/iiif_manifest\n IIIFManifest::DisplayImage.new(url,\n width: width,\n height: height,\n iiif_endpoint: iiif_endpoint(latest_file_id))\n end", "title": "" }, { "docid": "bd5374849bcb840affecf0c5b6984cd3", "score": "0.58203375", "text": "def image\n # if we have a cache key with aprint and style, assume we're good\n # to just return that value\n if img = Rails.cache.read(\"img:#{params[:id]}:#{params[:aprint]}:#{params[:style]}\")\n _send_file(img) and return\n end\n\n asset = Asset.find_by_id(params[:id])\n\n if !asset\n render_not_found and return\n end\n\n asset.request = request\n\n # Special case for \"original\"\n # This isn't a \"style\", just someone has requested\n # the raw image file.\n if params[:aprint] == \"original\"\n _send_file(asset.file_key) and return\n end\n\n # valid style?\n output = Output.find_by_code(params[:style])\n\n if !output\n render_not_found and return\n end\n\n # do the fingerprints match? If not, redirect them to the correct URL\n if asset.image_fingerprint && params[:aprint] != asset.image_fingerprint\n redirect_to image_path(\n :aprint => asset.image_fingerprint,\n :id => asset.id,\n :style => params[:style]\n ), status: :moved_permanently and return\n end\n\n # do we have a rendered output for this style?\n # if not then create a new one.\n retries = 0\n begin\n asset_output = asset.outputs.where(output_id: output.id, image_fingerprint: asset.image_fingerprint).first_or_create\n rescue ActiveRecord::RecordNotUnique => ex\n if ex.message =~ /Duplicate entry/\n retries += 1\n raise ex if retries > 3 # max 3 retries \n sleep 5\n retry\n else\n raise ex\n end\n end\n\n # if a new asset_output gets created, it should automatically\n # fire off a new render job that will then give it a fingerprint\n\n 5.times do\n asset_output.reload\n if asset_output.fingerprint.present?\n path = asset.file_key(asset_output)\n sent_file = _send_file(path)\n if sent_file\n Rails.cache.write(\"img:#{asset.id}:#{asset.image_fingerprint}:#{output.code}\",\n path,\n expires_in: 30.minutes)\n return\n else\n RenderJob.enqueue_uniq(asset_output.id)\n sleep 0.5\n end\n else\n # nope... sleep!\n RenderJob.enqueue_uniq(asset_output.id)\n sleep 0.5\n end\n end\n\n # crap. totally failed.\n redirect_to asset.image_url(output.code) and return\n end", "title": "" }, { "docid": "6cd00bf91171c7ab8d52e054dfa7b3c6", "score": "0.5819366", "text": "def image_tag(source, options = {})\n options.symbolize_keys!\n # We set here the upload path\n upload_path = \"uploads/thumbs\"\n # Now we can create a thumb on the fly\n if options[:resize]\n begin\n geometry = options.delete(:resize)\n filename = File.basename(source)\n new_filename = \"#{geometry}_#{filename}\".downcase.gsub(/#/, '')\n # Checking if we have just process them (we don't want to do the same job two times)\n if File.exist?(\"#{Rails.root}/public/#{upload_path}/#{new_filename}\")\n options[:src] = \"/#{upload_path}/#{new_filename}\"\n else # We need to create the thumb\n FileUtils.mkdir(\"#{Rails.root}/tmp\") unless File.exist?(\"#{Rails.root}/tmp\")\n # We create a temp file of the original file\n # Notice that we can download them from an url! So this Image can reside anywhere on the web\n if source =~ /#{URI.regexp}/\n tmp = File.new(\"#{Rails.root}/tmp/#{filename}\", \"w\")\n tmp.write open(source).read\n tmp.close\n else # If the image is local\n tmp = File.open(File.join(\"#{Rails.root}/public\", path_to_image(source).gsub(/\\?+\\d*/, \"\")))\n end\n # Now we generate a thumb with our Thumbnail Processor (based on Paperclip)\n thumb = Lipsiadmin::Attachment::Thumbnail.new(tmp, :geometry => geometry).make\n # We check if our dir exists\n FileUtils.mkdir_p(\"#{Rails.root}/public/#{upload_path}\") unless File.exist?(\"#{Rails.root}/public/#{upload_path}\")\n # Now we put the image in our public path\n File.open(\"#{Rails.root}/public/#{upload_path}/#{new_filename}\", \"w\") do |f|\n f.write thumb.read\n end\n # Finally we return the new image path\n options[:src] = \"/#{upload_path}/#{new_filename}\"\n end\n rescue Exception => e\n options[:src] = path_to_image(source)\n ensure\n File.delete(tmp.path) if tmp && tmp.path =~ /#{Rails.root}\\/tmp/\n File.delete(thumb.path) if thumb\n end\n end\n\n if size = options.delete(:size)\n options[:width], options[:height] = size.split(\"x\") if size =~ %r{^\\d+x\\d+$}\n end\n\n options[:src] ||= path_to_image(source)\n options[:alt] ||= File.basename(options[:src], '.*').\n split('.').first.to_s.capitalize\n\n if mouseover = options.delete(:mouseover)\n options[:onmouseover] = \"this.src='#{image_path(mouseover)}'\"\n options[:onmouseout] = \"this.src='#{image_path(options[:src])}'\"\n end\n\n tag(\"img\", options)\n end", "title": "" }, { "docid": "f8f00876adb1a551ce44195ee2abb7fb", "score": "0.5818572", "text": "def thumb_tag(id)\n id.gsub!(\"druid:\", \"\")\n \"<img src=#{url_for(:action => 'show', :controller => 'asset', :id => id, :format => :jpg )} alt=\\\"druid:#{id}\\\"/>\".html_safe\n \n end", "title": "" }, { "docid": "61a104160dac64a51fcaa7482c7c0193", "score": "0.58179957", "text": "def create_image(handler, ref, user_id)\n Image.create do |img|\n img.original_url = handler.url(ref)\n img.remote_upload_url = img.original_url\n img.ppi = handler.ppi(ref)\n img.user_id = user_id\n img.ref = ref\n img.image_type = Image::TYPE_LS\n # set by devise functionality: width, height, upload, medium_width, medium_height\n end\n end", "title": "" }, { "docid": "5b778be58eeb8bf60c377764a1bd4b73", "score": "0.58168775", "text": "def image(size)\n if self.has_image\n image_url(size)\n else\n nil\n end\n end", "title": "" }, { "docid": "0059f28d1bab9cc1f0538acbb58b6902", "score": "0.5815354", "text": "def get_img(id,name)\n url = @base_url + \"/assets/#{id}\"\n new_name = \"#{id}_#{name}\"\n thumb_name = \"thumb_#{new_name}\"\n path = \"app/assets/images/#{new_name}\"\n thumb_path = \"app/assets/images/#{thumb_name}\"\n unless File.exists?(path)\n open(path,\"wb\") {|f| f << get(url)}\n end\n\n unless File.exists?(thumb_path)\n img = Magick::Image.read(path).first \n thumb = img.resize(100,100)\n thumb.write(thumb_path)\n end\n\n return {path: \"/assets/#{new_name}\", alt: name, thumb_path: \"/assets/#{thumb_name}\"}\n\n end", "title": "" }, { "docid": "98928bdb50e76676b4a193dab9819b50", "score": "0.5809634", "text": "def safe_file_type\n type = self.image_content_type.nil? ? 'image/jpeg' : self.image_content_type\n end", "title": "" }, { "docid": "c0079f81ad30657bb0eed78dbff29969", "score": "0.5803005", "text": "def show\n @image = Image.find(params[:id])\n hide_gps = @image.observations.any?(&:gps_hidden)\n\n if @image.transferred\n cmd = Shellwords.escape(\"script/exiftool_remote\")\n url = Shellwords.escape(@image.original_url)\n @result, @status = Open3.capture2e(cmd, url)\n else\n cmd = Shellwords.escape(\"exiftool\")\n file = Shellwords.escape(@image.local_file_name(\"orig\"))\n @result, @status = Open3.capture2e(cmd, file)\n end\n\n @data = @status.success? ? parse_exif_data(@result, hide_gps) : nil\n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" } ]
a822a846e62322ec99cd471848e0a4f1
Get all contacts Provides a list of all contacts
[ { "docid": "b6aca384bbb1ab306d482af48de5eb15", "score": "0.0", "text": "def get_contacts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts ...'\n end\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling ContactsApi.get_contacts, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling ContactsApi.get_contacts, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/contacts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'filter[speeddial]'] = opts[:'filter_speeddial'] if !opts[:'filter_speeddial'].nil?\n query_params[:'filter[first_name]'] = opts[:'filter_first_name'] if !opts[:'filter_first_name'].nil?\n query_params[:'filter[last_name]'] = opts[:'filter_last_name'] if !opts[:'filter_last_name'].nil?\n query_params[:'filter[company]'] = opts[:'filter_company'] if !opts[:'filter_company'].nil?\n query_params[:'filter[email]'] = opts[:'filter_email'] if !opts[:'filter_email'].nil?\n query_params[:'filter[email_work]'] = opts[:'filter_email_work'] if !opts[:'filter_email_work'].nil?\n query_params[:'filter[phone_work]'] = opts[:'filter_phone_work'] if !opts[:'filter_phone_work'].nil?\n query_params[:'filter[mobile_work]'] = opts[:'filter_mobile_work'] if !opts[:'filter_mobile_work'].nil?\n query_params[:'filter[phone]'] = opts[:'filter_phone'] if !opts[:'filter_phone'].nil?\n query_params[:'filter[mobile]'] = opts[:'filter_mobile'] if !opts[:'filter_mobile'].nil?\n query_params[:'filter[blocked]'] = opts[:'filter_blocked'] if !opts[:'filter_blocked'].nil?\n query_params[:'search[number]'] = opts[:'search_number'] if !opts[:'search_number'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_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\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] || 'Array<Contact>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\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: ContactsApi#get_contacts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "c270827ce9446c80883a5f9b000d6cf8", "score": "0.87078035", "text": "def all_contacts\n Contact.all\n end", "title": "" }, { "docid": "76f89af45b495e0d53bfdbadb0fa403b", "score": "0.8316215", "text": "def get_contacts(params={})\n @obj.get('get-contacts', @auth.merge(params))\n end", "title": "" }, { "docid": "2f55faf06184e557ecb4477482522bcb", "score": "0.8130566", "text": "def all\n ContactDatabase.get_all\n end", "title": "" }, { "docid": "7b14b97a9853cc4c2c43dd1861e79725", "score": "0.8113471", "text": "def contacts(options = {})\n params = { :limit => 200 }.update(options)\n response = get(PATH['contacts_full'], params)\n parse_contacts response_body(response)\n end", "title": "" }, { "docid": "4dee6346da2ec576d9ed09f23b136f8b", "score": "0.80637354", "text": "def get_list(options={})\n rsp = @flickr.send_request('flickr.contacts.getList', options)\n collect_contacts(rsp)\n end", "title": "" }, { "docid": "d9c0ff7ccad1cc402ff4242ca572a6b2", "score": "0.80542326", "text": "def get_all_contacts\r\n info = load_contacts\r\n info.each do |arr|\r\n puts \"#{arr[0]}: #{arr[1]} (#{arr[2]})\"\r\n end\r\n puts \"---\"\r\n puts \"#{generate_id} records total\"\r\n end", "title": "" }, { "docid": "033770ec89580081cf05edf14bbf58e1", "score": "0.80408037", "text": "def query_contacts(options={}) path = \"/api/v2/contacts\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "fab983bbbc817a6a5050c24b3e354975", "score": "0.8016131", "text": "def contacts\n contact_client.contacts\n end", "title": "" }, { "docid": "5ff3dfc2228a24afc918cf8196259731", "score": "0.79481626", "text": "def get_all_contacts(opts = {})\n get_all_contacts_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "9fc70ebdbdb5d95c6abf10d41a6421ba", "score": "0.79413605", "text": "def all_contacts\n ret = []\n chunk_size = 200\n offset = 0\n \n while (chunk = contacts(:limit => chunk_size, :offset => offset)).size != 0\n ret.push(*chunk)\n offset += chunk_size\n break if chunk.size < chunk_size\n end\n ret\n end", "title": "" }, { "docid": "4719918a9fc7c3560af068950533db1e", "score": "0.7885934", "text": "def list\n contacts_index(Contact.all)\n end", "title": "" }, { "docid": "7a06d8317282043c7da8432d9e9a12bb", "score": "0.78797406", "text": "def list\n ContactDatabase.list\n end", "title": "" }, { "docid": "f5c0ef6001a31a2de9c4b8c1e156508a", "score": "0.7800319", "text": "def contacts\n @contacts = @seller.get_contacts\n end", "title": "" }, { "docid": "857ff8bda492b763b417159c5ce5350a", "score": "0.7798569", "text": "def get_contacts(options = {})\n send_request(\"get\", contacts_url, body: options.to_json)\n end", "title": "" }, { "docid": "ce75002f37021e20d22d05b8c927a4fb", "score": "0.77811474", "text": "def get_all_contacts\n\t\t#@contacts = Contact.find_with_deleted(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n #Bug 11593 Deleted contacts are displayed in Drop down.\n @contacts = Contact.find(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n end", "title": "" }, { "docid": "868c3b717dfdd4fddf8639332cd76e39", "score": "0.77803934", "text": "def contacts(options = {})\n params = { :limit => 200 }.update(options)\n response = get(params)\n parse_contacts response_body(response)\n end", "title": "" }, { "docid": "e4715c9f096e4823f6d6b65b311ce886", "score": "0.7773787", "text": "def index\n\t\t@contacts = current_user.contacts.get_active_contacts\n\tend", "title": "" }, { "docid": "ac254316bc7937350e4204975a729c91", "score": "0.77303684", "text": "def contacts\n collection = CapsuleCRM::ContactCollection.new(self,CapsuleCRM::Contact, [])\n collection.concat emails\n collection.concat phone_numbers\n collection.concat websites\n collection.concat addresses\n collection\n end", "title": "" }, { "docid": "23a75b816c359a76aa81e45de349804c", "score": "0.76779866", "text": "def contacts\n respond_with_entity(api.get('/api/v1/profile/contacts'),\n NexaasID::Entities::Profile::Contacts)\n end", "title": "" }, { "docid": "d8693cf9afc49ae8b0457f4d2dc86d4a", "score": "0.7675965", "text": "def contacts\n return [] unless persisted?\n results = connection.get(\"#{self.class.path}/#{@attributes[\"Id\"]}\")\n @attributes['ContactIds'] = results.first['ContactIds']\n end", "title": "" }, { "docid": "e22fbfb68a174eeb23d90ddf47cd603e", "score": "0.7659147", "text": "def index\n # todo implement search and sort and paginate\n @contacts = Legacy::LegacyContact.order(\"first_name\").paginate(:page => params[:page])\n end", "title": "" }, { "docid": "87804cdbe24b42f41ba03db08c95a61a", "score": "0.7624949", "text": "def contacts\n\t\t@contact = Contact.first();\n\tend", "title": "" }, { "docid": "36d4b2be7791225234c751a1c25e1ac7", "score": "0.7619231", "text": "def display_all_contacts\n\t\tputs \"Your contact list includes:\"\n\t\t\tContact.all.each do |contact|\n\t\t\t\tputs \"[#{contact.id}] #{contact.first_name} #{contact.last_name}\"\n\tend\nend", "title": "" }, { "docid": "c028655029580be3e132d45fccf1f558", "score": "0.7613541", "text": "def contacts(id, limit:, offset: 0, account: nil)\n path = \"filter/#{id}/contacts\"\n get account, path, limit: limit, offset: offset\n end", "title": "" }, { "docid": "2121cb8c72716a0159b30c74f5feb9cb", "score": "0.7603588", "text": "def contacts\n fail NotPersisted if id.nil?\n\n @contacts ||=\n begin\n links = Amorail::ContactLink.find_by_leads(id)\n links.empty? ? [] : Amorail::Contact.find_all(links.map(&:contact_id))\n end\n end", "title": "" }, { "docid": "f82f2d553707786dadfa6bd9ecdbd294", "score": "0.75920117", "text": "def get_contacts(opts = {})\n data, _status_code, _headers = get_contacts_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "690673319ea0802efded8f0fbf6b1e4d", "score": "0.75828105", "text": "def my_contacts(opts = {})\n client.get_my_contacts(opts)\n end", "title": "" }, { "docid": "4f84d5755375d4e363bb8c72b1540ab6", "score": "0.7580851", "text": "def index\n @contacts = @client.contacts\n end", "title": "" }, { "docid": "7238a891ab13ca0820b1c004bb162850", "score": "0.75665665", "text": "def contacts\n Easybill::Api::Contacts\n end", "title": "" }, { "docid": "c44f3f41773a15ec73405bae21f3c0b3", "score": "0.7563294", "text": "def contacts\n @contacts ||= Harvest::API::Contacts.new(credentials)\n end", "title": "" }, { "docid": "49a09ed285f09fd6c09fdd638a0e3146", "score": "0.7523105", "text": "def display_all_contacts\n all_contact = Contact.all\n all_contact.each do |list|\n puts:\"===============================\"\n puts \"first name: #{list.first_name}\"\n puts \"last name: #{list.last_name}\"\n puts \"email: #{list.email}\"\n puts \"note: #{list.note}\"\n puts \"id: #{list.id}\"\n puts\n\n end\n end", "title": "" }, { "docid": "eea1e38481e003664ebd5017c1252b1b", "score": "0.7518478", "text": "def all\n results = connection.exec_params('SELECT * FROM contacts LIMIT 5 OFFSET\n $1::int;', [get_offset])\n return results.map do |contact|\n self.new(contact['name'], contact['email'], contact['id'])\n end \n end", "title": "" }, { "docid": "311bc2ff46fb228819f0e3d38cb46405", "score": "0.75036687", "text": "def contacts\n Contact.where(account_ids: self._id)\n end", "title": "" }, { "docid": "59046a5191148934dd0970973fe14c41", "score": "0.74370486", "text": "def getContacts\n @contact_list.each_with_index do |c, i|\n #puts \"#{i +1}) #{c}\"\n puts \"#{i +1}) #{c[:first_name]} #{c[:last_name]} #{c[:email]}\"\n end\n end", "title": "" }, { "docid": "47f611ac82714b76080d61c9e167027d", "score": "0.7430502", "text": "def get_contacts(options = {})\n request_params = {}\n request_params[:type] = options[:type] if options[:type]\n request_params[:sortBy] = options[:sort] if options[:sort] \n request_params[:direction] = options[:direction] if options[:direction] \n \n response_xml = http_get(\"#{@xero_url}/contacts\", request_params)\n \n parse_response(response_xml, :request_params => request_params)\n end", "title": "" }, { "docid": "13af2205d31c84d5108996013b5f421e", "score": "0.7421881", "text": "def display_all_contacts\t\n\t @rolodex.contacts.each do |contact|\n\t \tputs \"#{contact.id} #{contact.first_name} #{contact.last_name} <#{contact.email}>\"\n\t\t\tend\n\t\tputs\n\tend", "title": "" }, { "docid": "fc28ec724b2b57ff26985faaa8904546", "score": "0.742162", "text": "def contacts(params = {})\n # contacts in this group\n @contacts ||= get_contacts({\"group\" => self.id}.merge(params))\n end", "title": "" }, { "docid": "20aea9840319e8fb11f6c318ab4af3a4", "score": "0.7421334", "text": "def index\n @contacts = []\n Facebase::Contact.on_each_shard{|p|\n @contacts.concat(p.limit(20).all())\n }\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contacts }\n end\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "969a6d31831b3cd301cee0f932c4a20d", "score": "0.7409554", "text": "def index\n @contacts = Contact.all\n end", "title": "" }, { "docid": "ef0ecaa396ad93fd4de0b9d0b429ef57", "score": "0.74067163", "text": "def list params={}\n params[:fields] = params[:fields].join(',') if params[:fields]\n params[:record_type] ||= 'person'\n @nimble.get \"contacts\", params\n end", "title": "" }, { "docid": "ee92a30ef66e42e539a989790bd250d0", "score": "0.73893225", "text": "def contacts()\n return MicrosoftGraph::Contacts::ContactsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "a12e394192f59e9af72de50eebe4631e", "score": "0.7372459", "text": "def index\n @contacts = current_user.contacts\n end", "title": "" }, { "docid": "59f3077c7407d4a24b26a8b587d8a2c0", "score": "0.7359795", "text": "def list_contacts_by_company(companyId, options={}) path = \"/api/v2/companies/#{companyId}/contacts\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "f848472e702d00cd069e4fb50a9764a6", "score": "0.7347075", "text": "def index\n # only show contacts for current login user\n @user = User.find_by_id(current_user.id)\n if (!@user.nil?)\n @contacts = @user.contacts\n end\n end", "title": "" }, { "docid": "ffb1af6279f35062891f2bc709658ede", "score": "0.73448354", "text": "def get_contacts(user_or_identifier)\n identifier = identifier_param(user_or_identifier)\n json = parse_response(get(\"/api/#{API_VERSION}/get_contacts\",\n :apiKey => @api_key,\n :identifier => identifier))\n ContactList.new(json)\n end", "title": "" }, { "docid": "62bb37083ea573be1490b45b2aca6516", "score": "0.7329475", "text": "def index\n # @contacts = Contact.all\n end", "title": "" }, { "docid": "1b6364dce4a5e541ef2af246556f305e", "score": "0.73281366", "text": "def index\n @contacts = Contact.all\n\n end", "title": "" }, { "docid": "b23fa0c363cec9754026f794833646ef", "score": "0.7321348", "text": "def index\n @contacts = current_user.contacts.all\n\n\n end", "title": "" }, { "docid": "daebf2eaeef4fceb5bd4b0275aacc1a5", "score": "0.7319722", "text": "def index\n json_response(@contacts, user_id: @user.id, status: :ok)\n end", "title": "" }, { "docid": "a11db898cc0bba37f73b3bda8d862bc9", "score": "0.7303274", "text": "def index\n @contacts = contacts.page(params[:page]).per_page(18)\n end", "title": "" }, { "docid": "1842ca280af8f97e8e90f8471707e7bf", "score": "0.7301743", "text": "def contacts!(params = {})\n @contacts ||= get_contacts({\"group\" => self.id}.merge(params))\n end", "title": "" }, { "docid": "8413393607b5988fd8d0bbf55c3157c0", "score": "0.7291881", "text": "def index\n\t\t@page_title = \"My Contacts\"\n\t\t@contacts = current_agendify_user.contacts\n\tend", "title": "" }, { "docid": "70ae1b1bf65c197d0f6ea99c9580fce0", "score": "0.7276392", "text": "def get_contacts\n @notification_server.get_contacts\n end", "title": "" }, { "docid": "873cb8572c491c629305ba364375b9e8", "score": "0.72714627", "text": "def get_contacts(options = {})\n request_params = {}\n\n if !options[:updated_after].nil?\n warn '[warning] :updated_after is depracated in XeroGateway#get_contacts. Use :modified_since'\n options[:modified_since] = options.delete(:updated_after)\n end\n\n request_params[:ContactID] = options[:contact_id] if options[:contact_id]\n request_params[:ContactNumber] = options[:contact_number] if options[:contact_number]\n request_params[:order] = options[:order] if options[:order]\n request_params[:ModifiedAfter] = options[:modified_since] if options[:modified_since]\n request_params[:where] = options[:where] if options[:where]\n request_params[:page] = options[:page] if options[:page]\n\n response_xml = http_get(@client, \"#{@xero_url}/Contacts\", request_params)\n\n parse_response(response_xml, {:request_params => request_params}, {:request_signature => 'GET/contacts'})\n end", "title": "" }, { "docid": "1ef7939f02aef14161baaebbb745fa63", "score": "0.7270919", "text": "def all\n # TODO: Return an Array of Contact instances made from the data in 'contacts.csv'.\n\n all_contacts = []\n CSV.foreach('contacts.csv') do |row|\n # TODO call contact.new for each row\n all_contacts << Contact.new(row[0], row[1], row[2])\n end\n all_contacts\n end", "title": "" }, { "docid": "f2d77a9bf4850d1a842603f3c9c22ea0", "score": "0.7261658", "text": "def list\n @mailing_list.contacts(limit: 10000).map{|contact| contact.email}\n end", "title": "" }, { "docid": "08b486bcab49b17d0c2f1cac4c910734", "score": "0.72509027", "text": "def contacts\n\t\t@user = current_user\n\t\tcheck_if_myself\n\t\t@contacts = @user.contacts\n\tend", "title": "" }, { "docid": "07f54f1e4208ed5e8e66094f8c1d5a66", "score": "0.72375154", "text": "def get_all_contacts(list_id, opts = {})\n data, _status_code, _headers = get_all_contacts_with_http_info(list_id, opts)\n data\n end", "title": "" }, { "docid": "7a4651f85e9b20455f532df23399b335", "score": "0.72275317", "text": "def contacts(params = {})\n # contacts in this group\n @contacts = nil\n contacts!\n end", "title": "" }, { "docid": "a8e6e76aae228ebbbeeae4f0170b743b", "score": "0.7218314", "text": "def contacts(consent)\n process_consent(consent)\n contacts_xml = access_live_contacts_api()\n contacts_list = WindowsLive.parse_xml(contacts_xml)\n end", "title": "" }, { "docid": "9ca17ec25e99b74805169ea60936e6fe", "score": "0.72080046", "text": "def display_all_contacts\n\t\t@rolodex.contacts.each do |user|\n\t\t\tputs \"First Name:#{user.first_name}\" \n\t\t\tputs \"Last Name: #{user.last_name}\"\n\t\t\tputs \"Email Address:#{user.email}\" \n\t\t\tputs \"Note: #{user.note}\"\n\t\tend\n\tend", "title": "" }, { "docid": "706b75d214e648d23b9d7524e0b93968", "score": "0.71782273", "text": "def contacts\n @contacts ||= get_attr(:contacts).collect { |c| OpenStruct.new(c) }\n end", "title": "" }, { "docid": "0407e6880c42cce99d9d9d80f042a6dd", "score": "0.71397674", "text": "def get_user_contacts username_for, options = {}\n do_request 'get_user_contacts', options.merge(username_for: username_for)\n end", "title": "" }, { "docid": "cd0a8659fc51c87f12b0757af5af260a", "score": "0.7128362", "text": "def index\n @contacts = Contact.paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "50f41ad1072c99a8c0f3adf65984467a", "score": "0.7125648", "text": "def get_all_contacts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContactsAndContactListsApi.get_all_contacts ...'\n end\n # resource path\n local_var_path = '/v3/contacts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] \n\n auth_names = opts[: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 => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContactsAndContactListsApi#get_all_contacts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "74445adfb438c45df2df661d703d6052", "score": "0.7094743", "text": "def index\n @form_contacts = FormContact.all\n end", "title": "" }, { "docid": "35627a02498f61beffb9d070353e5a46", "score": "0.70715964", "text": "def contacts(uid, params={})\n response = @client.get \"#{@path}/#{uid}/contacts\", params\n PaginateResource.new \"#{@path}\", @client, response, Textmagic::REST::Contact\n end", "title": "" }, { "docid": "1d9771e4839e79dc09ddb070b66cab83", "score": "0.7067126", "text": "def index\n @contact = Contact.all\n end", "title": "" }, { "docid": "1b9d827d1b4a34cc9c9878e3e3416754", "score": "0.7063978", "text": "def contacts\n @contacts = Employee.by_company_id(params[:company_id]).by_search(params[:search]).by_contacts(current_user).paginate :page => params[:page]\n @active_employers = current_user.employers.active_employers.all\n end", "title": "" }, { "docid": "8a004bf00ce1bddee52bd4e1e6cad8e3", "score": "0.7042279", "text": "def contacts\n parser.contacts\n end", "title": "" }, { "docid": "631bceccd3d544b8069e4870790eb26e", "score": "0.7040428", "text": "def display_contacts\n # Fill this in\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods\n Contact.all.each do |contacts|\n puts \":#{contacts.full_name}, #{contacts.email}, #{contacts.id}, #{contacts.note}\"\n end\n end", "title": "" }, { "docid": "d399f4da3e37df9e79670df6260ce5bc", "score": "0.70328784", "text": "def index\n @case_contacts = CaseContact.all\n end", "title": "" }, { "docid": "ac47e32015461196a4b78253e286cbbe", "score": "0.70145047", "text": "def contacts\n contacts = params[:contacts].map{|c| c[1]}\n if contacts\n logger.debug \">>> received #{contacts.length} contacts\"\n end\n render :text => \"ok\"\n end", "title": "" }, { "docid": "e817d15a62f611293ca66a91ac6d3827", "score": "0.70084333", "text": "def index\n page = params[:page]\n limit = params[:limit] || 10\n\n if page.nil?\n page = 1\n else\n page = [page.to_i, 1].max\n end\n sort_column = params[:sort] || ''\n sort_direction = params[:direction] || ''\n @contacts = Contact\n .search(params[:search]).order(sort_column + ' ' + sort_direction).page(page).per(limit)\n end", "title": "" }, { "docid": "9923647a22174fa22e2b229d536a4db8", "score": "0.69894254", "text": "def index\n @contacts = Contact\n\n if params[:project_id]\n # https://stackoverflow.com/q/680141/6594668\n @contacts = Contact.where(contactable_type: 'Project')\n .joins('INNER JOIN projects ON contacts.contactable_id = projects.id')\n .where(projects: { identifier: params[:project_id] }).all\n end\n\n @contacts = @contacts.where(id: params[:id]) if params[:id]\n\n @contacts = @contacts.all\n end", "title": "" }, { "docid": "b6aa080fdfffa1bc438e8ec27bb2de2c", "score": "0.6979264", "text": "def contacts\r\n\r\n end", "title": "" }, { "docid": "69a73f14438a7e772d6d3516f8486998", "score": "0.69775915", "text": "def index\n respond_with Contact.all\n end", "title": "" }, { "docid": "77a2d0a675f8e21cd818e38756efd8bf", "score": "0.6963802", "text": "def index\n @contacts = Contact.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "ea6dd56b43be494181467f0d9c0cd69d", "score": "0.6955495", "text": "def index\n @member_contacts = MemberContact.all\n end", "title": "" }, { "docid": "6f9eb5528e93a48c177681f384a4fc6a", "score": "0.6943923", "text": "def index\n @employee_contacts = EmployeeContact.all\n end", "title": "" }, { "docid": "6730b34f4752ab58e14092ccc7966590", "score": "0.69369733", "text": "def all\n list = []\n list = ContactDatabase.read_csv\n list\n end", "title": "" }, { "docid": "a5ee4e5ca4ee05db43c12a520e811df4", "score": "0.6923766", "text": "def contacts\n @contacts ||= @ab.people.map {|abperson| Macabee::Contact.new(abperson, :macabee => self)}\n end", "title": "" }, { "docid": "2a79836c36c167a1fa4cf8bf0cf7acf4", "score": "0.69223213", "text": "def list_contact(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/contacts'\n\t\targs[:query]['Action'] = 'ListContact'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :contact_name\n\t\t\targs[:query]['ContactName'] = optional[:contact_name]\n\t\tend\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "1a3aec4702eea2358b09bab774696a98", "score": "0.69099367", "text": "def where(options = {})\n _, _, root = @client.get(\"/contacts\", options)\n\n root[:items].map{ |item| Contact.new(item[:data]) }\n end", "title": "" }, { "docid": "2761b3ae7b508902ff1296e38409f2aa", "score": "0.68969643", "text": "def index\n @contactpeople = Contactperson.all\n end", "title": "" }, { "docid": "717b7f6f16947a5bbceeedeeb37dc2cf", "score": "0.68935156", "text": "def display_contacts\n Contact.each do |contacts|\n print \"First name: #{contacts.first_name}, Last name: #{contacts.last_name}, Email address: #{contacts.email}, Notes: #{contacts.note}\"\n end\n\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods to keep your code DRY\n end", "title": "" }, { "docid": "1f06e2e55b9927e5374cbc4546c0fdc8", "score": "0.68874085", "text": "def index\n @contacts = current_user.contacts.order(:email_address)\n end", "title": "" }, { "docid": "065ddfb74e3db0f4e48e83cf38fa611c", "score": "0.68864685", "text": "def show_contacts(filters: {}, orders: {}, **params)\n params[:filters] = filters if filters.any?\n params[:orders] = orders if orders.any?\n\n get('contacts', params)\n end", "title": "" }, { "docid": "3b668ad92e786a2a212c71afeff1ff03", "score": "0.688521", "text": "def user_contacts(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/contacts\", simple_params(options)\n end\n response.body\n end", "title": "" }, { "docid": "e7f7ade7571cbbe128bea17bf721b66b", "score": "0.6883029", "text": "def index\n @contacts = current_company.contacts\n respond_to do |format|\n format.xml { render :xml => @contacts }\n format.json { render :json => @contacts }\n end\n end", "title": "" } ]
8574cdb1d07ede6bb3cb756ca0887fe9
Edit link with bootstrap classes
[ { "docid": "cdc03b565ff437894393872ef03f3fe2", "score": "0.7245088", "text": "def link_to_edit(path)\n link_to 'Edit', path, class: 'btn btn-default btn-xs'\n end", "title": "" } ]
[ { "docid": "4e40a696c3bec204025535a3f89906fa", "score": "0.7278591", "text": "def link_to_edit(path, *options)\n link_to path,\n class: \"btn btn-warning btn-sm\",\n title: \"Alterar\",\n style: \"color: #FFF; \" do\n content_tag :span, class: \"fa fa-pencil\" do\n options.first[:label] if options.present? && options.first[:label]\n end\n\n end\n end", "title": "" }, { "docid": "27733aefe1728417f1937314344873df", "score": "0.66882527", "text": "def edit_button_table(model, link_args = {})\n link_args[:class] = 'btn-warning btn-xs' + (link_args[:class] || '')\n link_args[:additional_I18n] = 'short'\n action_button :edit, model, link_args\n end", "title": "" }, { "docid": "931a44f0099ec6620cce06998a6dc6c1", "score": "0.668304", "text": "def edit_link(path)\n\t\tif user_signed_in? && current_user.editor?\n\t\t\tlink_to(\"<span class='glyphicon glyphicon-pencil'> Editar\".html_safe, path)\n\t\telse\t\n\t\t\t'<a data-toggle=\"modal\" data-target=\"#can-not-edit-modal\"> <span class=\"glyphicon glyphicon-pencil\"> Editar</a>'.html_safe\n\t\tend\n\tend", "title": "" }, { "docid": "96c1d98b14fc875e79fcfd77ada7f7e6", "score": "0.65885127", "text": "def edit_button_to(path, text = t('edit'))\n link_to path, class: 'button small warning' do\n concat text\n end\n end", "title": "" }, { "docid": "b364b151f4f973debb000d5c8cfa04b1", "score": "0.6369129", "text": "def link_to_edit(path)\n link_to icon('edit'), path, title: 'Edit this record'\n end", "title": "" }, { "docid": "8dfa7562c2e7cf1eeec94b0b64dc14d9", "score": "0.63558286", "text": "def link_to_edit(resource, options = {})\n name = (\"<i class='icon-white icon-edit'></i>\").html_safe\n attributes = {\n :class => \"mr-xs btn btn-mini btn-inverse edit-link\",\n }.merge(options)\n link_to name, resource, attributes\n end", "title": "" }, { "docid": "07d63cfb6470c13bee5b4723ff729761", "score": "0.624972", "text": "def edit_button(destination_path)\n # Consider using:\n # ActionDispatch::Routing::PolymorphicRoutes::edit_polymorphic_path(@object)\n @template.link_to I18n.t('form.edit'), destination_path,\n class: \"btn btn-primary\"\n end", "title": "" }, { "docid": "0186b407d5b7b1a12ba25208ab579fd5", "score": "0.62264305", "text": "def link_to_edit_with_text(resource, options = {})\n name = ('<i class=\"icon-pencil\"></i> '+t(:'gaku_helpers.edit')).html_safe\n attributes = {:class => \"span12 btn edit-link\"}.merge(options)\n link_to name, resource, attributes\n end", "title": "" }, { "docid": "8a5f492505825a526ae8157d43d152d4", "score": "0.621384", "text": "def edit_button(target:, name: :EDIT.t, **args)\n # necessary if nil/empty string passed\n name = :EDIT.t if name.blank?\n path, identifier, icon, content = button_atts(:edit, target, args, name)\n\n html_options = {\n class: class_names(identifier, args[:class]), # usually also btn\n title: name, data: { toggle: \"tooltip\", placement: \"top\", title: name }\n }.merge(args.except(:class, :back))\n\n link_to(path, html_options) do\n [content, icon].safe_join\n end\n end", "title": "" }, { "docid": "3a9e3bb7d329d7bc895b2e2dbd0437b9", "score": "0.6190901", "text": "def github_edit_link\n source_file_path = current_page.file_descriptor.relative_path\n repo_slug = config[:site][:github][:repo_slug]\n branch = config[:site][:github][:branch]\n\n [GITHUB_URL, repo_slug, 'edit', branch, config[:source], source_file_path].join('/')\n end", "title": "" }, { "docid": "ccc94fff1c1e38a47b46eababd176d11", "score": "0.6074822", "text": "def link_to_edit_entry_template(page)\n url = admin_page_path page, entries: 1\n link_to 'Edit Entry Template', url, class: 'button'\n end", "title": "" }, { "docid": "24b3a7616f8aefe5c12243618599d33d", "score": "0.6036403", "text": "def edit_post_link(obj)\n if logged_in? && (obj.creator == current_user || current_user.admin?)\n link_to edit_post_path(obj), title: 'Edit Post', :'data-toggle' => 'tooltip' do\n content_tag :small do\n content_tag :span, '', class: 'glyphicon glyphicon-pencil', :'aria-hidden' => true\n end\n end\n end\n end", "title": "" }, { "docid": "3cbf5afcd8f540b8243ac1ff45d22777", "score": "0.60285527", "text": "def click_edit(the_name)\n response.should contain the_name\n click_link_within \"div[id*=\\\"\"+to_html_tag(the_name)+\"\\\"]\", \"Edit\"\n end", "title": "" }, { "docid": "7d39dfdfe5f0ef0328661278cf5c310c", "score": "0.6027674", "text": "def link_to_edit(path)\n link_to image_tag('icons/001_45.png',\n :size => ICON_SIZE,\n :alt => 'Edit'), path\n end", "title": "" }, { "docid": "3cbf5afcd8f540b8243ac1ff45d22777", "score": "0.6027597", "text": "def click_edit(the_name)\n response.should contain the_name\n click_link_within \"div[id*=\\\"\"+to_html_tag(the_name)+\"\\\"]\", \"Edit\"\n end", "title": "" }, { "docid": "f0fe9ab73c2ac56e0c2b1f5a508203bf", "score": "0.59979147", "text": "def link_to_edit_index_template(page)\n url = admin_page_path page\n link_to 'Edit Index Tempate', url, class: 'button'\n end", "title": "" }, { "docid": "493cfcca7401061c425202676449f419", "score": "0.5984582", "text": "def edit_button_for_quest(quest)\n if !!current_user && current_user.master\n link_to \"Edit\", edit_quest_path(quest), class: \"btn btn-secondary btn-sm\" \n end\n end", "title": "" }, { "docid": "029278f165f3ccec7b0c67bdbe09d5d6", "score": "0.5958162", "text": "def link_to_modal_form project\n link_to \"##{ idify( project ) }\", :class => 'btn btn-mini btn-warning',\n :'data-toggle' => \"modal\", :role=>\"button\" do\n content_tag( :i, nil, :class => \"icon-wrench\" ) +\n \" Setup your project\"\n end\n end", "title": "" }, { "docid": "7aaffa080e14a3a9c8173a596110f11a", "score": "0.59440035", "text": "def edit\n resource.prepare_links\n\n super\n end", "title": "" }, { "docid": "3f1604df17e676e9da05e9f6b44c7c12", "score": "0.59257257", "text": "def url_edit\n cname = self.class.classname.to_s.downcase\n return \"?show=#{cname}_edit&#{cname}_id=#{self.id}\"\n end", "title": "" }, { "docid": "750ba7284eb8b2676769931f9e8974c1", "score": "0.5850222", "text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end", "title": "" }, { "docid": "750ba7284eb8b2676769931f9e8974c1", "score": "0.5850222", "text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end", "title": "" }, { "docid": "72903269501623e986052fbc04c19e1c", "score": "0.5818351", "text": "def link_to_edit(objeto)\n link_to image_tag(\"icons/pencil.png\", :alt => \"editar objeto\"), \n edit_polymorphic_path(objeto), :title => \"Modificar objeto\"\n end", "title": "" }, { "docid": "143988bc664fda3c3c6bfb66820fe455", "score": "0.5809452", "text": "def simple_posts_edit_button(current_user, simple_post)\n if(current_user.id == @user.id)\n link_to svg('edit-2'), edit_user_simple_post_path(current_user, simple_post), class:\"btn\"\n end\n end", "title": "" }, { "docid": "05a31d0c085ca84b50d01538521e7858", "score": "0.57969767", "text": "def link_user_edit\n return nil unless @user.is_a? User\n msg = 'impostazioni'\n link = { :controller => 'user', :action => 'edit' }\n link[:host] = @host_forum if @host_forum\n link[:only_path] = false if @host_forum\n s = link_to msg, link\n content_tag('span', s, :class => 'profile')\n end", "title": "" }, { "docid": "17e432e53b2b753e3d9fd2b983060ac5", "score": "0.57935816", "text": "def publication_link\n h.link_to \"Read Now\" , object.publication_url , title: 'Read Now' , class: 'btn waves-effect waves-light btn-primary custom-btn' , target: '_blank'\n end", "title": "" }, { "docid": "3a90db8f97d5e7373cc244fa0a9ba7ce", "score": "0.57909536", "text": "def edit_button(article)\n return \"\" if cannot?(:edit, article)\n html = <<-HTML\n <a class=\"btn\" href=\"#{edit_article_path(article)}\"><i class=\"icon-pencil\"></i></a>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "90828f818d7d244f610373b9ba44c1ae", "score": "0.5746411", "text": "def avatar_edit_link(user, options={})\n if Setting.gravatar_enabled?\n url = Redmine::Configuration['avatar_server_url']\n link_to avatar(user, {:title => l(:button_edit)}.merge(options)), url, :target => '_blank'\n end\n end", "title": "" }, { "docid": "1fe170fbbf230d202856de343f47f20a", "score": "0.5730739", "text": "def workflow_action_link(title, link, opts={})\n link_to(title, link, {:class=>'btn btn-mini'}.merge(opts))\n end", "title": "" }, { "docid": "1ee0772850e03f5b79bce08d8cbcae2f", "score": "0.57191175", "text": "def edit_button\n 'Edit <i class=\"icon-edit icon-white\"></i>'.html_safe\n end", "title": "" }, { "docid": "6c9e53a07918db2f9c1ad15bfab91cec", "score": "0.5657513", "text": "def view_button(object, link = nil)\n link_to '<span class=\"glyphicon glyphicon-eye-open\"></span> View'.html_safe,\n link ? link : polymorphic_path(object),\n class: 'btn btn-default',\n title: \"View #{object_title(object)}\"\n end", "title": "" }, { "docid": "897a659ac1cd5920dbdd4761cbec0bfb", "score": "0.56213105", "text": "def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end", "title": "" }, { "docid": "897a659ac1cd5920dbdd4761cbec0bfb", "score": "0.56213105", "text": "def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end", "title": "" }, { "docid": "0d607a4794a191549269fc537e95131d", "score": "0.5619759", "text": "def btn_criar_editar_curriculo resume\n if resume == nil\n link_to \"Curriculo\", \"/users/#{current_user.id}/resumes/new\", :class => \"btn btn-danger btn-block\"\n else\n link_to \"Editar Curriculo\", \"/users/#{current_user.id}/resumes/#{current_user.resume.id}/edit\", :class => \"btn btn-danger btn-block\"\n end\n end", "title": "" }, { "docid": "f3bf1368b3e3c5c9fbe1b8d0eb517612", "score": "0.5617072", "text": "def build_link(master_u)\n icon_edit = '<span class=\"glyphicon glyphicon-edit\"></span>'\n icon_show = '<span class=\"glyphicon glyphicon-info-sign\"></span>'\n link = link_to(raw(icon_show), master_u)\n link += link_to(raw(icon_edit), edit_master_unit_path(master_u))\n raw('<div class=\"datatable-actions\">'+link+'</div>')\n end", "title": "" }, { "docid": "c277192562387464f39ffab2d5cb26a7", "score": "0.560716", "text": "def button_go_to\n h.link_to \"Order ##{object.id}\", h.order_path(object), class: \"btn btn-xs #{btn_type}\", target: :_blank\n end", "title": "" }, { "docid": "44b688a421b95afa91c2fea17631e592", "score": "0.5595177", "text": "def display_edit_link(blog)\n# is_blog_admin? ? \"|<a href='/manage/blogs/#{blog.id}/edit'>编辑</a>\" : ''\n end", "title": "" }, { "docid": "9e04ec04d83df29943b9d0fb31a182e1", "score": "0.5579167", "text": "def link_to_updating(entity = @entity, text = \"更新する\", options = {}, html_options = {})\n link_to_altering(entity, text, :updating, options, html_options)\n end", "title": "" }, { "docid": "b32649f328b539099c03100150ee63a5", "score": "0.5560839", "text": "def link_4edit #:nodoc:\n html = ''\n return html unless @opts[:edit_mode] > 1\n \n @opts[:editparams].merge!( { table: 'dc_big_menu', controller: 'cmsedit', action: 'edit' } )\n title = \"#{t('drgcms.edit')}: \"\n @opts[:editparams].merge!( { id: @menu.id, title: \"#{title}#{@menu.name}\" } ) if @menu\n title << t('helpers.label.dc_big_menu.tabletitle')\n @opts[:editparams].merge!( { action: 'index', title: title }) if @menu.nil?\n html << dc_link_for_edit( @opts[:editparams] )\nend", "title": "" }, { "docid": "c86ab7a881375d097dfc995e62f7006b", "score": "0.55568254", "text": "def link_to_user_training_story_edit( user_training_story )\n link_to( edit_user_training_story_path(id: user_training_story.id), class: 'btn btn-default' ) do\n image_tag('page_edit.png') << \"&nbsp; #{I18n.t(:edit)}\".html_safe\n end if check_story_ownership_for( user_training_story )\n end", "title": "" }, { "docid": "ff444d9c886be8b46d267af13c95298f", "score": "0.55408", "text": "def get_edit_user_link(user, link)\n link_to link do\n html = []\n if not user.google_avatar_url.blank?\n html << image_tag(\"#{user.google_avatar_url}?sz=30\", class: 'user-avatar')\n elsif user.email.present?\n html << image_tag(\"#{(request.ssl? ? 'https://secure' : 'http://www')}.gravatar.com/avatar/#{Digest::MD5.hexdigest user.email}?s=30\", alt: '', class: 'user-avatar')\n end\n\n if user.full_name.blank?\n html << content_tag(:span, user.email, class: 'user-name')\n else\n html << content_tag(:span, user.full_name, class: 'user-name')\n end\n html.join.html_safe\n end\n end", "title": "" }, { "docid": "6448786d9ba4dff221faca820083a3d3", "score": "0.55291575", "text": "def view_edit_link(user, attraction)\n if user.admin\n content_tag(:p, link_to(\"Edit Attraction\", edit_attraction_path(attraction)))\n end\n end", "title": "" }, { "docid": "eceec82805db00902e6ddedfe220417f", "score": "0.5501486", "text": "def old_button_link_to( title, url, options={} )\n#\t\tid = \"id='#{options[:id]}'\" unless options[:id].blank?\n#\t\tklass = if options[:class].blank?\n#\t\t\t\"class='link'\"\n#\t\telse\n#\t\t\t\"class='#{options[:class]}'\"\n#\t\tend\n#\t\ts = \"<button #{id} #{klass} type='button'>\"\n\t\tclasses = ['link']\n\t\tclasses << options[:class]\n\t\ts = \"<button class='#{classes.flatten.join(' ')}' type='button'>\"\n\t\ts << \"<span class='href' style='display:none;'>\"\n\t\ts << url_for(url)\n\t\ts << \"</span>\"\n\t\ts << title\n\t\ts << \"</button>\"\n\t\ts\n\tend", "title": "" }, { "docid": "261c36f1f91e3af84ea86c6cb7322f2a", "score": "0.5501198", "text": "def edit\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end", "title": "" }, { "docid": "4a35f62724f0a4d93295ba3ff633e874", "score": "0.5495491", "text": "def bootstrap_button(text, *params)\n options = params.extract_options!.symbolize_keys\n if options.include?(:class)\n options[:class] << \" btn small\"\n end\n options[:class] ||= \"btn small\"\n options[:href] ||= \"#\"\n content_tag(:a, text, options)\n end", "title": "" }, { "docid": "df0ace808bc9739eb88b241e78006af0", "score": "0.54763514", "text": "def content_edit_action_link(text, object)\n content_edit_action_item(link_to_remote_facebox(text, member_url([@tier, object], :edit), {:rel => \"nofollow\"}))\n end", "title": "" }, { "docid": "930f765381de831f6df5d8fd749c7fc3", "score": "0.5472102", "text": "def edit_link(obj, options = {})\n if policy(obj).edit?\n url = polymorphic_url([:edit] + Array(obj))\n action_link('Edit', url, 'pencil', options)\n end\n end", "title": "" }, { "docid": "5e15b88e5582dcafb67ac6f6e3da4f3b", "score": "0.54691666", "text": "def show_button_to(path, text = t('show'))\n link_to path, class: 'button small' do\n concat text\n end\n end", "title": "" }, { "docid": "5d4883f68900b66104c0442681ab566a", "score": "0.5444511", "text": "def action_links(object, options = {})\n class_name = object.class.to_s.tableize.downcase\n \n haml do\n open :td, :class => \"list-table-links\" do\n puts link_to(icon(options[:edit_icon]), \n {:action => \"edit\", \n :controller => class_name, \n :id => object.id}, \n :class => \"edit-link\")\n puts button_to_remote('', \n { :url => {:action => \"destroy\", :id => object}}, \n { :loading => transparent_message_show('ajax_info_message'), \n :complete => transparent_message_hide('ajax_info_message'), \n :method => :delete, \n :confirm => \"Are you sure you want to delete this #{class_name.humanize.downcase.singularize}?\", \n :class => options[:delete_class], \n :onmouseover => \"this.style.cursor = 'pointer';\", \n :onmouseout => \"this.style.cursor = 'auto';\",\n :value => \" \"})\n end # open\n end # haml\n end", "title": "" }, { "docid": "84f30d3991fc4144286d7bac13a63737", "score": "0.54402727", "text": "def bootstrap_dropdown_toggle_tag(body)\n link_to(ERB::Util.html_escape(body) + ' '.html_safe + bootstrap_caret_tag,\n '#',\n class: 'dropdown-toggle',\n 'data-toggle': 'dropdown')\n end", "title": "" }, { "docid": "326cc060faea2a4ac0ace7bbdf419b8f", "score": "0.54390734", "text": "def link!\n self.linkbutton = true\n self.save\n self.linkbutton\n end", "title": "" }, { "docid": "470724166eebee34025ae9c7d6a44d3d", "score": "0.54324824", "text": "def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end", "title": "" }, { "docid": "470724166eebee34025ae9c7d6a44d3d", "score": "0.54324824", "text": "def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end", "title": "" }, { "docid": "c0a50c03da27d669e70613f0d249b68b", "score": "0.53929204", "text": "def edit_link(obj)\n \tcase obj.class.to_s\n \t when \"Tenant\"\n \t edit_tenant_path(obj)\n \t when \"Semester\"\n \t edit_semester_path(obj)\n \t when \"Department\"\n \t edit_department_path(obj)\n \t when \"Subject\"\n \t edit_subject_path(obj) \t \n \t when \"Faculty\"\n \t edit_faculty_path(obj)\n \t when \"Exam\"\n \t edit_exam_path(obj)\n \t when \"Batch\"\n \t edit_batch_path(obj) \t \t \t \n \t when \"SchoolType\"\n \t edit_school_type_path(obj) \t \n \t when \"Student\"\n \t edit_student_path(obj) \t \t\n \t when \"Section\"\n \t edit_section_path(obj)\n \t when \"BloodGroup\"\n \t edit_blood_group_path(obj)\n \t when \"Resource\"\n \t edit_resource_path(obj)\n \t when \"Role\"\n \t edit_role_path(obj) \t \t \t\n \t when \"UserProfile\"\n \t edit_user_profile_path(obj) \n \t when \"Grade\"\n \t edit_grade_path(obj) \t \t \t \t \t \t \n \t when nil\n \t nil\n end\n end", "title": "" }, { "docid": "f2387890804cf65803e1b0acae121304", "score": "0.53875107", "text": "def edit_button\n if object.owner?(h.current_user.id)\n \"<span class=\\\"glyphicon glyphicon-pencil pull-right\\\"></span>\".html_safe\n end\n end", "title": "" }, { "docid": "4d0f552611808f530ed8da5c140b378e", "score": "0.5386273", "text": "def mag_button_to_remote_selected(name, options = {}, html_options = {}) \n html_options[:class] = add_default_styling_selected(html_options[:class])\n name.gsub!(/\\s/, \"&nbsp;\")\n link_to_function(\"<span>#{name}</span>\", remote_function(options), html_options)\n end", "title": "" }, { "docid": "f62a5f3d876daf1c4485e8a2620e85c2", "score": "0.53802705", "text": "def menu_link_to(name,path,options={})\n style = \"page_item\"\n style = \"current_page_item\" if current_page?(path)\n options.merge!( { :class => \"#{style} btn btn-small\" } )\n link_to( name, path, options )\n end", "title": "" }, { "docid": "d27e74988a2ae4e19dbac1ddb5aecef3", "score": "0.53789276", "text": "def select_which_add_link(name)\n\t\tcase name\n\t\t\twhen \"solutions\"\n\t\t\t\tlink_to(\"Add One Today\", new_issue_solution_path(@issue), class: \"btn btn-primary btn-sm\")\n\t\t\twhen \"workarounds\"\n\t\t\t\tlink_to(\"Add one Today\", new_issue_issue_workaround_path(@issue), class: \"btn btn-primary btn-sm\" )\n\t\tend\n\tend", "title": "" }, { "docid": "d2c8426862b7e478bf0380eacd65b2f3", "score": "0.53704953", "text": "def r_table_cell_action(label, link, link_options = {})\n link_to(label, link, link_options.merge(class: \"text-indigo-600 hover:text-indigo-900\"))\n end", "title": "" }, { "docid": "37525df2022e7def2857ce19bb1304ad", "score": "0.5369631", "text": "def lcr_edit\n @page_title = _('LCR_edit')\n @page_icon = \"edit.png\"\n end", "title": "" }, { "docid": "02e0667c615ff2f13bf701ab6ba76a5e", "score": "0.53566784", "text": "def click(link); end", "title": "" }, { "docid": "1f2693d72d6b0efa62cb51719db291ee", "score": "0.53549063", "text": "def crud_link_css(options, action)\n\n if options.keys.include?(:icon_only) && options[:icon_only] == true\n if options.keys.include?(:class)\n options[:class] += \"#{action.to_s.downcase}-link \"\n else\n options[:class] = \"#{action.to_s.downcase}-link \"\n end\n else\n if options.keys.include?(:class)\n options[:class].insert(0, \"#{action.to_s.downcase}-link btn \")\n else\n options[:class] = \"#{action.to_s.downcase}-link btn\"\n end\n\n case true\n when %w(delete destroy).include?(action.to_s.downcase) then options[:class] += ' btn-danger'\n end\n end\n\n options\n end", "title": "" }, { "docid": "616abb99c6f86a5f45b599c703cc3d65", "score": "0.53497714", "text": "def fixme_button(done, auto_check)\n content_tag(:div, class: \"col-sm-1\") do\n if !done && auto_check\n link_to url_helpers.edit_product_path(@review.product) do\n content_tag(:button, 'FIXME', type: \"button\", class: \"btn btn-warning btn-xs\")\n end\n end\n end\n end", "title": "" }, { "docid": "5a769bcbe3d4366b9cf9081ec223ba8b", "score": "0.53489953", "text": "def html(args = nil)\n if args and args[:edit]\n url = self.url_edit\n else\n url = self.url\n end\n\n return \"<a href=\\\"#{Knj::Web.ahref_parse(url)}\\\">#{self.name_html}</a>\"\n end", "title": "" }, { "docid": "eb26f5c42da7e8a11b94197c044fa066", "score": "0.5341425", "text": "def button_to_edit(record, options={})\n button_to_action record, :edit, options\n end", "title": "" }, { "docid": "302509c02a237f37424427dbec1d46bb", "score": "0.53405476", "text": "def render_new_content_link(element)\n\t\t\t\tlink_to_overlay_window(\n\t\t\t\t\trender_icon('create') + t('add new content'),\n\t\t\t\t\talchemy.new_admin_element_content_path(element),\n\t\t\t\t\t{\n\t\t\t\t\t\t:size => '335x70',\n\t\t\t\t\t\t:title => t('Select an content'),\n\t\t\t\t\t\t:overflow => true\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t:id => \"add_content_for_element_#{element.id}\",\n\t\t\t\t\t\t:class => 'small button with_icon new_content_link'\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\tend", "title": "" }, { "docid": "06e32a203b1aafc1cd59d1be3a8ccddd", "score": "0.5329749", "text": "def linkbutton\n config[\"linkbutton\"]\n end", "title": "" }, { "docid": "6cbba3439f95a37bd4aae838434af6de", "score": "0.53257424", "text": "def edit_address_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.button.className(create_ats_regex_string(\"ats-editbtn\")), format_method(__method__))\n end", "title": "" }, { "docid": "9d0c3ae31da3d2621eab89f81298d2aa", "score": "0.53242296", "text": "def mokio_preview_link_in_edit_page\n self.path\n end", "title": "" }, { "docid": "714c2a42cc095518fc97d1f3d76b0e1e", "score": "0.5321734", "text": "def edit\n turbolinks_animate 'fadeinright'\n super\n end", "title": "" }, { "docid": "e602a3ac6d0af2e3f925860916e886ea", "score": "0.53159046", "text": "def link_options_for(item)\n if options[:allow_classes_and_ids]\n opts = super\n opts[:id] = \"breadcrumb_#{opts[:id]}\" if opts[:id]\n opts\n else\n {:method => item.method}.merge(item.html_options.except(:class,:id))\n end\n end", "title": "" }, { "docid": "fed4d691431807771df391f60dd0b151", "score": "0.53108764", "text": "def edit_link(resource, *args)\n link = ''.html_safe\n\n resource_name = normalized_resource_name(resource)\n object = determine_proper_resource(resource)\n options = args.first || {}\n\n # CSS classes for this crud link\n crud_link_css(options, 'edit')\n # text to be displayed\n link_text = crud_link_text(options, 'edit')\n\n # (optional) add a tooltip to the link\n if options.keys.include?(:tooltip)\n add_tooltip(options)\n end\n\n options[:id] = 'edit-' + link_id(object)\n options[:title] = 'Edit this ' + resource_name\n\n case true\n when defined? CanCan\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options if can?(:edit, object)\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options if can?(:edit, object)\n end\n else\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options\n end\n end\n\n link\n end", "title": "" }, { "docid": "350dfebf1a9e8753cd5b7898c942d568", "score": "0.5301589", "text": "def button_link_to(text, icon, url, options = {})\n options[:class] = \"btn #{options[:type] || 'btn-default'} #{options[:class]}\".strip\n icon_link_to(text, icon, url, options)\n end", "title": "" }, { "docid": "da0c7b095ed1363cd737b4e2f2247680", "score": "0.5294266", "text": "def edit\n\t\t@rlink = Rlink.find(params[:id])\n\tend", "title": "" }, { "docid": "b00ec2051b92ca24eedd97a7e4b73340", "score": "0.5282894", "text": "def button_link_to( title, url, options={} )\n\t\tclasses = ['link']\n\t\tclasses << options[:class]\n\t\ts = \"<a href='#{url_for(url)}' style='text-decoration:none;'>\"\n\t\ts << \"<button type='button'>\"\n\t\ts << title\n\t\ts << \"</button></a>\\n\"\n\tend", "title": "" }, { "docid": "c8129f67c9df882be3109b2d734adf37", "score": "0.52800053", "text": "def settings_link\n # TBD: test to see if we are signed in first\n link_to( \n \"#{iconify(:settings)}&nbsp;Settings\".html_safe,\n edit_person_registration_path, \n method: :get,\n 'class' => 'ui-btn-right' # force button to the right side of the header, leaving space for the back button\n )\n end", "title": "" }, { "docid": "3d2db0b0842ba4f72905a44bd9c3dacd", "score": "0.5270754", "text": "def helper_app_btn_icon_edit_row\n \"btn glyphicon glyphicon-edit\"\n end", "title": "" }, { "docid": "3142f826c7b9cf837042553d63fe121a", "score": "0.5235415", "text": "def auto_pop_up_link(text, target, options, url = nil)\n link_to text, (url || '#'), {\n :class => \"auto_pop_up_link#{ \" #{options[:class]}\" if options[:class]}\", \n :title => options[:title], \n :'data-div-id' => target, \n :'data-width' => options[:width], \n :'data-height' => options[:height],\n :'data-modal' => options[:modal]\n }\n end", "title": "" }, { "docid": "bfd31e071b79b9afdcb97a01a88013c1", "score": "0.52336144", "text": "def mapping_edit_tabs(mapping, options = {})\n if mapping.versions.any?\n tag.div class: \"add-bottom-margin\" do\n bootstrap_flavour_tabs(\n {\n \"Edit\" => edit_site_mapping_path(mapping.site, mapping),\n \"History\" => site_mapping_versions_path(mapping.site, mapping),\n },\n options,\n )\n end\n end\n end", "title": "" }, { "docid": "80eae29192a8a5dcde9268e5b9555d7a", "score": "0.5228871", "text": "def click_approach_link\n click APPROACH_LINK\n end", "title": "" }, { "docid": "2a2d9cadb667ed09e5b28663c8b35e09", "score": "0.52240115", "text": "def link_to_edit_game(game)\n link_to 'Править игру', edit_creators_game_path(game), class: 'edit_game'\n end", "title": "" }, { "docid": "36c3c8a74b4a39c3db8433ef340f52ba", "score": "0.52098", "text": "def title_view\n (ActionController::Base.helpers.link_to self[:title], ApplicationController.helpers.edit_url(self.class.base_class, self)).html_safe\n end", "title": "" }, { "docid": "53e770efb049fbe1dc8a2d3e5e5998cd", "score": "0.5202333", "text": "def link_to_aba_selecionada(name, options = {}, html_options = {})\n class_name= \"lapela_menu\"\n case name\n when \"Propostas e problemas\"\n class_name += \" selecionado\" if request.request_uri.index(/(topicos|propostas|problemas|topico|nova_proposta|novo_problema)/)\n when \"Pessoas e entidades\"\n class_name += \" selecionado\" if request.request_uri.index(/(usuarios|perfil|login|cadastrar)/)\n when /(Meu )\\w+/\n class_name += \" selecionado\" if request.request_uri.index(/(observatorio)/)\n when \"Tour\"\n class_name += \" selecionado\" if request.request_uri.index(/(tour)/)\n else\n class_name += \" selecionado\" if request.request_uri == \"/#{@cidade_corrente.slug}\"\n end\n link_to name, options, html_options.merge(:class => class_name)\n end", "title": "" }, { "docid": "c3b85bbccf15c4dedf4e544db544c3b4", "score": "0.5183553", "text": "def link_to_edit(text, path, options={})\n unless path.is_a? String\n path = options.delete(:url) || edit_polymorphic_path(path)\n end\n link_to_action(text, path, options.reverse_merge(:action => :edit))\n end", "title": "" }, { "docid": "f554ecbefb1353da6ee007ed49c76ef3", "score": "0.5182616", "text": "def email_support_link\n select_list.a(:name => \"email-support\")\n # text: Email Support\n end", "title": "" }, { "docid": "d2e23aa706e9e13adbc871318136c3f3", "score": "0.517276", "text": "def autocomplete_link\n h.link_to '#' do\n h.content_tag :div, class: 'row' do\n h.content_tag(:div, profile_image_thumbnail, class: 'col-sm-2').html_safe +\n h.content_tag(\n :div,\n \"#{full_name} #{h.tag(:br)} #{I18n.t('user.decorator.last_visit')} #{last_visit_started_at}\".html_safe,\n class: 'col-sm-10'\n ).html_safe\n end\n end\n end", "title": "" }, { "docid": "f001774fa45ba1cce848faec681c0ad9", "score": "0.5168485", "text": "def update_url(attrs, *_args)\n attrs.style = 'watermarked'\n end", "title": "" }, { "docid": "2db8eb8e08ad5081fb751fc818170c8f", "score": "0.51684105", "text": "def inline_cancel_button(class_extras = 'pull-right')\n \"<a class=\\\"show-entity show-#{hyphenated_name} #{class_extras} glyphicon glyphicon-remove-sign dropup\\\"\n title=\\\"cancel\\\"\n data-target=\\\"[data-subscription='#{hyphenated_name}-edit-form--#{@container.id}']\\\"\n data-toggle=\\\"clear-content\\\"></a>\".html_safe\n end", "title": "" }, { "docid": "a81cbdf384cdc4be422f22830bc545d7", "score": "0.51661515", "text": "def view_more_button(url, custom_class = '', settings = {})\n settings = {label: 'View more', closest: '.text-center'}.merge(settings)\n content_tag :div, link_to(\"#{settings[:label]} &raquo;\".html_safe, url, class: 'link_more_btn ujs_success_replace margin_top10 inline underline '+custom_class, 'data-closest-replace' => settings[:closest], remote: true, 'data-disable-with' => button_spinner), class: 'text-center'\n end", "title": "" }, { "docid": "881bbabc31b2149b333eaf8e873ac54b", "score": "0.5161399", "text": "def update\n set_meta_tags site: meta_title('Edit Account')\n add_breadcrumb 'Account', edit_user_registration_path\n super\n end", "title": "" }, { "docid": "c95022477b4fc744e0a73d3af79b0859", "score": "0.5159491", "text": "def hyperlink(url, class_name)\n hyper_a = @doc.at_css \"div[@class='row title #{class_name}']//a\"\n hyper_a['href'] = url\n end", "title": "" }, { "docid": "c4bcb6c5b505dda1f8b5d2a0c5b929fc", "score": "0.5156499", "text": "def tab_to(*args)\n name = args[0]\n url_options = args[1] || {}\n html_options = args[2]\n url = url_for(url_options)\n\n link = link_to(name, url, html_options)\n\n if request.path == url\n raw \"<li class ='selected'>\" + link + \"</li>\"\n else\n raw \"<li>\" + link + \"</li>\"\n end\n end", "title": "" }, { "docid": "d672d81281542f082fbb095bc15dc146", "score": "0.5145972", "text": "def link\n h.content_tag :li do\n h.link_to h.content_tag(:i, '' , class: object.icon ) , object.url , target: \"_blank\" , title: object.name\n end\n end", "title": "" }, { "docid": "13e458e5c3872983d2124b632fa23f99", "score": "0.51427186", "text": "def api_update_link(action, model, attributes, html_options = nil, &block)\n i18n_key = \"#{model.model_name.singular}.%s.#{action.to_s.camelize(:lower)}\"\n url = \"/api/#{model.model_name.route_key.sub('_', '-')}/#{model.id}\"\n new_options = {\n title: t(i18n_key % 'button'),\n data: {\n remote: true, method: :patch, type: :jsonapi,\n params: {type: model.model_name.route_key, id: model.id, attributes: attributes},\n 'success-message': t((i18n_key % 'message') + 'Success', model: get_name_for(model))\n }\n }\n render_button(block_given? ? block : t(i18n_key % 'button'), action,\n i18n_key, url, html_options.deep_merge(new_options))\n end", "title": "" }, { "docid": "fa9ef944b4e6d739b82bbedeec3eb655", "score": "0.5140887", "text": "def edit\n add_breadcrumb I18n.t('integral.breadcrumbs.edit'), :edit_list_path\n end", "title": "" }, { "docid": "5dd8ca81ffcfb529c9d0a34b8bfe7e96", "score": "0.51349413", "text": "def submit_block(link)\n @template.content_tag(:div, :class => \"pull-right\") do\n submit(:class => \"btn btn-primary\") + @template.content_tag(:span, @template.admin_t(:or), :class => \"or\") + @template.cancel_link(link)\n end\n end", "title": "" }, { "docid": "79616cda53774d2d242f7ba8b1e494fd", "score": "0.5134687", "text": "def toggle_link\n new_params = toggle_params\n\n if enabled\n h.link_to(h.search_path(new_params)) do\n h.check_box_tag(\"category_#{to_param}\", '1', true, disabled: true) +\n h.html_escape(name)\n end\n else\n h.link_to(h.search_path(new_params)) do\n h.check_box_tag(\"category_#{to_param}\", '1', false, disabled: true) +\n h.html_escape(name)\n end\n end\n end", "title": "" }, { "docid": "a55e70743c995ed75e6eb47086f40421", "score": "0.51293", "text": "def edit\n frm.button(:value=>\"Edit\").click\n AddEditAnnouncements.new(@browser)\n end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.5126804", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.5126804", "text": "def edit; end", "title": "" } ]
dd9ad7787727a8339f3abb78658f931a
PATCH/PUT /invitados/1 PATCH/PUT /invitados/1.json
[ { "docid": "a7ffe9ac9c016e3ec0bab12b041db32d", "score": "0.6804974", "text": "def update\n respond_to do |format|\n if @invitado.update(invitado_params)\n format.html { redirect_to @invitado, notice: 'Invitado was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitado }\n else\n format.html { render :edit }\n format.json { render json: @invitado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "6d204552315ee10c65455866fc8efa4c", "score": "0.67890984", "text": "def update\n invite = current_user.received_invites.find(params[:id])\n raise PermissionViolation unless current_user.updatable_by?(current_user)\n \n case params[:status].downcase\n when 'accepted' then invite.accept!\n when 'ignored' then invite.ignore!\n end\n \n respond_to do |format|\n format.json { render :json => [invite.to_rest] }\n end\n end", "title": "" }, { "docid": "8dfa8d7640a6191bd7adcf516916691b", "score": "0.6781297", "text": "def update\n @invitacion = Invitacion.find(params[:id])\n\n respond_to do |format|\n if @invitacion.update_attributes(params[:invitacion])\n format.html { redirect_to @invitacion, notice: 'La Plantilla fue actualizada exitosamente' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "865e3ffe757067142b2846c0db6f5422", "score": "0.65309054", "text": "def update\n @inviterequest = Inviterequest.find(params[:id])\n\n respond_to do |format|\n if @inviterequest.update_attributes(params[:inviterequest])\n format.html { redirect_to @inviterequest, notice: 'Inviterequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inviterequest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a2e8d9c305a09c7ab63070ad2cd29ed", "score": "0.65123594", "text": "def update\n @invitacion = Invitacion.find(params[:id])\n\n respond_to do |format|\n if @invitacion.update_attributes(params[:invitacion])\n format.html { redirect_to(@invitacion, :notice => 'Invitacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a2e8d9c305a09c7ab63070ad2cd29ed", "score": "0.65123594", "text": "def update\n @invitacion = Invitacion.find(params[:id])\n\n respond_to do |format|\n if @invitacion.update_attributes(params[:invitacion])\n format.html { redirect_to(@invitacion, :notice => 'Invitacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e67bbebe06004980d1d76cdb1cfdee5", "score": "0.65068704", "text": "def activo_update\n respond_to do |format|\n activo = params[:plan_paciente][:activo]\n id = params[:id]\n PlanPaciente.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "title": "" }, { "docid": "a477ff9dbf5c93a94aa920ec24fe4f5b", "score": "0.6496815", "text": "def update\n respond_to do |format|\n if @invetar.update(invetar_params)\n format.html { redirect_to @invetar, notice: 'Invetar was successfully updated.' }\n format.json { render :show, status: :ok, location: @invetar }\n else\n format.html { render :edit }\n format.json { render json: @invetar.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6c9c9a6a53c4b3de4c0c462112d1c8e", "score": "0.6494235", "text": "def activo_update\n respond_to do |format|\n activo = params[:sustancium][:activo]\n id = params[:id]\n Sustancium.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "title": "" }, { "docid": "8cf5582be869fc5b155331c1d0f7a490", "score": "0.6476637", "text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24465636e32103092ff6bdf1875b5585", "score": "0.6436164", "text": "def update\n\n respond_to do |format|\n if @invoiceline.update(invoiceline_params)\n format.html { redirect_to invoice_path(@invoiceline.invoice), notice: 'Ligne modifiée.' }\n format.json { render :show, status: :ok, location: @invoiceline }\n else\n format.html { render :edit }\n format.json { render json: @invoiceline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39328c8f3a81a2781319b7f598eb05ca", "score": "0.6423624", "text": "def update\n respond_to do |format|\n if @invmtolinea.update(invmtolinea_params)\n format.html { redirect_to @invmtolinea, notice: 'Invmtolinea was successfully updated.' }\n format.json { render :show, status: :ok, location: @invmtolinea }\n else\n format.html { render :edit }\n format.json { render json: @invmtolinea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ef0901df1feb6c530b61c8cd81ae807", "score": "0.63624406", "text": "def update\n respond_to do |format|\n if @invoce.update(invoce_params)\n format.html { redirect_to @invoce, notice: t(:successfully_updated_invoice) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoce.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bdb04f9fbea0d2f9de16576761098a2", "score": "0.6343342", "text": "def update\n invitation = invitable.find(params[:id])\n respond_to do |format|\n if invitation.update(invitation_params)\n format.json { render json: invitation, status: :ok }\n else\n format.json { render errors_for(invitation) }\n end\n end\n end", "title": "" }, { "docid": "587dc9f0563ef0779bc576eb3ad41199", "score": "0.6338065", "text": "def update\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n if @inventario.update_attributes(params[:inventario])\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "430945b2b82498b1bd0d4a9e0b26b5a7", "score": "0.63229316", "text": "def update\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n\n respond_to do |format|\n if @ventas_cliente.update_attributes(params[:ventas_cliente])\n format.html { redirect_to @ventas_cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "211c353ebce98d82f568daa17afc889e", "score": "0.63228166", "text": "def update\n # Chequear que solo puedan editar reservas los dueños\n if current_user == @reserva.user || current_user.admin?\n\n # Arregla invitados anonimos\n if reserva_params[:finalidad] == 'Evento/capacitación/reunión' || current_user.admin?\n invitados_anon = [params[:invitados_anon].to_i, MAX_OCUPACIONES].min\n if invitados_anon.positive?\n @reserva.invitados.delete_all\n invitados_anon.times do |_invitado_anon|\n @reserva.invitados.create(anonimo: true)\n end\n # Remueve parametros de invitados declarados\n params.require(:reserva).delete(:invitados_attributes)\n end\n end\n\n # Chequea numero de usuarios\n if reserva_params[:invitados_attributes].to_h.size > MAX_OCUPACIONES\n @reserva.errors.add(:invitaciones, \"No puede haber más de #{MAX_OCUPACIONES} lugares ocupados.\")\n respond_to do |format|\n format.html do\n render :edit, status: :unprocessable_entity\n end\n format.json { render json: @reserva.errors, status: :unprocessable_entity }\n end\n else\n respond_to do |format|\n # Setea aprobación\n decide_aprobacion(@reserva) unless current_user.admin?\n @por_aprobar = !@reserva.aprobado\n\n if @reserva.update(reserva_params)\n # Arregla invitados previamente anonimos ahora declarados\n @reserva.invitados.each do |inv|\n inv.update anonimo: false\n end\n\n # Avisa a admins\n notice_admins_update\n\n format.html { redirect_to @reserva, notice: 'La reserva fue correctamente guardada.' }\n format.json { render :show, status: :ok, location: @reserva }\n else\n format.html do\n render :edit, status: :unprocessable_entity\n end\n format.json { render json: @reserva.errors, status: :unprocessable_entity }\n end\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'No tiene los permisos necesarios', status: :unauthorized }\n format.json { render :show, status: :unauthorized, location: @reserva }\n end\n end\n end", "title": "" }, { "docid": "0fa4095d013435c483c98dcf834e0b9f", "score": "0.630716", "text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47b02eae668e38a5bcfc0695b237a1e6", "score": "0.62876457", "text": "def update\n\t\n if params[:todos]\n\tparams[:notificacao][:ginasio_id] = nil\n end\n\n @notificacao = Notificacao.find(params[:id])\n\n respond_to do |format|\n if @notificacao.update_attributes(params[:notificacao])\n format.html { redirect_to @notificacao, :flash => { :success => \"Notificacao alterada com sucesso.\" } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @notificacao.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3dfb09db877af60cc95e9b4e4bf8340a", "score": "0.62729675", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Din tur blevet opdateret og gemt' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.6238023", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "3c22f7d9b5cca5f86d5055b60e6383d3", "score": "0.6236543", "text": "def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: \"Invite for #{@invite.email}was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e1772d1d906a576328f2d9dbff6f4f7", "score": "0.6222918", "text": "def update\n respond_to do |format|\n if @insumos_reactivo.update(insumos_reactivo_params)\n format.html { redirect_to @insumos_reactivo, notice: 'Insumos reactivo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f3e19f0c6598a59b92476ae15785370", "score": "0.62112725", "text": "def update\n cliente_viejo = @cliente.dup\n respond_to do |format|\n if @cliente.update(cliente_params)\n Auditorium.GenerarAuditoria(\"Modifiacion de Cliente\", current_user.email, cliente_viejo, @cliente)\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9d77e2c47861f36636dfcd4c24bc489", "score": "0.62089187", "text": "def update\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n if @clientetipo.update_attributes(params[:clientetipo])\n format.html { redirect_to @clientetipo, notice: 'Clientetipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientetipo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72b1a4b3bf2443427b140a072cd86cb8", "score": "0.618951", "text": "def update\n @invite = Invite.find_by_name(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, :notice => 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @invite.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c17d147ed9e5f14ef9c63e4e6aafaa07", "score": "0.6178466", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n if @invoice.update(invoice_params)\n head :no_content\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "29c085006d82a12845002816b590925b", "score": "0.61730623", "text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, notice: 'Oferta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oferta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf63ca6298156736dc3c695cfe8dae1d", "score": "0.6162316", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to admin_pessoa_servicos_path(@pessoa), notice: 'Serviço foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61543524", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d413fef50d18065886d9e3b8ae796f8", "score": "0.61535376", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2beb9c36d1483cf9f9f858e4023cd4f0", "score": "0.6150316", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2beb9c36d1483cf9f9f858e4023cd4f0", "score": "0.6150316", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce2ef0547d1285c6bc27fcbd7458f3d2", "score": "0.61374784", "text": "def update\n @vigencia_ofertum = VigenciaOferta.find(params[:id])\n\n respond_to do |format|\n if @vigencia_ofertum.update_attributes(params[:vigencia_ofertum])\n format.html { redirect_to @vigencia_ofertum, notice: 'Vigencia ofertum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vigencia_ofertum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "795f7dbe0c93a7e96b2b3515f95051f8", "score": "0.61328745", "text": "def update\n @nota_entrega = NotaEntrega.find(params[:id])\n\n respond_to do |format|\n if @nota_entrega.update_attributes(params[:nota_entrega])\n format.html { redirect_to @nota_entrega, notice: 'Nota entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nota_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0d6540ba0778b1e6ad8fab0f11c279f", "score": "0.6132612", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0d6540ba0778b1e6ad8fab0f11c279f", "score": "0.6132612", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16a7a26ee5a1d1134bf09de143750603", "score": "0.6131614", "text": "def update\n @invoice = Invoice.find_by_rand(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated. Whew.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fcdeb4b1295fef2a76fc6de836fee47", "score": "0.6129931", "text": "def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fcdeb4b1295fef2a76fc6de836fee47", "score": "0.6129931", "text": "def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fcdeb4b1295fef2a76fc6de836fee47", "score": "0.6129931", "text": "def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db640cce29255d116e926a24802b6b8c", "score": "0.6123689", "text": "def update\n @invitee = Invitee.find(params[:id])\n\n respond_to do |format|\n if @invitee.update_attributes(params[:invitee])\n format.html { redirect_to @invitee, :notice => 'Invitee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @invitee.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2025243aa7304fcd76794f137206367f", "score": "0.612315", "text": "def update\n #params[:os][:pagamentos_attributes].each do |pagamento|\n # currency_to_number pagamento[1][\"valor\"]\n #end\n\n params[:os][:itens_attributes].each do |item|\n currency_to_number item[1][\"desconto\"]\n currency_to_number item[1][\"acrescimo\"]\n end\n \n #params[:os][:pagamentos_attributes][\"0\"][:cliente_id] = params[:os][:cliente_id]\n \n @os = Os.find(params[:id])\n\n respond_to do |format|\n if @os.update_attributes(params[:os])\n format.html { redirect_to @os, notice: 'Ordem de Serviço atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa72790c63fc3d9756d2feedc4b10beb", "score": "0.6122525", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1326bf4a921a2c1a7718ad3815ab546a", "score": "0.61138284", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço alterado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9939d104cc69ee0603b44e21eac25e30", "score": "0.61078084", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27c077f51cbdbed8109c228d4eadfc91", "score": "0.61056226", "text": "def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67ddec4cb6d9870bfce845fe91e4ac06", "score": "0.6102388", "text": "def update\n @solicitacao = Solicitacao.find(params[:id])\n\n respond_to do |format|\n if @solicitacao.update_attributes(params[:solicitacao])\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8030b6a3a618d66537d0f1f7e1a4175e", "score": "0.609147", "text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f2f4987f1f29db241eea2c22df91c8f", "score": "0.60883886", "text": "def update\n @viagem = Viagem.find(params[:id])\n\n respond_to do |format|\n if @viagem.update_attributes(params[:viagem])\n format.html { redirect_to @viagem, :notice => 'Viagem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @viagem.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46e95b6ac946e8628f4b2bee17eb7c3d", "score": "0.6088364", "text": "def update\n @invitee = Invitee.find(params[:id])\n\n respond_to do |format|\n if @invitee.update_attributes(params[:invitee])\n format.html { redirect_to @invitee, notice: 'Invitee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d91fe8ffe79c0ce9f854a7339dc24d6", "score": "0.6083689", "text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.request_parameters\n if n_param[\"id\"]\n render json: {\"error\": \"id no es modificable\"}, status: 400\n elsif n_param.size > 1\n render json: {\"error\": \"La modificación ha fallado, solo puedes ingresar un parametro para modificar\"}, status: 500\n elsif usuario.update(usuario_params) && n_param.size == 1\n if [\"usuario\", \"nombre\", \"apellido\", \"twitter\"].include?(n_param.keys[0])\n render json: usuario, status: 200\n else\n render json: {\"error\": \"La modificación ha fallado, el atributo entregado no es válido\"}, status: 500\n end\n else\n render json: {\"error\": \"La modificación ha fallado\"}, status: 500\n end\n else\n render json: {\"error\": \"Usuario no encontrado\"}, status: 404\n end\n end", "title": "" }, { "docid": "1325bd0998e12f8c2b90e98f65f13717", "score": "0.60774976", "text": "def update\n respond_to do |format|\n if @invocy.update(invocy_params)\n format.html { redirect_to @invocy, notice: 'Invocy was successfully updated.' }\n format.json { render :show, status: :ok, location: @invocy }\n else\n format.html { render :edit }\n format.json { render json: @invocy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02b80e3ce894bc22a4c705eba3c2fc3d", "score": "0.60771364", "text": "def update\n respond_to do |format|\n if @registro_insumos_reactivo.update(registro_insumos_reactivo_params)\n format.html { redirect_to @registro_insumos_reactivo, notice: 'Registro insumos reactivo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registro_insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "273634315f20717f09fb319e75b9e206", "score": "0.60693395", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n set_formatted_dates()\n format.json { render json: @invoice.to_json(include: :client), status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ce22fa855d19d8a804d01e9d92700f9", "score": "0.6067648", "text": "def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "674c8de468652f1a88bb89121e27fc77", "score": "0.60664004", "text": "def update\n \t@empresa = Empresa.find_by :id_empresa => params[:id]\n \t# Rubro updating\n \tif params[:rubros] \n \t\t@empresa.rubros << params[:rubros]\n \tend\n \t# If activating a company, send the activation email to the user.\n \tif @empresa.activa != params[:empresa][:activa] && @empresa.company_user\n \t\tUserMailer.activation_email(@empresa.company_user).deliver\n \tend\n\n \tif @empresa.update({\n\t \tnombre: params[:empresa][:nombre],\n\t \tcuenta_banco: params[:empresa][:cuenta_banco],\n\t \trut_empresa: params[:empresa][:rut_empresa],\n\t \tactiva: params[:empresa][:activa]\n\t })\n \t\trender :json => @empresa, :include => [:company_user], status: :ok\n \telse\n \t\trender :json => {}, status: :internal_server_error\n \tend\n\tend", "title": "" }, { "docid": "8f5adc7656e74cea8dbba9154a81144f", "score": "0.6066051", "text": "def update\n respond_to do |format|\n if @oferta.update(oferta_params)\n format.html { redirect_to @oferta, notice: 'Oferta de monitoria editada com sucesso!' }\n format.json { render :show, status: :ok, location: @oferta }\n else\n format.html { render :edit }\n format.json { render json: @oferta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b43604bd409d8c4644421c395d71320", "score": "0.6062162", "text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend", "title": "" }, { "docid": "6961df2adb3101e480f091d6c271889a", "score": "0.6061225", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n @folioDetail = FolioDetail.find(@invoice.folio_detail_id)\n @folioDetail.status = 0\n @folioDetail.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ede6237d8115e07828362d423a749e6", "score": "0.60605925", "text": "def update\n respond_to do |format|\n if @viagem.update(viagem_params)\n format.html { redirect_to @viagem, notice: 'Viagem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @viagem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74b5fed3975d7bffe23a128e46a76ad1", "score": "0.6060188", "text": "def update\n respond_to do |format|\n if @servicio.update(servicio_params)\n format.html { redirect_to @servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio }\n else\n format.html { render :edit }\n format.json { render json: @servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d2dcd0d0f9c448835b0aa704ce6f516", "score": "0.60509884", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to [:admin, @cliente], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eaea96cff1ef5a1ebcd4d64e34b98b1e", "score": "0.6034831", "text": "def update\n @invoiceline = Invoiceline.find(params[:id])\n\n respond_to do |format|\n if @invoiceline.update_attributes(params[:invoiceline])\n format.html { redirect_to @invoiceline, notice: 'Invoiceline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoiceline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04d51aa212185cdcc914b45e24ec57ec", "score": "0.6034609", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to \"/dados\", notice: 'Suas informações foram alteradas com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd87955a1d9f0d5163fc9c902b1bfb1b", "score": "0.6033835", "text": "def update\n respond_to do |format|\n if @licenta.update(licenta_params)\n format.html { redirect_to @licenta, notice: 'Licenta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @licenta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96b63b6e68d29aad6acd7c0b37664778", "score": "0.6022773", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to [:account,@invoice], notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73e14c1f14f5c0a2f7d225b4265537f9", "score": "0.6021384", "text": "def update\n respond_to do |format|\n if @ventas_cliente.update(ventas_cliente_params)\n format.html { redirect_to @ventas_cliente, notice: 'Cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @ventas_cliente }\n else\n format.html { render :edit }\n format.json { render json: @ventas_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8098031dc873dd6f0050a1488fdb273", "score": "0.60187584", "text": "def update\n @endereco = Endereco.find(params[:id])\n\n respond_to do |format|\n if @endereco.update_attributes(params[:endereco])\n if @endereco.enderecavel_type == 'Usuario'\n format.html { redirect_to Usuario.find(@endereco.enderecavel_id), :notice => 'Endereço was successfully updated.' }\n format.json { head :ok }\n else\n format.html { redirect_to Cliente.find(@endereco.enderecavel_id), :notice => 'Endereço was successfully created.' }\n format.json { render :json => @endereco, :status => :created, :location => @endereco }\n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @endereco.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2114acc5e74f8f729650a4f11d378e85", "score": "0.60164773", "text": "def update\n\n @cliente = find_cliente\n @descuento_cliente = @cliente.descuento_clientes.find(params[:id])\n\n respond_to do |format|\n\n if @descuento_cliente.update_attributes(params[:descuento_cliente])\n #format.html { redirect_to redirigir(@contelefono), :notice => 'El telefono fue actualizado correctamente.' }\n format.json { render json: @descuento_cliente }\n else\n #format.html { render :action => \"edit\" }\n format.json { render json: @descuento_cliente.errors }\n end\n\n end\n\n end", "title": "" }, { "docid": "32bb9fca7d96ce959e1b3306358b47a0", "score": "0.6012441", "text": "def update\n respond_to do |format|\n if @ventum.update(ventum_params)\n format.html { redirect_to @ventum, notice: 'La venta ha sido actualizada con exito' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bd76a24a644f6b72838892241b0bd36", "score": "0.6011752", "text": "def update\n @telefono = Telefono.find(params[:id])\n\n respond_to do |format|\n if @telefono.update_attributes(params[:telefono])\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c1a09a9d20ee815b5c9f998eda70b44", "score": "0.6006549", "text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end", "title": "" }, { "docid": "6d12d3d3de7f4f0577ee3c9f487b087b", "score": "0.6006523", "text": "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Resto was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9a878214d8416e96d62a5e43bf3dccb", "score": "0.60041684", "text": "def update\n respond_to do |format|\n if @objeto.update(observacion_params)\n format.html { redirect_to @objeto, notice: \"Observacion was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47e4f698013b6873a59111e77a123142", "score": "0.6002735", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df93eb01bfe78026d7b48f0644922fe9", "score": "0.60011256", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente actualizado ^^' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffd9ad76982426218cd95167473527fd", "score": "0.60008746", "text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'La Factura fue editada correctamente.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "626af91271495ade9fd5601fc2a240fe", "score": "0.6000017", "text": "def update\n @orden_servicio = OrdenServicio.find(params[:id])\n\n respond_to do |format|\n if @orden_servicio.update_attributes(params[:orden_servicio])\n format.html { redirect_to @orden_servicio, notice: 'Orden servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bcfeb34b553cbd0a61b298636499d6f", "score": "0.59986234", "text": "def update\n respond_to do |format|\n if @paquete_inventario.update(paquete_inventario_params)\n format.html { redirect_to @paquete_inventario, notice: 'Paquete inventario was successfully updated.' }\n format.json { render :show, status: :ok, location: @paquete_inventario }\n else\n format.html { render :edit }\n format.json { render json: @paquete_inventario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67c7530438da71401cfa36444421f7c8", "score": "0.5996374", "text": "def update\n @event = Event.find(params[:event_id])\n @invite = @event.invites.find(params[:id])\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to this_invite_path, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91132b4d82a7f93f46d59cd054188fca", "score": "0.5993895", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, :notice => 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3617d428e79e05def5b33b3391dc7f30", "score": "0.5990191", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56bbd4ee4679385224b5fd008abb75ec", "score": "0.5988401", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to invoices_path(), notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74e34e4da7980e5fba560f486950bd49", "score": "0.59880733", "text": "def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to invites_path, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8728282391de2104b2c5376c99a4dcda", "score": "0.5986014", "text": "def update\n respond_to do |format|\n if @registro_cliente_servicio.update(registro_cliente_servicio_params)\n format.html { redirect_to @registro_cliente_servicio, notice: 'Cliente servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_cliente_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_cliente_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbb92c685a955774aca73f25c632418d", "score": "0.59842646", "text": "def update\n @estado_cliente = EstadoCliente.find(params[:id])\n\n respond_to do |format|\n if @estado_cliente.update_attributes(params[:estado_cliente])\n format.html { redirect_to @estado_cliente, notice: 'Estado cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estado_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b31b9024d5291ac8b5d1d73329b5234", "score": "0.5983924", "text": "def update\n @agente = Agente.find(params[:id])\n\n respond_to do |format|\n if @agente.update_attributes(params[:agente])\n format.html { redirect_to @agente, notice: 'Agente modificato con successo.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "893083a2ba78576ff36cb68b0dd16fb2", "score": "0.5980685", "text": "def update\n @invoice = Invoice.find(params[:id])\n @invoice.updated_user = current_user.login_name\n @invoice.invoice_details.each do |i|\n i.updated_user = current_user.login_name\n end\n @object = @invoice.invoiceable_type.classify.constantize.find(@invoice.invoiceable_id)\n @object.selector = @invoice.invoiceable_type == \"Provider\" ? Selector::PROVIDER : Selector::GROUP\n @invoice_method = InvoiceCalculation::METHODS\n @payment_terms = Invoice::PAYMENT_TERMS\n @display_sidebar = true\n @back_index = true\n @title = \"Client Invoices\"\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n @invoice.validate\n if params[:commit] == \"Update\"\n format.html { render action: \"new\", notice: 'Invoice was successfully created.' }\n else\n format.html { redirect_to invoice_path(@invoice), notice: 'Invoice was successfully updated.' }\n end\n format.json { render json: @invoice }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
57fd43c5056857f89db3d32a9c853283
return value will directly be passed into the ffi fn
[ { "docid": "1546ffa4d3b63c4b03739a27e186a4ef", "score": "0.0", "text": "def ruby_input_conversion(obj); obj; end", "title": "" } ]
[ { "docid": "1c018a8bd179d92610ddc75d6d0958e1", "score": "0.72172487", "text": "def ffi_struct; end", "title": "" }, { "docid": "b57354c1d329cf50f9497919a034aaf9", "score": "0.703072", "text": "def ffi_managed_struct; end", "title": "" }, { "docid": "d2f470837ce699e91dc0ee8ed6a6ab53", "score": "0.64196575", "text": "def ffi_struct\n self.class.ffi_struct\n end", "title": "" }, { "docid": "d2f470837ce699e91dc0ee8ed6a6ab53", "score": "0.64196575", "text": "def ffi_struct\n self.class.ffi_struct\n end", "title": "" }, { "docid": "b668670d56c0018c99ec4e12ec07434c", "score": "0.6270197", "text": "def to_ffi\n @ffi_struct\n end", "title": "" }, { "docid": "cc13bd25d32f9c322e48b26c55ff0a20", "score": "0.6067635", "text": "def ffi_managed_struct\n self.class.ffi_managed_struct\n end", "title": "" }, { "docid": "cc13bd25d32f9c322e48b26c55ff0a20", "score": "0.6067635", "text": "def ffi_managed_struct\n self.class.ffi_managed_struct\n end", "title": "" }, { "docid": "bbadf0e94a094d831cd0e171539dc91e", "score": "0.6013811", "text": "def ffi_lib(*)\n super(Mock.path)\n end", "title": "" }, { "docid": "bbadf0e94a094d831cd0e171539dc91e", "score": "0.6013811", "text": "def ffi_lib(*)\n super(Mock.path)\n end", "title": "" }, { "docid": "45f82873fe12a0a22758abc87977cf07", "score": "0.6011127", "text": "def from_ffi(ffi_ptr)\n from_address(ffi_ptr.address)\n end", "title": "" }, { "docid": "bc92d9e769de5b0c000ead784b6b5f0b", "score": "0.60006446", "text": "def retval; end", "title": "" }, { "docid": "bc92d9e769de5b0c000ead784b6b5f0b", "score": "0.60006446", "text": "def retval; end", "title": "" }, { "docid": "7141265da2901466efd384a47d7421b5", "score": "0.59045094", "text": "def pointer=(_arg0); end", "title": "" }, { "docid": "7141265da2901466efd384a47d7421b5", "score": "0.59045094", "text": "def pointer=(_arg0); end", "title": "" }, { "docid": "f20473284a2311111e1b322c0ab5070c", "score": "0.5814178", "text": "def native; end", "title": "" }, { "docid": "f20473284a2311111e1b322c0ab5070c", "score": "0.5814178", "text": "def native; end", "title": "" }, { "docid": "3193c407a52e85393bb9fdcda99cdc18", "score": "0.5798428", "text": "def ptr; end", "title": "" }, { "docid": "6f145f803576b5f9d7d79b3031fe579b", "score": "0.5759789", "text": "def at_return(_return_value); end", "title": "" }, { "docid": "6f145f803576b5f9d7d79b3031fe579b", "score": "0.5759789", "text": "def at_return(_return_value); end", "title": "" }, { "docid": "3a6c467b91b215d41d1bccfe04753402", "score": "0.57175153", "text": "def _return_value()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c758b778e457db2e89a6d76342ae3914", "score": "0.57008666", "text": "def make_function_pointer(memp, args, ret)\n funcptr = \n if FFI.const_defined?(\"Function\")\n ## use FFI::Function for ffi-0.5.0. Dunno if this works in jruby.\n FFI::Function.new FFI.find_type(ret), # return type\n args, # args\n memp, # pointer to our function\n :convention => :default # calling convention\n\n elsif FFI.const_defined?(\"Invoker\")\n ## use FFI::Invoker for ffi-0.4.0 - two flavors... yay!\n if RUBY_PLATFORM=='java' # JRuby FFI\n FFI::Invoker.new memp, args, FFI.find_type(ret), \"\"\n else ## and not Jruby...\n FFI::Invoker.new memp, args, ret, FFI.find_type(ret), \"\", nil\n end\n else\n raise \"oh noes! this version of ffi is totally unfamiliar\"\n end\n\n return funcptr\nend", "title": "" }, { "docid": "2b8efe57ec1d144e66c6371a5703f75c", "score": "0.56698745", "text": "def ffi_type; rust_type.to_sym; end", "title": "" }, { "docid": "9f8be43f7454d3875181fb94ad8ec441", "score": "0.5622613", "text": "def byte_pointer; end", "title": "" }, { "docid": "9f8be43f7454d3875181fb94ad8ec441", "score": "0.5622613", "text": "def byte_pointer; end", "title": "" }, { "docid": "f9edf66eac9613050d33fb3ca53ef1c8", "score": "0.5611453", "text": "def to_native\n ptr = FFI::MemoryPointer.new(:pointer, 1)\n ptr.write_pointer(FFI::MemoryPointer.from_string(@value))\n ptr\n end", "title": "" }, { "docid": "aebff2d4631221013e762e9ab996b339", "score": "0.55748725", "text": "def return_path(val = T.unsafe(nil)); end", "title": "" }, { "docid": "26da328e8cf814fdc197fd2d301c3d2b", "score": "0.5566259", "text": "def flipx\r\n end", "title": "" }, { "docid": "3f8616b1d07a229912d449c023d6064c", "score": "0.55574566", "text": "def _get(_arg0); end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.5527407", "text": "def returned; end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.5527407", "text": "def returned; end", "title": "" }, { "docid": "55168850d46d410e2fbd18c676d97f30", "score": "0.5508052", "text": "def to_ffi_value(ffi_type)\n self.addr\n end", "title": "" }, { "docid": "9e3ba7ad556a59d84543af6453d458ba", "score": "0.54977846", "text": "def argv_to_ffi\n array_to_ffi(ARGV)\n end", "title": "" }, { "docid": "792be6eadacebdee265be975baeda2c7", "score": "0.54496753", "text": "def function; end", "title": "" }, { "docid": "f5b335a9ceb81ee0163a9cd71497a36e", "score": "0.5446421", "text": "def to_native(value, ctx)\n value.ptr\n end", "title": "" }, { "docid": "6ce3756b6ffad05f6eb711edacc06bf2", "score": "0.5425507", "text": "def load_ffi\n ffi_module = BEL::LibBEL::find_ffi\n extend ffi_module::Library\n ffi_module\n end", "title": "" }, { "docid": "813fd9187e90a29c6b0ea6711772f902", "score": "0.54238224", "text": "def on_fcall(value); end", "title": "" }, { "docid": "526aafde2ae453b99e8cc5b3998acfee", "score": "0.5378134", "text": "def f(x0)\n @f.call(x0)\n end", "title": "" }, { "docid": "03f2753d10737e1ce99b8cd6b90fc930", "score": "0.5375869", "text": "def wrapper\n make_fortran_fct_name r.name\n\n code_for_return_type(r.return_type)\n\n r.each_arg do |name, type|\n code_for_argument(name, type)\n end\n\n # first we generate the code for the non-output arguments\n r.each_arg do |name, type|\n if not type.output?\n code_for_array_management(name, type)\n end\n end\n\n # and now for the output arguments\n r.each_arg do |name, type|\n if type.output?\n code_for_array_management(name, type)\n end\n end\n\n return <<EOS\nJNIEXPORT #{return_type} JNICALL Java_#{fct_name}(JNIEnv *env, jclass this#{decl_args})\n{\n extern #{fortran_return_type} #{fortran_fct_name}(#{fortran_args.join(', ')});\n \n#{conversions}\n savedEnv = env;\n #{call_pre}#{fortran_fct_name}(#{call_args.join(', ')});\n#{release_arrays}#{call_post}\n}\nEOS\n end", "title": "" }, { "docid": "bf3db1c1d60f93d6ab27ca4e7d7cfad2", "score": "0.53607625", "text": "def embedded_argv_to_ffi\n array_to_ffi(%w[-e 0])\n end", "title": "" }, { "docid": "bde0d778388bebf5117ae327b644d06d", "score": "0.5355511", "text": "def ffi_function_not_implemented(*args)\n raise NotImplementedError, \"function not implemented on this platform\"\n end", "title": "" }, { "docid": "dbde88f51a7940d79154abd18d962d4e", "score": "0.53435487", "text": "def _data0=(_arg0); end", "title": "" }, { "docid": "23de8e8263b7c8e728ac234e8c84db6e", "score": "0.53420436", "text": "def fstype=(_arg0); end", "title": "" }, { "docid": "5b96094af40124a1a1c3217b1c75af01", "score": "0.53381014", "text": "def ffi_delegate(method)\n def_delegator(:@ffi_delegate, method)\n end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.533032", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.533032", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "464b4755a70c48ed92218344e0776406", "score": "0.53300434", "text": "def returned=(_); end", "title": "" }, { "docid": "464b4755a70c48ed92218344e0776406", "score": "0.53300434", "text": "def returned=(_); end", "title": "" }, { "docid": "e6c7c19b8fca5c5a185c06f3c8180f15", "score": "0.529444", "text": "def return_to=(_arg0); end", "title": "" }, { "docid": "0c2136b4b6e0738f7e2a3bff9f030872", "score": "0.5288976", "text": "def run_function(fun, *args)\n FFI::MemoryPointer.new(FFI.type_size(:pointer) * args.size) do |args_ptr|\n new_values = []\n args_ptr.write_array_of_pointer(fun.params.zip(args).map do |p, a|\n if a.kind_of?(GenericValue)\n a\n else\n value = LLVM.make_generic_value(p.type, a)\n new_values << value\n value\n end\n end)\n result = LLVM::GenericValue.from_ptr(\n C.run_function(self, fun, args.size, args_ptr))\n new_values.each(&:dispose)\n return result\n end\n end", "title": "" }, { "docid": "d58443db91c28169e62223cd2a7c4793", "score": "0.5287707", "text": "def load!\n unless @permanently_loaded\n dll_path = self.class.get_dll_path\n Openeuo::Core::UoDllFfi.class_eval do\n\n ffi_lib dll_path\n\n attach_function :open, 'Open', [ ], :int\n attach_function :close, 'Close', [ :int ], :void\n attach_function :version, 'Version', [ ], :int\n attach_function :push_nil, 'PushNil', [ :int ], :void\n attach_function :push_boolean, 'PushBoolean', [ :int, :bool ], :void\n attach_function :push_integer, 'PushInteger', [ :int, :int ], :void\n attach_function :push_double, 'PushDouble', [ :int, :double ], :void\n attach_function :push_str_ref, 'PushStrRef', [ :int, :string ], :void\n attach_function :push_str_val, 'PushStrVal', [ :int, :string ], :void\n attach_function :get_boolean, 'GetBoolean', [ :int, :int ], :bool\n attach_function :get_integer, 'GetInteger', [ :int, :int ], :int\n attach_function :get_double, 'GetDouble', [ :int, :int ], :double\n attach_function :get_string, 'GetString', [ :int, :int ], :string\n attach_function :get_top, 'GetTop', [ :int ], :int\n attach_function :get_type, 'GetType', [ :int, :int ], :int\n attach_function :insert, 'Insert', [ :int, :int ], :void\n attach_function :push_value, 'PushValue', [ :int, :int ], :void\n attach_function :remove, 'Remove', [ :int, :int ], :void\n attach_function :set_top, 'SetTop', [ :int, :int ], :void\n attach_function :mark, 'Mark', [ ], :void\n attach_function :clean, 'Clean', [ ], :void\n attach_function :execute, 'Execute', [ :int ], :int\n attach_function :query, 'Query', [ :int ], :int\n end\n\n @permanently_loaded = true\n end\n @loaded = true\n\n nil\n end", "title": "" }, { "docid": "c80534bd17e4115e6c0a7b852c1e7140", "score": "0.52796793", "text": "def ffi_lib(*)\n super(Spotify::Heroku.libspotify_path)\n end", "title": "" }, { "docid": "c5a7a0c2e151734202fa1a534d568846", "score": "0.5276608", "text": "def pointer; end", "title": "" }, { "docid": "c5a7a0c2e151734202fa1a534d568846", "score": "0.5276608", "text": "def pointer; end", "title": "" }, { "docid": "dbd2d9b822abe91d8ba9c0b907796d7e", "score": "0.52107704", "text": "def calldata(value); end", "title": "" }, { "docid": "dd42b42ca1299ca0e7962cf867fa5323", "score": "0.5197872", "text": "def to_ptr\n ptr\n rescue MessageFrameClosed\n FFI::Pointer::NULL\n end", "title": "" }, { "docid": "5a06247b13b4ee1eb45269e4b8b27b70", "score": "0.51961774", "text": "def rc=(_arg0); end", "title": "" }, { "docid": "fc10964a943d39d1cd6432dabee777ca", "score": "0.5194368", "text": "def _ret # ret value\r\n val = @operands[0]\r\n\r\n routine_return val\r\n end", "title": "" }, { "docid": "ed25ead5357c739085ed8a8e032480c6", "score": "0.5179975", "text": "def result=(_arg0); end", "title": "" }, { "docid": "ed25ead5357c739085ed8a8e032480c6", "score": "0.5179975", "text": "def result=(_arg0); end", "title": "" }, { "docid": "68c9f1403ee3eb6ec1f4753ee4d7a25f", "score": "0.5173664", "text": "def buffer=(_arg0); end", "title": "" }, { "docid": "f64e6a92a55643bf3ba0e28a59c99ec3", "score": "0.5171626", "text": "def call_funify\n\treturn(array.push(\"fun\"))\nend", "title": "" }, { "docid": "09aeb72f84bd4898669d5156f5149bbd", "score": "0.5160461", "text": "def native_declaration\n begin\n return_type = ''\n fct_name = r.name.downcase\n args = []\n\n return_type = java_return_type\n \n r.args.each do |name|\n type = r.argtype[name]\n if name != 'INFO'\n args << type.to_java + \" \" + name.downcase\n if type.to_java =~ /\\[\\]/\n args << \"int #{name.downcase}Idx\"\n end\n end\n end\n result = \" public static native #{return_type} #{fct_name}(#{args.join(\", \")});\"\n unless r.workspace_arguments.empty?\n result += \"\\n\" + with_workspace_query\n end\n return result\n rescue\n puts\n puts \"---Error for routine #{@routine}\"\n puts\n raise\n end\n end", "title": "" }, { "docid": "3df0abf8b0b59bc6df673f57e654c26a", "score": "0.51596946", "text": "def opaque=(_arg0); end", "title": "" }, { "docid": "3df0abf8b0b59bc6df673f57e654c26a", "score": "0.51596946", "text": "def opaque=(_arg0); end", "title": "" }, { "docid": "3df0abf8b0b59bc6df673f57e654c26a", "score": "0.51596946", "text": "def opaque=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "096f52fe5de39620819d66a142495850", "score": "0.51486015", "text": "def data=(_arg0); end", "title": "" }, { "docid": "0c38f45dbd37e538a9d6c8e3a6f76869", "score": "0.5138304", "text": "def for_invoke \n enum_type = FFI::Library.enums[type]\n \n if enum_type\n CFunc::Int.new(enum_type[value])\n \n elsif type == :string\n value\n \n elsif (cfunc_type = FFI::TYPES[type])\n if (typedef = FFI::Library.typedefs[type])\n o_type = type\n self[:type] = typedef\n q = for_invoke()\n self[:type] = o_type\n return q\n end\n \n return cfunc_type.new(value)\n \n elsif (callback_type = FFI::Library.callbacks[type])\n FFI::Closure.new(*callback_type, &value)\n\n elsif (struct = type).respond_to?(:is_struct?)\n if value.is_a?(CFunc::Struct)\n return value.addr\n elsif value.is_a?(CFunc::Pointer)\n return value\n else\n return value\n end\n \n elsif (instance = type).is_a?(FFI::Struct::ReturnAsInstance)\n struct = instance.klass\n \n if value.is_a?(struct)\n return value.addr\n \n elsif value.is_a?(CFunc::Pointer)\n return value\n \n else\n # FIXME: should probally raise\n return value\n \n end\n \n else\n raise \"Unsupported type: #{type}\"\n end\n end", "title": "" }, { "docid": "68a9747e9e3c56840865a895d47a7b97", "score": "0.5135304", "text": "def fulfill(value, opts = T.unsafe(nil)); end", "title": "" }, { "docid": "4fd16fe9211f601ec151eba08c05098d", "score": "0.5132923", "text": "def get_return_value()\n func_name = @ids_and_values_stack.pop()\n @memory_stack.pop()\n func_type = @types_stack.pop()\n @manager.set_memory_next()\n memory_dir = @manager.memory_counter()\n quad = Quadruple.new(\"=\", func_name, nil, memory_dir)\n @ids_and_values_stack.push(memory_dir)\n @memory_stack.push(memory_dir)\n @types_stack.push(func_type)\n @manager.quadruples.push(quad)\n @manager.counter += 1\n end", "title": "" }, { "docid": "7e858585032835a500e51c4979125f0d", "score": "0.51170295", "text": "def attach(return_type, function_name, *arg_types)\n @ffi_module.attach_function(function_name, arg_types.map{|arg_type| Types[arg_type] }, Types[return_type])\n metaclass=class << self;self;end\n ffi_module=@ffi_module\n metaclass.send(:define_method, function_name) do |*args|\n ffi_module.send(function_name, *args)\n end\n nil\n end", "title": "" }, { "docid": "21f4b698685a6f7df878994724231b90", "score": "0.51093", "text": "def make_convert_arg\n basectype = ctype[0...-5]\n code.conversions << <<EOS + ' '\n #{basectype} *#{name}PtrBase = 0, *#{name}Ptr = 0;\n if (#{name}) {\nEOS\n unless code.arrays.empty?\n code.arrays.each do |a, t|\n if t == basectype\n code.conversions << \"if((*env)->IsSameObject(env, #{name}, #{a}) == JNI_TRUE)\\n #{name}PtrBase = #{a}PtrBase;\\n else\\n \"\n end\n end\n end\n code.conversions << <<EOS\n#{name}PtrBase = (*env)->Get#{basectype[1..-1].capitalize}ArrayElements(env, #{name}, NULL);\n #{name}Ptr = #{name}PtrBase + #{'2*' if type.basetype =~ /COMPLEX/}#{name}Idx;\n }\nEOS\n \n # and releasing the stuff again...\n release = []\n release << \" if(#{name}PtrBase) {\"\n release << \" (*env)->Release#{basectype[1..-1].capitalize}ArrayElements(env, #{name}, #{name}PtrBase, #{@type.output? ? '0' : 'JNI_ABORT'});\"\n code.arrays.each do |a, t|\n if t == basectype\n release << \" if (#{name}PtrBase == #{a}PtrBase)\"\n release << \" #{a}PtrBase = 0;\"\n end\n end\n release << \" #{name}PtrBase = 0;\"\n release << \" }\\n\"\n\n code.release_arrays = release.join(\"\\n\") + code.release_arrays\n \n # store information about the arrays we have already handled\n code.arrays << [name, basectype]\n end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.51061875", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.51061875", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.51061875", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "0744a304a49f5b9a1a64210a79fff235", "score": "0.51047504", "text": "def _data1=(_arg0); end", "title": "" }, { "docid": "92fedf0fa596b949817537094ffcad21", "score": "0.5090611", "text": "def ret_value_addr; @offset; end", "title": "" }, { "docid": "da77d477d6522d50035164df5aa1227b", "score": "0.50899947", "text": "def memory_ptr\n FFI::MemoryPointer.new(2, 256)\n end", "title": "" }, { "docid": "0035843e43b78b925bcb4f2ab97300c2", "score": "0.5087365", "text": "def call(env = T.unsafe(nil)); end", "title": "" }, { "docid": "0035843e43b78b925bcb4f2ab97300c2", "score": "0.5087365", "text": "def call(env = T.unsafe(nil)); end", "title": "" }, { "docid": "0035843e43b78b925bcb4f2ab97300c2", "score": "0.5087365", "text": "def call(env = T.unsafe(nil)); end", "title": "" }, { "docid": "8ec89ac10eeec8ec182c6c26be573a4f", "score": "0.50833356", "text": "def run_function(fun, *args)\n FFI::MemoryPointer.new(FFI.type_size(:pointer) * args.size) do |args_ptr|\n args_ptr.write_array_of_pointer fun.params.zip(args).map { |p, a|\n a.kind_of?(GenericValue) ? a : LLVM.make_generic_value(p.type, a)\n }\n return LLVM::GenericValue.from_ptr(\n C.LLVMRunFunction(self, fun, args.size, args_ptr))\n end\n end", "title": "" }, { "docid": "285c90ac81985231965aec74d03bf92d", "score": "0.505378", "text": "def binary_path=(_arg0); end", "title": "" }, { "docid": "b7eca4285650a5fc3d51583beae2bd7a", "score": "0.5052023", "text": "def _reduce_276(val, vofs)\n\t\t # \"primary: tFID\" \n result = new_fcall( val[vofs ], nil) \n \n result\nend", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" }, { "docid": "bad8aea9edc5814f8c6f14176268e62f", "score": "0.5049345", "text": "def value=(_arg0); end", "title": "" } ]
cf0baade8b36b6087b730737e9b943cb
GET /platforms/new GET /platforms/new.json
[ { "docid": "5bd486a39eb3daff5bfca7de4d3524d3", "score": "0.66085136", "text": "def new\n @platform = Platform.new\n @indicator_categories = IndicatorCategory.with_indicators.sorted\n\n # create the translation object for however many locales there are\n # so the form will properly create all of the nested form fields\n I18n.available_locales.each do |locale|\n\t\t\t@platform.platform_translations.build(:locale => locale.to_s)\n\t\tend\n\n gon.election_political_parties_path = election_political_parties_path(:election_id => 999)\n\n # create the score object for however many categories there are\n # so the form will properly create all of the nested form fields\n @indicator_categories.each do |cat|\n\t\t\t@platform.platform_scores.build(:indicator_category_id => cat.id)\n\t\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @platform }\n end\n end", "title": "" } ]
[ { "docid": "4943b3b2f659d3d0bde747613308c897", "score": "0.7255065", "text": "def new\n @platform = Platform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @platform }\n end\n end", "title": "" }, { "docid": "c6cf0defe28133db77832befb4c593ff", "score": "0.71252686", "text": "def create\n @platform = Platform.new(platform_params)\n\n if @platform.save\n render json: @platform, status: :created, location: @platform\n else\n render json: @platform.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3d1a990e784a0e4eeb35146e4aa74323", "score": "0.69751", "text": "def create\n @platform = Platform.new(platform_params)\n\n respond_to do |format|\n if @platform.save\n format.html { redirect_to @platform, notice: 'Platform was successfully created.' }\n format.json { render :show, status: :created, location: @platform }\n else\n format.html { render :new }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b0c6811ec5e2a93929cf3eeeb6b12b3", "score": "0.6852163", "text": "def new\n @platform_category = PlatformCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @platform_category }\n end\n end", "title": "" }, { "docid": "af1880a6c02e2726078b6450fecf58c9", "score": "0.677872", "text": "def create\n\n @platform = Platform.create(params[:new_platform])\n\n if @platform.errors.empty?\n flash['notice'] = \"Platform #{@platform[:name]} added\"\n redirect_to :action => 'list'\n else\n flash['notice'] = @platform.errors.full_messages.pop\n redirect_to :action => 'add'\n end\n \n end", "title": "" }, { "docid": "ad500a01f883ff2439cc09c7ac9a1192", "score": "0.6731797", "text": "def new\n @partition_platform = PartitionPlatform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partition_platform }\n end\n end", "title": "" }, { "docid": "8afacade92a4d927b0c3c2e26f3acfeb", "score": "0.6714233", "text": "def new\n @platform = Platform.new\n end", "title": "" }, { "docid": "418912bb7d0ea9eac7e1b03b9b51de2d", "score": "0.6548706", "text": "def new\n @root = \"projects\"\n @branch = \"new\"\n \n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "6c52b06dac93274484b0dd2b440c31da", "score": "0.6501516", "text": "def create\n @platform = Platform.new(platform_params)\n current_user\n @platform.user_id = current_user.id\n\n respond_to do |format|\n if @platform.save\n format.html { redirect_to @platform, notice: 'Platform was successfully created.' }\n format.json { render action: 'show', status: :created, location: @platform }\n else\n format.html { render action: 'new' }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0890b6da7c990de2d1fc0c7b5b05ca8", "score": "0.64855427", "text": "def new\n @minor = Minor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @minor }\n end\n end", "title": "" }, { "docid": "d0890b6da7c990de2d1fc0c7b5b05ca8", "score": "0.64855427", "text": "def new\n @minor = Minor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @minor }\n end\n end", "title": "" }, { "docid": "0e5a9768c37119a082d9969d8812c888", "score": "0.6466251", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.mobile # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "459203c6494b7bedde052966fce14ef2", "score": "0.6437212", "text": "def new\n @flight_platform = FlightPlatform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @flight_platform }\n end\n end", "title": "" }, { "docid": "fbdd1bfd7ac419524e65db0d10b86c9b", "score": "0.640638", "text": "def new\n @project = Project.new\n get_repo_list\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "9d67bece19ca4be0d3f93382ff07670f", "score": "0.63910556", "text": "def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cloud }\n end\n end", "title": "" }, { "docid": "2caf9e2ef41b0a319ca8c426969f779d", "score": "0.6327365", "text": "def platforms(filter = {})\n request('platforms', filter).map { |ent| OsVersion.create(ent) }\n end", "title": "" }, { "docid": "1777fa1fb836cbf71cd8958d02ea9ca6", "score": "0.62903374", "text": "def platforms\n self.class.get(\"/platforms/?api_key=#{@key}&format=json&field_list=name,id\")[\"results\"]\n end", "title": "" }, { "docid": "de14ec66ff116d40d1c487ed5522a3a7", "score": "0.6276832", "text": "def new\n @major = Major.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "d9b5273fa01b88dd5eaeafbbf8fc3a9d", "score": "0.6257276", "text": "def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "bdca9cf43597f485d75f16f89ca1aef3", "score": "0.6252155", "text": "def create\n @platform_server = PlatformServer.new(platform_server_params)\n\n respond_to do |format|\n if @platform_server.save\n format.html { redirect_to @platform_server, notice: 'Platform server was successfully created.' }\n format.json { render action: 'show', status: :created, location: @platform_server }\n else\n format.html { render action: 'new' }\n format.json { render json: @platform_server.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c20f98ed08bbaaf44f97e264d7734eb2", "score": "0.6247707", "text": "def new\n @launch = Launch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @launch }\n end\n end", "title": "" }, { "docid": "cb5cd9c32243151a20b6a1788be2293c", "score": "0.6247428", "text": "def new\n @new_project = NewProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_project }\n end\n end", "title": "" }, { "docid": "6142c81a61aee8ebaa81a240406fa1b7", "score": "0.6183214", "text": "def new\n @operatingsystem = Operatingsystem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @operatingsystem }\n end\n end", "title": "" }, { "docid": "4982146b969f284d95705c7ea569ec86", "score": "0.61504465", "text": "def new\n @project = Project.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "bdefcae1cec841161a2377f72e605801", "score": "0.61457425", "text": "def new\n @server = Server.new\n @creating_new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n\n end\n end", "title": "" }, { "docid": "3ad9f0359ada5d3fa63cc3441ccd678e", "score": "0.6142199", "text": "def new\n @projecttype = Projecttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projecttype }\n end\n end", "title": "" }, { "docid": "1c88a0c79c1907e3d9d91f06dd081e2d", "score": "0.61367875", "text": "def create\n\t\t@portfolio_platform = PortfolioPlatform.new(portfolio_platform_params)\n\n\t\trespond_to do |format|\n\t\t\tif @portfolio_platform.save\n\t\t\t\tformat.html { redirect_to edit_admin_portfolio_platform_path(@portfolio_platform), notice: 'Portfolio platform was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @portfolio_platform }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @portfolio_platform.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "48db29c519f15f58d36328704169976c", "score": "0.61268556", "text": "def create\n @over_platform = OverPlatform.new(over_platform_params)\n\n respond_to do |format|\n if @over_platform.save\n format.html { redirect_to @over_platform, notice: 'Over platform was successfully created.' }\n format.json { render :show, status: :created, location: @over_platform }\n else\n format.html { render :new }\n format.json { render json: @over_platform.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0cfd83b2304d760c341792ed5cb39a6", "score": "0.6112296", "text": "def show\n @platform = Platform.find(params[:id])\n\n render json: @platform\n end", "title": "" }, { "docid": "072bf098817af52cd41e26b2986aaec7", "score": "0.6094834", "text": "def new\n @website = Website.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.60855436", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.6085324", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "bdccf65d565a9bdcdb2455f60500dc73", "score": "0.6083834", "text": "def new\n @foundry = Foundry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foundry }\n end\n end", "title": "" }, { "docid": "da3bfa7f5962e4e83d987fa04fd9afef", "score": "0.6075164", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_configuration }\n end\n end", "title": "" }, { "docid": "df6e735436b184bd65ad28246dc28641", "score": "0.6063344", "text": "def new\n @project_type = ProjectType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_type }\n end\n end", "title": "" }, { "docid": "5825ebdb373d0c7b32ad5a6974f535ad", "score": "0.6060618", "text": "def new\n @system = System.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @system }\n end\n end", "title": "" }, { "docid": "fee09f13b6895bbe0e0a10a8b2585af5", "score": "0.6046579", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.604657", "text": "def new\n json_404\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.60406435", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.60406435", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.60406435", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "aa02d7cf2200fbd0488541cedbe461ac", "score": "0.60394776", "text": "def new\n\t\t@project = Project.new\n\n\t\trender json: @project\n\tend", "title": "" }, { "docid": "e09319c82ba42910b24aeeb34943dfa9", "score": "0.6033947", "text": "def new\n @title = t('view.apps.new_title')\n @app = App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @app }\n end\n end", "title": "" }, { "docid": "e61b74200f46dc002d5991da43bd5fc1", "score": "0.6033198", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n #~ format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "ea368361f00ecd5adee284d2b18b2d8a", "score": "0.6031948", "text": "def create\n # split the score values into indicator_id and value\n params[:platform][:platform_scores_attributes].each do |key, values|\n # [indicator_id, value]\n\t\t\tif values[:combined] && !values[:combined].empty?\n\t\t combined = values[:combined].split(\"||\")\n\t\t values[:indicator_id] = combined[0]\n\t\t values[:value] = combined[1]\n\t\t\tend\n end\n\n @platform = Platform.new(params[:platform])\n\n add_missing_translation_content(@platform.platform_translations)\n\n respond_to do |format|\n if @platform.save\n format.html { redirect_to @platform, notice: t('app.msgs.success_created', :obj => t('app.common.platform')) }\n format.json { render json: @platform, status: :created, location: @platform }\n else\n\t\t @indicator_categories = IndicatorCategory.with_indicators.sorted\n gon.election_political_parties_path = election_political_parties_path(:election_id => 999)\n format.html { render action: \"new\" }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e3aa20223022b139e3c88fa270cfaed", "score": "0.60299313", "text": "def new\n @project = Project.find params[:project_id]\n @api = @project.apis.new\n @parameters = @api.parameters.build\n @api.success_responses.build\n @api.failure_responses.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.6028959", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.6028959", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.6028959", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.6028959", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "b254d282e9aa9461ab4e8cfdc77d226c", "score": "0.6028209", "text": "def new\n @build = build_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @build }\n end\n end", "title": "" }, { "docid": "5db20e4d01b68c131c5e05f916e14737", "score": "0.60276294", "text": "def new\n @project = Project.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "9660261bedfb6adbb3f8d848f8d7a6c0", "score": "0.602667", "text": "def new\n @initial_project = InitialProject.new(:name => \"myblog\")\n\n respond_to do |format|\n format.html\n format.json { render json: @initial_project }\n end\n end", "title": "" }, { "docid": "0f369e8e579bc0b230955dab7ed9cf35", "score": "0.6023656", "text": "def new\n @project = Project.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "a2580ba29ac6a0bde96f42a651ec72a3", "score": "0.6017773", "text": "def create\n @platform = Platform.find(params[:platform_id])\n @game = @platform.games.create(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to platform_path(@platform), notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a60337c464cd6ddcb3edcc47994d52e", "score": "0.60174316", "text": "def new\n @plat = Plat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plat }\n end\n end", "title": "" }, { "docid": "8718839c1873ebb1d41aaf909b25c347", "score": "0.6010009", "text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end", "title": "" }, { "docid": "8718839c1873ebb1d41aaf909b25c347", "score": "0.6010009", "text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.60067874", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.60067874", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.60067874", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.60067874", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "1004aa6e19494bf2a49d6438bd489cd1", "score": "0.60067874", "text": "def new\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @host }\n end\n end", "title": "" }, { "docid": "b5834f4d2b3fc7f68159510aec0d217d", "score": "0.6004936", "text": "def new\n @release = Release.new\n @root = EventType.find(2)\n\n @available_states = State.all\n\n @add_states = Array.new\n @add_event_types = Array.new\n\n @by_system = false\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @release }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6002583", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6002583", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" } ]